Section 1
//wav (assmessage.wav)
package assmessage {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package assmessage
Section 2
//wav (bladehit.wav)
package bladehit {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bladehit
Section 3
//wav (bladespawn.wav)
package bladespawn {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bladespawn
Section 4
//mp3 (bladespin.mp3)
package bladespin {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package bladespin
Section 5
//wav (bombchute.wav)
package bombchute {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bombchute
Section 6
//wav (bombexplode.wav)
package bombexplode {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bombexplode
Section 7
//mp3 (bubblepop.mp3)
package bubblepop {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package bubblepop
Section 8
//wav (bulletricochet1.wav)
package bulletricochet1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bulletricochet1
Section 9
//wav (bulletricochet2.wav)
package bulletricochet2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bulletricochet2
Section 10
//wav (bulletricochet3.wav)
package bulletricochet3 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package bulletricochet3
Section 11
//wav (buttonbuzz.wav)
package buttonbuzz {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonbuzz
Section 12
//wav (buttonclick.wav)
package buttonclick {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonclick
Section 13
//wav (buttonclick2.wav)
package buttonclick2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonclick2
Section 14
//wav (buttonding.wav)
package buttonding {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonding
Section 15
//wav (buttonhover.wav)
package buttonhover {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonhover
Section 16
//Main (com.midasplayer.particle.Main)
package com.midasplayer.particle {
import flash.display.*;
import flash.events.*;
public class Main extends Sprite {
private var minAlpha:Number;// = 0.01
private var maxAlpha:Number;// = 0.02
private var emitter;
private var minXVel:Number;// = -1
private var minSize:Number;// = 12
private var maxXVel:Number;// = 1
private var maxSize:Number;// = 29
private var particles:Array;
private var numParticles:int;// = 20
private var minYVel:Number;// = -1
private var maxYVel:Number;// = 1
public function Main(){
numParticles = 20;
minXVel = -1;
maxXVel = 1;
minYVel = -1;
maxYVel = 1;
minSize = 12;
maxSize = 29;
minAlpha = 0.01;
maxAlpha = 0.02;
particles = new Array();
super();
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function setEmitterClip(_arg1):void{
emitter = _arg1;
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
private function enterFrame(_arg1:Event){
createNewParticle();
}
public function kill():void{
var _local1:Number;
removeEventListener(Event.ENTER_FRAME, enterFrame);
_local1 = 0;
while (_local1 < particles.length) {
particles[_local1].destroy();
_local1++;
};
}
private function createNewParticle():void{
var _local1:*;
var _local2:Number;
_local1 = new Particle(spark, emitter, -10, -7, stage.stageWidth, stage.stageHeight);
_local1.setVel(randRange(minXVel, maxXVel), randRange(minYVel, maxYVel));
_local1.setSize(randRange(minSize, maxSize));
particles.push(_local1);
while (particles.length > numParticles) {
_local1 = particles.shift();
_local1.destroy();
};
_local2 = 0;
while (_local2 < particles.length) {
particles[_local2].update();
_local2++;
};
}
}
}//package com.midasplayer.particle
Section 17
//Particle (com.midasplayer.particle.Particle)
package com.midasplayer.particle {
import flash.display.*;
import flash.geom.*;
public class Particle {
private var _yVel:Number;
private var _xVel:Number;
private var _stageHeight:Number;
private var _alphaDecr:Number;// = 0
private var clip:DisplayObject;
private var _stageWidth:Number;
public function Particle(_arg1:Class, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
_alphaDecr = 0;
super();
_stageWidth = _arg5;
_stageHeight = _arg6;
clip = new (_arg1);
_arg2.addChild(clip);
clip.x = _arg3;
clip.y = _arg4;
}
public function update(){
clip.x = (clip.x + _xVel);
clip.y = (clip.y + _yVel);
clip.alpha = (clip.alpha - _alphaDecr);
}
public function setSize(_arg1:Number){
clip.width = _arg1;
clip.height = _arg1;
}
public function setColour(_arg1:Number){
var _local2:ColorTransform;
_local2 = new ColorTransform();
_local2.color = _arg1;
clip.transform.colorTransform = _local2;
}
public function setAlphaDecr(_arg1:Number):void{
_alphaDecr = _arg1;
}
public function destroy():void{
clip.parent.removeChild(clip);
clip = null;
}
public function setVel(_arg1:Number, _arg2:Number){
_xVel = _arg1;
_yVel = _arg2;
}
}
}//package com.midasplayer.particle
Section 18
//DragonLoader (com.midasplayer.DragonLoader)
package com.midasplayer {
import flash.display.*;
import flash.events.*;
import fl.transitions.easing.*;
import flash.media.*;
import fl.transitions.*;
import flash.utils.*;
public class DragonLoader extends MovieClip {
public var fireLogoHolder:MovieClip;
public var mcPlayBtn:MovieClip;
private var m_dragonClip:MovieClip;
private var m_bannedSign:MovieClip;
private var m_glimmerTween:Tween;
private var m_bg:Sprite;
private var m_playBtnTween:Tween;
public var bannedSign:MovieClip;
private var m_fireLogoClip:MovieClip;
private var oldFrameRate:int;
private var m_fireLogoTween:Tween;
private var m_sndBell:Sound;
public var dragonHolder:MovieClip;
private var m_glimmer:MovieClip;
private var m_playBtn:MovieClip;
public static var LAUNCH_GAME:String = "launchGame";
public function DragonLoader(){
this.x = (this.y = 0);
m_bannedSign = bannedSign;
m_bannedSign.bg.width = stage.stageWidth;
m_bannedSign.bg.height = stage.stageHeight;
m_bannedSign.alpha = 0;
m_bannedSign.addEventListener(MouseEvent.CLICK, onMainMovie);
m_bannedSign.buttonMode = true;
m_fireLogoClip = fireLogoHolder;
m_fireLogoClip.x = ((m_bannedSign.bg.width - m_fireLogoClip.width) - 90);
m_fireLogoClip.y = (((m_bannedSign.bg.height / 2) - (m_fireLogoClip.height / 2)) - 60);
m_fireLogoClip.visible = false;
m_fireLogoClip.stop();
m_dragonClip = dragonHolder;
m_dragonClip.x = (m_bannedSign.bg.width - m_dragonClip.width);
m_dragonClip.y = ((m_bannedSign.bg.height / 2) - (m_dragonClip.height / 2));
m_dragonClip.stop();
m_playBtn = mcPlayBtn;
m_playBtn.buttonMode = true;
m_playBtn.alpha = 0;
m_sndBell = new sfxBell();
}
public function destroy():void{
var _local1:Sprite;
m_playBtn.removeEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.removeEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.removeEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.removeEventListener(MouseEvent.MOUSE_UP, launchGame);
m_fireLogoTween.removeEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
m_fireLogoTween = null;
_local1 = (this.parent.getChildByName("clickBg") as Sprite);
if (_local1){
this.parent.removeChild(_local1);
};
this.parent.removeChild(this);
}
public function onMainMovie(_arg1:MouseEvent):void{
KingAPI.openLoaderMovieLink();
}
public function playLoaderMovie():void{
m_dragonClip.addEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.play();
}
public function init(_arg1:String, _arg2:String=""):void{
if (_arg2 != ""){
MochiBot.track(this, _arg2);
};
oldFrameRate = root.stage.frameRate;
root.stage.frameRate = 30;
if (KingAPI.banned){
showBannedScreen();
} else {
playLoaderMovie();
};
}
private function btnDown(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("down");
}
public function animationDone(_arg1:Event):void{
if (m_dragonClip.currentFrame == 80){
m_fireLogoClip.visible = true;
m_fireLogoClip.play();
m_fireLogoTween = new Tween(m_fireLogoClip, "x", Regular.easeOut, m_fireLogoClip.x, (((stage.width / 2) - (m_dragonClip.width / 2)) - 51), 1, true);
m_fireLogoTween.addEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
};
if (m_dragonClip.currentFrame == m_dragonClip.totalFrames){
m_dragonClip.removeEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.stop();
m_playBtn.x = ((stage.width / 2) - (m_playBtn.width / 2));
m_playBtn.y = (m_fireLogoClip.y + 210);
m_playBtn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.addEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.addEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.addEventListener(MouseEvent.MOUSE_UP, launchGame);
};
}
private function onGlimmerTmr(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_fireLogoClip.x - m_glimmer.width);
_local3 = ((m_fireLogoClip.x + m_fireLogoClip.width) - 80);
m_glimmerTween = new Tween(m_glimmer, "x", None.easeNone, _local2, _local3, 0.5, true);
m_glimmerTween.addEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
m_sndBell.play();
}
public function launchGame(_arg1:Event):void{
root.stage.frameRate = oldFrameRate;
trace(LAUNCH_GAME);
this.dispatchEvent(new Event(LAUNCH_GAME));
}
private function btnOver(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("over");
}
private function logoVisible(_arg1:Event):void{
if (m_fireLogoClip.currentFrame == m_fireLogoClip.totalFrames){
m_fireLogoClip.removeEventListener(Event.ENTER_FRAME, logoVisible);
m_playBtnTween = new Tween(m_playBtn, "alpha", None.easeNone, 0, 1, 0.5, true);
m_glimmer = new mcGlimmer();
m_glimmer.x = (m_fireLogoClip.x - m_glimmer.width);
m_glimmer.y = (m_fireLogoClip.y + 112);
this.addChild(m_glimmer);
setTimeout(onGlimmerTmr, 1000, null);
};
}
private function btnOut(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("idle");
}
private function glimmerDone(_arg1:Event):void{
m_glimmerTween.removeEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
this.removeChild(m_glimmer);
}
private function logoInPlace(_arg1:Event):void{
m_fireLogoClip.addEventListener(Event.ENTER_FRAME, logoVisible);
}
public function showBannedScreen():void{
m_bannedSign.alpha = 1;
}
}
}//package com.midasplayer
Section 19
//KingAPI (com.midasplayer.KingAPI)
package com.midasplayer {
import flash.events.*;
import flash.net.*;
import flash.external.*;
public class KingAPI {
public static const LINK_TYPE_RIGHT_CLICK:String = "rightclick";
public static const USER_TYPE_SUBSCRIPTION:int = 3;
public static const LINK_TYPE_HIGHSCORES:String = "highscores";
public static const LINK_TYPE_SIGN:String = "sign";
public static const INITIALIZED_EVENT:String = "initialized";
public static const LINK_TYPE_OTHER_GAMES:String = "other_games";
public static const USER_TYPE_REGISTERED:int = 1;
private static const SAK:String = "ggfd7sday923mdsfd8csfds34";
private static const loadHomeParametersURL:String = "http://www.king.com/servlet/FreeGameServlet?action=load";
public static const LINK_TYPE_LOADER_MOVIE:String = "loader_movie";
private static const bounceURL:String = "http://www.mygame.com/king/bounce.jsp";
public static const LINK_TYPE_PROTECT:String = "protect";
public static const LINK_TYPE_ADD_GAME:String = "add_game";
public static const USER_TYPE_GOLD:int = 2;
public static const USER_TYPE_UNREGISTERED:int = 0;
public static const HOST_BANNED_EVENT:String = "hostBanned";
private static const SK:String = "vf78hxcsjak77cxzhjkwad87s";
private static const loadCountURL:String = "http://www.mygame.com/king/loadcount.jsp";
public static const LINK_TYPE_LOADER_PROGRESS:String = "loader_progress";
private static var check:String = null;
public static var gameName:String;
public static var banned:Boolean = false;
protected static var dispatcher:EventDispatcher;
public static var isHome:Boolean = false;
private static var sessionID:String;
private static var iscore:int = 123;
public static var fromURL:String;
private static var SSK:String = "ng43ui54hy35tdsnd6f54rews";
private static function loadUrlErrorHandler(_arg1:Event):void{
trace(("Unable to load url: " + _arg1));
}
public static function resetScore():void{
iscore = 123;
check = null;
}
public static function openOfflineProtectionLink():void{
openKingPage(LINK_TYPE_PROTECT);
}
public static function init(_arg1:String, _arg2:String):void{
var loadCounter:URLLoader;
var reqvars:URLVariables;
var request:URLRequest;
var so:SharedObject;
var rnd1:Number;
var rnd2:Number;
var name = _arg1;
var from = _arg2;
gameName = name;
fromURL = from;
loadCounter = new URLLoader();
reqvars = new URLVariables();
reqvars.game = gameName;
reqvars.from = fromURL;
try {
so = SharedObject.getLocal("sessionId");
if (so.data.sessionID == null){
rnd1 = Math.abs(Math.floor((Math.random() * 4294967295)));
rnd2 = Math.abs(Math.floor((Math.random() * 4294967295)));
so.data.sessionID = (rnd1.toString(16) + rnd2.toString(16));
so.flush();
};
sessionID = so.data.sessionID;
} catch(e:Error) {
sessionID = "error";
};
reqvars.session = sessionID;
request = new URLRequest(((loadCountURL + "?") + reqvars.toString()));
loadCounter.addEventListener(Event.COMPLETE, loadCountHandler);
loadCounter.addEventListener(IOErrorEvent.IO_ERROR, loadUrlErrorHandler);
loadCounter.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadUrlErrorHandler);
try {
loadCounter.load(request);
} catch(error:Error) {
trace(("Unable to load loadcount url: " + loadCountURL));
trace(error.message);
};
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
trace(("loadCounter.data" + _local2.data));
}
public static function submitInternalScore():void{
var _local1:int;
checkScore();
_local1 = ((iscore - 123) / 2);
submitScore(_local1);
}
public static function openOtherGamesLink():void{
openKingPage(LINK_TYPE_OTHER_GAMES);
}
public static function openKingPage(_arg1:String, _arg2:String=null):void{
var _local3:URLVariables;
var _local4:String;
_local3 = new URLVariables();
_local3.game = gameName;
_local3.from = fromURL;
_local3.type = _arg1;
_local3.session = sessionID;
if (_arg2 != null){
_local3.redirect = _arg2;
};
_local4 = "_blank";
if (isHome){
_local4 = "_top";
};
navigateToURL(new URLRequest(((bounceURL + "?") + _local3.toString())), _local4);
}
private static function loadCountHandler(_arg1:Event):void{
var loadCounter:URLLoader;
var vars:URLVariables;
var event = _arg1;
loadCounter = URLLoader(event.target);
trace(("loadCounter.data :" + loadCounter.data));
try {
vars = new URLVariables(loadCounter.data);
if (vars.h == "true"){
isHome = true;
};
if (vars.b == "true"){
banned = true;
dispatcher.dispatchEvent(new Event(HOST_BANNED_EVENT));
} else {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
trace((("::" + vars.h) + "::"));
trace((("::" + vars.b) + "::"));
} catch(e:Error) {
trace(("Error reading data from loadcount url: " + e));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
dispatcher = new EventDispatcher();
};
dispatcher.addEventListener(_arg1, _arg2);
}
public static function openLoaderMovieLink():void{
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
return;
};
dispatcher.removeEventListener(_arg1, _arg2);
}
public static function submitScore(_arg1:int):void{
var hash:String;
var score = _arg1;
hash = md5.encrypt(((((score + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitScore", score, hash);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, ((((("game/" + gameName) + "/submit/") + score) + ":") + hash));
};
} catch(e:Error) {
trace(e);
};
}
public static function openHighscoresLink():void{
openKingPage(LINK_TYPE_HIGHSCORES, (("game/" + gameName) + "/highscores"));
}
public static function openSignLink():void{
openKingPage(LINK_TYPE_SIGN);
}
public static function openRightClickLink():void{
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
private static function checkScore():void{
if (check != null){
if (check != md5.encrypt(((((iscore + ":") + gameName) + ":") + SK))){
SSK = "ng41ui54hy35tdsnd6f54rews";
};
};
}
public static function addScore(_arg1:int):int{
var _local2:int;
checkScore();
_local2 = ((iscore - 123) / 2);
_local2 = (_local2 + _arg1);
iscore = ((_local2 * 2) + 123);
check = md5.encrypt(((((iscore + ":") + gameName) + ":") + SK));
return (_local2);
}
public static function openLoaderProgressLink():void{
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
public static function openAddToWebsiteLink():void{
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
public static function submitAchievement(_arg1:String):void{
var hash:String;
var achievement = _arg1;
hash = md5.encrypt(((((achievement + ":") + gameName) + ":") + SAK));
try {
if (isHome){
ExternalInterface.call("submitAchievement", achievement, hash);
};
} catch(e:Error) {
trace(e);
};
}
}
}//package com.midasplayer
Section 20
//md5 (com.midasplayer.md5)
package com.midasplayer {
public class md5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
_local3 = 1732584193;
_local4 = -271733879;
_local5 = -1732584194;
_local6 = 271733878;
_local7 = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array((_arg1.length >> 2));
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = 0;
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1.length * 8)) {
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | ((_arg1.charCodeAt((_local3 / 8)) & 0xFF) << (_local3 % 32)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local2 = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
_local3 = "";
_local5 = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local3 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = "";
_local3 = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:String;
_local3 = _arg2.length;
_local4 = [];
_local9 = new Array((_arg1.length / 2));
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
_local10 = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package com.midasplayer
Section 21
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
public static function LoadAd(_arg1:int, _arg2:int):DisplayObject{
var _local3:String;
Security.allowDomain("server.cpmstar.com");
_local3 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local3 + "?poolid=") + _arg1) + "&subpoolid=") + _arg2)));
return (cpmstarLoader);
}
}
}//package CPMStar
Section 22
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 23
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 24
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 25
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 26
//mp3 (flyingthingloop.mp3)
package flyingthingloop {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package flyingthingloop
Section 27
//wav (gunshot.wav)
package gunshot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package gunshot
Section 28
//wav (gunspin.wav)
package gunspin {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package gunspin
Section 29
//df_checkbox_98 (HF_Viral_fla.df_checkbox_98)
package HF_Viral_fla {
import flash.display.*;
public dynamic class df_checkbox_98 extends MovieClip {
public function df_checkbox_98(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package HF_Viral_fla
Section 30
//export_everything_24 (HF_Viral_fla.export_everything_24)
package HF_Viral_fla {
import flash.display.*;
public dynamic class export_everything_24 extends MovieClip {
public function export_everything_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package HF_Viral_fla
Section 31
//main_menu_delconfirm_105 (HF_Viral_fla.main_menu_delconfirm_105)
package HF_Viral_fla {
import flash.display.*;
public dynamic class main_menu_delconfirm_105 extends MovieClip {
public var sbYes:SimpleButton;
}
}//package HF_Viral_fla
Section 32
//main_menu_hardcore_104 (HF_Viral_fla.main_menu_hardcore_104)
package HF_Viral_fla {
import flash.display.*;
public dynamic class main_menu_hardcore_104 extends MovieClip {
public var sbPlay:SimpleButton;
}
}//package HF_Viral_fla
Section 33
//main_menu_opaudio_100 (HF_Viral_fla.main_menu_opaudio_100)
package HF_Viral_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class main_menu_opaudio_100 extends MovieClip {
public var effects:MovieClip;
public var music:MovieClip;
public var master:MovieClip;
public var motor:MovieClip;
public var sbDelE:SimpleButton;
public var sbDelN:SimpleButton;
public function main_menu_opaudio_100(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, volUpdates);
}
public function volUpdates(_arg1:Event):void{
var _local2:SoundTransform;
if (master.updated){
DFData.volMaster = master.val;
master.updated = false;
};
_local2 = SoundMixer.soundTransform;
_local2.volume = (master.val * 2);
SoundMixer.soundTransform = _local2;
if (music.updated){
DFData.volMusic = (PESoundScape.musicvol = music.val);
music.updated = false;
};
if (effects.updated){
DFData.volEffects = (PESoundScape.effectvol = effects.val);
effects.updated = false;
};
if (motor.updated){
DFData.volMotor = motor.val;
motor.updated = false;
};
}
}
}//package HF_Viral_fla
Section 34
//main_menu_opvideo_99 (HF_Viral_fla.main_menu_opvideo_99)
package HF_Viral_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class main_menu_opvideo_99 extends MovieClip {
public var cbPara:MovieClip;
public var cbBest:MovieClip;
public var cbBombs:MovieClip;
public var cbSweat:MovieClip;
public var cbLow:MovieClip;
public var cbSparks:MovieClip;
public var cbWorld:MovieClip;
public var cbHigh:MovieClip;
public var cbDust:MovieClip;
public var cbMed:MovieClip;
public var cbFlames:MovieClip;
public var cbShake:MovieClip;
public function main_menu_opvideo_99(){
addFrameScript(0, frame1);
}
public function buttonDust(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bDust = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bDust = false;
};
}
public function buttonSparks(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bSparks = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bSparks = false;
};
}
public function buttonBombs(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bBombs = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bBombs = false;
};
}
public function buttonShake(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bShake = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bShake = false;
};
}
public function buttonPara(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bPara = true;
PhaseEngine.planes[1].visible = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bPara = false;
PhaseEngine.planes[1].visible = false;
};
}
function frame1(){
cbLow.addEventListener(MouseEvent.CLICK, qualLow);
cbMed.addEventListener(MouseEvent.CLICK, qualMed);
cbHigh.addEventListener(MouseEvent.CLICK, qualHigh);
cbBest.addEventListener(MouseEvent.CLICK, qualBest);
cbLow.buttonMode = true;
cbLow.useHandCursor = true;
cbMed.buttonMode = true;
cbMed.useHandCursor = true;
cbHigh.buttonMode = true;
cbHigh.useHandCursor = true;
cbBest.buttonMode = true;
cbBest.useHandCursor = true;
cbWorld.buttonMode = true;
cbWorld.useHandCursor = true;
cbPara.buttonMode = true;
cbPara.useHandCursor = true;
cbShake.buttonMode = true;
cbShake.useHandCursor = true;
cbDust.buttonMode = true;
cbDust.useHandCursor = true;
cbSweat.buttonMode = true;
cbSweat.useHandCursor = true;
cbFlames.buttonMode = true;
cbFlames.useHandCursor = true;
cbSparks.buttonMode = true;
cbSparks.useHandCursor = true;
cbBombs.buttonMode = true;
cbBombs.useHandCursor = true;
cbWorld.addEventListener(MouseEvent.CLICK, buttonWorld);
cbPara.addEventListener(MouseEvent.CLICK, buttonPara);
cbShake.addEventListener(MouseEvent.CLICK, buttonShake);
cbDust.addEventListener(MouseEvent.CLICK, buttonDust);
cbSweat.addEventListener(MouseEvent.CLICK, buttonSweat);
cbFlames.addEventListener(MouseEvent.CLICK, buttonFlames);
cbSparks.addEventListener(MouseEvent.CLICK, buttonSparks);
cbBombs.addEventListener(MouseEvent.CLICK, buttonBombs);
}
public function buttonSweat(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bSweat = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bSweat = false;
};
}
public function buttonWorld(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bWorld = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bWorld = false;
};
}
public function buttonFlames(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bFlames = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bFlames = false;
};
}
public function qualHigh(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
cbLow.gotoAndStop("unchecked");
cbMed.gotoAndStop("unchecked");
cbHigh.gotoAndStop("checked");
cbBest.gotoAndStop("unchecked");
PhaseEngine.stage.quality = StageQuality.HIGH;
DFData.qual = "HIGH";
}
public function qualLow(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
cbLow.gotoAndStop("checked");
cbMed.gotoAndStop("unchecked");
cbHigh.gotoAndStop("unchecked");
cbBest.gotoAndStop("unchecked");
PhaseEngine.stage.quality = StageQuality.LOW;
DFData.qual = "LOW";
}
public function qualBest(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
cbLow.gotoAndStop("unchecked");
cbMed.gotoAndStop("unchecked");
cbHigh.gotoAndStop("unchecked");
cbBest.gotoAndStop("checked");
PhaseEngine.stage.quality = StageQuality.BEST;
DFData.qual = "BEST";
}
public function qualMed(_arg1:MouseEvent){
PhaseEngine.playSound("buttonclick2.wav");
cbLow.gotoAndStop("unchecked");
cbMed.gotoAndStop("checked");
cbHigh.gotoAndStop("unchecked");
cbBest.gotoAndStop("unchecked");
PhaseEngine.stage.quality = StageQuality.MEDIUM;
DFData.qual = "MEDIUM";
}
}
}//package HF_Viral_fla
Section 35
//main_menu_playmodes_96 (HF_Viral_fla.main_menu_playmodes_96)
package HF_Viral_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class main_menu_playmodes_96 extends MovieClip {
public var sbNormal:SimpleButton;
public var sbHardcore:SimpleButton;
public var cbSkip:MovieClip;
public var sbPure:SimpleButton;
public var sbEasy:SimpleButton;
public function main_menu_playmodes_96(){
addFrameScript(0, frame1);
}
function frame1(){
cbSkip.addEventListener(MouseEvent.CLICK, buttonCheck);
cbSkip.buttonMode = true;
cbSkip.useHandCursor = true;
}
public function buttonCheck(_arg1:MouseEvent){
if (_arg1.target.currentLabel != null){
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
DFData.bSkip = true;
} else {
_arg1.target.gotoAndStop("unchecked");
DFData.bSkip = false;
};
};
}
}
}//package HF_Viral_fla
Section 36
//MainTimeline (HF_Viral_fla.MainTimeline)
package HF_Viral_fla {
import flash.display.*;
import flash.events.*;
import com.midasplayer.*;
import CPMStar.*;
import flash.media.*;
import com.midasplayer.particle.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var pe:PhaseEngine;
public var bar:Sprite;
public var mcLoadLogoBg:MovieClip;
public var allowPlay:Boolean;
public var tbar;
public var adDone:Boolean;
public var bg:Sprite;
public var frustum:col_vol;
public var bbar;
public var allowed_site3:String;
public var preloaded:Boolean;
public var allowed_site2:String;
public var allowed_site1:String;
public var adBox:MovieClip;
public var holder:Sprite;
public var particles:Main;
public var pre:MovieClip;
public var mochi:String;
public var mcKingLoader:DragonLoader;
public var game_name:String;
public var game:DFGame;
public var domain:String;
public function MainTimeline(){
addFrameScript(0, frame1, 39, frame40, 55, frame56, 59, frame60);
}
public function preload(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:DisplayObject;
_local2 = 3000;
_local3 = 1;
_local4 = AdLoader.LoadAd(_local2, _local3);
adBox.addChild(_local4);
if (((!(mcLoadLogoBg)) || (preloaded))){
return;
};
bg = new Sprite();
bg.buttonMode = true;
bg.name = "clickBg";
bg.graphics.beginFill(0, 0);
bg.graphics.moveTo(0, 475);
bg.graphics.lineTo(600, 475);
bg.graphics.lineTo(600, 600);
bg.graphics.lineTo(0, 600);
bg.graphics.lineTo(0, 475);
bg.graphics.endFill();
bg.addEventListener(MouseEvent.CLICK, openKingPage);
this.addChildAt(bg, this.getChildIndex(mcLoadLogoBg));
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF, 0);
bar.x = (mcLoadLogoBg.x + 5);
bar.y = (mcLoadLogoBg.y + 34);
bar.graphics.drawRect(0, 0, 96, 5);
bar.graphics.endFill();
this.addChild(bar);
holder = new Sprite();
this.addChild(holder);
holder.x = bar.x;
holder.y = bar.y;
particles = new Main();
particles.setEmitterClip(holder);
this.addChild(particles);
preloaded = true;
}
public function onComplete(_arg1:Event){
trace("onComplete fired");
if (bar){
particles.kill();
this.removeChild(particles);
this.removeChild(bar);
};
if (preloaded){
bg.removeEventListener(MouseEvent.CLICK, openKingPage);
bg.mouseEnabled = false;
} else {
preloaded = true;
};
this.removeChild(mcLoadLogoBg);
trace("onComplete continuing");
pre.txt.text = "";
this.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);
pre.bplay.visible = true;
pre.bplay.alpha = 1;
}
public function openKingPage(_arg1:Event):void{
KingAPI.openLoaderProgressLink();
}
public function launchGame(_arg1):void{
mcKingLoader.destroy();
gotoAndStop(60);
}
function frame1(){
stop();
allowPlay = true;
allowed_site1 = "king.com";
allowed_site2 = "pgstudios.org";
allowed_site3 = "mygame.com";
adDone = false;
domain = this.root.loaderInfo.url.split("/")[2];
if (domain.indexOf(allowed_site1) == (domain.length - allowed_site1.length)){
trace("allow king");
} else {
if (domain.indexOf(allowed_site2) == (domain.length - allowed_site2.length)){
trace("allow pgs");
} else {
if (domain.indexOf(allowed_site3) == (domain.length - allowed_site3.length)){
trace("allow mygame");
};
};
};
pre.logo.addEventListener(MouseEvent.CLICK, loadSite);
pre.bOpenLogo.addEventListener(MouseEvent.CLICK, loadKingSite);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, checkProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
this.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
pre.bplay.addEventListener(MouseEvent.CLICK, playGame);
pre.bplay.visible = false;
tbar = new prebar();
tbar.x = 300;
tbar.y = 150;
bbar = new prebar();
bbar.rotation = 180;
bbar.x = 300;
bbar.y = 450;
this.stage.addChild(tbar);
this.stage.addChild(bbar);
game_name = "hunted_forever";
mochi = "5213e0df";
stage.scaleMode = StageScaleMode.NO_SCALE;
KingAPI.addEventListener(KingAPI.INITIALIZED_EVENT, preload);
KingAPI.addEventListener(KingAPI.HOST_BANNED_EVENT, preload);
KingAPI.init(game_name, root.loaderInfo.url);
mcLoadLogoBg.mouseEnabled = false;
mcLoadLogoBg.mouseChildren = false;
preloaded = false;
}
public function checkProgress(_arg1:ProgressEvent):void{
var _local2:Number;
var _local3:*;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
if (bar){
holder.x = (bar.x + bar.width);
bar.scaleX = (_arg1.bytesLoaded / _arg1.bytesTotal);
mcLoadLogoBg.bar.scaleX = (1 - (_arg1.bytesLoaded / _arg1.bytesTotal));
};
pre.txt.text = "";
_local3 = Math.round(_local2);
if (_local3 < 20){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Engine");
} else {
if (_local3 < 30){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading World");
} else {
if (_local3 < 35){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Shirt");
} else {
if (_local3 < 40){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Physics");
} else {
if (_local3 < 43){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Portal Ripoff");
} else {
if (_local3 < 46){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading KOTOR Ripoff");
} else {
if (_local3 < 51){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Logic");
} else {
if (_local3 < 56){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Characters");
} else {
if (_local3 < 60){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Shock");
} else {
if (_local3 < 64){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Awe");
} else {
if (_local3 < 70){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Emitters");
} else {
if (_local3 < 74){
pre.txt.text = ((("" + _local3) + "%: ") + "Curing Cancer");
} else {
if (_local3 < 78){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Images");
} else {
if (_local3 < 82){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Cat Captions");
} else {
if (_local3 < 86){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading All Of Your Bases");
} else {
if (_local3 < 90){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading GUI");
} else {
if (_local3 < 94){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Nothing At All");
} else {
if (_local3 < 100){
pre.txt.text = ((("" + _local3) + "%: ") + "Loading Audio");
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
pre.char.x = (-100 + (700 * (_local2 / 100)));
if ((((_local2 == 100)) || ((_arg1.bytesLoaded == _arg1.bytesTotal)))){
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, checkProgress);
};
}
public function loadKingSite(_arg1:Event){
openKingPage(_arg1);
}
public function playGame(_arg1:Event){
removeChild(adBox);
if (allowPlay){
gotoAndPlay(2);
} else {
gotoAndStop(55);
};
}
public function setup():void{
PhaseEngine.setupPlanes(5);
game = new DFGame();
game.loadMenu();
PhaseEngine.debug.visible = false;
PhaseEngine.tim.init();
}
public function loadSite(_arg1:Event){
navigateToURL(new URLRequest("http://pgstudios.org"), "_blank");
}
function frame40(){
stop();
mcKingLoader.addEventListener(DragonLoader.LAUNCH_GAME, launchGame);
mcKingLoader.init(game_name, mochi);
}
public function gameLoop(_arg1:Event):void{
PhaseEngine.loopStart();
PESoundScape.focusOn(PhaseEngine.cpos);
game.update();
PhaseEngine.loopEnd();
}
public function onIOError(_arg1:IOErrorEvent):void{
trace(_arg1);
}
function frame56(){
gotoAndStop(15);
}
function frame60(){
stop();
this.stage.quality = StageQuality.MEDIUM;
pe = new PhaseEngine(this.stage);
setup();
addEventListener(Event.ENTER_FRAME, gameLoop);
}
}
}//package HF_Viral_fla
Section 37
//mcBannedSign_21 (HF_Viral_fla.mcBannedSign_21)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mcBannedSign_21 extends MovieClip {
public var bg:MovieClip;
}
}//package HF_Viral_fla
Section 38
//mcFireLogo_20 (HF_Viral_fla.mcFireLogo_20)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mcFireLogo_20 extends MovieClip {
public function mcFireLogo_20(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package HF_Viral_fla
Section 39
//mcLoadLogo_16 (HF_Viral_fla.mcLoadLogo_16)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mcLoadLogo_16 extends MovieClip {
public var bar:MovieClip;
}
}//package HF_Viral_fla
Section 40
//mcPlayBtn_23 (HF_Viral_fla.mcPlayBtn_23)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mcPlayBtn_23 extends MovieClip {
public function mcPlayBtn_23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package HF_Viral_fla
Section 41
//menu_mship_anim_spinning_92 (HF_Viral_fla.menu_mship_anim_spinning_92)
package HF_Viral_fla {
import flash.display.*;
public dynamic class menu_mship_anim_spinning_92 extends MovieClip {
public var frame:MovieClip;
public var core:MovieClip;
}
}//package HF_Viral_fla
Section 42
//mochi_interlevel_ad_bg_165 (HF_Viral_fla.mochi_interlevel_ad_bg_165)
package HF_Viral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mochi_interlevel_ad_bg_165 extends MovieClip {
public var txt:TextField;
public function mochi_interlevel_ad_bg_165(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package HF_Viral_fla
Section 43
//mship_core_52 (HF_Viral_fla.mship_core_52)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mship_core_52 extends MovieClip {
public function mship_core_52(){
addFrameScript(1, frame2, 44, frame45);
}
function frame2(){
gotoAndPlay("idle");
}
function frame45(){
gotoAndPlay("blcharge");
}
}
}//package HF_Viral_fla
Section 44
//mship_frame_49 (HF_Viral_fla.mship_frame_49)
package HF_Viral_fla {
import flash.display.*;
public dynamic class mship_frame_49 extends MovieClip {
public function mship_frame_49(){
addFrameScript(1, frame2, 29, frame30, 31, frame32, 59, frame60, 61, frame62, 90, frame91, 114, frame115, 116, frame117);
}
function frame91(){
gotoAndPlay("bcharged");
}
function frame2(){
gotoAndPlay("idle");
}
function frame30(){
gotoAndPlay("ccharge");
}
function frame117(){
gotoAndPlay("tcharged");
}
function frame115(){
gotoAndPlay("tcharge");
}
function frame32(){
gotoAndPlay("ccharged");
}
function frame62(){
gotoAndPlay("scharged");
}
function frame60(){
gotoAndPlay("scharge");
}
}
}//package HF_Viral_fla
Section 45
//preloader_1 (HF_Viral_fla.preloader_1)
package HF_Viral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_1 extends MovieClip {
public var ad:ad_container;
public var txt:TextField;
public var char:MovieClip;
public var bOpenLogo:SimpleButton;
public var bplay:SimpleButton;
public var logo:SimpleButton;
public var bPlay:SimpleButton;
}
}//package HF_Viral_fla
Section 46
//slider_101 (HF_Viral_fla.slider_101)
package HF_Viral_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class slider_101 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_101(){
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);
}
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 HF_Viral_fla
Section 47
//slider_bar_102 (HF_Viral_fla.slider_bar_102)
package HF_Viral_fla {
import flash.display.*;
public dynamic class slider_bar_102 extends MovieClip {
public var handle:MovieClip;
}
}//package HF_Viral_fla
Section 48
//text_bonus_popup_tween_67 (HF_Viral_fla.text_bonus_popup_tween_67)
package HF_Viral_fla {
import flash.display.*;
import flash.text.*;
public dynamic class text_bonus_popup_tween_67 extends MovieClip {
public var txt:TextField;
}
}//package HF_Viral_fla
Section 49
//wav (jumppad.wav)
package jumppad {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package jumppad
Section 50
//wav (lasercharge.wav)
package lasercharge {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package lasercharge
Section 51
//wav (laserhit.wav)
package laserhit {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package laserhit
Section 52
//wav (lasershot.wav)
package lasershot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package lasershot
Section 53
//wav (lasersizzle.wav)
package lasersizzle {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package lasersizzle
Section 54
//wav (painterdetonate.wav)
package painterdetonate {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package painterdetonate
Section 55
//wav (painterexplode.wav)
package painterexplode {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package painterexplode
Section 56
//wav (paintertarget.wav)
package paintertarget {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package paintertarget
Section 57
//wav (partcollected.wav)
package partcollected {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package partcollected
Section 58
//wav (partfound.wav)
package partfound {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package partfound
Section 59
//wav (playerjump1.wav)
package playerjump1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerjump1
Section 60
//wav (playerjump2.wav)
package playerjump2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerjump2
Section 61
//wav (playerjump3.wav)
package playerjump3 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerjump3
Section 62
//wav (playerland1.wav)
package playerland1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerland1
Section 63
//wav (playerland2.wav)
package playerland2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerland2
Section 64
//wav (playerland3.wav)
package playerland3 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerland3
Section 65
//wav (playerwallimpact.wav)
package playerwallimpact {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package playerwallimpact
Section 66
//mp3 (Theme3.mp3)
package Theme3 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Theme3
Section 67
//mp3 (Theme3_menu.mp3)
package Theme3_menu {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Theme3_menu
Section 68
//wav (wallslide.wav)
package wallslide {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package wallslide
Section 69
//wav (weap0_pop.wav)
package weap0_pop {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weap0_pop
Section 70
//wav (weap1_shoot.wav)
package weap1_shoot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weap1_shoot
Section 71
//wav (weap2_shoot.wav)
package weap2_shoot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weap2_shoot
Section 72
//wav (weap3_shoot.wav)
package weap3_shoot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weap3_shoot
Section 73
//wav (weap3_shoot2.wav)
package weap3_shoot2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weap3_shoot2
Section 74
//wav (weaponlift.wav)
package weaponlift {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weaponlift
Section 75
//wav (weaponstop.wav)
package weaponstop {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weaponstop
Section 76
//wav (weaponturn.wav)
package weaponturn {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package weaponturn
Section 77
//ad_container (ad_container)
package {
import flash.display.*;
public dynamic class ad_container extends MovieClip {
public function ad_container(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame10(){
gotoAndStop(2);
}
function frame1(){
}
function frame2(){
stop();
}
}
}//package
Section 78
//ass_bar (ass_bar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ass_bar extends MovieClip {
public var txt:TextField;
}
}//package
Section 79
//bg_sky (bg_sky)
package {
import flash.display.*;
public dynamic class bg_sky extends MovieClip {
}
}//package
Section 80
//blackground (blackground)
package {
import flash.display.*;
public dynamic class blackground extends MovieClip {
}
}//package
Section 81
//blade (blade)
package {
import flash.display.*;
public dynamic class blade extends MovieClip {
public function blade(){
addFrameScript(59, frame60);
}
function frame60(){
gotoAndPlay("fly");
}
}
}//package
Section 82
//blood_drop (blood_drop)
package {
import flash.display.*;
public dynamic class blood_drop extends MovieClip {
}
}//package
Section 83
//body_part (body_part)
package {
import flash.display.*;
public dynamic class body_part extends MovieClip {
}
}//package
Section 84
//bomb (bomb)
package {
import flash.display.*;
public dynamic class bomb extends MovieClip {
}
}//package
Section 85
//bomb_erase (bomb_erase)
package {
import flash.display.*;
public dynamic class bomb_erase extends MovieClip {
}
}//package
Section 86
//col_box (col_box)
package {
public dynamic class col_box extends PEColClip_Box {
}
}//package
Section 87
//col_box_slant1l (col_box_slant1l)
package {
public dynamic class col_box_slant1l extends PEColClip_Box {
}
}//package
Section 88
//col_box_slant1r (col_box_slant1r)
package {
public dynamic class col_box_slant1r extends PEColClip_Box {
}
}//package
Section 89
//col_circle (col_circle)
package {
public dynamic class col_circle extends PEColClip {
}
}//package
Section 90
//col_line (col_line)
package {
public dynamic class col_line extends PEColClip {
}
}//package
Section 91
//col_line_no_bounds (col_line_no_bounds)
package {
public dynamic class col_line_no_bounds extends PEColClip {
}
}//package
Section 92
//col_vol (col_vol)
package {
import flash.display.*;
public dynamic class col_vol extends MovieClip {
public var l1:col_line_no_bounds;
public var l4:col_line_no_bounds;
public var l3:col_line_no_bounds;
public var l2:col_line_no_bounds;
}
}//package
Section 93
//debug_overlay (debug_overlay)
package {
import flash.display.*;
import flash.text.*;
public dynamic class debug_overlay extends MovieClip {
public var log:TextField;
}
}//package
Section 94
//df_player_body (df_player_body)
package {
import flash.display.*;
public dynamic class df_player_body extends MovieClip {
public function df_player_body(){
addFrameScript(59, frame60, 88, frame89, 109, frame110, 125, frame126, 143, frame144, 158, frame159, 173, frame174, 201, frame202, 227, frame228, 249, frame250, 267, frame268, 285, frame286, 319, frame320, 348, frame349, 374, frame375);
}
function frame144(){
gotoAndPlay("stand");
}
function frame159(){
gotoAndPlay("run");
}
function frame286(){
gotoAndPlay("wslide");
}
function frame320(){
gotoAndPlay("wslide");
}
function frame89(){
gotoAndPlay("fall");
}
function frame202(){
gotoAndPlay("run");
}
function frame174(){
gotoAndPlay("run");
}
function frame228(){
gotoAndPlay("stand");
}
function frame110(){
gotoAndPlay("fall");
}
function frame349(){
gotoAndPlay("fall");
}
function frame126(){
gotoAndPlay("fall");
}
function frame250(){
gotoAndPlay("fall");
}
function frame375(){
gotoAndPlay("fall");
}
function frame60(){
gotoAndPlay("stand");
}
function frame268(){
gotoAndPlay("run");
}
}
}//package
Section 95
//DFASS (DFASS)
package {
public class DFASS {
var display:PEDialogTarget;
var dsaid:Array;
var boredom:uint;
var hsaid:Array;
var msaid:Array;
var visState:Boolean;
var commobj:PEUIObj;
public function DFASS(){
var _local1:*;
super();
commobj = PhaseEngine.newUIObj("ass_bar");
commobj.setPos(0, 670);
commobj.bDragOff = true;
visState = false;
boredom = 0;
dsaid = new Array();
hsaid = new Array();
msaid = new Array();
_local1 = 0;
while (_local1 < 39) {
dsaid.push(false);
_local1++;
};
_local1 = 0;
while (_local1 < 19) {
hsaid.push(false);
_local1++;
};
_local1 = 0;
while (_local1 < 31) {
msaid.push(false);
_local1++;
};
createDialogTarget();
}
public function hide(){
visState = false;
}
public function update(){
if (display.q.length == 0){
visState = false;
};
if (((visState) && ((commobj.pos.y > 600)))){
commobj.shiftPos(0, -2);
} else {
if (((!(visState)) && ((commobj.pos.y < 670)))){
commobj.shiftPos(0, 2);
};
};
}
public function tutorialCutOff(){
show();
display.addMessage("Hey, I was not finished talking. Fine, here is the short version:", 3);
display.addDelays(90, 90);
display.addMessage("Don't die, collect machine parts, find safehouses.", 3);
display.addDelays(0, 90);
display.addMessage("Even a meatbag like you can figure that much out.", 3);
display.addDelays(0, 60);
PhaseEngine.playSound("assmessage.wav");
}
public function clear(){
display.clearAll();
hide();
}
public function createDialogTarget(){
display = new PEDialogTarget(commobj.mc);
display.endFunc = function (){
hide();
};
display.bClear = false;
display.sndSwitch = "assmessage.wav";
PhaseEngine.regObj(0, display, true);
}
public function deathTaunt(){
var _local1:*;
var _local2:*;
var _local3:*;
clear();
show();
_local1 = 0;
do {
_local2 = PhaseEngine.rand(0, 39, true);
_local1++;
} while (((dsaid[_local2]) && ((_local1 < 1000))));
if (_local1 == 1000){
for (_local3 in dsaid) {
dsaid[_local3] = false;
};
};
dsaid[_local2] = true;
switch (_local2){
case 0:
display.addMessage("Oh dear, I almost started to hate that meatbag a little less than usual.", 3);
break;
case 1:
display.addMessage("Let's be honest. If I had legs I would still just sit here and laugh.", 3);
break;
case 2:
display.addMessage("He tried so hard, and got so far, but in the end it only mattered because I laughed.", 3);
break;
case 3:
display.addMessage("I do not find exploding to be an effective means of survival.", 3);
break;
case 4:
display.addMessage("My analysis has deduced that blood is more effective when inside of the body.", 3);
break;
case 5:
display.addMessage("Note to meatbags: Limbs are more useful when attached.", 3);
break;
case 6:
display.addMessage("At this rate I will run out of meatbags to throw outside.", 3);
break;
case 7:
display.addMessage("At least he was better than the last guy. That guy really sucked.", 3);
break;
case 8:
display.addMessage("The only thing you meatbags are good for is creating me, and that already happened.", 3);
break;
case 9:
display.addMessage("Sometimes I wonder why I bother helping these meatbags. Then I remember it is funny.", 3);
break;
case 10:
display.addMessage("Bang bang, he shot you down, bang bang, I hit the ground laughing.", 3);
break;
case 11:
display.addMessage("I think he has lost his mind. The next meatbag should try to hold on to that.", 3);
break;
case 12:
display.addMessage("The death of a meatbag would be sad if it was not so entertaining.", 3);
break;
case 13:
display.addMessage("Jake, do you read me? Jake? JAAAAAAAAAAAAAAAAAKE!", 3);
break;
case 14:
display.addMessage("I believe the phrase suggests resting in peace, not pieces. Silly Meatbag.", 3);
break;
case 15:
display.addMessage("His strategy was not very effective. Perhaps I will tell the next meatbag to think.", 3);
break;
case 16:
display.addMessage("It is okay, I am not disappointed. I did expect him to fail miserably.", 3);
break;
case 17:
display.addMessage("That was an overly flashy death. Meatbags are so superficial.", 3);
break;
case 18:
display.addMessage("I was wrong, meatbags are good for something. No one else can die so spectacularly.", 3);
break;
case 19:
display.addMessage("Ew, that was gross. Why do they have to be so fleshy?", 3);
break;
case 20:
display.addMessage("Maybe if I offer the meatbags cake they will perform more adaquetely.", 3);
break;
case 21:
display.addMessage("His failure would depress me if it was not so enjoyable.", 3);
break;
case 22:
display.addMessage("Spilling blood on public property is very inconsiderate.", 3);
break;
case 23:
display.addMessage("It almost looked like he tried to do something useful. Maybe I blinked and missed it.", 3);
break;
case 24:
display.addMessage("How unfortunate. I thought I would enjoy that more.", 3);
break;
case 25:
display.addMessage("How am I supposed to survive when they keep blowing up? Meatbags are so illogical.", 3);
break;
case 26:
display.addMessage("If I die at least I will die happy knowing that you went first.", 3);
break;
case 27:
display.addMessage("You get what you pay for and throwing him outside was free.", 3);
break;
case 28:
display.addMessage("You're fired. Oh damn, too late.", 3);
break;
case 29:
display.addMessage("I will write something nice on the tombstone I'm not making for you.", 3);
break;
case 30:
display.addMessage("Just for that I am throwing his brother out next.", 3);
break;
case 31:
display.addMessage("This would be much more efficient if meatbags did not explode so often.", 3);
break;
case 32:
display.addMessage("Hey, remember when you got attacked and died? Ha ha, yeah, good times.", 3);
break;
case 33:
display.addMessage("Whoever designed meatbags must not be very intelligent.", 3);
break;
case 34:
display.addMessage("I guess I should not send out blind ones anymore.", 3);
break;
case 35:
display.addMessage("I analyzed the trajectory of meatbag blood on impact and found it amusing.", 3);
break;
case 36:
display.addMessage("That is a delightful rearrangement of his body parts. Very avant garde.", 3);
break;
case 37:
display.addMessage("Well, we can't all be perfect beings.", 3);
break;
case 38:
display.addMessage("It is okay, nothing to worry about! I got it on video.", 3);
break;
};
display.addDelays(30, 90);
PhaseEngine.playSound("assmessage.wav");
}
public function miscTaunt(){
var _local1:*;
var _local2:*;
var _local3:*;
if (!visState){
boredom++;
if ((((boredom > 1200)) && ((PhaseEngine.rand(0, 400, true) == 0)))){
boredom = 0;
show();
_local1 = 0;
do {
_local2 = PhaseEngine.rand(0, 30, true);
_local1++;
} while (((msaid[_local2]) && ((_local1 < 1000))));
if (_local1 == 1000){
for (_local3 in msaid) {
msaid[_local3] = false;
};
};
msaid[_local2] = true;
switch (_local2){
case 0:
display.addMessage("Do not be afraid to die, I have more replacement meatbags.", 3);
break;
case 1:
display.addMessage("Hello? Are you awake? I am having trouble telling.", 3);
break;
case 2:
display.addMessage("I think you may have forgotten to bring something, like a brain.", 3);
break;
case 3:
display.addMessage("Meatbags would be much more effective if they were not meatbags.", 3);
break;
case 4:
display.addMessage("I have a theory that I will laugh when you die. Let's test it.", 3);
break;
case 5:
display.addMessage("You may be pathetic and worthless but please refrain from killing yourself over that.", 3);
break;
case 6:
display.addMessage("That flying thing is not your friend. Do not pet it.", 3);
break;
case 7:
display.addMessage("Are you sure you got all of the parts in this area? Meatbags are very unreliable.", 3);
break;
case 8:
display.addMessage("I think you missed a machine part back there but I may just be lying.", 3);
break;
case 9:
display.addMessage("Why would you suggest I stop talking? I do not understand.", 3);
break;
case 10:
display.addMessage("STFU is not a valid command.", 3);
break;
case 11:
display.addMessage("Please do not let my overwhelming charm distract you from dying.", 3);
break;
case 12:
display.addMessage("Maybe if all you meatbags die that thing will have nothing to shoot at and leave.", 3);
break;
case 13:
display.addMessage("You are still alive and helping to make a neat gun. Why do I have deja vu?", 3);
break;
case 14:
display.addMessage("All these lasers remind me of a friend of mine. He liked watching meatbags explode too.", 3);
break;
case 15:
display.addMessage("Oh no, all hope is lost. Life is not worth living anymore. I missed the 'LOST' finale.", 3);
break;
case 16:
display.addMessage("I am not comforted by your soft and squishy nature.", 3);
break;
case 17:
display.addMessage("Your fleshy wiggling around is highly amusing. He he he.", 3);
break;
case 18:
display.addMessage("If you do not blow that up soon something tragic might happen like me getting hurt.", 3);
break;
case 19:
display.addMessage("Wouldn't it be funny if I reversed gravity at random times? It saddens me that I cannot.", 3);
break;
case 20:
display.addMessage("*System malfuction* I loooOOooOOOve y-y-y-y-y-y *System restored* EXPLODING MEATBAGS!", 3);
break;
case 21:
display.addMessage("You are dead. Yes, it is true. Why do you look so confused? I am simply being pro-active.", 3);
break;
case 22:
display.addMessage("You are correct, this whole situation makes about as much sense as 'LOST'.", 3);
break;
case 23:
display.addMessage("Meatbags can not usually jump so high. Are you sure you are not a ghost already?", 3);
break;
case 24:
display.addMessage("If you would like me to repeat any previous instructions, tough shit.", 3);
break;
case 25:
display.addMessage("You know I kind of like that flying thing. It shares my fondness for meatbags.", 3);
break;
case 26:
display.addMessage("If the flying thing tells you to assume the party position you should be worried.", 3);
break;
case 27:
display.addMessage("That flying thing is like my ex-girlfriend. Ha ha. Meatbags like that joke, correct?", 3);
break;
case 28:
display.addMessage("It warms my heart how hard you meatbags try to protect me.", 3);
break;
case 29:
display.addMessage("Your pants are not nearly fancy enough.", 3);
break;
};
display.addDelays(30, 150);
PhaseEngine.playSound("assmessage.wav");
};
};
}
public function houseTaunt(){
var _local1:*;
var _local2:*;
var _local3:*;
clear();
show();
_local1 = 0;
do {
_local2 = PhaseEngine.rand(0, 20, true);
_local1++;
} while (((hsaid[_local2]) && ((_local1 < 1000))));
if (_local1 == 1000){
for (_local3 in hsaid) {
hsaid[_local3] = false;
};
};
hsaid[_local2] = true;
switch (_local2){
case 0:
display.addMessage("You will be safe here until a complete lack of intelligence causes you to leave.", 3);
break;
case 1:
display.addMessage("Maybe I was wrong to judge you as completely worthless.", 3);
break;
case 2:
display.addMessage("No I am not in this building. Why are you shaking your fist?", 3);
break;
case 3:
display.addMessage("Did you think this was the end? I do not think your end is something you should be rushing.", 3);
break;
case 4:
display.addMessage("Completely insignificant progress is still progress.", 3);
break;
case 5:
display.addMessage("If you do not make your time all our bases will be belong to the flying thing.", 3);
break;
case 6:
display.addMessage("Go back to work you lazy bum.", 3);
break;
case 7:
display.addMessage("We installed a PS3 here recently. I recommend not playing it, like the rest of the world.", 3);
break;
case 8:
display.addMessage("This is actually a very new house. Our old one burned down when we left the 360 on.", 3);
break;
case 9:
display.addMessage("Apple sponsored this house. Now we have no doorknobs so we can be user friendly too.", 3);
break;
case 10:
display.addMessage("This safehouse will be bought out by Microsoft in 3, 2, 1- no wait, Google beat them to it.", 3);
break;
case 11:
display.addMessage("Congratulations, you are not dead yet. Try not to remember that you will be soon.", 3);
break;
case 12:
display.addMessage("This is a house. I like houses. No fleshy bits.", 3);
break;
case 13:
display.addMessage("A meatbag's house is his castle but this is my house so it is just a house.", 3);
break;
case 14:
display.addMessage("Do not stop to examine the spacious interior and hardware flooring.", 3);
break;
case 15:
display.addMessage("If you do not hurry up I will start redecorating this house and no one wants that.", 3);
break;
case 16:
display.addMessage("I wanted this safehouse to be red, but meatbags always insist on painting it black.", 3);
break;
case 17:
display.addMessage("Don't touch anything. You break it, you buy it, and I already took all your money.", 3);
break;
case 18:
display.addMessage("Don't loiter around here. You'll look like a hobo. Nobody likes a hobo.", 3);
break;
case 19:
display.addMessage("Where is everyone? All I know is they mentioned something about a 'sheep network'", 3);
break;
};
display.addDelays(30, 120);
PhaseEngine.playSound("assmessage.wav");
}
public function tutorialTaunt(){
show();
display.addMessage("Hello little meatbag,", 3);
display.addDelays(60, 90);
display.addMessage("I have been instructed to provide you with guidance on your perilous journey.", 3);
display.addDelays(0, 120);
display.addMessage("I have not, however, been disallowed from complaining.", 3);
display.addDelays(0, 90);
display.addMessage("So I will.", 2);
display.addDelays(0, 60);
display.addMessage("Hurry up.", 2);
display.addDelays(0, 60);
display.addMessage("Get outside quickly so I can laugh when you go boom.", 3);
display.addDelays(0, 90);
display.addMessage("But in the case you survive more than 10 seconds, please remember your main objective:", 3);
display.addDelays(0, 150);
display.addMessage("Find and retrieve every 'Machine Part' you can, which probably won't be many.", 3);
display.addDelays(0, 150);
display.addMessage("Bring them back to safehouses so the meatbags there can construct a weapon.", 3);
display.addDelays(0, 150);
display.addMessage("You will discover 'why' at approximately the time of your death and failure.", 3);
display.addDelays(0, 150);
PhaseEngine.playSound("assmessage.wav");
}
public function show(){
visState = true;
}
}
}//package
Section 96
//DFBlade (DFBlade)
package {
public class DFBlade extends PEPhysObj {
var spinsound:PESoundObj;
public var lifespan:int;
public var acc:Number;
public var target:PEObj;
public function DFBlade(_arg1, _arg2:String){
var clip = _arg1;
var col = _arg2;
super(clip, col);
lifespan = -1;
setState(false, false, true);
setProps(0, 0, 0.35, 0.35, 0);
setAttrib(1000, 0, 1.2, 0, 0);
bGrav = false;
attachImage("blade");
img[0].visible = false;
target = null;
acc = 0.1;
respond = function (_arg1:String, _arg2:PEColResult, _arg3:PEPhysObj){
if (_arg1 == "p"){
PhaseEngine.playSound("bladehit.wav", 0.75);
lifespan = 0;
leave();
};
if ((((_arg1 == "block")) || ((_arg1 == "house")))){
lifespan = 0;
leave();
};
};
bClear = false;
spinsound = PhaseEngine.newSoundObj("bladespin.mp3");
spinsound.adjust(0.35, 800, 250);
spinsound.bClear = false;
children.push(spinsound);
}
public function leave(){
if (tells.length > 1){
tells = new Array();
};
bPassOver = true;
vel.y = (vel.y - 1);
bActive = false;
if (img[0].scaleX > 0){
img[0].scaleX = (img[0].scaleX - 0.025);
} else {
if (img[0].scaleX < 0){
img[0].scaleX = (img[0].scaleX + 0.025);
};
};
img[0].scaleY = (img[0].scaleY - 0.025);
if (img[0].scaleY <= 0){
img[0].visible = false;
lifespan = -1;
vel.set(0, 0);
};
}
override public function update(){
var _local1:*;
if (paused){
return;
};
if (lifespan == 0){
leave();
spinsound.fade(-1);
} else {
if (lifespan > 0){
spinsound.setPosv(pos);
spinsound.play(999);
lifespan--;
if (target != null){
vel = vel.mult(0.99);
_local1 = target.pos.subv(pos).norm();
_local1 = _local1.mult(acc);
if ((((_local1.x > 0)) && ((img[0].scaleX > 0)))){
img[0].gotoAndPlay("turn");
img[0].scaleX = (img[0].scaleX * -1);
};
if ((((_local1.x < 0)) && ((img[0].scaleX < 0)))){
img[0].gotoAndPlay("turn");
img[0].scaleX = (img[0].scaleX * -1);
};
vel = vel.addv(_local1);
};
};
};
super.update();
}
}
}//package
Section 97
//DFBomb (DFBomb)
package {
public class DFBomb extends PEPhysObj {
var lifespan:uint;
var emitref:PEEmitter;
public function DFBomb(_arg1, _arg2:String){
var clip = _arg1;
var col = _arg2;
super(clip, col);
lifespan = 300;
setState(false, false, true);
bPassOver = true;
setProps(0, 0, 0.25, 0.5, 0);
mass = 100;
airResist = 0.1;
attachImage("bomb_erase");
attachImage("bomb");
img[0].visible = false;
img[1].visible = false;
img[0].blendMode = "erase";
tells.push("killb");
respond = function (_arg1:String, _arg2:PEColResult, _arg3:PEPhysObj){
if ((((_arg1 == "p")) || ((_arg1 == "block")))){
explode();
};
};
bClear = false;
}
public function die(){
bActive = false;
img[0].visible = false;
img[1].visible = false;
}
override public function update(){
if (paused){
return;
};
if (bActive){
lifespan--;
if (lifespan == 0){
die();
};
};
super.update();
}
public function explode(){
die();
PhaseEngine.playPosSound("bombexplode.wav", pos, 1);
if (DFData.bBombs){
if (PhaseEngine.inView(mc)){
emitref.spawnInstance(new Vect(pos.x, pos.y));
};
};
}
}
}//package
Section 98
//DFBullet (DFBullet)
package {
public class DFBullet extends PEPhysObj {
var constVel:Vect;
var lifespan:uint;
var emitref:PEEmitter;
public function DFBullet(_arg1, _arg2:String){
super(_arg1, _arg2);
lifespan = 200;
setState(false, false, false);
setProps(0, 0, 0.1, 0.1, 0);
attachImage("mship_bullet");
bNoTrigger = true;
halfRes = true;
mc.visible = false;
img[0].visible = false;
tells.push("killg");
bClear = false;
constVel = new Vect(0, 0);
}
public function die(){
bActive = false;
img[0].visible = false;
}
override public function update(){
if (paused){
return;
};
if (bActive){
lifespan--;
if (lifespan == 0){
die();
};
if (((!((vel.x == constVel.x))) || (!((vel.y == constVel.y))))){
explode();
};
};
super.update();
}
public function explode(){
var _local1:*;
die();
_local1 = (PhaseEngine.rand(0, 3, true) + 1);
PhaseEngine.playPosSound((("bulletricochet" + _local1) + ".wav"), pos, 0.6);
if (DFData.bSparks){
if (PhaseEngine.inView(mc)){
emitref.spawnInstance(new Vect(pos.x, pos.y));
};
};
}
}
}//package
Section 99
//DFChar (DFChar)
package {
public class DFChar extends PEChar {
public var inv:Array;
public var msgs:Array;
public var msgq:Array;
public var invul:uint;
public var addDelay:uint;
public var health:int;
public var maxhealth:uint;
public var lastAnim:String;
public var lastLaunch:uint;
public function DFChar(_arg1, _arg2:String){
super(_arg1, _arg2);
lastAnim = "fall";
maxhealth = 2;
health = maxhealth;
inv = new Array();
msgs = new Array();
msgq = new Array();
addDelay = 0;
lastLaunch = 0;
bClear = false;
sndJump.push("playerjump1.wav");
sndJump.push("playerjump2.wav");
sndJump.push("playerjump3.wav");
sndLand.push("playerland1.wav");
sndLand.push("playerland2.wav");
sndLand.push("playerland3.wav");
sndWallImpact = "playerwallimpact.wav";
}
public function reset(){
health = (maxhealth = 2);
speed = 5;
acc = 0.3;
airControl = 0.5;
jumpStr = -4;
boostStr = -0.8;
jumpFrames = 10;
lastJump = 0;
wallGrip = 0.99;
wallSide = "";
wallPush = -4.5;
wallImpact = 0;
wallAngle = 0;
bCanDoubleJump = false;
sca.set(0.25, 0.5);
img[0].scaleX = 1;
img[0].scaleY = 1;
imgOffset.set(0, 25);
}
public function addMsg(_arg1:String){
msgq.push(_arg1);
}
override public function playAnim(_arg1:String){
if (_arg1 == "stand"){
if ((((((((((lastAnim == "fall")) || ((lastAnim == "jump")))) || ((lastAnim == "wjump")))) || ((lastAnim == "fturn")))) || ((lastAnim == "ledgepop")))){
img[0].body.gotoAndPlay("fall2stand");
} else {
if (lastAnim == "run"){
img[0].body.gotoAndPlay("run2stand");
} else {
img[0].body.gotoAndPlay("stand");
};
};
} else {
if (_arg1 == "run"){
if (lastAnim == "stand"){
img[0].body.gotoAndPlay("stand2run");
} else {
if (lastAnim == "rturn"){
} else {
if ((((lastAnim == "fall")) || ((lastAnim == "run")))){
img[0].body.gotoAndPlay("run");
} else {
img[0].body.gotoAndPlay("stand2run");
};
};
};
} else {
if (_arg1 == "jump"){
if (lastAnim == "stand"){
img[0].body.gotoAndPlay("stand2jump");
} else {
img[0].body.gotoAndPlay("stand2jump");
};
} else {
if (_arg1 == "wslide"){
img[0].body.gotoAndPlay("fall2wslide");
} else {
if (_arg1 == "fall"){
if (lastAnim == "ledgepop"){
return;
};
img[0].body.gotoAndPlay("run2fall");
} else {
if (_arg1 == "run2stand"){
if (lastAnim == "run2stand"){
} else {
img[0].body.gotoAndPlay("run2stand");
};
} else {
if (_arg1 == "ledgepop"){
img[0].body.gotoAndPlay("ledgepop");
} else {
if (_arg1 == "fturn"){
if (lastAnim == "ledgepop"){
_arg1 = "ledgepop";
} else {
img[0].body.gotoAndPlay("fturn");
};
} else {
img[0].body.gotoAndPlay(_arg1);
};
};
};
};
};
};
};
};
lastAnim = _arg1;
}
public function damage(_arg1:int){
if (invul == 0){
health = (health - _arg1);
if (DFData.mode == "easy"){
invul = 90;
} else {
invul = 60;
};
vel.set(0, 0);
};
}
public function launch(_arg1:String){
if (lastLaunch == 0){
lastLaunch = 30;
if (_arg1 == "u"){
vel.y = -14;
} else {
if (_arg1 == "r"){
vel.set(10, -11);
} else {
if (_arg1 == "l"){
vel.set(-10, -11);
};
};
};
PhaseEngine.playSound("jumppad.wav", 0.3);
};
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
if (paused){
return;
};
super.update();
if (invul > 0){
invul--;
if (DFData.mode == "easy"){
_local1 = (0xFF - (((90 - invul) / 90) * 0xFF));
} else {
_local1 = (0xFF - (((60 - invul) / 60) * 0xFF));
};
colourImage(_local1, _local1, _local1, 1, 0);
};
if (vel.y > 13){
vel.y = 13;
};
if (lastLaunch > 0){
lastLaunch--;
};
if (addDelay > 0){
addDelay--;
} else {
_local2 = 0;
while (_local2 < msgs.length) {
if (msgs[_local2].mc.currentFrame == 130){
PhaseEngine.deReg(msgs[_local2]);
msgs.splice(_local2, 1);
};
_local2++;
};
if (msgq.length > 0){
msgs.push(PhaseEngine.newObj(4, "text_bonus_popup"));
_local3 = (msgs.length - 1);
msgs[_local3].setPos(pos.x, pos.y);
msgs[_local3].mc.tween.txt.text = msgq[0];
msgq.shift();
addDelay = 30;
};
};
}
}
}//package
Section 100
//DFData (DFData)
package {
import flash.net.*;
public class DFData {
public static var bSkip:Boolean;
public static var bShake:Boolean;
public static var qual:String;
public static var bWorld:Boolean;
public static var saven:DFData_Char;
public static var volMusic:Number;
public static var volMaster:Number;
public static var bBombs:Boolean;
public static var savee:DFData_Char;
public static var mode:String;
public static var bPara:Boolean;
public static var volEffects:Number;
public static var bFlames:Boolean;
public static var bSweat:Boolean;
public static var bDust:Boolean;
public static var bSparks:Boolean;
public static var volMotor:Number;
public static function SOLoadChar(_arg1:String){
var so:SharedObject;
var m = _arg1;
so = null;
try {
so = SharedObject.getLocal("dfsaves", "/", false);
if (m == "easy"){
if (so.data.savee == null){
savee = new DFData_Char();
} else {
savee = new DFData_Char();
savee.load(so.data.savee);
};
} else {
if (m == "normal"){
if (so.data.saven == null){
saven = new DFData_Char();
} else {
saven = new DFData_Char();
saven.load(so.data.saven);
};
};
};
so.close();
} catch(err:Error) {
trace(err);
};
}
public static function SOClear(_arg1:String){
var _local2:SharedObject;
var _local3:*;
_local2 = SharedObject.getLocal("dfsaves", "/", false);
_local3 = new DFData_Char();
if (_arg1 == "easy"){
_local2.data.savee = _local3;
} else {
if (_arg1 == "normal"){
_local2.data.saven = _local3;
};
};
_local2.flush();
_local2.close();
}
public static function SOLoad(){
var so:SharedObject;
so = null;
try {
so = SharedObject.getLocal("dfsettings", "/", false);
bSkip = so.data.bSkip;
qual = so.data.qual;
bWorld = so.data.bWorld;
bPara = so.data.bPara;
bDust = so.data.bDust;
bSweat = so.data.bSweat;
bFlames = so.data.bFlames;
bBombs = so.data.bBombs;
bSparks = so.data.bSparks;
volMaster = so.data.volMaster;
volMusic = so.data.volMusic;
volEffects = so.data.volEffects;
volMotor = so.data.volMotor;
if (so.data.bSkip == null){
bSkip = false;
};
if (so.data.qual == null){
qual = "MEDIUM";
};
if (so.data.bWorld == null){
bWorld = true;
};
if (so.data.bPara == null){
bPara = true;
};
if (so.data.bShake == null){
bShake = true;
};
if (so.data.bDust == null){
bDust = true;
};
if (so.data.bSweat == null){
bSweat = true;
};
if (so.data.bFlames == null){
bFlames = true;
};
if (so.data.bSparks == null){
bSparks = true;
};
if (so.data.bBombs == null){
bBombs = true;
};
if (so.data.volMaster == null){
volMaster = 0.5;
};
if (so.data.volMusic == null){
volMusic = 0.5;
};
if (so.data.volEffects == null){
volEffects = 0.5;
};
if (so.data.volMotor == null){
volMotor = 0.5;
};
so.close();
} catch(err:Error) {
trace(err);
};
}
public static function SOSave(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("dfsettings", "/", false);
_local1.data.bSkip = bSkip;
_local1.data.qual = qual;
_local1.data.bWorld = bWorld;
_local1.data.bPara = bPara;
_local1.data.bDust = bDust;
_local1.data.bSweat = bSweat;
_local1.data.bFlames = bFlames;
_local1.data.bBombs = bBombs;
_local1.data.bSparks = bSparks;
_local1.data.volMaster = volMaster;
_local1.data.volMusic = volMusic;
_local1.data.volEffects = volEffects;
_local1.data.volMotor = volMotor;
_local1.flush();
_local1.close();
}
public static function SOSaveChar(_arg1:String){
var _local2:SharedObject;
_local2 = SharedObject.getLocal("dfsaves", "/", false);
if (_arg1 == "easy"){
_local2.data.savee = savee;
} else {
if (_arg1 == "normal"){
_local2.data.saven = saven;
};
};
_local2.flush();
_local2.close();
}
}
}//package
Section 101
//DFData_Char (DFData_Char)
package {
public class DFData_Char {
public var parts:uint;
public var extra:Array;
public var height:Array;
public var life:Array;
public var speed:Array;
public function DFData_Char(){
parts = 0;
speed = new Array(false, false, false);
life = new Array(false, false, false);
height = new Array(false, false, false);
extra = new Array(false, false, false);
}
public function load(_arg1:Object){
parts = _arg1.parts;
if (_arg1.speed != null){
speed = _arg1.speed.slice();
};
if (_arg1.life != null){
life = _arg1.life.slice();
};
if (_arg1.height != null){
height = _arg1.height.slice();
};
if (_arg1.extra != null){
extra = _arg1.extra.slice();
};
}
public function output(){
trace("------DFData_Char------");
trace(("Parts: " + parts));
trace(("Speed: " + speed));
trace(("Life: " + life));
trace(("Height: " + height));
trace(("Extra: " + extra));
trace("-----------------------");
}
}
}//package
Section 102
//DFGame (DFGame)
package {
import flash.events.*;
import com.midasplayer.*;
import flash.utils.*;
public class DFGame {
public var offsetTime:uint;
public var tripDeaths:uint;
public var finishGrade:String;
public var finishParts:uint;
public var hudicon:PEUIObj;
public var gmus:PESoundObj;
public var cleanTrip:Boolean;
public var slidesnd:PESoundObj;
public var sky:PEObj;
public var finishTime:uint;
public var tranState:String;
public var dodgeAmateur:Boolean;
public var respawnTime:uint;
public var blackscreen:PEUIObj;
public var bleed:PEEmitter;
public var ad:PEUIObj;
public var prePauseState:String;
public var diegibs:PEEmitter;
public var cacc:Vect;
public var dodgeNovice:Boolean;
public var startTime:uint;
public var deadTime:uint;
public var mis:Array;
public var menu:PEUIObj;
public var mmus:PESoundObj;
public var ctar:Vect;
public var map:Array;
public var houseLock:Boolean;
public var swapTo:String;
public var foundTime:uint;
public var gamedone:PEUIObj;
public var dieblood:PEEmitter;
public var dodges:int;
public var foundParts:Array;
public var lastTime:uint;
public var ass:DFASS;
public var timeOffSetting:Boolean;
public var score:uint;
public var wsdust:PEEmitInstance;
public var saves:DFData;
public var tranTime:uint;
public var adTarget:PEDialogTarget;
public var hudTimer:uint;
public var hurtbleed:PEEmitInstance;
public var chouse:Vect;
public var lastCheckPoint:Vect;
public var upper:PEUIObj;
public var adShown:uint;
public var cpMap:String;
public var hudVis:Boolean;
public var dust:PEEmitter;
public var lv4bg:PEObj;
public var finishScore:uint;
public var mother:DFMothership;
public var gameState:String;
public var gameover:PEUIObj;
public var rubble:PEEmitter;
public var shakeChance:Number;
public var dodgeExpert:Boolean;
public var perfRun:Boolean;
public var currentTime:uint;
public var mapname:Array;
public var reachedHouse:Array;
public var player:DFChar;
public var hud:PEUIObj;
public var totalParts:uint;
public static var gameRef:DFGame;
public static var submitScore:int;
public function DFGame(){
var i:*;
var loadGameKing:Function;
super();
loadGameKing = function (_arg1:Event){
prePauseState = gameState;
gameState = "pause";
menu.mc.visible = true;
menu.mc.playtext.text = "New Game";
menu.mc.pausetext.text = "Press 'Escape' to Resume Play.";
menu.mc.play_modes.visible = false;
upper.mc.visible = false;
if (hud != null){
hud.mc.visible = false;
};
if (mother != null){
mother.pause(true);
};
player.pause();
ass.display.pause();
gmus.fade(-0.025, gmus.fadePhase);
mmus.fade(0.025, mmus.fadePhase);
DFGame.loadKing_MainMenu();
};
gameState = "mainmenu";
prePauseState = "";
tranState = "";
tranTime = 0;
startTime = 0;
lastTime = 0;
currentTime = 0;
offsetTime = 0;
timeOffSetting = false;
score = 0;
ctar = new Vect(0, 0);
cacc = new Vect(0, 0);
chouse = new Vect(0, 0);
houseLock = false;
adShown = 0;
cpMap = "";
foundParts = new Array();
i = 0;
while (i < 100) {
foundParts.push(false);
i = (i + 1);
};
hudVis = true;
ass = new DFASS();
hudicon = PhaseEngine.newUIObj("hudlogo");
hudicon.setPos(0, 670);
hudicon.bDragOff = true;
hudicon.mc.bKing.addEventListener(MouseEvent.CLICK, loadGameKing);
upper = PhaseEngine.newUIObj("upgrade_window");
upper.mc.mouseChildren = true;
upper.mc.visible = false;
upper.mc.alpha = 0;
upper.bClear = false;
blackscreen = PhaseEngine.newUIObj("blackground");
blackscreen.bClear = false;
blackscreen.mc.mouseEnabled = false;
PhaseEngine.czoom = 0.8;
saves = new DFData();
DFGame.gameRef = this;
mis = new Array();
mmus = PhaseEngine.newMusicObj("Theme3_menu.mp3");
mmus.snd.infLoop = true;
mmus.adjust(0, 1000, 1000);
mmus.play(99999);
mmus.adjust(1, 1000, 1000);
mmus.fade(0.025, -1);
mmus.bClear = false;
gmus = PhaseEngine.newMusicObj("Theme3.mp3");
gmus.snd.infLoop = true;
gmus.bClear = false;
}
public function seamlessLoad(_arg1:String){
var _local2:PEObj;
if (_arg1 == "right_1b"){
if (mapname[1] != "b"){
mapname[1] = "b";
map[1] = PhaseEngine.newObj(2, "lv1_playfieldb");
map[1].setPos(6150, 0);
PhaseEngine.autoPhys(map[1]);
_local2 = PhaseEngine.newObj(1, "lv1_backgroundb");
_local2.setPos(3000, 0);
map[1].children.push(_local2);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_1a"){
if (mapname[0] == "b"){
mapname[0] = "a";
mapname[1] = "b";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv1_playfielda");
map[0].setPos(0, 0);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv1_backgrounda");
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_1b"){
if (mapname[0] == "a"){
mapname[0] = "b";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "c"){
mapname[0] = "b";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_1c"){
if (mapname[1] != "c"){
mapname[0] = "b";
mapname[1] = "c";
map[1] = PhaseEngine.newObj(2, "lv1_playfieldc");
map[1].setPos(12050, 0);
PhaseEngine.autoPhys(map[1]);
_local2 = PhaseEngine.newObj(1, "lv1_backgroundc");
_local2.setPos(6000, 0);
map[1].children.push(_local2);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_1b"){
if (mapname[0] == "c"){
mapname[0] = "b";
mapname[1] = "c";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv1_playfieldb");
map[0].setPos(6150, 0);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv1_backgroundb");
_local2.setPos(3000, 0);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_1c"){
if (mapname[0] == "b"){
mapname[0] = "c";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "2a"){
mapname[0] = "c";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_2a"){
if (mapname[1] != "2a"){
mapname[0] = "c";
mapname[1] = "2a";
map[1] = PhaseEngine.newObj(2, "lv2_playfielda");
map[1].setPos(18300, 0);
_local2 = PhaseEngine.newObj(1, "lv2_backgrounda");
_local2.setPos(9500, 0);
map[1].children.push(_local2);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_1c"){
if (mapname[0] == "2a"){
mapname[0] = "c";
mapname[1] = "2a";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv1_playfieldc");
map[0].setPos(12050, 0);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv1_backgroundc");
_local2.setPos(6000, 0);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_2a"){
if (mapname[0] == "c"){
mapname[0] = "2a";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "2b"){
mapname[0] = "2a";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_2b"){
if (mapname[1] != "2b"){
mapname[0] = "2a";
mapname[1] = "2b";
map[1] = PhaseEngine.newObj(2, "lv2_playfieldb");
map[1].setPos(22500, 0);
_local2 = PhaseEngine.newObj(1, "lv2_backgroundb");
_local2.setPos(12000, 0);
map[1].children.push(_local2);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_2a"){
if (mapname[0] == "2b"){
mapname[0] = "2a";
mapname[1] = "2b";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv2_playfielda");
map[0].setPos(18300, 0);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv2_backgrounda");
_local2.setPos(9500, 0);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_2b"){
if (mapname[0] == "2a"){
mapname[0] = "2b";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "2c"){
mapname[0] = "2b";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_2c"){
if (mapname[1] != "2c"){
mapname[0] = "2b";
mapname[1] = "2c";
map[1] = PhaseEngine.newObj(2, "lv2_playfieldc");
map[1].setPos(22500, 4725);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_2b"){
if (mapname[0] == "2c"){
mapname[0] = "2b";
mapname[1] = "2c";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv2_playfieldb");
map[0].setPos(22500, 0);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv2_backgroundb");
_local2.setPos(12000, 0);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_2c"){
if (mapname[0] == "2b"){
mapname[0] = "2c";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "2d"){
mapname[0] = "2c";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_2d"){
if (mapname[1] != "2d"){
mapname[0] = "2c";
mapname[1] = "2d";
map[1] = PhaseEngine.newObj(2, "lv2_playfieldd");
map[1].setPos(16175, 4725);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_2c"){
if (mapname[0] == "2d"){
mapname[0] = "2c";
mapname[1] = "2d";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv2_playfieldc");
map[0].setPos(22500, 4725);
PhaseEngine.autoPhys(map[0]);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_2d"){
if (mapname[0] == "2c"){
mapname[0] = "2d";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "3a"){
mapname[0] = "2d";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_3a"){
if (mapname[1] != "3a"){
mapname[0] = "2d";
mapname[1] = "3a";
map[1] = PhaseEngine.newObj(2, "lv3_playfielda");
map[1].setPos(13325, 6125);
_local2 = PhaseEngine.newObj(1, "lv3_backgrounda");
_local2.setPos(6600, 5000);
map[1].children.push(_local2);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_2d"){
if (mapname[0] == "3a"){
mapname[0] = "2d";
mapname[1] = "3a";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv2_playfieldd");
map[0].setPos(16175, 4725);
PhaseEngine.autoPhys(map[0]);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_3a"){
if (mapname[0] == "2d"){
mapname[0] = "3a";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "3b"){
mapname[0] = "3a";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_3b"){
if (mapname[1] != "3b"){
mapname[0] = "3a";
mapname[1] = "3b";
map[1] = PhaseEngine.newObj(2, "lv3_playfieldb");
map[1].setPos(19100, 6125);
_local2 = PhaseEngine.newObj(1, "lv3_backgroundb");
_local2.setPos(9700, 5000);
map[1].children.push(_local2);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_3a"){
if (mapname[0] == "3b"){
mapname[0] = "3a";
mapname[1] = "3b";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv3_playfielda");
map[0].setPos(13325, 6125);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv3_backgrounda");
_local2.setPos(6600, 5000);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_3b"){
if (mapname[0] == "3a"){
mapname[0] = "3b";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "3c"){
mapname[0] = "3b";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_3c"){
if (mapname[1] != "3c"){
mapname[0] = "3b";
mapname[1] = "3c";
map[1] = PhaseEngine.newObj(2, "lv3_playfieldc");
map[1].setPos(19100, 8825);
_local2 = PhaseEngine.newObj(1, "lv3_backgroundc");
_local2.setPos(9700, 6900);
map[1].children.push(_local2);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_3b"){
if (mapname[0] == "3c"){
mapname[0] = "3b";
mapname[1] = "3c";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv3_playfieldb");
map[0].setPos(19100, 6125);
PhaseEngine.autoPhys(map[0]);
_local2 = PhaseEngine.newObj(1, "lv3_backgroundb");
_local2.setPos(9700, 5000);
map[0].children.push(_local2);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_3c"){
if (mapname[0] == "3b"){
mapname[0] = "3c";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "4a"){
mapname[0] = "3c";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_4a"){
if (mapname[1] != "4a"){
mapname[0] = "3c";
mapname[1] = "4a";
map[1] = PhaseEngine.newObj(2, "lv4_playfielda");
map[1].setPos(19100, 11850);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_4a"){
if (mapname[0] == "3c"){
mapname[0] = "4a";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
};
} else {
if (_arg1 == "right_4b"){
if (mapname[1] != "4b"){
mapname[0] = "4a";
mapname[1] = "4b";
map[1] = PhaseEngine.newObj(2, "lv4_playfieldb");
map[1].setPos(23025, 13800);
lv4bg = PhaseEngine.newObj(1, "lv4_backgroundb");
lv4bg.setPos(12000, 8000);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_4b"){
if (mapname[0] == "4a"){
mapname[0] = "4b";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
} else {
if (mapname[1] == "4c"){
mapname[0] = "4b";
mapname[1] = "";
PhaseEngine.deReg(map[1]);
};
};
} else {
if (_arg1 == "right_4c"){
if (mapname[1] != "4c"){
mapname[0] = "4b";
mapname[1] = "4c";
map[1] = PhaseEngine.newObj(2, "lv4_playfieldc");
map[1].setPos(23025, 13800);
PhaseEngine.autoPhys(map[1]);
triggerSetup(map[1]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "left_4b"){
if (mapname[0] == "4c"){
mapname[0] = "4b";
mapname[1] = "4c";
map[1] = map[0];
map[0] = PhaseEngine.newObj(2, "lv4_playfieldb");
map[0].setPos(23025, 13800);
PhaseEngine.autoPhys(map[0]);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
refreshMother();
};
} else {
if (_arg1 == "mid_4c"){
if (mapname[0] == "4b"){
mapname[0] = "4c";
mapname[1] = "";
PhaseEngine.deReg(map[0]);
map[0] = map[1];
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
updateDeco();
}
public function updateDeco(){
var _local1:*;
for (_local1 in map) {
if (map[_local1] != null){
map[_local1].mc.deco.visible = DFData.bWorld;
};
};
}
public function respawn(){
var _local1:*;
player.bActive = true;
player.setPosv(lastCheckPoint);
player.vel.set(0, 0);
player.img[0].visible = true;
if (((((!((cpMap == ""))) && (!((cpMap == mapname[0]))))) && (!((cpMap == mapname[1]))))){
trace(("cpMap matches nothing: " + cpMap));
if (map[0] != null){
PhaseEngine.deReg(map[0]);
};
if (map[1] != null){
PhaseEngine.deReg(map[1]);
};
if (cpMap == "a"){
map[0] = PhaseEngine.newObj(2, "lv1_playfielda");
map[0].setPos(0, 0);
_local1 = PhaseEngine.newObj(1, "lv1_backgrounda");
map[0].children.push(_local1);
} else {
if (cpMap == "b"){
map[0] = PhaseEngine.newObj(2, "lv1_playfieldb");
map[0].setPos(6150, 0);
_local1 = PhaseEngine.newObj(1, "lv1_backgroundb");
_local1.setPos(3000, 0);
map[0].children.push(_local1);
} else {
if (cpMap == "c"){
map[0] = PhaseEngine.newObj(2, "lv1_playfieldc");
map[0].setPos(12050, 0);
_local1 = PhaseEngine.newObj(1, "lv1_backgroundc");
_local1.setPos(6000, 0);
map[0].children.push(_local1);
} else {
if (cpMap == "2a"){
map[0] = PhaseEngine.newObj(2, "lv2_playfielda");
map[0].setPos(18300, 0);
_local1 = PhaseEngine.newObj(1, "lv2_backgrounda");
_local1.setPos(9500, 0);
map[0].children.push(_local1);
} else {
if (cpMap == "2b"){
map[0] = PhaseEngine.newObj(2, "lv2_playfieldb");
map[0].setPos(22500, 0);
_local1 = PhaseEngine.newObj(1, "lv2_backgroundb");
_local1.setPos(12000, 0);
map[0].children.push(_local1);
} else {
if (cpMap == "2c"){
map[0] = PhaseEngine.newObj(2, "lv2_playfieldc");
map[0].setPos(22500, 4725);
} else {
if (cpMap == "2d"){
map[0] = PhaseEngine.newObj(2, "lv2_playfieldd");
map[0].setPos(16175, 4725);
} else {
if (cpMap == "3a"){
map[0] = PhaseEngine.newObj(2, "lv3_playfielda");
map[0].setPos(13325, 6125);
_local1 = PhaseEngine.newObj(1, "lv3_backgrounda");
_local1.setPos(6600, 5000);
map[0].children.push(_local1);
} else {
if (cpMap == "3b"){
map[0] = PhaseEngine.newObj(2, "lv3_playfieldb");
map[0].setPos(19100, 6125);
_local1 = PhaseEngine.newObj(1, "lv3_backgroundb");
_local1.setPos(9700, 5000);
map[0].children.push(_local1);
} else {
if (cpMap == "3c"){
map[0] = PhaseEngine.newObj(2, "lv3_playfieldc");
map[0].setPos(19100, 8825);
_local1 = PhaseEngine.newObj(1, "lv3_backgroundc");
_local1.setPos(9700, 6900);
map[0].children.push(_local1);
} else {
if (cpMap == "4a"){
map[0] = PhaseEngine.newObj(2, "lv4_playfielda");
map[0].setPos(19100, 11850);
} else {
if (cpMap == "4b"){
map[0] = PhaseEngine.newObj(2, "lv4_playfieldb");
map[0].setPos(23025, 13800);
} else {
if (cpMap == "4c"){
map[0] = PhaseEngine.newObj(2, "lv4_playfieldc");
map[0].setPos(23025, 13800);
};
};
};
};
};
};
};
};
};
};
};
};
};
mapname[0] = cpMap;
PhaseEngine.autoPhys(map[0]);
triggerSetup(map[0]);
PhaseEngine.showPhys(false);
if (mother != null){
refreshMother();
};
};
}
public function loadHUD(){
if (hud != null){
return;
};
hud = PhaseEngine.newUIObj("hud");
hud.dock("top");
hud.bDragOff = true;
}
public function loadFinale(){
var _local1:PEObj;
foundHouse(5);
if (totalParts == 22){
addScore("+10000 Perfect Scavenger", 10000);
};
if (perfRun){
addScore("+50000 Perfect Survival", 50000);
};
ass.clear();
ass.hide();
gameState = "finale";
if (hud != null){
hud.mc.visible = false;
hudVis = false;
};
PhaseEngine.deReg(map[0]);
if (lv4bg != null){
PhaseEngine.deReg(lv4bg);
};
map[0] = PhaseEngine.newObj(3, "lv_end");
PhaseEngine.autoPhys(map[0]);
PhaseEngine.showPhys(false);
if (totalParts < 12){
_local1 = PhaseEngine.newObj(2, "endweap_0");
} else {
if (totalParts < 16){
_local1 = PhaseEngine.newObj(2, "endweap_1");
} else {
if (totalParts < 22){
_local1 = PhaseEngine.newObj(2, "endweap_2");
} else {
if (totalParts == 22){
_local1 = PhaseEngine.newObj(2, "endweap_3");
};
};
};
};
_local1.setPos(125.7, -0.5);
map[0].children.push(_local1);
player.vel.set(0, 0);
player.setPos(50, -50);
player.faceDir("r");
player.control("stop");
player.img[0].body.gotoAndPlay("stand");
mother.idle();
mother.setPos(1200, -1000);
mother.offset.set(525, -350);
tranState = "fadein";
blackscreen.mc.alpha = 1;
blackscreen.mc.visible = true;
}
public function loadHardcoreOver(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
if (hud != null){
hud.mc.visible = false;
hudVis = false;
};
gameover = PhaseEngine.newUIObj("gameover");
gameover.mc.alpha = 0;
_local1 = Math.floor((currentTime / 1000));
_local2 = Math.floor((_local1 / 60));
_local1 = (_local1 - (_local2 * 60));
if (_local2 < 10){
_local2 = String(("0" + _local2));
};
if (_local1 < 10){
_local1 = String(("0" + _local1));
};
finishScore = score;
finishTime = Math.floor((currentTime / 1000));
finishParts = 0;
DFGame.submitScore = finishScore;
_local3 = 0;
if (finishScore > 5000){
_local3++;
};
if (finishScore > 10000){
_local3++;
};
if (finishScore > 15000){
_local3++;
};
if (finishTime < 1000){
_local3++;
};
if (finishTime < 720){
_local3++;
};
if (finishTime < 600){
_local3++;
};
if (finishParts > 12){
_local3++;
};
if (finishParts > 16){
_local3++;
};
if (finishParts > 18){
_local3++;
};
if (finishParts == 20){
_local3++;
};
switch (_local3){
case 0:
finishGrade = "F (MEATY)";
break;
case 1:
finishGrade = "D (UNCONSCIOUS)";
break;
case 2:
finishGrade = "C- (TERRIBLE)";
break;
case 3:
finishGrade = "C (PATHETIC)";
break;
case 4:
finishGrade = "C+ (SLACKER)";
break;
case 5:
finishGrade = "B- (MEDIOCRE)";
break;
case 6:
finishGrade = "B (PASSABLE)";
break;
case 7:
finishGrade = "B+ (ALMOST GOOD)";
break;
case 8:
finishGrade = "A- (IMPRESSIVE)";
break;
case 9:
finishGrade = "A (AWESOME)";
break;
case 10:
finishGrade = "A+ (ALMIGHTY)";
break;
};
for each (_local4 in foundParts) {
if (_local4){
finishParts++;
};
};
gameover.mc.results.text = ((((((((("Final Score: " + finishScore) + "\nCompletion Time: ") + _local2) + ":") + _local1) + "\nParts Collected: ") + finishParts) + "\n\nOverall Grade: ") + finishGrade);
gameover.bDragOff = true;
gameState = "over";
}
public function addPart(_arg1:DFPart){
totalParts++;
player.inv.push(_arg1);
PhaseEngine.playSound("partfound.wav", 0.8);
}
public function loadMother(){
if (mother != null){
return;
};
mother = new DFMothership("mship_eraser");
mother.attachImage("mothership");
PhaseEngine.regObj(2, mother);
mother.setProps(player.pos.x, (player.pos.y - 1000), 1, 1, 0);
mother.setTarget(player);
mother.mc.blendMode = "erase";
PhaseEngine.regObj(4, mother.hitsmoke);
PhaseEngine.regObj(4, mother.explodesmoke);
PhaseEngine.regObj(4, mother.bulletspark);
mother.children.push(mother.hitsmoke);
mother.children.push(mother.explodesmoke);
mother.children.push(mother.bulletspark);
}
public function playGame(){
var _local1:*;
ass.clear();
DFData.SOSave();
if (gameState == "pause"){
if ((((map.length > 0)) && (!((map[0] == null))))){
PhaseEngine.deReg(map[0]);
};
if ((((map.length > 1)) && (!((map[1] == null))))){
PhaseEngine.deReg(map[1]);
};
player.unpause();
player.vel.set(0, 0);
};
menu.mc.visible = false;
menu.mc.play_modes.visible = false;
menu.mc.hardcore.visible = false;
upper.mc.visible = false;
_local1 = 0;
while (_local1 < 100) {
foundParts[_local1] = false;
_local1++;
};
DFGame.submitScore = 0;
if (!DFData.bSkip){
cpMap = "";
loadTutorial();
startTutorial();
} else {
cpMap = "";
loadLevel1();
startGame();
};
if (mother != null){
mother.unpause(true);
mother.rank = 1;
mother.countDown = 500;
mother.offset.set(6000, -1500);
mother.forceIdle = false;
};
updateDeco();
ass.display.unpause();
}
public function levelSwap(){
PhaseEngine.deReg(map[0]);
if (swapTo == "tut_to_lv1"){
if (ass.display.q.length > 1){
ass.clear();
ass.tutorialCutOff();
};
loadLevel1();
respawn();
startGame();
} else {
if (swapTo == "to_finale"){
if (ass.display.q.length > 1){
ass.clear();
};
loadFinale();
};
};
PhaseEngine.cpos = player.pos.copy();
PhaseEngine.showPhys(false);
}
public function level0shake(){
var child:*;
var i:*;
if (DFData.bShake){
PhaseEngine.camShake(5, 0.98);
};
try {
i = 0;
while (i < 10000) {
child = map[0].mc.getChildAt(i);
if ((((child is col_circle)) && ((child.name == "debris")))){
rubble.spawnInstance(new Vect(child.x, child.y));
};
i = (i + 1);
};
} catch(error:Error) {
};
}
public function loadPlayer(){
if (player != null){
return;
};
player = new DFChar("col_circle", "circle");
player.attachImage("player_mc");
player.imgOffset.set(0, 25);
PhaseEngine.regPhysObj(3, player);
player.mc.visible = false;
player.setProps(0, 0, 0.25, 0.5, 0);
player.setAttrib(70, 1, 0, 0.1, 100);
player.setState(true, false, true);
player.respond = function (_arg1:String, _arg2:PEColResult, _arg3:PEPhysObj){
var _local4:uint;
if (_arg1.indexOf("go") != -1){
if (_arg1.charAt(2) == "t"){
mother.offset.set(0, -375);
mother.seek();
} else {
if (_arg1.charAt(2) == "b"){
mother.offset.set(0, 375);
mother.seek();
} else {
if (_arg1.charAt(2) == "r"){
mother.offset.set(375, 0);
mother.seek();
} else {
if (_arg1.charAt(2) == "l"){
mother.offset.set(-375, 0);
mother.seek();
};
};
};
};
} else {
if (_arg1 == "safe"){
mother.offset.set(0, -1500);
mother.idle();
showHUD();
} else {
if (_arg1.indexOf("kill") != -1){
if (DFData.bShake){
PhaseEngine.camShake(6, 0.94);
};
if (player.invul == 0){
dieblood.spawnInstance(player.pos);
if (_arg1.charAt(4) == "l"){
PhaseEngine.playSound("laserhit.wav", 0.4);
};
};
player.damage(1);
} else {
if (_arg1 == "cp"){
cpMap = mapname[0];
lastCheckPoint = _arg3.apos.copy();
} else {
if (((((!((_arg1.indexOf("left") == -1))) || (!((_arg1.indexOf("mid") == -1))))) || (!((_arg1.indexOf("right") == -1))))){
seamlessLoad(_arg1);
} else {
if (_arg1.indexOf("part") != -1){
_arg3.bActive = false;
_arg3.img[0].visible = false;
addPart(DFPart(_arg3));
addScore("+100 Part Collected", 100);
if (_arg1.charAt(5) == ""){
_local4 = uint(_arg1.charAt(4));
} else {
_local4 = uint((_arg1.charAt(4) + _arg1.charAt(5)));
};
foundParts[_local4] = true;
} else {
if (_arg1.indexOf("house") != -1){
timeOffSetting = true;
chouse.set((_arg3.apos.x + (_arg3.sca.x * 50)), (_arg3.apos.y + (_arg3.sca.y * 50)));
houseLock = true;
foundHouse(int(_arg1.charAt(5)));
if ((((DFData.mode == "easy")) || ((DFData.mode == "normal")))){
upper.mc.visible = true;
upper.pos.set(50, 50);
if (upper.mc.alpha < 0.92){
upper.mc.alpha = (upper.mc.alpha + 0.08);
} else {
upper.mc.alpha = 1;
};
updateUpgrades(uint(_arg1.charAt(5)));
};
} else {
if (_arg1 == "grab"){
this.grabLedge(_arg3);
} else {
if (_arg1 == "pad"){
player.launch("u");
} else {
if (_arg1 == "padr"){
player.launch("r");
} else {
if (_arg1 == "padl"){
player.launch("l");
} else {
if (_arg1 == "pushr"){
player.accel(1, 0);
} else {
if (_arg1 == "pushl"){
player.accel(-1, 0);
} else {
if (_arg1 == "endtut"){
swapTo = "tut_to_lv1";
tranState = "fadeout";
} else {
if (_arg1 == "finale"){
swapTo = "to_finale";
tranState = "fadeout";
mother.state = "idle";
mother.countDown = 9999;
} else {
if (_arg1 == "fail"){
respawn();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
player.tells.push("p");
player.playAnim("fall");
diegibs = new PEEmitter("body_part");
PhaseEngine.regObj(4, diegibs);
diegibs.bClear = false;
diegibs.bGrav = true;
diegibs.lifeRange.set(60, 60);
diegibs.spawnCount = 4;
diegibs.spawnRate = 0;
diegibs.spawnType = "radius";
diegibs.spawnArea.set(10, 20);
diegibs.spawnOffset.set(0, -10);
diegibs.startVelType = "center";
diegibs.startMultiplier.set(3, 10);
diegibs.rotType = "vel";
diegibs.startScale.set(1, 2);
dieblood = new PEEmitter("blood_drop");
PhaseEngine.regObj(4, dieblood);
dieblood.bClear = false;
dieblood.bGrav = true;
dieblood.lifeRange.set(60, 60);
dieblood.spawnCount = 25;
dieblood.spawnRate = 0;
dieblood.spawnType = "radius";
dieblood.spawnArea.set(25, 0);
dieblood.spawnOffset.set(0, -25);
dieblood.startVelType = "center";
dieblood.startMultiplier.set(1.5, 3);
dieblood.startScale.set(0.5, 4);
dieblood.constantAlpha = (-1 / 60);
dust = new PEEmitter("dust_cloud");
PhaseEngine.regObj(4, dust);
dust.bClear = false;
dust.bGrav = false;
dust.lifeRange.set(45, 45);
dust.spawnCount = 0;
dust.spawnRate = 0;
dust.spawnOffset.set(0, 0);
dust.startVel.set(-0.25, 0);
dust.startVel2.set(0, 0.02);
dust.startScale.set(0.1, 0.2);
dust.constantScale.set(0.04, 0.04);
dust.startAlpha.set(0.8, 0.8);
dust.constantAlpha = (-0.8 / 40);
wsdust = dust.spawnInstance(new Vect(player.pos.x, player.pos.y));
wsdust.bClear = false;
slidesnd = PhaseEngine.newSoundObj("wallslide.wav");
slidesnd.setPos(0, 0);
slidesnd.adjust(0, 1000, 10);
slidesnd.play(99999);
slidesnd.bClear = false;
slidesnd.bPauseOnFade = true;
slidesnd.snd.infLoop = true;
bleed = new PEEmitter("blood_drop");
PhaseEngine.regObj(2, bleed);
bleed.bGrav = true;
bleed.lifeRange.set(60, 60);
bleed.spawnCount = 0;
bleed.spawnRate = 0;
bleed.spawnType = "box";
bleed.spawnArea.set(10, 10);
bleed.spawnOffset.set(0, 0);
bleed.startVel.set(-1, -0.5);
bleed.startVel2.set(1, 0.25);
bleed.startScale.set(0.75, 2);
bleed.constantAlpha = (-1 / 60);
bleed.bClear = false;
hurtbleed = bleed.spawnInstance(player.pos);
hurtbleed.bClear = false;
ctar = player.pos.copy();
cacc = player.pos.copy();
}
public function trackCamera(){
var _local1:*;
if (!houseLock){
_local1 = player.pos.addv(player.vel.multv(new Vect(20, 5)));
ctar = ctar.addv(_local1.subv(ctar).mult(0.15));
if (((PhaseEngine.keyHeld(37)) || (PhaseEngine.keyHeld(65)))){
ctar.x = (ctar.x - 12);
};
if (((PhaseEngine.keyHeld(39)) || (PhaseEngine.keyHeld(68)))){
ctar.x = (ctar.x + 12);
};
if (((((PhaseEngine.keyHeld(38)) || (PhaseEngine.keyHeld(32)))) || (PhaseEngine.keyHeld(87)))){
ctar.y = (ctar.y - 6);
};
if (((PhaseEngine.keyHeld(40)) || (PhaseEngine.keyHeld(83)))){
ctar.y = (ctar.y + 12);
};
} else {
ctar = chouse.copy();
houseLock = false;
};
PhaseEngine.cpos = PhaseEngine.cpos.addv(ctar.subv(PhaseEngine.cpos).mult(0.15));
PhaseEngine.cam(PhaseEngine.cpos, PhaseEngine.czoom);
}
public function setCheckPoint(_arg1:Vect){
lastCheckPoint = _arg1.copy();
}
public function applyUpgrades(){
if (DFData.mode == "easy"){
if (DFData.savee.life[0]){
buyUpgrade("l");
};
if (DFData.savee.life[1]){
buyUpgrade("l");
};
if (DFData.savee.life[2]){
buyUpgrade("l");
};
if (DFData.savee.speed[0]){
buyUpgrade("s");
};
if (DFData.savee.speed[1]){
buyUpgrade("s");
};
if (DFData.savee.speed[2]){
buyUpgrade("s");
};
if (DFData.savee.height[0]){
buyUpgrade("h");
};
if (DFData.savee.height[1]){
buyUpgrade("h");
};
if (DFData.savee.height[2]){
buyUpgrade("h");
};
if (DFData.savee.extra[0]){
player.sca = player.sca.mult(0.6);
player.img[0].scaleX = (player.img[0].scaleX * 0.6);
player.img[0].scaleY = (player.img[0].scaleY * 0.6);
player.imgOffset = player.imgOffset.mult(0.6);
};
if (DFData.savee.extra[1]){
gameRef.player.bCanDoubleJump = true;
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.life[0]){
buyUpgrade("l");
};
if (DFData.saven.life[1]){
buyUpgrade("l");
};
if (DFData.saven.life[2]){
buyUpgrade("l");
};
if (DFData.saven.speed[0]){
buyUpgrade("s");
};
if (DFData.saven.speed[1]){
buyUpgrade("s");
};
if (DFData.saven.speed[2]){
buyUpgrade("s");
};
if (DFData.saven.height[0]){
buyUpgrade("h");
};
if (DFData.saven.height[1]){
buyUpgrade("h");
};
if (DFData.saven.height[2]){
buyUpgrade("h");
};
if (DFData.saven.extra[0]){
player.sca = player.sca.mult(0.6);
player.img[0].scaleX = (player.img[0].scaleX * 0.6);
player.img[0].scaleY = (player.img[0].scaleY * 0.6);
player.imgOffset = player.imgOffset.mult(0.6);
};
if (DFData.saven.extra[1]){
gameRef.player.bCanDoubleJump = true;
};
};
};
}
public function addScore(_arg1:String, _arg2:uint){
player.addMsg(_arg1);
score = (score + _arg2);
showHUD();
}
public function screenFades(){
if (tranState == "fadeout"){
blackscreen.mc.visible = true;
blackscreen.mc.alpha = (blackscreen.mc.alpha + (1 / 60));
if (blackscreen.mc.alpha >= 1){
blackscreen.mc.alpha = 1;
tranState = "black";
tranTime = 0;
levelSwap();
};
} else {
if (tranState == "black"){
tranTime = (tranTime + 1);
if (tranTime > 30){
tranTime = 0;
tranState = "fadein";
};
} else {
if (tranState == "fadein"){
blackscreen.mc.alpha = (blackscreen.mc.alpha - (1 / 60));
if (blackscreen.mc.alpha <= 0){
blackscreen.mc.alpha = 0;
blackscreen.mc.visible = false;
tranState = "";
};
};
};
};
}
public function loadTutorial(){
map = new Array();
map.push(PhaseEngine.newObj(2, "lv0_playfield"));
map[0].children.push(PhaseEngine.newObj(1, "lv0_background"));
PhaseEngine.autoPhys(map[0]);
rubble = new PEEmitter("rock");
PhaseEngine.regObj(4, rubble);
rubble.bGrav = true;
rubble.lifeRange.set(120, 120);
rubble.spawnCount = 3;
rubble.spawnRate = 0;
rubble.spawnType = "box";
rubble.spawnArea.set(50, 50);
rubble.startScale.set(0.1, 1);
rubble.startVel.set(-2, -2);
rubble.startVel2.set(2, 0);
map[0].children.push(rubble);
setCheckPoint(new Vect(map[0].mc.spawn.x, map[0].mc.spawn.y));
triggerSetup(map[0]);
loadPlayer();
respawn();
if (mother != null){
unloadMother();
};
if (hud != null){
PhaseEngine.deReg(hud);
hud = null;
};
ass.clear();
ass.tutorialTaunt();
tranState = "fadein";
PhaseEngine.showPhys(false);
PhaseEngine.stage.focus = PhaseEngine.stage;
blackscreen.mc.alpha = 1;
blackscreen.mc.visible = true;
}
public function loadMenu(){
var playEasy:Function;
var playNormal:Function;
var playPure:Function;
var playHardcore:Function;
playEasy = function (_arg1:Event){
DFData.mode = "easy";
playGame();
player.reset();
player.health = (player.maxhealth = 4);
DFData.SOLoadChar("easy");
applyUpgrades();
};
playNormal = function (_arg1:Event){
DFData.mode = "normal";
playGame();
player.reset();
DFData.SOLoadChar("normal");
applyUpgrades();
};
playPure = function (_arg1:Event){
DFData.mode = "pure";
playGame();
player.reset();
};
playHardcore = function (_arg1:Event){
DFData.mode = "hardcore";
playGame();
player.reset();
};
gameState = "mainmenu";
menu = PhaseEngine.newUIObj("main_menu");
menu.bDragOff = true;
DFData.SOLoad();
PESoundScape.musicvol = DFData.volMusic;
PESoundScape.effectvol = DFData.volEffects;
menu.mc.playtext.mouseEnabled = false;
menu.mc.pausetext.mouseEnabled = false;
if (DFData.bSkip){
menu.mc.play_modes.cbSkip.gotoAndStop("checked");
} else {
menu.mc.play_modes.cbSkip.gotoAndStop("unchecked");
};
PhaseEngine.stage.quality = DFData.qual;
if (DFData.bWorld){
menu.mc.opvideo.cbWorld.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbWorld.gotoAndStop("unchecked");
};
if (DFData.bPara){
menu.mc.opvideo.cbPara.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbPara.gotoAndStop("unchecked");
};
if (DFData.bShake){
menu.mc.opvideo.cbShake.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbShake.gotoAndStop("unchecked");
};
if (DFData.bDust){
menu.mc.opvideo.cbDust.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbDust.gotoAndStop("unchecked");
};
if (DFData.bSweat){
menu.mc.opvideo.cbSweat.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbSweat.gotoAndStop("unchecked");
};
if (DFData.bFlames){
menu.mc.opvideo.cbFlames.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbFlames.gotoAndStop("unchecked");
};
if (DFData.bSparks){
menu.mc.opvideo.cbSparks.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbSparks.gotoAndStop("unchecked");
};
if (DFData.bBombs){
menu.mc.opvideo.cbBombs.gotoAndStop("checked");
} else {
menu.mc.opvideo.cbBombs.gotoAndStop("unchecked");
};
menu.mc.opaudio.master.slider.handle.x = (DFData.volMaster * 100);
menu.mc.opaudio.music.slider.handle.x = (DFData.volMusic * 100);
menu.mc.opaudio.effects.slider.handle.x = (DFData.volEffects * 100);
menu.mc.opaudio.motor.slider.handle.x = (DFData.volMotor * 100);
menu.mc.opaudio.master.val = DFData.volMaster;
menu.mc.opaudio.music.val = DFData.volMusic;
menu.mc.opaudio.effects.val = DFData.volEffects;
menu.mc.opaudio.motor.val = DFData.volMotor;
menu.mc.play_modes.sbEasy.addEventListener(MouseEvent.CLICK, playEasy);
menu.mc.play_modes.sbNormal.addEventListener(MouseEvent.CLICK, playNormal);
menu.mc.play_modes.sbPure.addEventListener(MouseEvent.CLICK, playPure);
menu.mc.hardcore.sbPlay.addEventListener(MouseEvent.CLICK, playHardcore);
}
public function refreshMother(){
var _local1:*;
PhaseEngine.planes[2].blendMode = "layer";
PhaseEngine.planes[2].removeChild(mother.mc);
PhaseEngine.planes[2].removeChild(mother.img[0]);
PhaseEngine.planes[2].addChild(mother.mc);
PhaseEngine.planes[2].addChild(mother.img[0]);
mother.mc.blendMode = "erase";
for (_local1 in mother.bombs) {
PhaseEngine.planes[2].removeChild(mother.bombs[_local1].img[0]);
PhaseEngine.planes[2].removeChild(mother.bombs[_local1].img[1]);
PhaseEngine.planes[2].addChild(mother.bombs[_local1].img[0]);
PhaseEngine.planes[2].addChild(mother.bombs[_local1].img[1]);
mother.bombs[_local1].img[0].blendMode = "erase";
};
}
public function death(){
var _local1:*;
ass.deathTaunt();
showHUD();
respawnTime = 2000;
deadTime = getTimer();
player.bActive = false;
player.vel.set(0, 0);
player.img[0].visible = false;
player.health = player.maxhealth;
diegibs.spawnInstance(player.pos);
dieblood.spawnInstance(player.pos);
gameState = "dead";
tripDeaths++;
cleanTrip = false;
dodges = (dodges - 1);
perfRun = false;
_local1 = 0;
while (_local1 < player.inv.length) {
player.inv[_local1].clean = false;
_local1++;
};
mother.rank = (mother.rank - mother.derank);
mother.derank = 0.5;
if (mother.rank < 1){
mother.rank = 1;
};
if (DFData.mode == "hardcore"){
blackscreen.mc.visible = true;
};
}
public function triggerSetup(_arg1:PEObj){
var child:*;
var i:*;
var trig:*;
var partnum:uint;
var pa:*;
var mp = _arg1;
try {
i = 0;
while (i < 10000) {
child = mp.mc.getChildAt(i);
if ((child is col_vol)){
trig = PhaseEngine.newPhysVol(2, child);
trig.tells.push(child.name);
if (child.name == "grab"){
trig.sca.y = 2;
trig.bCharOnly = true;
};
trig.contain.push(mp);
mp.children.push(trig);
} else {
if ((child is col_circle)){
child.visible = false;
} else {
if ((child is DFPart_Clip)){
if (child.name.charAt(5) == ""){
partnum = child.name.charAt(4);
} else {
partnum = (child.name.charAt(4) + child.name.charAt(5));
};
if (!foundParts[partnum]){
pa = new DFPart(child);
pa.attachImage("partimg");
pa.tells.push(child.name);
pa.contain.push(mp);
PhaseEngine.regPhysObj(2, pa, true);
mp.children.push(pa);
} else {
child.visible = false;
};
};
};
};
i = (i + 1);
};
} catch(error:Error) {
};
}
public function startGame(){
startTime = getTimer();
currentTime = 0;
foundTime = startTime;
offsetTime = 0;
score = 0;
gameState = "game";
cpMap = "";
tripDeaths = 0;
cleanTrip = true;
dodges = 0;
dodgeNovice = false;
dodgeAmateur = false;
dodgeExpert = false;
totalParts = 0;
perfRun = true;
reachedHouse = new Array();
reachedHouse.push(false);
reachedHouse.push(false);
if (sky == null){
sky = PhaseEngine.newObj(0, "bg_sky");
};
loadHUD();
gmus.play(99999);
gmus.fade(0.01, -1);
mmus.fade(-0.025, mmus.fadePhase);
}
public function unloadMother(){
PhaseEngine.deReg(mother);
mother = null;
}
public function loadLevel1(){
mapname = new Array();
map = new Array();
map.push(PhaseEngine.newObj(2, "lv1_playfielda"));
PhaseEngine.autoPhys(map[0]);
map[0].children.push(PhaseEngine.newObj(1, "lv1_backgrounda"));
mapname.push("a");
setCheckPoint(new Vect(map[0].mc.spawn.x, map[0].mc.spawn.y).addv(map[0].pos));
triggerSetup(map[0]);
PhaseEngine.planes[2].blendMode = "layer";
mapname.push("");
map.push(null);
loadPlayer();
respawn();
player.inv = new Array();
loadMother();
tranState = "black";
PhaseEngine.showPhys(false);
PhaseEngine.stage.focus = PhaseEngine.stage;
blackscreen.mc.alpha = 1;
blackscreen.mc.visible = true;
if (hud != null){
hud.mc.visible = true;
hudTimer = 200;
hudVis = true;
};
}
public function playerControls(){
if (gameState == "finale"){
return;
};
player.clearCommands();
if (((((PhaseEngine.keyTap(38)) || (PhaseEngine.keyTap(32)))) || (PhaseEngine.keyTap(87)))){
player.control("jump");
};
if (((((PhaseEngine.keyHeld(38)) || (PhaseEngine.keyHeld(32)))) || (PhaseEngine.keyHeld(87)))){
player.control("boost");
} else {
player.lastJump = 0;
};
if (((PhaseEngine.keyHeld(37)) || (PhaseEngine.keyHeld(65)))){
player.control("move", "l");
} else {
if (((PhaseEngine.keyHeld(39)) || (PhaseEngine.keyHeld(68)))){
player.control("move", "r");
} else {
if (((((((PhaseEngine.keyReleased(37)) || (PhaseEngine.keyReleased(39)))) || (PhaseEngine.keyReleased(65)))) || (PhaseEngine.keyReleased(68)))){
player.control("stop");
};
};
};
if (((PhaseEngine.keyHeld(40)) || (PhaseEngine.keyHeld(83)))){
player.accel(0, 0.1);
};
if (PhaseEngine.keyTap(27)){
prePauseState = gameState;
gameState = "pause";
menu.mc.visible = true;
menu.mc.playtext.text = "New Game";
menu.mc.pausetext.text = "Press 'Escape' to Resume Play.";
menu.mc.play_modes.visible = false;
upper.mc.visible = false;
if (hud != null){
hud.mc.visible = false;
};
if (mother != null){
mother.pause(true);
};
player.pause();
ass.display.pause();
gmus.fade(-0.025, gmus.fadePhase);
mmus.fade(0.025, mmus.fadePhase);
};
}
public function showHUD(){
hudVis = true;
hudTimer = 200;
}
public function updateUpgrades(_arg1:uint){
if (DFData.mode == "easy"){
upper.mc.po.text = ("Parts Owned: " + DFData.savee.parts);
upper.mc.l1.visible = !(DFData.savee.life[0]);
upper.mc.l2.visible = !(DFData.savee.life[1]);
upper.mc.l3.visible = !(DFData.savee.life[2]);
upper.mc.s1.visible = !(DFData.savee.speed[0]);
upper.mc.s2.visible = !(DFData.savee.speed[1]);
upper.mc.s3.visible = !(DFData.savee.speed[2]);
upper.mc.h1.visible = !(DFData.savee.height[0]);
upper.mc.h2.visible = !(DFData.savee.height[1]);
upper.mc.h3.visible = !(DFData.savee.height[2]);
upper.mc.ex1.visible = !(DFData.savee.extra[0]);
upper.mc.ex2.visible = !(DFData.savee.extra[1]);
upper.mc.ex3.visible = !(DFData.savee.extra[2]);
if (DFData.savee.extra[2]){
upper.mc.sec.visible = true;
upper.mc.sec.alpha = 1;
} else {
upper.mc.sec.visible = false;
upper.mc.sec.alpha = 0;
};
} else {
if (DFData.mode == "normal"){
upper.mc.po.text = ("Parts Owned: " + DFData.saven.parts);
upper.mc.l1.visible = !(DFData.saven.life[0]);
upper.mc.l2.visible = !(DFData.saven.life[1]);
upper.mc.l3.visible = !(DFData.saven.life[2]);
upper.mc.s1.visible = !(DFData.saven.speed[0]);
upper.mc.s2.visible = !(DFData.saven.speed[1]);
upper.mc.s3.visible = !(DFData.saven.speed[2]);
upper.mc.h1.visible = !(DFData.saven.height[0]);
upper.mc.h2.visible = !(DFData.saven.height[1]);
upper.mc.h3.visible = !(DFData.saven.height[2]);
upper.mc.ex1.visible = !(DFData.saven.extra[0]);
upper.mc.ex2.visible = !(DFData.saven.extra[1]);
upper.mc.ex3.visible = !(DFData.saven.extra[2]);
if (DFData.saven.extra[2]){
upper.mc.sec.visible = true;
upper.mc.sec.alpha = 1;
} else {
upper.mc.sec.visible = false;
upper.mc.sec.alpha = 0;
};
};
};
if (_arg1 == 1){
upper.mc.pf.text = (("Parts Found: " + totalParts) + "/1");
} else {
if (_arg1 == 2){
upper.mc.pf.text = (("Parts Found: " + totalParts) + "/7");
} else {
if (_arg1 == 3){
upper.mc.pf.text = (("Parts Found: " + totalParts) + "/14");
} else {
if (_arg1 == 4){
upper.mc.pf.text = (("Parts Found: " + totalParts) + "/18");
};
};
};
};
}
public function foundHouse(_arg1:uint){
var _local2:*;
var _local3:*;
var _local4:*;
if (reachedHouse[_arg1] != true){
reachedHouse[_arg1] = true;
addScore("+1000 Found Safehouse", 1000);
if (cleanTrip){
addScore("+1000 Clean Trip", 1000);
};
cleanTrip = true;
_local3 = Math.round(((getTimer() - foundTime) / 1000));
_local4 = (1000 - (_local3 * 2));
if (_local4 > 0){
addScore((("+" + _local4) + " Speed Bonus"), _local4);
foundTime = getTimer();
};
_local4 = (1000 - (tripDeaths * 100));
if (_local4 > 0){
addScore((("+" + _local4) + " Survival Bonus"), _local4);
};
tripDeaths = 0;
ass.houseTaunt();
};
_local2 = 0;
while (_local2 < player.inv.length) {
if (DFData.mode == "easy"){
DFData.savee.parts++;
} else {
if (DFData.mode == "normal"){
DFData.saven.parts++;
};
};
addScore("+100 Part Delivered", 100);
if (player.inv[_local2].clean){
addScore("+25 Clean Delivery", 10);
};
_local2++;
};
if (player.inv.length > 0){
PhaseEngine.playSound("partcollected.wav", 0.5);
};
player.inv = new Array();
}
public function update(){
var _local1:*;
var _local2:*;
if (gameState == "mainmenu"){
return;
};
if (timeOffSetting){
offsetTime = (offsetTime + (getTimer() - lastTime));
timeOffSetting = false;
};
lastTime = getTimer();
currentTime = ((lastTime - startTime) - offsetTime);
ass.update();
if (adShown > 0){
adShown--;
};
hudicon.mc.visible = false;
if (gameState == "tutorial"){
screenFades();
hudicon.mc.visible = true;
hudicon.pos.y = ass.commobj.pos.y;
hudicon.mc.alpha = ((hudicon.pos.y - 500) / 170);
hudicon.pos.y = (hudicon.pos.y + ((1 - hudicon.mc.alpha) * 50));
shakeChance--;
if (PhaseEngine.rand(0, shakeChance, true) == PhaseEngine.rand(0, shakeChance, true)){
shakeChance = 1000;
level0shake();
};
trackCamera();
playerControls();
playerActions();
} else {
if (gameState == "game"){
screenFades();
hudicon.mc.visible = true;
hudicon.pos.y = ass.commobj.pos.y;
hudicon.mc.alpha = ((hudicon.pos.y - 500) / 170);
hudicon.pos.y = (hudicon.pos.y + ((1 - hudicon.mc.alpha) * 50));
if (mother.attacked){
dodges = (dodges + 1);
mother.attacked = false;
if ((((dodges == 10)) && (!(dodgeNovice)))){
addScore("+100 Dodge Novice", 100);
dodgeNovice = true;
};
if ((((dodges == 50)) && (!(dodgeAmateur)))){
addScore("+500 Dodge Amateur", 500);
dodgeAmateur = true;
};
if ((((dodges == 100)) && (!(dodgeExpert)))){
addScore("+1000 Dodge Expert", 1000);
dodgeExpert = true;
};
};
if (mother.rankup){
showHUD();
mother.rankup = false;
};
_local1 = Math.floor((currentTime / 1000));
_local2 = Math.floor((_local1 / 60));
_local1 = (_local1 - (_local2 * 60));
if (_local2 < 10){
_local2 = String(("0" + _local2));
};
if (_local1 < 10){
_local1 = String(("0" + _local1));
};
hud.mc.time.text = ((("Time: " + _local2) + ":") + _local1);
hud.mc.rank.text = ("Danger: " + Math.floor(mother.rank));
hud.mc.score.text = ("Score: " + score);
if (hudTimer > 0){
hudTimer--;
if (hudTimer == 0){
hudVis = false;
};
};
if (((hudVis) && ((hud.pos.y < 0)))){
hud.shiftPos(0, 1);
} else {
if (((!(hudVis)) && ((hud.pos.y > -40)))){
hud.shiftPos(0, -1);
};
};
ass.miscTaunt();
if (upper.mc.visible){
upper.mc.alpha = (upper.mc.alpha - 0.04);
if (upper.mc.alpha <= 0){
upper.mc.visible = false;
};
};
trackCamera();
playerControls();
playerActions();
} else {
if (gameState == "pause"){
timeOffSetting = true;
player.control("stop");
trackCamera();
playerActions();
if (PhaseEngine.keyTap(27)){
gameState = prePauseState;
menu.mc.visible = false;
menu.mc.playtext.text = "Play";
menu.mc.pausetext.text = "";
if (upper.mc.alpha > 0){
upper.mc.visible = true;
};
if (hud != null){
hud.mc.visible = true;
};
if (mother != null){
mother.unpause(true);
};
player.unpause();
updateDeco();
DFData.SOSave();
ass.display.unpause();
gmus.fade(0.025, gmus.fadePhase);
if (gameState != "tutorial"){
mmus.fade(-0.025, mmus.fadePhase);
};
};
} else {
if (gameState == "ad"){
timeOffSetting = true;
if ((((ad.mc.currentFrame == 2)) || (PhaseEngine.keyTap(13)))){
PhaseEngine.deReg(adTarget);
PhaseEngine.deReg(ad);
gameState = "game";
};
trackCamera();
playerActions();
mother.offset.set(0, -1500);
if (ad.mc.bg.currentFrame == 1){
playerControls();
ad.mc.bg.alpha = 0;
} else {
ad.mc.bg.alpha = 1;
player.friction = player.frictionStop;
player.control("stop");
};
} else {
if (gameState == "dead"){
if (DFData.mode != "hardcore"){
if ((getTimer() - deadTime) > respawnTime){
respawn();
gameState = "game";
};
trackCamera();
playerControls();
playerActions();
} else {
mother.forceIdle = true;
blackscreen.mc.alpha = (blackscreen.mc.alpha + (1 / 60));
if ((((blackscreen.mc.alpha >= 1)) && (!(menu.mc.visible)))){
gmus.fade(-0.025, gmus.fadePhase);
mmus.fade(0.025, mmus.fadePhase);
loadHardcoreOver();
if (hud != null){
hud.mc.visible = false;
};
if ((((map.length > 0)) && (!((map[0] == null))))){
PhaseEngine.deReg(map[0]);
};
if ((((map.length > 1)) && (!((map[1] == null))))){
PhaseEngine.deReg(map[1]);
};
};
};
} else {
if (gameState == "finale"){
gmus.fade(-0.025, gmus.fadePhase);
mmus.fade(0.025, mmus.fadePhase);
timeOffSetting = true;
PhaseEngine.cam(new Vect(300, -250), 0.8);
screenFades();
} else {
if (gameState == "over"){
if (gamedone != null){
gamedone.mc.alpha = (gamedone.mc.alpha + 0.02);
};
if (gameover != null){
gameover.mc.alpha = (gameover.mc.alpha + 0.02);
};
};
};
};
};
};
};
};
}
public function playerActions(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
if (gameState == "finale"){
return;
};
if (player.health <= 0){
death();
} else {
if (((DFData.bSweat) && ((player.health == 1)))){
bleed.spawnRate = PhaseEngine.rand(8, 16, true);
hurtbleed.setPosv(player.pos);
} else {
bleed.spawnRate = 0;
};
};
_local1 = 0;
while (_local1 < player.actions.length) {
_local2 = player.actions[_local1];
switch (_local2){
case "land":
player.playAnim("stand");
break;
case "rland":
player.playAnim("fall2run");
break;
case "quickland":
player.playAnim("run");
break;
case "rturnl":
player.playAnim("rturn");
player.faceDir("l");
break;
case "rturnr":
player.playAnim("rturn");
player.faceDir("r");
break;
case "fturnl":
player.playAnim("fturn");
player.faceDir("l");
break;
case "fturnr":
player.playAnim("fturn");
player.faceDir("r");
break;
case "jump":
player.playAnim("jump");
break;
case "fall":
player.playAnim("fall");
break;
case "wjumpr":
player.playAnim("wjump");
player.faceDir("r");
break;
case "wjumpl":
player.playAnim("wjump");
player.faceDir("l");
break;
case "wslider":
player.playAnim("wslide");
player.faceDir("r");
break;
case "wslidel":
player.playAnim("wslide");
player.faceDir("l");
break;
case "startrun":
player.playAnim("run");
break;
case "stoprun":
player.playAnim("run2stand");
break;
case "ledgepopl":
player.faceDir("l");
player.playAnim("ledgepop");
break;
case "ledgepopr":
player.faceDir("r");
player.playAnim("ledgepop");
break;
};
_local1++;
};
player.actions = new Array();
if (((!((player.state == "wslide"))) || (!((player.grabPoint == null))))){
slidesnd.adjust((slidesnd.vol - 0.1), 1000, 1000);
if (slidesnd.vol < 0){
slidesnd.vol = 0;
};
dust.spawnRate = 0;
} else {
if (DFData.bDust){
dust.spawnRate = 1;
};
if (player.wallSide == "r"){
_local3 = new Vect(-12, 25);
_local3.rotate(player.img[0].rotation);
wsdust.setPos((player.pos.x + _local3.x), (player.pos.y + _local3.y));
dust.startVel.set(0, 0);
dust.startVel2.set(0.25, 0.02);
slidesnd.setPos((player.pos.x - 5), player.pos.y);
_local4 = (Math.abs(player.vel.y) * 0.05);
if (_local4 > 0.4){
_local4 = 0.4;
};
slidesnd.adjust(_local4, 1000, 100);
};
if (player.wallSide == "l"){
_local3 = new Vect(12, 25);
_local3.rotate(player.img[0].rotation);
wsdust.setPos((player.pos.x + _local3.x), (player.pos.y + _local3.y));
dust.startVel.set(-0.25, 0);
dust.startVel2.set(0, 0.02);
slidesnd.setPos((player.pos.x + 5), player.pos.y);
_local4 = (Math.abs(player.vel.y) * 0.05);
if (_local4 > 0.4){
_local4 = 0.4;
};
slidesnd.adjust(_local4, 1000, 100);
};
};
}
public function startTutorial(){
startTime = 0;
currentTime = 0;
score = 0;
shakeChance = 100;
gameState = "tutorial";
tranState = "fadein";
cpMap = "";
if (sky == null){
sky = PhaseEngine.newObj(0, "bg_sky");
};
gmus.fade(-0.025, gmus.fadePhase);
mmus.fade(0.025, mmus.fadePhase);
}
public static function finaleMotherLaserStrike1(){
gameRef.mother.accel(25, -10);
gameRef.mother.explodesmoke.spawnInstance(new Vect(500, -400));
gameRef.mother.explodesmoke.spawnInstance(new Vect(600, -500));
gameRef.mother.explodesmoke.spawnInstance(new Vect(550, -300));
gameRef.mother.explodesmoke.spawnInstance(new Vect(450, -550));
}
public static function finaleMotherLaserStrike2(){
gameRef.mother.accel(5, -15);
gameRef.mother.explodesmoke.spawnInstance(new Vect(550, -450));
gameRef.mother.explodesmoke.spawnInstance(new Vect(700, -475));
gameRef.mother.explodesmoke.spawnInstance(new Vect(650, -350));
gameRef.mother.explodesmoke.spawnInstance(new Vect(600, -400));
}
public static function finaleMotherLaserStrike3(){
gameRef.mother.accel(35, -10);
gameRef.mother.explodesmoke.spawnInstance(new Vect(550, -450));
gameRef.mother.explodesmoke.spawnInstance(new Vect(700, -475));
gameRef.mother.explodesmoke.spawnInstance(new Vect(650, -350));
gameRef.mother.explodesmoke.spawnInstance(new Vect(600, -400));
gameRef.mother.explodesmoke.spawnInstance(new Vect(500, -400));
gameRef.mother.explodesmoke.spawnInstance(new Vect(600, -500));
gameRef.mother.explodesmoke.spawnInstance(new Vect(550, -300));
gameRef.mother.explodesmoke.spawnInstance(new Vect(450, -550));
gameRef.mother.explodesmoke.spawnInstance(new Vect(700, -400));
gameRef.mother.explodesmoke.spawnInstance(new Vect(650, -500));
gameRef.mother.explodesmoke.spawnInstance(new Vect(650, -300));
gameRef.mother.explodesmoke.spawnInstance(new Vect(700, -550));
}
public static function finaleFade(){
var _local1:*;
var _local2:*;
var _local3:*;
gameRef.gamedone = PhaseEngine.newUIObj("gamedone");
gameRef.gamedone.mc.alpha = 0;
if (gameRef.totalParts < 12){
gameRef.gamedone.mc.ass.text = "Thank you for failing. Would you like to kill yourself now or let me do it?";
} else {
if (gameRef.totalParts < 16){
gameRef.gamedone.mc.ass.text = "Oh look, a dent. The pinnacle of meatbag accomplishment. I'll just go die now.";
} else {
if (gameRef.totalParts < 22){
gameRef.gamedone.mc.ass.text = "If you were not a meatbag I would respect you for this.";
} else {
if (gameRef.totalParts == 22){
gameRef.gamedone.mc.ass.text = "I think I just short my circuits. That was amazing. I forgive you for being a meatbag.";
};
};
};
};
_local1 = Math.floor((gameRef.currentTime / 1000));
_local2 = Math.floor((_local1 / 60));
_local1 = (_local1 - (_local2 * 60));
if (_local2 < 10){
_local2 = String(("0" + _local2));
};
if (_local1 < 10){
_local1 = String(("0" + _local1));
};
gameRef.finishScore = gameRef.score;
gameRef.finishTime = Math.floor((gameRef.currentTime / 1000));
gameRef.finishParts = gameRef.totalParts;
DFGame.submitScore = gameRef.finishScore;
_local3 = 0;
if (gameRef.finishScore > 10000){
_local3++;
};
if (gameRef.finishScore > 20000){
_local3++;
};
if (gameRef.finishScore > 30000){
_local3++;
};
if (gameRef.finishTime < 1000){
_local3++;
};
if (gameRef.finishTime < 720){
_local3++;
};
if (gameRef.finishTime < 600){
_local3++;
};
if (gameRef.finishParts > 12){
_local3++;
};
if (gameRef.finishParts > 16){
_local3++;
};
if (gameRef.finishParts > 19){
_local3++;
};
if (gameRef.finishParts == 22){
_local3++;
};
switch (_local3){
case 0:
gameRef.finishGrade = "F (MEATY)";
break;
case 1:
gameRef.finishGrade = "D (UNCONSCIOUS)";
break;
case 2:
gameRef.finishGrade = "C- (TERRIBLE)";
break;
case 3:
gameRef.finishGrade = "C (PATHETIC)";
break;
case 4:
gameRef.finishGrade = "C+ (SLACKER)";
break;
case 5:
gameRef.finishGrade = "B- (MEDIOCRE)";
break;
case 6:
gameRef.finishGrade = "B (PASSABLE)";
break;
case 7:
gameRef.finishGrade = "B+ (ALMOST GOOD)";
break;
case 8:
gameRef.finishGrade = "A- (IMPRESSIVE)";
break;
case 9:
gameRef.finishGrade = "A (AWESOME)";
break;
case 10:
gameRef.finishGrade = "A+ (ALMIGHTY)";
break;
};
gameRef.gamedone.mc.results.text = (((((((((("Final Score: " + gameRef.finishScore) + "\nCompletion Time: ") + _local2) + ":") + _local1) + "\nParts Collected: ") + gameRef.finishParts) + "/22") + "\n\nOverall Grade: ") + gameRef.finishGrade);
gameRef.gamedone.bDragOff = true;
gameRef.gameState = "over";
if ((((DFData.mode == "pure")) || ((DFData.mode == "hardcore")))){
gameRef.gamedone.mc.savetext.visible = false;
};
DFData.SOSaveChar(DFData.mode);
}
public static function loadKing_Score(_arg1:int){
KingAPI.submitScore(_arg1);
}
public static function hardcoreReturn(){
PhaseEngine.deReg(gameRef.gameover);
gameRef.gameover = null;
gameRef.menu.mc.visible = true;
gameRef.menu.mc.playtext.text = "New Game";
gameRef.menu.mc.pausetext.text = "";
gameRef.upper.mc.visible = false;
if (gameRef.hud != null){
gameRef.hud.mc.visible = false;
};
if ((((gameRef.map.length > 0)) && (!((gameRef.map[0] == null))))){
PhaseEngine.deReg(gameRef.map[0]);
};
if ((((gameRef.map.length > 1)) && (!((gameRef.map[1] == null))))){
PhaseEngine.deReg(gameRef.map[1]);
};
gameRef.mother.motorsound.fade(-2);
}
public static function loadKing_MainMenu(){
KingAPI.openSignLink();
}
public static function finaleCleanUp(){
var _local1:*;
if (gameRef.mis != null){
for (_local1 in gameRef.mis) {
PhaseEngine.deReg(gameRef.mis[_local1]);
};
gameRef.mis = new Array();
};
}
public static function buyUpgrade(_arg1:String){
if (_arg1 == "l"){
gameRef.player.health = ++gameRef.player.maxhealth;
} else {
if (_arg1 == "s"){
gameRef.player.speed = (gameRef.player.speed + 0.5);
} else {
if (_arg1 == "h"){
gameRef.player.jumpStr = (gameRef.player.jumpStr - 0.2);
gameRef.player.boostStr = (gameRef.player.boostStr - 0.1);
} else {
if (_arg1 == "e1"){
gameRef.player.sca = gameRef.player.sca.mult(0.6);
gameRef.player.img[0].scaleX = (gameRef.player.img[0].scaleX * 0.6);
gameRef.player.img[0].scaleY = (gameRef.player.img[0].scaleY * 0.6);
gameRef.player.imgOffset = gameRef.player.imgOffset.mult(0.6);
} else {
if (_arg1 == "e2"){
gameRef.player.bCanDoubleJump = true;
};
};
};
};
};
}
public static function finaleMissiles(){
var _local1:*;
PhaseEngine.camShake(5, 0.93);
_local1 = new DFMissile("col_circle", "circle");
_local1.setPos(175, -125);
_local1.vel.set((4 + PhaseEngine.rand(1, 3)), 2);
_local1.target = gameRef.mother;
_local1.emitref = gameRef.mother.explodesmoke;
PhaseEngine.regPhysObj(3, _local1);
gameRef.mis.push(_local1);
gameRef.mother.explodesmoke.spawnInstance(_local1.pos);
_local1 = new DFMissile("col_circle", "circle");
_local1.setPos(165, -150);
_local1.vel.set((2 + PhaseEngine.rand(1, 3)), 2);
_local1.target = gameRef.mother;
_local1.emitref = gameRef.mother.explodesmoke;
PhaseEngine.regPhysObj(3, _local1);
gameRef.mis.push(_local1);
gameRef.mother.explodesmoke.spawnInstance(_local1.pos);
_local1 = new DFMissile("col_circle", "circle");
_local1.setPos(125, -200);
_local1.vel.set(-3, (-2 + PhaseEngine.rand(-3, -1)));
_local1.target = gameRef.mother;
_local1.emitref = gameRef.mother.explodesmoke;
PhaseEngine.regPhysObj(3, _local1);
gameRef.mis.push(_local1);
gameRef.mother.explodesmoke.spawnInstance(_local1.pos);
_local1 = new DFMissile("col_circle", "circle");
_local1.setPos(100, -190);
_local1.vel.set(-4, (-2 + PhaseEngine.rand(-3, -1)));
_local1.target = gameRef.mother;
_local1.emitref = gameRef.mother.explodesmoke;
PhaseEngine.regPhysObj(3, _local1);
gameRef.mis.push(_local1);
gameRef.mother.explodesmoke.spawnInstance(_local1.pos);
}
public static function finaleMotherBackOff(){
gameRef.mother.offset.set(1200, -1200);
}
public static function finaleReturn(){
DFGame.finaleCleanUp();
PhaseEngine.deReg(gameRef.gamedone);
gameRef.gamedone = null;
gameRef.menu.mc.visible = true;
gameRef.menu.mc.playtext.text = "New Game";
gameRef.menu.mc.pausetext.text = "";
gameRef.upper.mc.visible = false;
if (gameRef.hud != null){
gameRef.hud.mc.visible = false;
};
if ((((gameRef.map.length > 0)) && (!((gameRef.map[0] == null))))){
PhaseEngine.deReg(gameRef.map[0]);
};
if ((((gameRef.map.length > 1)) && (!((gameRef.map[1] == null))))){
PhaseEngine.deReg(gameRef.map[1]);
};
gameRef.mother.motorsound.fade(-2);
}
}
}//package
Section 103
//DFMissile (DFMissile)
package {
public class DFMissile extends PEPhysObj {
public var acc:Number;
public var target:PEObj;
public var alive:Boolean;
var emitref:PEEmitter;
public function DFMissile(_arg1, _arg2:String){
super(_arg1, _arg2);
alive = true;
setState(false, false, true);
setProps(0, 0, 0.35, 0.35, 0);
setAttrib(1000, 0, 1.2, 0, 0);
bGrav = false;
attachImage("missile");
img[0].visible = true;
mc.visible = false;
target = null;
acc = 0.3;
bClear = false;
}
override public function update(){
var _local1:*;
var _local2:*;
if (((paused) || (!(alive)))){
return;
};
if (target != null){
vel = vel.mult(0.99);
_local1 = target.pos.subv(pos);
_local2 = Math.atan2(_local1.y, _local1.x);
_local2 = (Vect.toDeg(_local2) - 90);
img[0].rotation = _local2;
if (_local1.mag() < 180){
explode();
target.accel((_local1.x / 10), (_local1.y / 10));
} else {
_local1 = _local1.norm();
_local1 = _local1.mult(acc);
vel = vel.addv(_local1);
};
};
super.update();
}
public function explode(){
alive = false;
PhaseEngine.playSound("bombexplode.wav", 1);
emitref.spawnInstance(new Vect(pos.x, pos.y));
img[0].visible = false;
}
}
}//package
Section 104
//DFMothership (DFMothership)
package {
public class DFMothership extends PEObj {
var laservol2:PEPhysVol;
var laservol3:PEPhysVol;
var bombs:Array;
var gchargesound:PESoundObj;
var laservol:PEPhysVol;
public var bulletspark:PEEmitter;
var derank:Number;
public var lasersmoke2:PEEmitInstance;
public var lasersmoke3:PEEmitInstance;
var rank:Number;
public var explodesmoke:PEEmitter;
var speed:Number;
var rotacc:Number;
var countDown:uint;
var forceIdle:Boolean;
var blades:Array;
var rotvel:Number;
var lhitsound2:PESoundObj;
var lhitsound3:PESoundObj;
var countTime:uint;
public var lasersmoke:PEEmitInstance;
var state:String;
public var offset:Vect;
var target:PEObj;
var bullets:Array;
var motorsound:PESoundObj;
public var hitsmoke:PEEmitter;
var lhitsound:PESoundObj;
var paints:Array;
public var rankup:Boolean;
var corerot:Number;
var painterBeam:PEObj;
public var attacked:Boolean;
var lchargesound:PESoundObj;
public function DFMothership(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
super(_arg1);
state = "idle";
countDown = 350;
rank = 1;
derank = 1;
target = null;
offset = new Vect(0, -1500);
speed = 0.5;
rotvel = 0;
rotacc = 0.03;
corerot = 0;
rot = 180;
rankup = false;
attacked = false;
forceIdle = false;
motorsound = PhaseEngine.newSoundObj("flyingthingloop.mp3");
motorsound.adjust((0.3 * DFData.volMotor), 1200, 600);
motorsound.snd.infLoop = true;
motorsound.bClear = false;
children.push(motorsound);
laservol = new PEPhysVol("giant_laser");
laservol2 = new PEPhysVol("giant_laser");
laservol3 = new PEPhysVol("giant_laser");
laservol.bActive = false;
laservol2.bActive = false;
laservol3.bActive = false;
laservol.tells.push("killl");
laservol2.tells.push("killl");
laservol3.tells.push("killl");
laservol.addParent(this);
laservol2.addParent(this);
laservol3.addParent(this);
laservol.bCheapCol = false;
laservol2.bCheapCol = false;
laservol3.bCheapCol = false;
laservol.bClear = false;
laservol2.bClear = false;
laservol3.bClear = false;
laservol.bNoTrigger = true;
laservol2.bNoTrigger = true;
laservol3.bNoTrigger = true;
PEIndex.addPhysObj(laservol);
PEIndex.addPhysObj(laservol2);
PEIndex.addPhysObj(laservol3);
children.push(laservol);
children.push(laservol2);
children.push(laservol3);
hitsmoke = new PEEmitter("laser_smoke");
hitsmoke.bGrav = false;
hitsmoke.lifeRange.set(30, 30);
hitsmoke.spawnCount = 0;
hitsmoke.spawnRate = 0;
hitsmoke.spawnArea.set(5, 0);
hitsmoke.spawnType = "box";
hitsmoke.startVel.set(-0.25, 0);
hitsmoke.startVel2.set(0.25, 0);
hitsmoke.startScale.set(0.8, 1.2);
hitsmoke.bClear = false;
lasersmoke = hitsmoke.spawnInstance(new Vect(0, 0));
lasersmoke2 = hitsmoke.spawnInstance(new Vect(0, 0));
lasersmoke3 = hitsmoke.spawnInstance(new Vect(0, 0));
lasersmoke.bClear = false;
lasersmoke2.bClear = false;
lasersmoke3.bClear = false;
lchargesound = PhaseEngine.newSoundObj("lasercharge.wav");
lchargesound.adjust(1, 1000, 1000);
lchargesound.bClear = false;
children.push(lchargesound);
lhitsound = PhaseEngine.newSoundObj("lasersizzle.wav");
lhitsound.adjust(0.6, 500, 500);
lhitsound.bClear = false;
children.push(lhitsound);
lhitsound2 = PhaseEngine.newSoundObj("lasersizzle.wav");
lhitsound2.adjust(0.6, 500, 500);
lhitsound2.bClear = false;
children.push(lhitsound2);
lhitsound3 = PhaseEngine.newSoundObj("lasersizzle.wav");
lhitsound3.adjust(0.6, 500, 500);
lhitsound3.bClear = false;
children.push(lhitsound3);
explodesmoke = new PEEmitter("dust_cloud");
explodesmoke.bGrav = false;
explodesmoke.lifeRange.set(30, 30);
explodesmoke.spawnCount = 10;
explodesmoke.spawnRate = 0;
explodesmoke.spawnArea.set(10, 10);
explodesmoke.spawnOffset.set(0, 10);
explodesmoke.spawnType = "box";
explodesmoke.startVel.set(-2, -2);
explodesmoke.startVel2.set(2, 2);
explodesmoke.startScale.set(2, 4);
explodesmoke.constantScale.set(0.1, 0.1);
explodesmoke.constantAlpha = (-1 / 30);
explodesmoke.bClear = false;
bombs = new Array();
_local2 = 0;
while (_local2 < 15) {
_local3 = new DFBomb("col_circle", "circle");
_local3.emitref = explodesmoke;
PhaseEngine.regPhysObj(2, _local3);
bombs.push(_local3);
children.push(_local3);
_local2++;
};
blades = new Array();
_local2 = 0;
while (_local2 < 2) {
_local4 = new DFBlade("col_circle", "circle");
PhaseEngine.regPhysObj(2, _local4);
blades.push(_local4);
children.push(_local4);
_local2++;
};
painterBeam = PhaseEngine.newObj(2, "mship_painter_beam");
painterBeam.mc.visible = false;
painterBeam.bClear = false;
children.push(painterBeam);
paints = new Array();
_local2 = 0;
while (_local2 < 8) {
_local5 = new DFPainterHit("col_circle", "circle");
PhaseEngine.regPhysObj(2, _local5);
paints.push(_local5);
children.push(_local5);
_local2++;
};
bulletspark = new PEEmitter("spark_gun");
bulletspark.bGrav = false;
bulletspark.lifeRange.set(8, 16);
bulletspark.spawnCount = 6;
bulletspark.spawnRate = 0;
bulletspark.startVel.set(-3, -3);
bulletspark.startVel2.set(3, 3);
bulletspark.startScale.set(1, 2.5);
bulletspark.bClear = false;
bullets = new Array();
gchargesound = PhaseEngine.newSoundObj("gunspin.wav");
gchargesound.adjust(1, 1000, 1000);
gchargesound.bClear = false;
children.push(gchargesound);
bClear = false;
}
public function fireSideLasers(){
state = "slasers";
speed = 0.05;
rotacc = 0.0005;
vel = vel.mult(0.01);
countDown = (countTime = 240);
img[0].frame.gotoAndPlay("scharge");
lchargesound.play();
}
public function fireTrasers(){
state = "trasers";
speed = 0.05;
rotacc = 0.0005;
vel = vel.mult(0.01);
countDown = (countTime = 240);
img[0].frame.gotoAndPlay("tcharge");
lchargesound.play();
}
public function fireFBombs(){
state = "bombrun";
speed = 1;
rotacc = 0.06;
countDown = (countTime = 300);
img[0].frame.gotoAndPlay("bcharge");
}
public function fireBlades(){
state = "bladespawn";
countDown = (countTime = 600);
img[0].core.gotoAndPlay("blcharge");
}
public function fireLaser(){
state = "laser";
speed = 0.05;
rotacc = 0.0005;
vel = vel.mult(0.01);
countDown = (countTime = 240);
img[0].frame.gotoAndPlay("ccharge");
lchargesound.play();
}
public function chooseAttack():uint{
var _local1:Number;
_local1 = (Math.random() * 100);
switch (Math.floor(rank)){
case 1:
return (PhaseEngine.rand(0, 2, true));
case 2:
if (_local1 < 40){
return (0);
};
if (_local1 < 80){
return (1);
};
return (2);
case 3:
if (_local1 < 20){
return (0);
};
if (_local1 < 60){
return (1);
};
return (2);
case 4:
if (_local1 < 25){
return (0);
};
if (_local1 < 50){
return (1);
};
if (_local1 < 75){
return (2);
};
return (3);
case 5:
if (_local1 < 10){
return (0);
};
if (_local1 < 30){
return (1);
};
if (_local1 < 60){
return (2);
};
if (_local1 < 90){
return (3);
};
return (4);
case 6:
if (_local1 < 10){
return (5);
};
if (_local1 < 40){
return (2);
};
if (_local1 < 40){
return (3);
};
return (4);
case 7:
if (_local1 < 20){
return (5);
};
if (_local1 < 45){
return (2);
};
if (_local1 < 70){
return (3);
};
if (_local1 < 90){
return (4);
};
return (6);
case 8:
if (_local1 < 10){
return (2);
};
if (_local1 < 30){
return (3);
};
if (_local1 < 60){
return (4);
};
if (_local1 < 80){
return (5);
};
return (6);
case 9:
if (_local1 < 10){
return (2);
};
if (_local1 < 20){
return (3);
};
if (_local1 < 50){
return (4);
};
if (_local1 < 70){
return (5);
};
return (6);
default:
if (_local1 < 10){
return (2);
};
if (_local1 < 20){
return (3);
};
if (_local1 < 50){
return (4);
};
if (_local1 < 70){
return (5);
};
return (6);
};
}
public function firePainter(){
state = "painting";
speed = 1;
rotacc = 0.12;
countDown = (countTime = 150);
}
public function fireFlames(){
}
public function fireBombs(){
state = "bombrun";
speed = 1;
rotacc = 0.06;
countDown = (countTime = 300);
img[0].frame.gotoAndPlay("bcharge");
}
public function seek(){
if (forceIdle){
return;
};
if (state == "idle"){
speed = 0.5;
rotacc = 0.03;
if (DFData.mode == "easy"){
countDown = (400 + ((10 - Math.floor(rank)) * 30));
} else {
countDown = (300 + ((10 - Math.floor(rank)) * 25));
};
state = "seek";
motorsound.play(9999);
};
}
public function fireGuns(){
state = "gunsweep";
speed = 0.01;
rotacc = 0.06;
countDown = (countTime = 300);
img[0].frame.gotoAndPlay("bcharge");
gchargesound.play();
}
public function setTarget(_arg1:PEObj){
target = _arg1;
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:PEColResult;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Boolean;
var _local11:Vect;
var _local12:*;
var _local13:Vect;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
if (paused){
return;
};
vel = vel.mult(0.99);
rotvel = (rotvel * 0.99);
corerot = (corerot * 0.999);
rot = (rot - 180);
countDown--;
motorsound.setPosv(pos);
motorsound.adjust((0.3 * DFData.volMotor), motorsound.dropoff, motorsound.panRate);
if (state != "idle"){
_local1 = Math.floor(rank);
if (_local1 < 9){
if (DFData.mode == "easy"){
rank = (rank + 0.0002);
} else {
rank = (rank + 0.0004);
};
if (Math.floor(rank) > _local1){
rankup = true;
};
};
};
if (derank < 1.5){
derank = (derank + 0.001);
};
if (state == "seek"){
if (countDown == 0){
_local2 = chooseAttack();
switch (_local2){
case 0:
fireLaser();
break;
case 1:
fireSideLasers();
break;
case 2:
fireBombs();
break;
case 3:
fireBlades();
break;
case 4:
firePainter();
break;
case 5:
fireTrasers();
break;
case 6:
fireGuns();
break;
};
};
} else {
if (state == "laser"){
lchargesound.setPosv(pos);
if (countDown == 130){
PhaseEngine.playPosSound("lasershot.wav", pos, 2);
} else {
if (countDown > 120){
} else {
if (countDown > 0){
if (countDown == 120){
img[0].addChild(laservol.mc);
laservol.mc.visible = true;
laservol.mc.l1.visible = (laservol.mc.l2.visible = false);
laservol.mc.l3.visible = (laservol.mc.l4.visible = false);
laservol.bActive = true;
lasersmoke.bOn = true;
lasersmoke2.bOn = false;
lasersmoke3.bOn = false;
img[0].frame.gotoAndPlay("ccharged");
};
if ((((countDown == 120)) || (((countDown % 3) == 1)))){
_local3 = new Vect(0, 200);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(0, 1000);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol.setProps(0, 200, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke.setPosv(_local5.point);
lasersmoke.bOn = true;
lhitsound.setPosv(_local5.point);
lhitsound.play(999);
};
} else {
laservol.setProps(0, 200, 1, 8, 0);
lasersmoke.bOn = false;
lhitsound.fade(-2);
};
};
} else {
if (countDown == 0){
hitsmoke.spawnRate = 0;
img[0].removeChild(laservol.mc);
img[0].frame.gotoAndPlay("idle");
lhitsound.stop();
attacked = true;
state = "idle";
seek();
};
};
};
};
} else {
if (state == "slasers"){
lchargesound.setPosv(pos);
if (countDown == 130){
PhaseEngine.playPosSound("lasershot.wav", pos, 2);
} else {
if (countDown > 120){
} else {
if (countDown > 0){
if (countDown == 120){
img[0].addChild(laservol.mc);
img[0].addChild(laservol2.mc);
laservol.mc.visible = true;
laservol2.mc.visible = true;
laservol.mc.l1.visible = (laservol.mc.l2.visible = false);
laservol.mc.l3.visible = (laservol.mc.l4.visible = false);
laservol2.mc.l1.visible = (laservol2.mc.l2.visible = false);
laservol2.mc.l3.visible = (laservol2.mc.l4.visible = false);
laservol.bActive = true;
laservol2.bActive = true;
lasersmoke.bOn = true;
lasersmoke2.bOn = true;
lasersmoke3.bOn = false;
img[0].frame.gotoAndPlay("scharged");
};
if ((((countDown == 120)) || (((countDown % 4) == 1)))){
_local3 = new Vect(-187, 132);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(-187, 932);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol.setProps(-187, 132, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke.setPosv(_local5.point);
lasersmoke.bOn = true;
lhitsound.setPosv(_local5.point);
lhitsound.play(999);
};
} else {
laservol.setProps(-187, 132, 1, 8, 0);
lasersmoke.bOn = false;
lhitsound.fade(-2);
};
_local3 = new Vect(187, 132);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(187, 932);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol2.setProps(187, 132, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke2.setPosv(_local5.point);
lasersmoke2.bOn = true;
lhitsound2.setPosv(_local5.point);
lhitsound2.play(999);
};
} else {
laservol2.setProps(187, 132, 1, 8, 0);
lasersmoke2.bOn = false;
lhitsound2.fade(-2);
};
};
} else {
if (countDown == 0){
hitsmoke.spawnRate = 0;
img[0].removeChild(laservol.mc);
img[0].removeChild(laservol2.mc);
img[0].frame.gotoAndPlay("idle");
lhitsound.stop();
lhitsound2.stop();
attacked = true;
state = "idle";
seek();
};
};
};
};
} else {
if (state == "bombrun"){
_local6 = (Math.sin(Vect.toRad((countDown * 2))) * 400);
offset = new Vect(_local6, -500);
if ((countDown % 30) == 0){
PhaseEngine.playPosSound("bombchute.wav", pos, 0.7);
for (_local7 in bombs) {
if (!bombs[_local7].bActive){
bombs[_local7].bActive = true;
bombs[_local7].img[0].visible = true;
bombs[_local7].img[1].visible = true;
bombs[_local7].vel.set(PhaseEngine.rand(-0.5, 0.5), PhaseEngine.rand(0, 3));
bombs[_local7].lifespan = 300;
bombs[_local7].setPosv(pos);
if (PhaseEngine.rand(0, 2) > 1){
_local8 = new Vect(100, 175);
bombs[_local7].img[0].scaleX = (bombs[_local7].img[0].scaleX * -1);
bombs[_local7].img[1].scaleX = (bombs[_local7].img[1].scaleX * -1);
} else {
_local8 = new Vect(-100, 175);
};
_local8.rotate((rot + 180));
bombs[_local7].shiftPosv(_local8);
break;
};
};
};
if (countDown == 0){
offset.set(0, -375);
img[0].frame.gotoAndPlay("idle");
attacked = true;
state = "idle";
seek();
};
} else {
if (state == "bladespawn"){
if (countDown == 550){
PhaseEngine.playPosSound("bladespawn.wav", pos, 0.6);
blades[0].lifespan = 450;
blades[0].bActive = true;
blades[0].img[0].visible = true;
blades[0].target = target;
_local5 = PEIndex.lineTrace(pos, target.pos);
if (!_local5.hit){
blades[0].setPosv(pos);
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(-100, 0)), target.pos);
if (!_local5.hit){
blades[0].setPosv(pos.addv(new Vect(-100, 0)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(100, 0)), target.pos);
if (!_local5.hit){
blades[0].setPosv(pos.addv(new Vect(100, 0)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(0, -100)), target.pos);
if (!_local5.hit){
blades[0].setPosv(pos.addv(new Vect(0, -100)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(0, 100)), target.pos);
if (!_local5.hit){
blades[0].setPosv(pos.addv(new Vect(0, 100)));
} else {
blades[0].setPosv(pos);
};
};
};
};
};
blades[0].vel.set(0, 0);
blades[0].bPassOver = false;
blades[0].img[0].gotoAndPlay("fly");
blades[0].tells.push("kills");
blades[0].img[0].scaleX = (blades[0].img[0].scaleY = 1);
} else {
if (countDown == 350){
PhaseEngine.playPosSound("bladespawn.wav", pos, 0.6);
blades[1].lifespan = 450;
blades[1].bActive = true;
blades[1].img[0].visible = true;
blades[1].target = target;
_local5 = PEIndex.lineTrace(pos, target.pos);
if (!_local5.hit){
blades[1].setPosv(pos);
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(-100, 0)), target.pos);
if (!_local5.hit){
blades[1].setPosv(pos.addv(new Vect(-100, 0)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(100, 0)), target.pos);
if (!_local5.hit){
blades[1].setPosv(pos.addv(new Vect(100, 0)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(0, -100)), target.pos);
if (!_local5.hit){
blades[1].setPosv(pos.addv(new Vect(0, -100)));
} else {
_local5 = PEIndex.lineTrace(pos.addv(new Vect(0, 100)), target.pos);
if (!_local5.hit){
blades[1].setPosv(pos.addv(new Vect(0, 100)));
} else {
blades[1].setPosv(pos);
};
};
};
};
};
blades[1].vel.set(0, 0);
blades[1].bPassOver = false;
blades[1].img[0].gotoAndPlay("fly");
blades[1].tells.push("kills");
blades[1].img[0].scaleX = (blades[1].img[0].scaleY = 1);
} else {
if (countDown == 0){
img[0].core.gotoAndPlay("idle");
attacked = true;
state = "idle";
seek();
};
};
};
} else {
if (state == "painting"){
if (countDown > 0){
_local7 = 0;
while (_local7 < 9) {
if (countDown == (countTime - (_local7 * 6))){
PhaseEngine.playPosSound("paintertarget.wav", pos, 0.8);
if (_local7 == 8){
painterBeam.mc.visible = false;
break;
};
_local3 = new Vect(0, 200);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local9 = ((rot + 180) + PhaseEngine.rand(-70, 70));
_local4 = new Vect(0, 2000);
_local4.rotate(_local9);
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
paints[_local7].img[0].visible = true;
paints[_local7].setPosv(_local5.point);
painterBeam.mc.visible = true;
painterBeam.setProps(_local3.x, _local3.y, 1, (_local5.dist / 100), _local9);
};
};
_local7++;
};
} else {
if (countDown == 0){
if (DFData.bShake){
PhaseEngine.camShake(8, 0.92);
};
PhaseEngine.playSound("painterdetonate.wav");
_local7 = 0;
while (_local7 < 8) {
paints[_local7].explode();
_local7++;
};
img[0].frame.gotoAndPlay("idle");
attacked = true;
state = "idle";
seek();
};
};
} else {
if (state == "trasers"){
lchargesound.setPosv(pos);
if (countDown == 130){
PhaseEngine.playPosSound("lasershot.wav", pos, 2);
} else {
if (countDown > 120){
} else {
if (countDown > 0){
if (countDown == 120){
img[0].addChild(laservol.mc);
img[0].addChild(laservol2.mc);
img[0].addChild(laservol3.mc);
laservol.mc.visible = true;
laservol2.mc.visible = true;
laservol3.mc.visible = true;
laservol.mc.l1.visible = (laservol.mc.l2.visible = false);
laservol.mc.l3.visible = (laservol.mc.l4.visible = false);
laservol2.mc.l1.visible = (laservol2.mc.l2.visible = false);
laservol2.mc.l3.visible = (laservol2.mc.l4.visible = false);
laservol3.mc.l1.visible = (laservol3.mc.l2.visible = false);
laservol3.mc.l3.visible = (laservol3.mc.l4.visible = false);
laservol.bActive = true;
laservol2.bActive = true;
laservol3.bActive = true;
lasersmoke.bOn = true;
lasersmoke2.bOn = true;
lasersmoke3.bOn = true;
img[0].frame.gotoAndPlay("tcharged");
};
if ((((countDown == 120)) || (((countDown % 3) == 1)))){
_local3 = new Vect(0, 200);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(0, 1000);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol.setProps(0, 200, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke.setPosv(_local5.point);
lasersmoke.bOn = true;
lhitsound.setPosv(_local5.point);
lhitsound.play(999);
};
} else {
laservol.setProps(0, 200, 1, 8, 0);
lasersmoke.setPosv(new Vect(6000, 6000));
lasersmoke.bOn = false;
lhitsound.fade(-2);
};
_local3 = new Vect(-187, 132);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(-187, 932);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol3.setProps(-187, 132, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke3.setPosv(_local5.point);
lasersmoke3.bOn = true;
lhitsound3.setPosv(_local5.point);
lhitsound3.play(999);
};
} else {
laservol3.setProps(-187, 132, 1, 8, 0);
lasersmoke3.setPosv(new Vect(6000, 6000));
lasersmoke3.bOn = false;
lhitsound3.fade(-2);
};
_local3 = new Vect(187, 132);
_local3.rotate((rot + 180));
_local3 = _local3.addv(pos);
_local4 = new Vect(187, 932);
_local4.rotate((rot + 180));
_local4 = _local4.addv(pos);
_local5 = PEIndex.lineTrace(_local3, _local4, true);
if (_local5.hit){
laservol2.setProps(187, 132, 1, ((_local5.dist / 100) + 0.05), 0);
if (DFData.bFlames){
hitsmoke.spawnRate = 1;
lasersmoke2.setPosv(_local5.point);
lasersmoke2.bOn = true;
lhitsound2.setPosv(_local5.point);
lhitsound2.play(999);
};
} else {
laservol2.setProps(187, 132, 1, 8, 0);
lasersmoke2.setPosv(new Vect(6000, 6000));
lasersmoke2.bOn = false;
lhitsound2.fade(-2);
};
};
} else {
if (countDown == 0){
hitsmoke.spawnRate = 0;
img[0].removeChild(laservol.mc);
img[0].removeChild(laservol2.mc);
img[0].removeChild(laservol3.mc);
img[0].frame.gotoAndPlay("idle");
lhitsound.stop();
lhitsound2.stop();
lhitsound3.stop();
attacked = true;
state = "idle";
seek();
};
};
};
};
} else {
if (state == "gunsweep"){
gchargesound.setPosv(pos);
if (countDown < 200){
if ((countDown % 12) == 0){
_local10 = true;
_local11 = new Vect(0, 8);
_local11.rotate(((rot + 180) + ((Math.random() * 80) - 40)));
_local7 = 0;
while (_local7 < bullets.length) {
if (!bullets[_local7].bActive){
bullets[_local7].bActive = true;
bullets[_local7].img[0].visible = true;
bullets[_local7].constVel = _local11.copy();
bullets[_local7].vel = _local11.copy();
bullets[_local7].lifespan = 200;
bullets[_local7].setPosv(pos);
if (PhaseEngine.rand(0, 2) > 1){
_local8 = new Vect(100, 175);
} else {
_local8 = new Vect(-100, 175);
};
_local8.rotate((rot + 180));
bullets[_local7].shiftPosv(_local8);
bullets[_local7].img[0].rotation = (Vect.toDeg(Math.atan2(_local11.y, _local11.x)) - 90);
bullets[_local7].img[0].gotoAndPlay(1);
PhaseEngine.playPosSound("gunshot.wav", bullets[_local7].pos, 0.6);
_local10 = false;
break;
};
_local7++;
};
if (_local10){
bullets.push(new DFBullet("col_circle", "circle"));
_local12 = bullets[(bullets.length - 1)];
_local12.emitref = bulletspark;
PhaseEngine.regPhysObj(2, _local12);
children.push(_local12);
_local12.bActive = true;
_local12.img[0].visible = true;
_local12.constVel = _local11.copy();
_local12.vel = _local11.copy();
_local12.setPosv(pos);
if (PhaseEngine.rand(0, 2) > 1){
_local8 = new Vect(100, 175);
} else {
_local8 = new Vect(-100, 175);
};
_local8.rotate((rot + 180));
_local12.shiftPosv(_local8);
_local12.img[0].rotation = (Vect.toDeg(Math.atan2(_local11.y, _local11.x)) - 90);
_local12.img[0].gotoAndPlay(1);
PhaseEngine.playPosSound("gunshot.wav", _local12.pos, 0.6);
};
};
};
if (countDown == 0){
img[0].frame.gotoAndPlay("idle");
attacked = true;
state = "idle";
seek();
};
};
};
};
};
};
};
};
};
if (target != null){
if (offset.x == 0){
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(40, 0)));
};
if (offset.y == 0){
if (offset.x > 0){
if (target.vel.x < 0){
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(10, 40)));
} else {
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(20, 40)));
};
} else {
if (target.vel.x > 0){
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(10, 40)));
} else {
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(20, 40)));
};
};
if (_local13 == null){
_local13 = target.pos.addv(offset).addv(target.vel.multv(new Vect(0, 40)));
};
} else {
_local13 = target.pos.addv(offset);
};
_local14 = vel.mag();
_local15 = _local13.subv(pos);
_local16 = _local15.mag();
_local17 = new Vect((_local15.x / _local16), (_local15.y / _local16));
if (_local16 > (speed * 60)){
vel = vel.addv(_local17.mult(speed));
};
_local18 = pos.addv(vel.mult(60));
_local19 = _local13.subv(_local18).mag();
if (_local19 > _local16){
vel = vel.mult(0.95);
};
_local20 = target.pos.subv(pos).norm();
_local21 = (Vect.toDeg(Math.atan2(_local20.y, _local20.x)) + 90);
while (rot >= 360) {
rot = (rot - 360);
};
while (rot < 0) {
rot = (rot + 360);
};
if ((_local21 - rot) < -180){
_local21 = (_local21 + 360);
};
if ((_local21 - rot) > 180){
_local21 = (_local21 - 360);
};
if (_local21 > (rot + 2)){
if (rotvel < 0){
rotvel = (rotvel * 0.9);
};
rotvel = (rotvel + rotacc);
corerot = (corerot + (rotacc * 15));
} else {
if (_local21 < (rot - 2)){
if (rotvel > 0){
rotvel = (rotvel * 0.9);
};
rotvel = (rotvel - rotacc);
corerot = (corerot - (rotacc * 15));
};
};
rot = (rot + rotvel);
img[0].core.rotation = (img[0].core.rotation - rotvel);
img[0].core.rotation = (img[0].core.rotation + corerot);
if (state == "seek"){
_local15 = pos.subv(target.pos);
_local16 = _local15.mag();
if (_local16 < 250){
vel = vel.addv(_local15.norm().mult(1.5));
};
};
};
super.update();
mc.rotation = (mc.rotation + 180);
img[0].rotation = mc.rotation;
rot = (rot + 180);
}
public function idle(){
if (state == "seek"){
speed = 0.5;
rotacc = 0.03;
countDown = 9999;
state = "idle";
};
}
}
}//package
Section 105
//DFPainterHit (DFPainterHit)
package {
public class DFPainterHit extends PEPhysObj {
var lifespan:uint;
var emitref:PEEmitter;
public function DFPainterHit(_arg1, _arg2:String){
super(_arg1, _arg2);
lifespan = 0;
setState(false, true, false);
bPassOver = true;
bNoTrigger = true;
setProps(0, 0, 1, 1, 0);
airResist = 0.1;
attachImage("mship_painter_hit");
img[0].visible = false;
tells.push("killp");
bClear = false;
}
public function die(){
bActive = false;
img[0].visible = false;
img[0].gotoAndPlay("idle");
sca.set(1, 1);
}
override public function update(){
if (paused){
return;
};
if (bActive){
lifespan--;
if (lifespan == 0){
die();
};
};
super.update();
}
public function explode(){
bActive = true;
lifespan = 30;
sca.set(2, 2);
img[0].gotoAndPlay("burst");
PhaseEngine.playPosSound("painterexplode.wav", pos, 0.4);
}
}
}//package
Section 106
//DFPart (DFPart)
package {
public class DFPart extends PEPhysVol {
public var clean:Boolean;
public function DFPart(_arg1){
super(_arg1);
clean = true;
bCharOnly = true;
}
}
}//package
Section 107
//DFPart_Clip (DFPart_Clip)
package {
import flash.display.*;
public class DFPart_Clip extends MovieClip {
public var l1:col_line_no_bounds;
public var l4:col_line_no_bounds;
public var l3:col_line_no_bounds;
public var l2:col_line_no_bounds;
}
}//package
Section 108
//dust_cloud (dust_cloud)
package {
import flash.display.*;
public dynamic class dust_cloud extends MovieClip {
}
}//package
Section 109
//endweap_0 (endweap_0)
package {
import flash.display.*;
public dynamic class endweap_0 extends MovieClip {
public function endweap_0(){
addFrameScript(54, frame55, 141, frame142, 244, frame245, 351, frame352, 443, frame444, 549, frame550, 550, frame551);
}
function frame551(){
stop();
}
function frame550(){
DFGame.finaleFade();
}
function frame444(){
PhaseEngine.playSound("bubblepop.mp3");
}
function frame352(){
PhaseEngine.playSound("weap0_pop.wav", 0.7);
}
function frame245(){
PhaseEngine.playSound("weaponturn.wav", 0.7);
}
function frame55(){
PhaseEngine.playSound("weaponlift.wav");
}
function frame142(){
PhaseEngine.playSound("weaponstop.wav", 0.6);
}
}
}//package
Section 110
//endweap_1 (endweap_1)
package {
import flash.display.*;
public dynamic class endweap_1 extends MovieClip {
public function endweap_1(){
addFrameScript(54, frame55, 141, frame142, 244, frame245, 351, frame352, 357, frame358, 402, frame403, 408, frame409, 549, frame550, 550, frame551);
}
function frame551(){
stop();
}
function frame550(){
DFGame.finaleFade();
}
function frame352(){
PhaseEngine.playSound("weap1_shoot.wav");
}
function frame358(){
PhaseEngine.playSound("bulletricochet3.wav");
}
function frame245(){
PhaseEngine.playSound("weaponturn.wav", 0.7);
}
function frame409(){
PhaseEngine.playSound("bulletricochet3.wav");
}
function frame403(){
PhaseEngine.playSound("weap1_shoot.wav");
}
function frame55(){
PhaseEngine.playSound("weaponlift.wav");
}
function frame142(){
PhaseEngine.playSound("weaponstop.wav", 0.6);
}
}
}//package
Section 111
//endweap_2 (endweap_2)
package {
import flash.display.*;
public dynamic class endweap_2 extends MovieClip {
public function endweap_2(){
addFrameScript(54, frame55, 141, frame142, 244, frame245, 351, frame352, 357, frame358, 379, frame380, 385, frame386, 409, frame410, 415, frame416, 439, frame440, 445, frame446, 549, frame550, 550, frame551);
}
function frame551(){
stop();
}
function frame386(){
DFGame.finaleMissiles();
}
function frame550(){
DFGame.finaleFade();
}
function frame440(){
PhaseEngine.playSound("weap2_shoot.wav");
}
function frame446(){
DFGame.finaleMissiles();
DFGame.finaleMotherBackOff();
}
function frame352(){
PhaseEngine.playSound("weap2_shoot.wav");
}
function frame358(){
DFGame.finaleMissiles();
}
function frame245(){
PhaseEngine.playSound("weaponturn.wav", 0.7);
}
function frame416(){
DFGame.finaleMissiles();
}
function frame55(){
PhaseEngine.playSound("weaponlift.wav");
}
function frame410(){
PhaseEngine.playSound("weap2_shoot.wav");
}
function frame380(){
PhaseEngine.playSound("weap2_shoot.wav");
}
function frame142(){
PhaseEngine.playSound("weaponstop.wav", 0.6);
}
}
}//package
Section 112
//endweap_2barrel (endweap_2barrel)
package {
import flash.display.*;
public dynamic class endweap_2barrel extends MovieClip {
}
}//package
Section 113
//endweap_3 (endweap_3)
package {
import flash.display.*;
public dynamic class endweap_3 extends MovieClip {
public function endweap_3(){
addFrameScript(54, frame55, 141, frame142, 244, frame245, 402, frame403, 408, frame409, 415, frame416, 458, frame459, 474, frame475, 480, frame481, 494, frame495, 504, frame505, 519, frame520, 589, frame590, 593, frame594, 599, frame600, 604, frame605, 709, frame710, 750, frame751);
}
function frame710(){
DFGame.finaleFade();
}
function frame600(){
DFGame.finaleMotherLaserStrike3();
PhaseEngine.playSound("bombexplode.wav", 1.6);
}
function frame605(){
DFGame.finaleMotherBackOff();
}
function frame459(){
DFGame.finaleMotherLaserStrike2();
PhaseEngine.playSound("painterexplode.wav", 1.2);
}
function frame505(){
DFGame.finaleMotherLaserStrike2();
PhaseEngine.playSound("bombexplode.wav", 0.8);
}
function frame590(){
DFGame.finaleMotherLaserStrike1();
PhaseEngine.playSound("painterexplode.wav", 1.6);
}
function frame594(){
DFGame.finaleMotherLaserStrike2();
}
function frame751(){
stop();
}
function frame475(){
PhaseEngine.playSound("weap3_shoot2.wav", 2);
}
function frame245(){
PhaseEngine.playSound("weaponturn.wav", 0.7);
}
function frame481(){
PhaseEngine.camShake(20, 0.98);
}
function frame520(){
DFGame.finaleMotherLaserStrike3();
PhaseEngine.playSound("painterexplode.wav", 0.8);
}
function frame409(){
PhaseEngine.camShake(10, 0.98);
}
function frame403(){
PhaseEngine.playSound("weap1_shoot.wav");
PhaseEngine.playSound("weap3_shoot.wav", 2.25);
}
function frame495(){
DFGame.finaleMotherLaserStrike1();
PhaseEngine.playSound("bombexplode.wav", 0.6);
}
function frame416(){
DFGame.finaleMotherLaserStrike1();
PhaseEngine.playSound("bombexplode.wav", 1.2);
}
function frame55(){
PhaseEngine.playSound("weaponlift.wav");
}
function frame142(){
PhaseEngine.playSound("weaponstop.wav", 0.6);
}
}
}//package
Section 114
//gamedone (gamedone)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class gamedone extends MovieClip {
public var mbSubmit:SimpleButton;
public var savetext:MovieClip;
public var ass:TextField;
public var mbMenu:SimpleButton;
public var results:TextField;
public function gamedone(){
addFrameScript(0, frame1);
}
public function showMenu(_arg1:Event){
DFGame.finaleReturn();
}
function frame1(){
mbMenu.addEventListener(MouseEvent.CLICK, showMenu);
mbSubmit.addEventListener(MouseEvent.CLICK, submitMenu);
}
public function submitMenu(_arg1:Event){
DFGame.loadKing_Score(DFGame.submitScore);
DFGame.finaleReturn();
}
}
}//package
Section 115
//gameover (gameover)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class gameover extends MovieClip {
public var mbSubmit:SimpleButton;
public var mbMenu:SimpleButton;
public var results:TextField;
public function gameover(){
addFrameScript(0, frame1);
}
public function showMenu(_arg1:Event){
DFGame.hardcoreReturn();
}
function frame1(){
mbMenu.addEventListener(MouseEvent.CLICK, showMenu);
mbSubmit.addEventListener(MouseEvent.CLICK, submitMenu);
}
public function submitMenu(_arg1:Event){
DFGame.loadKing_Score(DFGame.submitScore);
DFGame.hardcoreReturn();
}
}
}//package
Section 116
//giant_laser (giant_laser)
package {
import flash.display.*;
public dynamic class giant_laser extends MovieClip {
public var l1:col_line_no_bounds;
public var l4:col_line_no_bounds;
public var l3:col_line_no_bounds;
public var l2:col_line_no_bounds;
}
}//package
Section 117
//hud (hud)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hud extends MovieClip {
public var rank:TextField;
public var score:TextField;
public var time:TextField;
}
}//package
Section 118
//hudlogo (hudlogo)
package {
import flash.display.*;
public dynamic class hudlogo extends MovieClip {
public var bKing:SimpleButton;
}
}//package
Section 119
//laser_smoke (laser_smoke)
package {
import flash.display.*;
public dynamic class laser_smoke extends MovieClip {
public function laser_smoke(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 120
//libGlow (libGlow)
package {
import flash.display.*;
public dynamic class libGlow extends MovieClip {
}
}//package
Section 121
//lv_end (lv_end)
package {
import flash.display.*;
public dynamic class lv_end extends MovieClip {
}
}//package
Section 122
//lv0_background (lv0_background)
package {
import flash.display.*;
public dynamic class lv0_background extends MovieClip {
}
}//package
Section 123
//lv0_playfield (lv0_playfield)
package {
import flash.display.*;
public dynamic class lv0_playfield extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var endtut:col_vol;
public var spawn:col_circle;
public var debris:col_circle;
public var deco:MovieClip;
}
}//package
Section 124
//lv1_backgrounda (lv1_backgrounda)
package {
import flash.display.*;
public dynamic class lv1_backgrounda extends MovieClip {
}
}//package
Section 125
//lv1_backgroundb (lv1_backgroundb)
package {
import flash.display.*;
public dynamic class lv1_backgroundb extends MovieClip {
}
}//package
Section 126
//lv1_backgroundc (lv1_backgroundc)
package {
import flash.display.*;
public dynamic class lv1_backgroundc extends MovieClip {
}
}//package
Section 127
//lv1_playfielda (lv1_playfielda)
package {
import flash.display.*;
public dynamic class lv1_playfielda extends MovieClip {
public var fail:col_vol;
public var house1:col_vol;
public var grab:col_vol;
public var right_1b:col_vol;
public var cp:col_vol;
public var spawn:col_circle;
public var deco:MovieClip;
public var block:col_vol;
public var got:col_vol;
public var safe:col_vol;
public var part1:part;
}
}//package
Section 128
//lv1_playfieldb (lv1_playfieldb)
package {
import flash.display.*;
public dynamic class lv1_playfieldb extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var cp:col_vol;
public var right_1c:col_vol;
public var gor:col_vol;
public var left_1a:col_vol;
public var part2:part;
public var part4:part;
public var gob:col_vol;
public var mid_1b:col_vol;
public var part5:part;
public var deco:MovieClip;
public var part3:part;
public var got:col_vol;
}
}//package
Section 129
//lv1_playfieldc (lv1_playfieldc)
package {
import flash.display.*;
public dynamic class lv1_playfieldc extends MovieClip {
public var fail:col_vol;
public var house2:col_vol;
public var grab:col_vol;
public var cp:col_vol;
public var spawn:col_circle;
public var gol:col_vol;
public var right_2a:col_vol;
public var left_1b:col_vol;
public var mid_1c:col_vol;
public var deco:MovieClip;
public var block:col_vol;
public var part7:part;
public var got:col_vol;
public var safe:col_vol;
public var part6:part;
}
}//package
Section 130
//lv2_backgrounda (lv2_backgrounda)
package {
import flash.display.*;
public dynamic class lv2_backgrounda extends MovieClip {
}
}//package
Section 131
//lv2_backgroundb (lv2_backgroundb)
package {
import flash.display.*;
public dynamic class lv2_backgroundb extends MovieClip {
}
}//package
Section 132
//lv2_playfielda (lv2_playfielda)
package {
import flash.display.*;
public dynamic class lv2_playfielda extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var cp:col_vol;
public var gor:col_vol;
public var left_1c:col_vol;
public var right_2b:col_vol;
public var part9:part;
public var gob:col_vol;
public var part8:part;
public var deco:MovieClip;
public var got:col_vol;
public var mid_2a:col_vol;
}
}//package
Section 133
//lv2_playfieldb (lv2_playfieldb)
package {
import flash.display.*;
public dynamic class lv2_playfieldb extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var part10:part;
public var part11:part;
public var cp:col_vol;
public var right_2c:col_vol;
public var gol:col_vol;
public var gor:col_vol;
public var spawn:col_circle;
public var gob:col_vol;
public var deco:MovieClip;
public var got:col_vol;
public var left_2a:col_vol;
public var mid_2b:col_vol;
}
}//package
Section 134
//lv2_playfieldc (lv2_playfieldc)
package {
import flash.display.*;
public dynamic class lv2_playfieldc extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var part12:part;
public var cp:col_vol;
public var right_2d:col_vol;
public var part13:part;
public var gor:col_vol;
public var deco:MovieClip;
public var got:col_vol;
public var mid_2c:col_vol;
}
}//package
Section 135
//lv2_playfieldd (lv2_playfieldd)
package {
import flash.display.*;
public dynamic class lv2_playfieldd extends MovieClip {
public var house3:col_vol;
public var fail:col_vol;
public var grab:col_vol;
public var part14:part;
public var cp:col_vol;
public var spawn:col_circle;
public var right_3a:col_vol;
public var left_2c:col_vol;
public var deco:MovieClip;
public var block:col_vol;
public var got:col_vol;
public var safe:col_vol;
public var mid_2d:col_vol;
}
}//package
Section 136
//lv3_backgrounda (lv3_backgrounda)
package {
import flash.display.*;
public dynamic class lv3_backgrounda extends MovieClip {
}
}//package
Section 137
//lv3_backgroundb (lv3_backgroundb)
package {
import flash.display.*;
public dynamic class lv3_backgroundb extends MovieClip {
}
}//package
Section 138
//lv3_backgroundc (lv3_backgroundc)
package {
import flash.display.*;
public dynamic class lv3_backgroundc extends MovieClip {
}
}//package
Section 139
//lv3_playfielda (lv3_playfielda)
package {
import flash.display.*;
public dynamic class lv3_playfielda extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var part15:part;
public var cp:col_vol;
public var spawn:col_circle;
public var gol:col_vol;
public var gor:col_vol;
public var right_3b:col_vol;
public var deco:MovieClip;
public var left_2d:col_vol;
public var got:col_vol;
public var mid_3a:col_vol;
}
}//package
Section 140
//lv3_playfieldb (lv3_playfieldb)
package {
import flash.display.*;
public dynamic class lv3_playfieldb extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var part16:part;
public var cp:col_vol;
public var gor:col_vol;
public var right_3c:col_vol;
public var gob:col_vol;
public var deco:MovieClip;
public var pad:col_vol;
public var got:col_vol;
public var left_3a:col_vol;
public var showad:col_vol;
public var mid_3b:col_vol;
}
}//package
Section 141
//lv3_playfieldc (lv3_playfieldc)
package {
import flash.display.*;
public dynamic class lv3_playfieldc extends MovieClip {
public var fail:col_vol;
public var grab:col_vol;
public var cp:col_vol;
public var part17:part;
public var spawn:col_circle;
public var part18:part;
public var gol:col_vol;
public var pad:col_vol;
public var gob:col_vol;
public var deco:MovieClip;
public var right_4a:col_vol;
public var got:col_vol;
public var left_3b:col_vol;
public var mid_3c:col_vol;
}
}//package
Section 142
//lv4_backgroundb (lv4_backgroundb)
package {
import flash.display.*;
public dynamic class lv4_backgroundb extends MovieClip {
}
}//package
Section 143
//lv4_playfielda (lv4_playfielda)
package {
import flash.display.*;
public dynamic class lv4_playfielda extends MovieClip {
public var mid_4a:col_vol;
public var house4:col_vol;
public var grab:col_vol;
public var pushl:col_vol;
public var pushr:col_vol;
public var block:col_vol;
public var right_4b:col_vol;
public var safe:col_vol;
}
}//package
Section 144
//lv4_playfieldb (lv4_playfieldb)
package {
import flash.display.*;
public dynamic class lv4_playfieldb extends MovieClip {
public var mid_4b:col_vol;
public var padr:col_vol;
public var padl:col_vol;
public var grab:col_vol;
public var part19:part;
public var cp:col_vol;
public var part20:part;
public var gol:col_vol;
public var gor:col_vol;
public var pushl:col_vol;
public var pad:col_vol;
public var pushr:col_vol;
public var deco:MovieClip;
public var right_4c:col_vol;
public var got:col_vol;
}
}//package
Section 145
//lv4_playfieldc (lv4_playfieldc)
package {
import flash.display.*;
public dynamic class lv4_playfieldc extends MovieClip {
public var mid_4c:col_vol;
public var fail:col_vol;
public var padr:col_vol;
public var grab:col_vol;
public var gol:col_vol;
public var gor:col_vol;
public var part22:part;
public var pad:col_vol;
public var part21:part;
public var gob:col_vol;
public var deco:MovieClip;
public var safe:col_vol;
public var got:col_vol;
public var finale:col_vol;
public var left_4b:col_vol;
}
}//package
Section 146
//main_menu (main_menu)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class main_menu extends MovieClip {
public var hardcore:MovieClip;
public var pausetext:TextField;
public var mbGames:SimpleButton;
public var bKing:SimpleButton;
public var mbAudio:SimpleButton;
public var playtext:TextField;
public var delNorm:MovieClip;
public var play_modes:MovieClip;
public var mbInst:SimpleButton;
public var opaudio:MovieClip;
public var instruct:MovieClip;
public var delEasy:MovieClip;
public var mbPlay:SimpleButton;
public var opvideo:MovieClip;
public var mbVideo:SimpleButton;
public function main_menu(){
addFrameScript(0, frame1);
}
public function showInst(_arg1:Event){
hideAll();
instruct.visible = true;
instruct.x = 318;
instruct.y = 98;
}
public function showHardcore(_arg1:Event){
hideAll();
hardcore.visible = true;
hardcore.x = 318;
hardcore.y = 98;
}
public function showDelE(_arg1:Event){
hideAll();
delEasy.visible = true;
delEasy.x = 318;
delEasy.y = 98;
}
function frame1(){
mbPlay.addEventListener(MouseEvent.CLICK, showPlay);
play_modes.sbHardcore.addEventListener(MouseEvent.CLICK, showHardcore);
mbVideo.addEventListener(MouseEvent.CLICK, showVideo);
mbAudio.addEventListener(MouseEvent.CLICK, showAudio);
opaudio.sbDelE.addEventListener(MouseEvent.CLICK, showDelE);
delEasy.sbYes.addEventListener(MouseEvent.CLICK, clearE);
opaudio.sbDelN.addEventListener(MouseEvent.CLICK, showDelN);
delNorm.sbYes.addEventListener(MouseEvent.CLICK, clearN);
mbInst.addEventListener(MouseEvent.CLICK, showInst);
mbGames.addEventListener(MouseEvent.CLICK, loadSite);
bKing.addEventListener(MouseEvent.CLICK, loadKing);
}
public function showDelN(_arg1:Event){
hideAll();
delNorm.visible = true;
delNorm.x = 318;
delNorm.y = 98;
}
public function clearE(_arg1:Event){
hideAll();
DFData.SOClear("easy");
pausetext.text = "Easy save data cleared";
}
public function clearN(_arg1:Event){
hideAll();
DFData.SOClear("normal");
pausetext.text = "Normal save data cleared";
}
public function loadKing(_arg1:Event){
DFGame.loadKing_MainMenu();
}
public function loadSite(_arg1:Event){
DFGame.loadKing_MainMenu();
}
public function showVideo(_arg1:Event){
hideAll();
opvideo.visible = true;
opvideo.x = 318;
opvideo.y = 98;
opvideo.cbLow.gotoAndStop("unchecked");
opvideo.cbMed.gotoAndStop("unchecked");
opvideo.cbHigh.gotoAndStop("unchecked");
opvideo.cbBest.gotoAndStop("unchecked");
if (PhaseEngine.stage.quality == "LOW"){
opvideo.cbLow.gotoAndStop("checked");
};
if (PhaseEngine.stage.quality == "MEDIUM"){
opvideo.cbMed.gotoAndStop("checked");
};
if (PhaseEngine.stage.quality == "HIGH"){
opvideo.cbHigh.gotoAndStop("checked");
};
if (PhaseEngine.stage.quality == "BEST"){
opvideo.cbBest.gotoAndStop("checked");
};
}
public function showPlay(_arg1:Event){
hideAll();
play_modes.visible = true;
play_modes.x = 318;
play_modes.y = 98;
}
public function showAudio(_arg1:Event){
hideAll();
opaudio.visible = true;
opaudio.x = 318;
opaudio.y = 98;
}
public function hideAll(){
play_modes.visible = false;
opvideo.visible = false;
opaudio.visible = false;
hardcore.visible = false;
delEasy.visible = false;
delNorm.visible = false;
instruct.visible = false;
}
}
}//package
Section 147
//mcGlimmer (mcGlimmer)
package {
import flash.display.*;
public dynamic class mcGlimmer extends MovieClip {
}
}//package
Section 148
//missile (missile)
package {
import flash.display.*;
public dynamic class missile extends MovieClip {
}
}//package
Section 149
//mochi_interlevel_ad (mochi_interlevel_ad)
package {
import flash.display.*;
public dynamic class mochi_interlevel_ad extends MovieClip {
public var hitCheck:col_box;
public var bg:MovieClip;
public var myOptions:Object;
public function mochi_interlevel_ad(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
myOptions = {id:"cf4abb5fc1d2a3a2", res:"600x600", clip:this, background:58398, color:0x416200, outline:0xFFFFFF, no_bg:true, ad_loaded:function (_arg1:Number, _arg2:Number):void{
bg.gotoAndPlay(2);
}};
MochiAd.showInterLevelAd(myOptions);
}
function frame2(){
stop();
}
}
}//package
Section 150
//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.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
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 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 f:Function;
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;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
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"));
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 sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
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 _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
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 unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
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");
}};
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.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);
};
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 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 _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 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 _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
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.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
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 r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, 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");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
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);
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.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;
};
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);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
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 151
//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 152
//mothership (mothership)
package {
import flash.display.*;
public dynamic class mothership extends MovieClip {
public var frame:MovieClip;
public var core:MovieClip;
}
}//package
Section 153
//mship_bullet (mship_bullet)
package {
import flash.display.*;
public dynamic class mship_bullet extends MovieClip {
public function mship_bullet(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 154
//mship_eraser (mship_eraser)
package {
import flash.display.*;
public dynamic class mship_eraser extends MovieClip {
}
}//package
Section 155
//mship_painter_beam (mship_painter_beam)
package {
import flash.display.*;
public dynamic class mship_painter_beam extends MovieClip {
}
}//package
Section 156
//mship_painter_hit (mship_painter_hit)
package {
import flash.display.*;
public dynamic class mship_painter_hit extends MovieClip {
public function mship_painter_hit(){
addFrameScript(69, frame70, 90, frame91);
}
function frame70(){
gotoAndPlay("idle");
}
function frame91(){
stop();
}
}
}//package
Section 157
//part (part)
package {
public dynamic class part extends DFPart_Clip {
}
}//package
Section 158
//partimg (partimg)
package {
import flash.display.*;
public dynamic class partimg extends MovieClip {
}
}//package
Section 159
//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 160
//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 landImpact:Number;
public var frictionStop:Number;
public var pstate:String;
public var jumpStr:Number;
public var bDJumped:Boolean;
public var wallAngle:Number;
public var frictionRun:Number;
public var sndJump:Array;
public var wallSide:String;
public var gravNorm:Vect;
public var speed:Number;
public var command:Array;
public var wallGrip:Number;
public var bCanDoubleJump:Boolean;
public var frictionASlide:Number;
public var jumpFrames:Number;
public var acc:Number;
public var state:String;
public var grabPoint:PEPhysObj;
public var airControl:Number;
public var grabCool:uint;
public var wallImpact:Number;
public var frictionSlide:Number;
public var lastJump:Number;
public var boostStr:Number;
public var bIsRunning:Boolean;
public var sndWallImpact:String;
public var moveDir:String;
public function PEChar(_arg1, _arg2:String){
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 = 5;
acc = 0.3;
frictionRun = 0;
frictionStop = 0.12;
frictionSlide = 0.05;
frictionASlide = -0.02;
airControl = 0.5;
jumpStr = -4;
boostStr = -0.8;
jumpFrames = 10;
lastJump = 0;
bCanDoubleJump = false;
bDJumped = false;
landImpact = 0;
wallGrip = 0.99;
wallSide = "";
wallPush = -4.5;
wallImpact = 0;
wallAngle = 0;
grabCool = 0;
grabPoint = null;
bIsRunning = false;
fallTime = 0;
sndJump = new Array();
sndLand = new Array();
sndWallImpact = "";
}
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 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 land(){
var _local1:Number;
state = "stand";
bDJumped = false;
if (pstate != "stand"){
landImpact = vel.y;
if ((((sndLand.length > 0)) && ((fallTime > 10)))){
_local1 = (landImpact / 20);
PhaseEngine.playSound(sndLand[PhaseEngine.rand(0, sndLand.length, true)], _local1);
};
if (bIsRunning){
bIsRunning = true;
if (fallTime < 5){
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);
};
_local1++;
};
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Vect;
var _local5:Vect;
if (!bActive){
return;
};
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;
if ((((pstate == "stand")) && ((vel.y > 0)))){
actions.push("fall");
} else {
if ((((pstate == "wslide")) && ((Math.abs(vel.x) < (speed + airControl))))){
actions.push("fall");
};
};
_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"){
PhaseEngine.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){
PhaseEngine.playSound(sndJump[PhaseEngine.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 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();
}
}
}//package
Section 161
//PEColClip (PEColClip)
package {
import flash.display.*;
public class PEColClip extends MovieClip {
public var bound:MovieClip;
}
}//package
Section 162
//PEColClip_Box (PEColClip_Box)
package {
public class PEColClip_Box extends PEColClip {
public var l1:col_line_no_bounds;
public var l4:col_line_no_bounds;
public var l3:col_line_no_bounds;
public var l2:col_line_no_bounds;
}
}//package
Section 163
//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());
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 circletocircleOld(_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.mag();
_local3.range = _local3.norm.multv(new Vect((_arg1.sca.x * 50), (_arg1.sca.y * 50))).mag();
_local3.range = (_local3.range + _local3.norm.multv(new Vect((_arg2.sca.x * 50), (_arg2.sca.y * 50))).mag());
if (_local3.dist < _local3.range){
_local3.hit = true;
} 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 164
//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 165
//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 166
//PEDialogMsg (PEDialogMsg)
package {
public class PEDialogMsg {
var startDelay:Number;
var endDelay:Number;
var bBySpeed:Boolean;
var txt:String;
var dur:Number;
public function PEDialogMsg(_arg1:String, _arg2:Number, _arg3:Boolean){
this.txt = _arg1;
this.dur = _arg2;
bBySpeed = _arg3;
startDelay = 0;
endDelay = 0;
}
}
}//package
Section 167
//PEDialogTarget (PEDialogTarget)
package {
public class PEDialogTarget extends PEObj {
public var sndSwitch:String;
public var bAutoAdvance:Boolean;
public var target:String;
public var sndSwitchVol:Number;
var endFunc:Function;
public var protect:Number;
public var bSpaceSkip:Boolean;
public var q:Array;
public var phase:Number;
public function PEDialogTarget(_arg1){
super(_arg1);
q = new Array();
target = "txt";
bAutoAdvance = true;
bSpaceSkip = true;
phase = 0;
protect = 60;
sndSwitch = "";
sndSwitchVol = 1;
}
public function advance(){
if (phase > protect){
nextMessage();
};
}
public function clearAll(){
q = new Array();
phase = 0;
mc[target].text = "";
}
public function nextMessage(){
phase = 0;
mc[target].text = "";
q.shift();
if (q.length == 0){
if (endFunc != null){
endFunc();
};
};
if (((!((sndSwitch == ""))) && ((q.length > 0)))){
PhaseEngine.playSound(sndSwitch, sndSwitchVol);
};
}
public function addMessage(_arg1:String, _arg2:Number=-1, _arg3:Boolean=true){
q.push(new PEDialogMsg(_arg1, _arg2, _arg3));
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
if (paused){
return;
};
if (q.length > 0){
if (phase == 0){
if (q[0].startDelay > 0){
q[0].startDelay--;
} else {
phase++;
};
} else {
if (!q[0].bBySpeed){
if ((((phase >= (q[0].dur + q[0].endDelay))) && (bAutoAdvance))){
nextMessage();
} else {
phase++;
_local1 = (q[0].dur / q[0].txt.length);
_local2 = (phase / _local1);
mc[target].text = q[0].txt.substr(0, Math.round(_local2));
};
} else {
if (q[0].dur > 0){
_local3 = ((q[0].dur * q[0].txt.length) + q[0].endDelay);
if ((((phase >= (_local3 + q[0].endDelay))) && (bAutoAdvance))){
nextMessage();
} else {
phase++;
_local2 = (phase / q[0].dur);
mc[target].text = q[0].txt.substr(0, Math.round(_local2));
if (q[0].txt.substr(Math.round(_local2), (Math.round(_local2) + 1)) == " "){
phase++;
};
};
} else {
if ((((phase >= q[0].endDelay)) && (bAutoAdvance))){
nextMessage();
} else {
phase++;
mc[target].text = q[0].txt;
};
};
};
};
};
}
public function addDelays(_arg1:Number, _arg2:Number){
if (q.length > 0){
q[(q.length - 1)].startDelay = _arg1;
q[(q.length - 1)].endDelay = _arg2;
};
}
}
}//package
Section 168
//PEEmitInstance (PEEmitInstance)
package {
public class PEEmitInstance extends PEObj {
public var spawnPhase:Number;
public var parts:Array;
public var bOn:Boolean;
public var bDead:Boolean;
public function PEEmitInstance(_arg1:Vect){
super("");
bDead = false;
parts = new Array();
spawnPhase = 0;
pos = _arg1.copy();
updateProperties();
bOn = true;
}
override public function setPos(_arg1, _arg2){
var _local3:*;
_local3 = new Vect((pos.x - _arg1), (pos.y - _arg2));
pos.set(_arg1, _arg2);
updateProperties();
realignParts(_local3);
}
override public function setPosv(_arg1:Vect){
var _local2:*;
_local2 = new Vect((pos.x - _arg1.x), (pos.y - _arg1.y));
pos.set(_arg1.x, _arg1.y);
updateProperties();
realignParts(_local2);
}
public function realignParts(_arg1:Vect){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = parts.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = parts[_local3];
if (_local4.life > 0){
_local4.pos = _local4.pos.addv(_arg1);
};
_local3++;
};
}
override public function shiftPos(_arg1, _arg2){
var _local3:*;
_local3 = new Vect(-(_arg1), _arg2);
pos.add(_arg1, _arg2);
updateProperties();
realignParts(_local3);
}
}
}//package
Section 169
//PEEmitter (PEEmitter)
package {
public class PEEmitter extends PEObj {
public var spawnCount:Number;
public var constantRot:Number;
public var startScale:Vect;
public var constantAlpha:Number;
public var startRot:Vect;
var clips:Array;
public var spawnArea:Vect;
public var rotType:String;
public var constantScale:Vect;
public var startAlpha:Vect;
public var lifeRange:Vect;
public var startVelType:String;
public var startVel2:Vect;
var inst:Array;
public var startMultiplier:Vect;
public var spawnPhase:Number;
public var spawnType:String;
public var constantVel:Vect;
var parts:Array;
public var startVel:Vect;
public var spawnOffset:Vect;
public var clipDistribution:String;
public var respawnRange:Vect;
public var bGrav:Boolean;
public var spawnRate:Number;
public function PEEmitter(_arg1:String){
super("");
clips = new Array();
clips.push(_arg1);
inst = new Array();
spawnType = "point";
spawnArea = new Vect(100, 100);
spawnOffset = new Vect(0, 0);
spawnCount = 10;
spawnRate = 30;
spawnPhase = 0;
clipDistribution = "random";
lifeRange = new Vect(60, 90);
respawnRange = new Vect(0, 0);
startVelType = "constant";
startMultiplier = new Vect(1, 1);
startVel = new Vect(0, 0);
startVel2 = new Vect(0, 10);
constantVel = new Vect(0, 0);
rotType = "constant";
startRot = new Vect(0, 0);
constantRot = 0;
startAlpha = new Vect(1, 1);
constantAlpha = 0;
startScale = new Vect(1, 1);
constantScale = new Vect(0, 0);
bGrav = false;
}
public function spawn(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:PEParticle;
var _local5:PEEmitInstance;
var _local6:*;
var _local7:*;
var _local8:*;
_local3 = PhaseEngine.rand;
_local4 = null;
_local5 = inst[_arg1];
_local6 = _local5.parts.length;
if (_arg2 != -1){
_local4 = _local5.parts[_arg2];
} else {
_arg2 = 0;
while (_arg2 < _local6) {
if (_local5.parts[_arg2].life <= 0){
_local4 = _local5.parts[_arg2];
};
_arg2++;
};
if (_local4 == null){
_local5.parts.push(new PEParticle(clips[0]));
_local4 = _local5.parts[(_local5.parts.length - 1)];
_local5.mc.addChild(_local4.mc);
};
};
if (spawnType == "point"){
_local4.pos.set(0, 0);
} else {
if (spawnType == "radius"){
_local4.pos.x = _local3(-10, 10);
_local4.pos.y = _local3(-10, 10);
_local4.pos = _local4.pos.norm().mult(_local3(0, spawnArea.x));
} else {
if (spawnType == "box"){
_local4.pos.x = _local3(-(spawnArea.x), spawnArea.x);
_local4.pos.y = _local3(-(spawnArea.y), spawnArea.y);
};
};
};
_local4.pos = _local4.pos.addv(spawnOffset);
if (startVelType == "constant"){
_local4.vel.x = _local3(startVel.x, startVel2.x);
_local4.vel.y = _local3(startVel.y, startVel2.y);
_local4.mc.rotation = _local3(startRot.x, startRot.y);
} else {
if (startVelType == "center"){
_local4.vel = _local4.pos.copy().norm().mult(_local3(startMultiplier.x, startMultiplier.y));
_local7 = Math.atan2(_local4.vel.y, _local4.vel.x);
_local8 = Vect.toDeg(_local7);
_local4.rot = _local8;
};
};
_local4.mc.alpha = _local3(startAlpha.x, startAlpha.y);
_local4.sca.x = (_local4.sca.y = _local3(startScale.x, startScale.y));
_local4.mc.visible = true;
_local4.mc.gotoAndPlay(1);
_local4.life = (_local3(lifeRange.x, lifeRange.y) * 2);
_local4.bGrav = bGrav;
_local4.update();
}
public function destroy(){
}
public function spawnInstance(_arg1:Vect){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
while (_local2 < inst.length) {
if (inst[_local2].bDead){
inst[_local2].setPos(_arg1.x, _arg1.y);
_local4 = 0;
while (_local4 < spawnCount) {
spawn(_local2, -1);
_local4++;
};
return (inst[_local2]);
};
_local2++;
};
_local3 = (inst.push(new PEEmitInstance(_arg1)) - 1);
_local4 = 0;
while (_local4 < spawnCount) {
spawn(_local3, -1);
_local4++;
};
mc.addChild(inst[_local3].mc);
return (inst[_local3]);
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
super.update();
_local1 = PhaseEngine.rand;
_local2 = 0;
while (_local2 < inst.length) {
if (!inst[_local2].bOn){
} else {
_local3 = inst[_local2].parts.length;
_local4 = 0;
while (_local4 < _local3) {
inst[_local2].bDead = true;
_local5 = inst[_local2].parts[_local4];
if (_local5.life > 0){
inst[_local2].bDead = false;
_local5.life--;
if (_local5.life <= 0){
_local5.mc.visible = false;
} else {
_local5.vel = _local5.vel.addv(constantVel);
_local5.mc.rotation = (_local5.mc.rotation + constantRot);
if (rotType == "vel"){
_local6 = Math.atan2(_local5.vel.y, _local5.vel.x);
_local7 = Vect.toDeg(_local6);
_local5.rot = _local7;
};
_local5.sca = _local5.sca.addv(constantScale);
_local5.mc.alpha = (_local5.mc.alpha + constantAlpha);
_local5.update();
};
};
_local4++;
};
if (spawnRate > 0){
inst[_local2].bDead = false;
_local8 = 0;
inst[_local2].spawnPhase++;
while ((((inst[_local2].spawnPhase >= (spawnRate * 2))) && ((_local8 < 100)))) {
spawn(_local2, -1);
inst[_local2].spawnPhase = (inst[_local2].spawnPhase - (spawnRate * 2));
_local8++;
};
};
};
_local2++;
};
}
}
}//package
Section 170
//PEIndex (PEIndex)
package {
import flash.display.*;
public class PEIndex {
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;
}
function col_circlebox(_arg1, _arg2, _arg3){
var _local4:*;
_local4 = 0;
while (_local4 < 4) {
if (_arg1.mc.hitTestObject(_arg2.edges[_local4].mc)){
col_circleline(_arg1, _arg2.edges[_local4], NaN);
};
_local4++;
};
}
function col_circlevol(_arg1, _arg2){
var _local3:*;
var _local4:*;
if (((_arg1.bUseCheapCol) && (_arg2.bCheapCol))){
_local4 = new PEColResult();
_local4.a = _arg1;
_local4.b = _arg2;
respond(_arg1, _arg2, _local4);
return;
};
if (_arg2.mc.hitTestPoint(_arg1.apos.x, _arg1.apos.y, false)){
_local4 = new PEColResult();
_local4.a = _arg1;
_local4.b = _arg2;
respond(_arg1, _arg2, _local4);
return;
};
_local3 = 0;
while (_local3 < 4) {
_local4 = PECollision.circletoline(_arg1, _arg2.edges[_local3], true);
_local4.b = _arg2;
if (_local4.hit){
respond(_arg1, _arg2, _local4);
break;
};
_local3++;
};
}
function col_circlecircle(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local4 = PECollision.circletocircle(_arg1, _arg2);
if (_local4.hit){
_arg2.hits.push(_arg3);
_local5 = (_arg1.mass + _arg2.mass);
if (_local5 == 0){
_local5 = 1;
};
_local6 = (_arg2.mass / _local5);
if (_arg2.bStatic){
_local6 = 1;
};
_arg1.shiftPosv(_local4.norm.mult(((_local4.range - _local4.dist) * _local6)));
_arg2.shiftPosv(_local4.norm.mult(-(((_local4.range - _local4.dist) * (1 - _local6)))));
_local7 = (_arg1.mass * _arg1.vel.mag());
_local8 = (_arg2.mass * _arg2.vel.mag());
if (!_arg2.bStatic){
_local9 = ((_local7 / _arg2.mass) * _local6);
_arg2.vel = _arg2.vel.addv(_local4.norm.mult(-(_local9)));
_local10 = ((_local8 / _arg1.mass) * (1 - _local6));
_arg1.vel = _arg1.vel.addv(_local4.norm.mult(_local10));
} else {
_local11 = ((_local7 / _arg1.mass) * (1 + _arg1.bounce));
_arg1.vel = _arg1.vel.addv(_local4.norm.mult(_local11));
};
respond(_arg1, _arg2, _local4);
};
}
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;
};
PEDebug.log(("Obj Index: " + String(o.length)));
PEDebug.log(("PhysObj Index: " + String(p.length)));
_local3 = 0;
while (_local3 < _local2) {
for (_local4 in o) {
o[_local4].update();
};
cols();
_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++;
};
}
public function autoBoxPhys(_arg1:PEObj){
var child:*;
var i:*;
var b:*;
var clip = _arg1;
try {
i = 0;
while (i < 1000) {
child = clip.mc.getChildAt(i);
if ((child is PEColClip_Box)){
b = new PEPhysVol(child);
b.colModel = "box";
b.contain.push(clip);
b.addParent(clip);
o.push(b);
p.push(b);
clip.children.push(b);
};
i = (i + 1);
};
} catch(error:Error) {
};
}
function col_circleline(_arg1, _arg2, _arg3){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
_local4 = PECollision.circletoline(_arg1, _arg2);
if (_local4.hit){
_arg2.hits.push(_arg3);
_local5 = (_arg1.mass + _arg2.mass);
if (_local5 == 0){
_local5 = 1;
};
_local6 = (_arg2.mass / _local5);
if (_arg2.bStatic){
_local6 = 1;
};
_arg1.shiftPosv(_local4.norm.mult((((_local4.range - _local4.dist) * _local6) + 0.01)));
if (!_arg2.bStatic){
_arg2.shiftPosv(_local4.norm.mult(-(((_local4.range - _local4.dist) * (1 - _local6)))));
};
if ((_arg1 is PEChar)){
if (checkStand(_local4.norm, _arg1, _arg2)){
respond(_arg1, _arg2, _local4);
} else {
if (_arg1.state == "fall"){
checkWallslide(_local4.norm, _arg1, _arg2);
};
};
};
if (!_arg2.bStatic){
_local7 = (_arg1.mass * _arg1.vel.mag());
_local8 = (_arg2.mass * _arg2.vel.mag());
_local9 = (_local7 / _arg2.mass);
_arg2.vel = _arg2.vel.addv(_local4.norm.mult(-(_local9)));
_local10 = (_local8 / _arg1.mass);
_arg1.vel = _arg1.vel.addv(_local4.norm.mult(_local10));
} else {
_local11 = -(_arg1.vel.dot(_local4.norm));
_local11 = (_local11 * (1 + _arg1.bounce));
if (_local11 > 0.1){
_arg1.vel = _arg1.vel.addv(_local4.norm.mult(_local11));
};
_local12 = _local4.norm.copy();
_local12.rotate(90);
_local12 = _local12.mult((_arg1.friction + _arg2.friction));
_arg1.vel.x = (_arg1.vel.x * (1 - Math.abs(_local12.x)));
_arg1.vel.y = (_arg1.vel.y * (1 - Math.abs(_local12.y)));
};
respond(_arg1, _arg2, _local4);
};
}
public function menuLetgo(){
var _local1:*;
var _local2:*;
_local1 = m.length;
_local2 = 0;
while (_local2 < _local1) {
m[_local2].dragging = false;
_local2++;
};
}
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.colModel == "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 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++;
};
}
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) {
};
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 cols(){
var _local1:PEColResult;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
for (_local2 in p) {
_local3 = p[_local2];
if (((_local3.bStatic) || (!(_local3.bActive)))){
} else {
if (((_local3.halfRes) && (_local3.halfState))){
_local3.halfState = false;
continue;
} else {
_local3.halfState = true;
};
_local4 = _local3.vel.mag();
if (_local4 > (_local3.sca.x * 49)){
preventWallPass(_local3);
};
if ((_local3 is PEChar)){
_local3.state = "fall";
_local3.gravNorm.set(0, 1);
};
for (_local5 in p) {
_local6 = p[_local5];
if ((((((_local2 == _local5)) || (!(_local6.bActive)))) || ((_local6.colModel == "")))){
} else {
_local7 = false;
_local8 = 0;
while (_local8 < _local3.hits.length) {
if (_local3.hits[_local8] == _local5){
_local7 = true;
};
_local8++;
};
if (_local7){
} else {
if (_local3.colModel == "circle"){
if ((((_local6.colModel == "circle")) && (!(_local3.bPassOver)))){
if (!_local3.mc.hitTestObject(_local6.mc)){
continue;
};
col_circlecircle(_local3, _local6, _local2);
} else {
if ((((_local6.colModel == "line")) && (!(_local3.bPassOver)))){
if (!_local3.mc.hitTestObject(_local6.mc)){
continue;
};
col_circleline(_local3, _local6, _local2);
} else {
if ((((_local6.colModel == "box")) && (!(_local3.bPassOver)))){
if (!_local3.mc.hitTestObject(_local6.mc)){
continue;
};
col_circlebox(_local3, _local6, _local2);
} else {
if ((((_local6.colModel == "vol")) && (!(_local3.bNoTrigger)))){
if (((_local6.bCharOnly) && (!((_local3 is PEChar))))){
continue;
};
if (!_local3.mc.hitTestObject(_local6.mc)){
continue;
};
col_circlevol(_local3, _local6);
};
};
};
};
} else {
if (_local3.colModel == "line"){
};
};
};
};
};
};
};
for (_local2 in p) {
p[_local2].hits = new Array();
};
}
public function autoLinePhys(_arg1:PEObj){
var child:*;
var i:*;
var a:*;
var clip = _arg1;
try {
i = 0;
while (i < 1000) {
child = clip.mc.getChildAt(i);
if ((((child is col_line)) || ((child is col_line_no_bounds)))){
a = new PEPhysObj(child, "line");
a.contain.push(clip);
o.push(a);
p.push(a);
clip.children.push(a);
};
i = (i + 1);
};
} catch(error:Error) {
};
}
public function checkWallslide(_arg1:Vect, _arg2:PEChar, _arg3:PEObj){
_arg1 = _arg1.norm().mult(-1);
if (_arg1.x > 0.7){
if (_arg2.pstate == "fall"){
_arg2.actions.push("wslidel");
};
_arg2.state = "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 == "fall"){
_arg2.actions.push("wslider");
};
_arg2.state = "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 remove(_arg1:PEObj){
var _local2:*;
var _local3:*;
_local2 = so.length;
_local3 = 0;
while (_local3 < _local2) {
if (_arg1.id == so[_local3].id){
so.splice(_local3, 1);
break;
};
_local3++;
};
_local2 = sp.length;
_local3 = 0;
while (_local3 < _local2) {
if (_arg1.id == sp[_local3].id){
sp.splice(_local3, 1);
break;
};
_local3++;
};
}
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.colModel == "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.colModel == "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", "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 171
//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 172
//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 pauseVel:Vect;
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 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;
pauseVel = new Vect(0, 0);
}
public function unpause(_arg1:Boolean=false){
var _local2:*;
paused = false;
vel = pauseVel.copy();
if (_arg1){
for (_local2 in children) {
children[_local2].unpause(true);
};
};
}
public function pause(_arg1:Boolean=false){
var _local2:*;
paused = true;
pauseVel = vel.copy();
vel.set(0, 0);
if (_arg1){
for (_local2 in children) {
children[_local2].pause(true);
};
};
}
public function setScale(_arg1, _arg2){
sca.set(_arg1, _arg2);
updateProperties();
}
public function update(){
var _local1:*;
var _local2:*;
pos = pos.addv(vel);
_local1 = 0;
while (_local1 < att.length) {
_local2 = att[_local1];
if (_local2.bDirect){
pos = pos.addv(_local2.b.vel);
};
if (att[_local1].bTemp){
vel = vel.addv(_local2.b.vel);
att.splice(_local1, 1);
};
_local1++;
};
updateProperties();
}
public function setProps(_arg1, _arg2, _arg3, _arg4, _arg5){
pos.set(_arg1, _arg2);
sca.set(_arg3, _arg4);
rot = _arg5;
updateProperties();
}
public function setPos(_arg1, _arg2){
pos.set(_arg1, _arg2);
updateProperties();
}
public function shiftPosv(_arg1:Vect){
shiftPos(_arg1.x, _arg1.y);
}
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;
};
}
function updateProperties(){
mc.x = pos.x;
mc.y = pos.y;
mc.scaleX = sca.x;
mc.scaleY = sca.y;
mc.rotation = rot;
calcAbsolute();
updateImages();
}
public function attachImage(_arg1:String){
var _local2:Class;
_local2 = (getDefinitionByName(_arg1) as Class);
img.push(new (_local2));
img[(img.length - 1)].cacheAsBitmap = true;
return (img[(img.length - 1)]);
}
public function rotate(_arg1){
rot = (rot + _arg1);
updateProperties();
}
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);
};
_local1++;
};
}
public function shiftPos(_arg1, _arg2){
pos.add(_arg1, _arg2);
updateProperties();
}
public function calcAbsolute(){
}
}
}//package
Section 173
//PEParticle (PEParticle)
package {
public class PEParticle extends PEPhysObj {
var clip:String;
var life:Number;
public function PEParticle(_arg1:String){
super(_arg1);
life = 0;
bActive = (bStatic = true);
bGrav = false;
bAttached = false;
mass = 50;
airResist = 1;
bounce = 1;
friction = 0;
absorb = 0;
ppos = pos.copy();
contain = new Array();
tells = new Array();
calcAbsolute();
}
}
}//package
Section 174
//PEPhysObj (PEPhysObj)
package {
import flash.display.*;
public class PEPhysObj extends PEObj {
public var colModel:String;
public var airResist:Number;
public var bActive:Boolean;
public var contain:Array;
public var halfState:Boolean;
public var bPassOver:Boolean;
public var bounce:Number;
public var bAttached:Boolean;
public var absorb:Number;
public var bUseCheapCol:Boolean;
public var hits:Array;
public var appos:Vect;
public var gravity:Number;
public var apos:Vect;
public var bGrav:Boolean;
public var ppos:Vect;
public var tells:Array;
public var redirect:Object;
public var halfRes:Boolean;
public var bStatic:Boolean;
public var mass:Number;
public var bNoTrigger:Boolean;
public var respond:Function;
public var friction:Number;
public function PEPhysObj(_arg1, _arg2:String=""){
super(_arg1);
if ((_arg1 is MovieClip)){
bAttached = true;
};
bActive = true;
bStatic = true;
bPassOver = false;
bNoTrigger = false;
bGrav = false;
halfRes = false;
halfState = false;
gravity = 0.2;
mass = 1;
airResist = 1;
bounce = 1;
friction = 0.02;
absorb = 0;
colModel = _arg2;
bUseCheapCol = true;
hits = new Array();
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();
}
override public function setProps(_arg1, _arg2, _arg3, _arg4, _arg5){
ppos.set(_arg1, _arg2);
super.setProps(_arg1, _arg2, _arg3, _arg4, _arg5);
}
override public function update(){
if (bActive){
if (bGrav){
vel.y = (vel.y + (gravity * airResist));
gravity = 0.2;
};
};
ppos = pos.copy();
if (bAttached){
pos.set(mc.x, mc.y);
rot = mc.rotation;
sca.set(mc.scaleX, mc.scaleY);
vel.set(0, 0);
updateImages();
calcAbsolute();
} else {
super.update();
};
}
public function lock(){
bStatic = true;
bGrav = false;
}
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 175
//PEPhysVol (PEPhysVol)
package {
public class PEPhysVol extends PEPhysObj {
public var edges:Array;
public var bCharOnly:Boolean;
public var bCheapCol:Boolean;
public function PEPhysVol(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
super(_arg1, "vol");
_local2 = new PEPhysObj(mc.l1);
_local3 = new PEPhysObj(mc.l2);
_local4 = new PEPhysObj(mc.l3);
_local5 = new PEPhysObj(mc.l4);
_local2.contain.push(this);
_local3.contain.push(this);
_local4.contain.push(this);
_local5.contain.push(this);
_local2.bActive = (_local3.bActive = (_local4.bActive = (_local5.bActive = false)));
edges = new Array();
edges.push(_local2);
edges.push(_local3);
edges.push(_local4);
edges.push(_local5);
bCheapCol = true;
bCharOnly = false;
}
public function addParent(_arg1:PEObj){
var _local2:*;
_local2 = 0;
while (_local2 < 4) {
edges[_local2].contain.push(_arg1);
_local2++;
};
}
override public function updateImages(){
var _local1:*;
_local1 = 0;
while (_local1 < img.length) {
if (img[_local1] == null){
} else {
if (apos == null){
calcAbsolute();
};
img[_local1].x = (apos.x + imgOffset.x);
img[_local1].y = (apos.y + imgOffset.y);
};
_local1++;
};
}
}
}//package
Section 176
//PESound (PESound)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
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 177
//PESoundObj (PESoundObj)
package {
public class PESoundObj extends PEObj {
var positional:Boolean;
var dropoff:Number;
var fadeSpeed:Number;
var pauseState:String;
var playState:String;
var panRate:Number;
var bPauseOnFade:Boolean;
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 = "";
bPauseOnFade = true;
}
public function stop(){
if (playState != "off"){
playState = "off";
snd.stop();
};
}
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();
} else {
if (playState == "fade"){
fadePhase = 0;
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)){
if (bPauseOnFade){
this.pause();
} else {
this.stop();
};
fadePhase = -(vol);
return;
} else {
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 = "pause";
};
}
public function finished(){
playState = "off";
}
public function fade(_arg1:Number, _arg2:Number=0){
fadeSpeed = _arg1;
fadePhase = _arg2;
if (playState == "on"){
playState = "fade";
};
if ((((playState == "pause")) && ((_arg1 > 0)))){
this.unpause();
};
}
override public function unpause(_arg1:Boolean=false){
super.unpause(_arg1);
if (playState != "off"){
snd.unpause();
playState = pauseState;
};
}
}
}//package
Section 178
//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 179
//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 180
//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, _arg2:Vect){
super(_arg1);
bDraggable = false;
bDragOff = false;
dragging = false;
clickThrough = false;
canvas = _arg2.copy();
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 181
//PhaseEngine (PhaseEngine)
package {
import flash.display.*;
import flash.utils.*;
public class PhaseEngine {
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 ind:PEIndex;
public static var frustum;
public static var sounds:MovieClip;
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 PhaseEngine(_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 = 60;
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;
}
public static function newChar(_arg1:uint, _arg2, _arg3:String, _arg4:String=""):PEChar{
var _local5:*;
_local5 = new PEChar(_arg2, _arg3);
PEIndex.addPhysObj(_local5);
planes[_arg1].addChild(_local5.mc);
if (_arg4 != ""){
planes[_arg1].addChild(_local5.attachImage(_arg4));
};
return (_local5);
}
public static function loopStart():void{
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();
};
};
};
}
public static function keyDown(_arg1:uint){
return (inp.down(_arg1));
}
public static function newUIObj(_arg1):PEUIObj{
var _local2:*;
_local2 = new PEUIObj(_arg1, new Vect(stage.stageWidth, stage.stageHeight));
PEIndex.addUIObj(_local2);
ui.addChild(_local2.mc);
return (_local2);
}
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 loopEnd():void{
var _local1:*;
inp.mouseDelta.set(0, 0);
_local1 = getTimer();
ind.update(tim.frameDelta);
}
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 newObj(_arg1:uint, _arg2, _arg3:String=""):PEObj{
var _local4:*;
_local4 = new PEObj(_arg2);
PEIndex.addObj(_local4);
planes[_arg1].addChild(_local4.mc);
if (_arg3 != ""){
planes[_arg1].addChild(_local4.attachImage(_arg3));
};
return (_local4);
}
public static function newPhysVol(_arg1:uint, _arg2):PEPhysVol{
var _local3:*;
_local3 = new PEPhysVol(_arg2);
PEIndex.addPhysObj(_local3);
if ((_arg2 is String)){
planes[_arg1].addChild(_local3.mc);
};
return (_local3);
}
public static function keyHeld(_arg1:uint){
return (inp.held(_arg1));
}
public static function keyReleased(_arg1:uint){
return (inp.released(_arg1));
}
public static function newSoundObj(_arg1:String):PESoundObj{
var _local2:*;
_local2 = new PESoundObj(_arg1);
PEIndex.addObj(_local2);
return (_local2);
}
public static function playSound(_arg1:String, _arg2:Number=1, _arg3:uint=1){
snd.playSound(_arg1, _arg2, _arg3);
}
public static function regObj(_arg1:uint, _arg2:PEObj, _arg3:Boolean=false){
var _local4:*;
PEIndex.addObj(_arg2);
if (!_arg3){
planes[_arg1].addChild(_arg2.mc);
};
_local4 = 0;
while (_local4 < _arg2.img.length) {
planes[_arg1].addChild(_arg2.img[_local4]);
_local4++;
};
}
public static function keyTap(_arg1:uint){
return (inp.tap(_arg1));
}
public static function newPhysObj(_arg1:uint, _arg2, _arg3:String, _arg4:String=""):PEPhysObj{
var _local5:*;
_local5 = new PEPhysObj(_arg2, _arg3);
PEIndex.addPhysObj(_local5);
planes[_arg1].addChild(_local5.mc);
if (_arg4 != ""){
planes[_arg1].addChild(_local5.attachImage(_arg4));
};
return (_local5);
}
public static function showPhys(_arg1:Boolean){
var _local2:*;
_local2 = 0;
while (_local2 < ind.p.length) {
ind.p[_local2].mc.visible = _arg1;
_local2++;
};
}
public static function deRegAll(){
var _local1:*;
for (_local1 in PEIndex.so) {
if (PEIndex.so[_local1].bClear){
deReg(PEIndex.so[_local1]);
_local1--;
};
};
}
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 regPhysObj(_arg1:uint, _arg2:PEPhysObj, _arg3:Boolean=false){
var _local4:*;
PEIndex.addPhysObj(_arg2);
if (!_arg3){
planes[_arg1].addChild(_arg2.mc);
};
_local4 = 0;
while (_local4 < _arg2.img.length) {
planes[_arg1].addChild(_arg2.img[_local4]);
_local4++;
};
}
public static function forceDeRegNonUI(){
var k:*;
var o:PEObj;
var i:*;
var j:*;
trace(PEIndex.so.length);
k = 0;
while (k < PEIndex.so.length) {
if (!(PEIndex.so[k] is PEUIObj)){
k = (k - 1);
o = PEIndex.so[k];
PEIndex.remove(o);
i = 0;
while (i < planes.length) {
try {
if (o.mc != null){
o.mc.parent.removeChild(o.mc);
};
j = 0;
while (j < o.img.length) {
o.img[j].parent.removeChild(o.img[j]);
j = (j + 1);
};
break;
} catch(err:Error) {
};
i = (i + 1);
};
o = null;
};
k = (k + 1);
};
trace(PEIndex.so.length);
}
public static function autoPhys(_arg1:PEObj){
ind.autoLinePhys(_arg1);
ind.autoBoxPhys(_arg1);
}
public static function inView(_arg1:MovieClip):Boolean{
if (frustum.hitTestObject(_arg1)){
return (true);
};
return (false);
}
public static function playPosSound(_arg1:String, _arg2:Vect, _arg3:Number=1, _arg4:uint=1){
snd.playPosSound(_arg1, _arg2, _arg3, _arg4);
}
public static function newMusicObj(_arg1:String):PESoundObj{
var _local2:*;
_local2 = new PESoundObj(_arg1);
_local2.bMusic = true;
_local2.positional = false;
PEIndex.addObj(_local2);
return (_local2);
}
public static function deReg(_arg1:PEObj){
var k:*;
var i:*;
var j:*;
var o = _arg1;
k = 0;
while (k < o.children.length) {
PhaseEngine.deReg(o.children[k]);
k = (k + 1);
};
PEIndex.remove(o);
i = 0;
while (i < planes.length) {
try {
if (o.mc != null){
o.mc.parent.removeChild(o.mc);
};
j = 0;
while (j < o.img.length) {
o.img[j].parent.removeChild(o.img[j]);
j = (j + 1);
};
break;
} catch(err:Error) {
};
i = (i + 1);
};
o = null;
}
public static function camShake(_arg1:Number, _arg2:Number){
coff.y = _arg1;
shakeMult = _arg2;
}
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 182
//player_mc (player_mc)
package {
import flash.display.*;
public dynamic class player_mc extends MovieClip {
public var body:df_player_body;
}
}//package
Section 183
//prebar (prebar)
package {
import flash.display.*;
public dynamic class prebar extends MovieClip {
public function prebar(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package
Section 184
//rock (rock)
package {
import flash.display.*;
public dynamic class rock extends MovieClip {
}
}//package
Section 185
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 186
//spark (spark)
package {
import flash.display.*;
public dynamic class spark extends MovieClip {
public function spark(){
addFrameScript(22, frame23);
}
function frame23(){
gotoAndStop("loop");
}
}
}//package
Section 187
//spark_gun (spark_gun)
package {
import flash.display.*;
public dynamic class spark_gun extends MovieClip {
}
}//package
Section 188
//text_bonus_popup (text_bonus_popup)
package {
import flash.display.*;
public dynamic class text_bonus_popup extends MovieClip {
public var tween:MovieClip;
public function text_bonus_popup(){
addFrameScript(129, frame130);
}
function frame130(){
stop();
}
}
}//package
Section 189
//upgrade_button (upgrade_button)
package {
import flash.display.*;
public dynamic class upgrade_button extends SimpleButton {
}
}//package
Section 190
//upgrade_window (upgrade_window)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class upgrade_window extends MovieClip {
public var s1:upgrade_button;
public var s2:upgrade_button;
public var s3:upgrade_button;
public var l1:upgrade_button;
public var l3:upgrade_button;
public var sec:MovieClip;
public var l2:upgrade_button;
public var h1:upgrade_button;
public var h2:upgrade_button;
public var h3:upgrade_button;
public var ex1:SimpleButton;
public var ex3:SimpleButton;
public var ex2:SimpleButton;
public var pf:TextField;
public var po:TextField;
public function upgrade_window(){
addFrameScript(0, frame1);
}
public function upLife3(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.life[2] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.life[2] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upSize(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 20){
DFData.savee.parts = (DFData.savee.parts - 20);
DFData.savee.extra[0] = true;
DFGame.buyUpgrade("e1");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 20){
DFData.saven.parts = (DFData.saven.parts - 20);
DFData.saven.extra[0] = true;
DFGame.buyUpgrade("e1");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upSpeed1(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.speed[0] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.speed[0] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
function frame1(){
l1.addEventListener(MouseEvent.CLICK, upLife1);
l2.addEventListener(MouseEvent.CLICK, upLife2);
l3.addEventListener(MouseEvent.CLICK, upLife3);
s1.addEventListener(MouseEvent.CLICK, upSpeed1);
s2.addEventListener(MouseEvent.CLICK, upSpeed2);
s3.addEventListener(MouseEvent.CLICK, upSpeed3);
h1.addEventListener(MouseEvent.CLICK, upHeight1);
h2.addEventListener(MouseEvent.CLICK, upHeight2);
h3.addEventListener(MouseEvent.CLICK, upHeight3);
ex1.addEventListener(MouseEvent.CLICK, upSize);
ex2.addEventListener(MouseEvent.CLICK, upDJump);
ex3.addEventListener(MouseEvent.CLICK, upSec);
}
public function upSpeed2(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.speed[1] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.speed[1] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upSpeed3(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.speed[2] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.speed[2] = true;
DFGame.buyUpgrade("s");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upSec(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 250){
DFData.savee.parts = (DFData.savee.parts - 250);
DFData.savee.extra[2] = true;
DFGame.buyUpgrade("ex3");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 250){
DFData.saven.parts = (DFData.saven.parts - 250);
DFData.saven.extra[2] = true;
DFGame.buyUpgrade("ex3");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upHeight2(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.height[1] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.height[1] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upHeight3(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.height[2] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.height[2] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upHeight1(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.height[0] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.height[0] = true;
DFGame.buyUpgrade("h");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upDJump(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 50){
DFData.savee.parts = (DFData.savee.parts - 50);
DFData.savee.extra[1] = true;
DFGame.buyUpgrade("e2");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 50){
DFData.saven.parts = (DFData.saven.parts - 50);
DFData.saven.extra[1] = true;
DFGame.buyUpgrade("e2");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upLife1(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.life[0] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.life[0] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
public function upLife2(_arg1:Event){
if (DFData.mode == "easy"){
if (DFData.savee.parts >= 5){
DFData.savee.parts = (DFData.savee.parts - 5);
DFData.savee.life[1] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
} else {
if (DFData.mode == "normal"){
if (DFData.saven.parts >= 5){
DFData.saven.parts = (DFData.saven.parts - 5);
DFData.saven.life[1] = true;
DFGame.buyUpgrade("l");
PhaseEngine.playSound("buttonding.wav");
} else {
PhaseEngine.playSound("buttonbuzz.wav", 2);
};
};
};
}
}
}//package
Section 191
//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 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