Section 1
//DefaultMedalIcon (com.newgrounds.assets.DefaultMedalIcon)
package com.newgrounds.assets {
import flash.display.*;
public dynamic class DefaultMedalIcon extends BitmapData {
public function DefaultMedalIcon(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package com.newgrounds.assets
Section 2
//DefaultSaveIcon (com.newgrounds.assets.DefaultSaveIcon)
package com.newgrounds.assets {
import flash.display.*;
public dynamic class DefaultSaveIcon extends BitmapData {
public function DefaultSaveIcon(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package com.newgrounds.assets
Section 3
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import com.newgrounds.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class APIConnector extends MovieClip {
public var encryptionKey:String;
public var loader:Preloader;
public var ad:FlashAd;
public var connectorType:String;
public var className:String;
public var _redirect:Boolean;
public var redirectOnHostBlocked:Boolean;
public var __setPropDict:Dictionary;
public var redirectOnNewVersion:Boolean;
public var movieVersion:String;
public var debugMode:String;
public var apiId:String;
public var adType:String;
public function APIConnector(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21);
}
public function _apiConnect():void{
var api:*;
api = API;
if (((api) && (!(api.connected)))){
if (!apiId){
Logger.logError("No API ID entered in the API Connector component.", "You can create an API ID for this submission at http://newgrounds.com/account/flashapi", "Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).");
return;
};
switch (debugMode){
case "Off":
default:
api.debugMode = api.RELEASE_MODE;
break;
case "Simulate Logged-in User":
api.debugMode = api.DEBUG_MODE_LOGGED_IN;
break;
case "Simulate Logged-out User":
api.debugMode = api.DEBUG_MODE_LOGGED_OUT;
break;
case "Simulate New Version":
api.debugMode = api.DEBUG_MODE_NEW_VERSION;
break;
case "Simulate Host Blocked":
api.debugMode = api.DEBUG_MODE_HOST_BLOCKED;
break;
};
api.addEventListener(APIEvent.API_CONNECTED, _onConnected);
api.connect(root, apiId, encryptionKey, movieVersion);
};
}
public function _onConnected(event:APIEvent):void{
if (((((redirectOnNewVersion) && (event.success))) && (event.data.newVersion))){
_redirect = true;
};
if (((((redirectOnHostBlocked) && (!(event.success)))) && ((event.error == APIEvent.ERROR_HOST_BLOCKED)))){
_redirect = true;
};
if (_redirect){
gotoAndStop("adPreloader");
forceAlwaysOnTop();
};
}
public function forceAlwaysOnTop():void{
var topIndex:uint;
if (parent){
topIndex = (parent.numChildren - 1);
if (parent.getChildIndex(this) != topIndex){
parent.setChildIndex(this, topIndex);
};
};
if (stage){
x = ((stage.stageWidth - width) / 2);
y = ((stage.stageHeight - height) / 2);
visible = true;
};
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
}
function __setProp_ad_APIConnector_AD_1(){
ad["componentInspectorSetting"] = true;
//unresolved jump
var _slot1 = e;
ad.apiId = "";
ad.showBorder = true;
ad.adType = "Video";
ad["componentInspectorSetting"] = false;
//unresolved jump
var _slot1 = e;
}
public function _onLoaded():void{
var mainClass:Class;
var main:*;
gotoAndStop("invisible");
if (_redirect){
API.loadOfficialVersion();
return;
};
if (className){
mainClass = (getDefinitionByName(className) as Class);
if (((mainClass) && (parent))){
main = new (mainClass);
parent.addChild(main);
parent.removeChild(this);
};
//unresolved jump
var _slot1 = error;
Logger.logError(("Unable to create main class: " + className));
};
}
function frame10(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame14(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame18(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame3(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame6(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame7(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame19(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame12(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame13(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame17(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame5(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame9(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame1(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
stop();
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
x = int(x);
y = int(y);
if (!debugMode){
debugMode = "Simulate Logged-in User";
};
if (!connectorType){
connectorType = "Flash Ad + Preloader";
};
if (!adType){
adType = "Video";
};
if (ad){
ad.adType = adType;
};
switch (connectorType){
case "Flash Ad + Preloader":
gotoAndStop("adPreloader");
break;
case "Flash Ad Only":
gotoAndStop("ad");
break;
case "Invisible":
gotoAndStop("invisible");
break;
};
_apiConnect();
}
function frame8(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame21(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame2(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame15(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame16(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame11(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame4(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
function frame20(){
if ((((__setPropDict[ad] == undefined)) || (!((((int(__setPropDict[ad]) >= 1)) && ((int(__setPropDict[ad]) <= 21))))))){
__setPropDict[ad] = currentFrame;
__setProp_ad_APIConnector_AD_1();
};
}
}
}//package com.newgrounds.components
Section 4
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class FlashAd extends FlashAdBase {
public function FlashAd(){
super();
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
stop();
}
function frame30(){
if (this["playButton"]){
this["playButton"].addEventListener(MouseEvent.CLICK, onPlayClick);
};
}
public function onPlayClick(event:MouseEvent):void{
removeAd();
if (parent){
parent.removeChild(this);
};
}
}
}//package com.newgrounds.components
Section 5
//FlashAdBase (com.newgrounds.components.FlashAdBase)
package com.newgrounds.components {
import flash.display.*;
import flash.events.*;
import com.newgrounds.*;
import flash.net.*;
import flash.system.*;
public class FlashAdBase extends MovieClip {
private var _showBorder:Boolean;// = true
public var showPlayButton:Boolean;
private var _fullScreen:Boolean;
public var adType:String;
public var VIDEO_ADS:String;// = "Video"
public var SIMPLE_ADS:String;// = "Simple"
private var _adFeedLoader:URLLoader;
private var _ad:Loader;
public function FlashAdBase(){
this.adType = this.VIDEO_ADS;
super();
try {
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
} catch(error) {
};
x = int(x);
y = int(y);
stop();
if (this["newgroundsButton"]){
this["newgroundsButton"].addEventListener(MouseEvent.CLICK, this.onNGClick);
};
addEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
addEventListener(Event.ENTER_FRAME, this.init);
}
public function get _adContainer():Sprite{
return (this["adContainer"]);
}
public function get _newgroundsButton():DisplayObject{
return (this["newgroundsButton"]);
}
public function get fullScreen():Boolean{
return (this._fullScreen);
}
public function set fullScreen(onRemovedFromStage:Boolean):void{
this._fullScreen = onRemovedFromStage;
if (onRemovedFromStage){
if (stage){
this.drawFullScreenRect();
} else {
addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
};
} else {
graphics.clear();
};
}
public function get showBorder():Boolean{
return (this._showBorder);
}
public function set showBorder(onRemovedFromStage:Boolean):void{
this._showBorder = onRemovedFromStage;
if (this._showBorder){
if (this._ad){
if (this._ad.content){
if (this.showPlayButton){
gotoAndStop("loadedPlay");
} else {
gotoAndStop("loaded");
};
} else {
gotoAndStop("loading");
};
} else {
gotoAndStop("idle");
};
} else {
gotoAndStop("noBorder");
};
}
private function init(onRemovedFromStage:Event):void{
removeEventListener(Event.ENTER_FRAME, this.init);
if (API.adFeedURL){
this.loadAdFeed();
} else {
API.addEventListener(APIEvent.API_CONNECTED, this.loadAdFeed);
};
}
private function loadAdFeed(onRemovedFromStage:APIEvent=null):void{
var event = onRemovedFromStage;
if (!API.adFeedURL){
return;
};
if (this._showBorder){
gotoAndStop("loading");
};
this._adFeedLoader = new URLLoader();
this._adFeedLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adFeedLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adFeedLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
var adFeedRequest:URLRequest = new URLRequest(API.adFeedURL);
try {
this._adFeedLoader.load(adFeedRequest);
} catch(e:Error) {
onAdError();
};
}
private function onAdFeedLoaded(onRemovedFromStage:Event):void{
if (((((this._adFeedLoader) && (this._adFeedLoader.data))) && (!((this._adFeedLoader.data == ""))))){
this.loadAd(this._adFeedLoader.data);
} else {
this.onAdError();
};
}
private function loadAd(onRemovedFromStage:String):void{
var adURL = onRemovedFromStage;
if (this._ad){
this.removeAd();
};
Logger.logMessage("Loading flash ad...");
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
try {
Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (onRemovedFromStage:Event):void{
onRemovedFromStage.preventDefault();
});
} catch(error:Error) {
};
try {
if (this.adType != this.VIDEO_ADS){
if (adURL.indexOf("?") >= 0){
adURL = (adURL + "&");
} else {
adURL = (adURL + "?");
};
adURL = (adURL + "blockoverlays=1");
};
this._ad.load(new URLRequest(adURL), new LoaderContext(false, new ApplicationDomain(null)));
if (this._adContainer){
this._adContainer.addChild(this._ad);
};
if (this._showBorder){
if (this.showPlayButton){
gotoAndStop("loadedPlay");
} else {
gotoAndStop("loaded");
};
};
} catch(error:Error) {
onAdError();
};
}
private function drawFullScreenRect():void{
if (stage){
x = ((stage.stageWidth - width) / 2);
y = ((stage.stageHeight - height) / 2);
graphics.beginFill(0);
graphics.drawRect(-(stage.stageWidth), -(stage.stageHeight), (stage.stageWidth * 2), (stage.stageHeight * 2));
graphics.endFill();
};
}
public function removeAd():void{
removeEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (this._adFeedLoader){
try {
this._adFeedLoader.close();
} catch(e:Error) {
};
};
if (this._ad){
try {
this._ad.close();
} catch(e:Error) {
};
try {
Object(this._ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
this._ad = null;
};
Logger.logError("Ad destroyed.");
}
private function onAdError(onRemovedFromStage:Event=null):void{
Logger.logError("Unable to load ad.");
this.removeAd();
}
private function onRemovedFromStage(onRemovedFromStage:Event):void{
this.removeAd();
}
private function onAddedToStage(onRemovedFromStage:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
if (this.fullScreen){
this.drawFullScreenRect();
};
}
private function onNGClick(onRemovedFromStage:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 6
//Preloader (com.newgrounds.components.Preloader)
package com.newgrounds.components {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Preloader extends MovieClip {
public var className:String;
public var loadingBar:MovieClip;
public var autoPlay:Boolean;
public var playButton:MovieClip;
public function Preloader(){
super();
addFrameScript(0, frame1, 9, frame10);
}
public function enterFrameHandler(event:Event):void{
var loaded:Number;
loaded = 0;
if (loaderInfo){
loaded = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (loadingBar){
loadingBar.gotoAndStop((int((loaded * (loadingBar.totalFrames - 1))) + 1));
};
if (loaded >= 1){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
gotoAndStop("loaded");
};
}
function frame10(){
if (playButton){
playButton.addEventListener(MouseEvent.CLICK, _onPlayClick);
playButton.stop();
playButton.buttonMode = true;
};
if (autoPlay){
_onPlayClick(null);
};
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
public function _onPlayClick(event:MouseEvent):void{
var theRoot:MovieClip;
var theParent:MovieClip;
theRoot = (root as MovieClip);
theParent = (parent as MovieClip);
if (theRoot){
theRoot.play();
theRoot.nextFrame();
};
if (((theParent) && (theParent._onLoaded))){
theParent._onLoaded();
};
}
}
}//package com.newgrounds.components
Section 7
//MD5 (com.newgrounds.crypto.MD5)
package com.newgrounds.crypto {
import flash.utils.*;
public class MD5 {
public static var digest:ByteArray;
private static var hexChars:String = "0123456789abcdef";
public static function hash(ByteArray:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(ByteArray);
return (hashBinary(_local2));
}
public static function hashBytes(ByteArray:ByteArray):String{
return (hashBinary(ByteArray));
}
public static function hashBinary(ByteArray:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(ByteArray);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + toHex(_local5)));
}
private static function f(String:int, String:int, String:int):int{
return (((String & String) | (~(String) & String)));
}
private static function g(String:int, String:int, String:int):int{
return (((String & String) | (String & ~(String))));
}
private static function h(String:int, String:int, String:int):int{
return (((String ^ String) ^ String));
}
private static function i(String:int, String:int, String:int):int{
return ((String ^ (String | ~(String))));
}
private static function transform(String:Function, String:int, String:int, String:int, String:int, String:int, String:int, String:int):int{
var _local9:int = (((String + int(String(String, String, String))) + String) + String);
return ((rol(_local9, String) + String));
}
private static function ff(String:int, String:int, String:int, String:int, String:int, String:int, String:int):int{
return (transform(f, String, String, String, String, String, String, String));
}
private static function gg(String:int, String:int, String:int, String:int, String:int, String:int, String:int):int{
return (transform(g, String, String, String, String, String, String, String));
}
private static function hh(String:int, String:int, String:int, String:int, String:int, String:int, String:int):int{
return (transform(h, String, String, String, String, String, String, String));
}
private static function ii(String:int, String:int, String:int, String:int, String:int, String:int, String:int):int{
return (transform(i, String, String, String, String, String, String, String));
}
private static function createBlocks(writeUTFBytes:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (writeUTFBytes.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((writeUTFBytes[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function rol(String:int, String:int):int{
return (((String << String) | (String >>> (32 - String))));
}
public static function ror(position:int, position:int):uint{
var _local3:int = (32 - position);
return (((position << _local3) | (position >>> (32 - _local3))));
}
public static function toHex(ByteArray:int, ByteArray:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (ByteArray){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((ByteArray >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((ByteArray >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((ByteArray >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((ByteArray >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package com.newgrounds.crypto
Section 8
//RC4 (com.newgrounds.crypto.RC4)
package com.newgrounds.crypto {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(calculate:String, calculate:String):String{
var _local3:Array = strToChars(calculate);
var _local4:Array = strToChars(calculate);
var _local5:Array = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public static function encryptbin(sbox:String, sbox:String):Array{
var _local3:Array = strToChars(sbox);
var _local4:Array = strToChars(sbox);
var _local5:Array = calculate(_local3, _local4);
return (_local5);
}
public static function decrypt(calculate:String, calculate:String):String{
var _local3:Array = hexToChars(calculate);
var _local4:Array = strToChars(calculate);
var _local5:Array = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(key:Array):void{
var _local3:uint;
var _local2:uint;
var _local4:uint = key.length;
var _local5:uint;
while (_local5 <= 0xFF) {
mykey[_local5] = key[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function calculate(sbox:Array, sbox:Array):Array{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
initialize(sbox);
var _local3:uint;
var _local4:uint;
var _local5:Array = new Array();
var _local9:uint;
while (_local9 < sbox.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (sbox[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function charsToHex(calculate:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:uint;
while (_local4 < calculate.length) {
_local2 = (_local2 + (_local3[(calculate[_local4] >> 4)] + _local3[(calculate[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function hexToChars(sbox:String):Array{
var _local2:Array = new Array();
var _local3:uint = ((sbox.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < sbox.length) {
_local2.push(parseInt(sbox.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
private static function charsToStr(calculate:Array):String{
var _local2:String = new String("");
var _local3:uint;
while (_local3 < calculate.length) {
_local2 = (_local2 + String.fromCharCode(calculate[_local3]));
_local3++;
};
return (_local2);
}
private static function strToChars(sbox:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < sbox.length) {
_local2.push(sbox.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds.crypto
Section 9
//decodeJson (com.newgrounds.encoders.json.decodeJson)
package com.newgrounds.encoders.json {
public const decodeJson:Function = initDecodeJson();
}//package com.newgrounds.encoders.json
import flash.utils.*;
private const initDecodeJson:Function = function ():Function{
var position:uint;
var byteInput:ByteArray;
var char:uint;
var charConvert:ByteArray;
var isNumberChar:ByteArray;
var stringHelper:ByteArray;
var isWhitespace:ByteArray;
var parseNumber:Function;
var parseWhitespace:Function;
var parse:Object;
charConvert = new ByteArray();
(charConvert.length = 0x0100);
(charConvert[34] = 34);
(charConvert[92] = 92);
(charConvert[47] = 47);
(charConvert[98] = 8);
(charConvert[102] = 12);
(charConvert[110] = 10);
(charConvert[114] = 13);
(charConvert[116] = 9);
isNumberChar = new ByteArray();
(isNumberChar.length = 0x0100);
(isNumberChar[43] = 1);
(isNumberChar[45] = 1);
(isNumberChar[46] = 1);
(isNumberChar[48] = 1);
(isNumberChar[49] = 1);
(isNumberChar[50] = 1);
(isNumberChar[51] = 1);
(isNumberChar[52] = 1);
(isNumberChar[53] = 1);
(isNumberChar[54] = 1);
(isNumberChar[55] = 1);
(isNumberChar[56] = 1);
(isNumberChar[57] = 1);
(isNumberChar[69] = 1);
(isNumberChar[101] = 1);
stringHelper = new ByteArray();
(stringHelper.length = 0x0100);
var i:int;
while (i < 0x0100) {
i = (i + 1);
var _local2 = i;
(stringHelper[_local2] = 1);
};
(stringHelper[34] = 0);
(stringHelper[92] = 0);
isWhitespace = new ByteArray();
(isWhitespace.length = 0x0100);
(isWhitespace[9] = 1);
(isWhitespace[10] = 1);
(isWhitespace[13] = 1);
(isWhitespace[32] = 1);
parseNumber = function ():Number{
if (position === 1){
(byteInput.position = 0);
return (parseFloat(byteInput.readUTFBytes(byteInput.length)));
};
(byteInput.position = (position - 1));
do {
} while (isNumberChar[byteInput[position++]]);
return (Number(byteInput.readUTFBytes(((position-- - byteInput.position) - 1))));
};
parseWhitespace = function ():Object{
while (isWhitespace[byteInput[position]]) {
position++;
};
return (parse[byteInput[position++]]());
};
var parseStringEscaped:Function = function (Error:String):String{
do {
if ((char = byteInput[position++]) === 117){
(byteInput.position = position);
(char = parseInt(byteInput.readUTFBytes(4), 16));
(position = (position + 4));
} else {
if (!(char = charConvert[char])){
throw (new Error(("Unknown escaped character encountered at position " + (position - 1))));
};
(byteInput.position = position);
};
Error = (Error + String.fromCharCode(char));
Error;
do {
} while (stringHelper[byteInput[position++]]);
if ((position - 1) > byteInput.position){
Error = (Error + byteInput.readUTFBytes(((position - 1) - byteInput.position)));
Error;
};
} while (byteInput[(position - 1)] === 92);
return (Error);
};
parse = {34:function ():String{
if (stringHelper[byteInput[position++]]){
(byteInput.position = (position - 1));
do {
} while (stringHelper[byteInput[position++]]);
if (byteInput[(position - 1)] === 92){
return (parseStringEscaped(byteInput.readUTFBytes(((position - 1) - byteInput.position))));
};
return (byteInput.readUTFBytes(((position - 1) - byteInput.position)));
//unresolved jump
};
if (byteInput[(position - 1)] === 92){
return (parseStringEscaped(""));
};
return ("");
}, 123:function ():Object{
var _local2:*;
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position] === 125){
position++;
return ({});
};
var _local1:* = {};
do {
do {
_local2 = parse[byteInput[position++]]();
_local2;
if (byteInput[position] !== 58){
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position++] !== 58){
throw (new Error(("Expected : at " + (position - 1))));
};
} else {
position++;
};
var _temp1 = _local2;
(_local1[_temp1] = parse[byteInput[position++]]());
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] === 125){
return (_local1);
};
while (isWhitespace[byteInput[position]]) {
position++;
};
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] !== 125){
throw (new Error(("Expected , or } at " + (position - 1))));
};
return (_local1);
}, 91:function ():Object{
while (isWhitespace[byteInput[position]]) {
position++;
};
if (byteInput[position] === 93){
position++;
return ([]);
};
var _local1:* = [];
do {
do {
(_local1[_local1.length] = parse[byteInput[position++]]());
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] === 93){
return (_local1);
};
position--;
while (isWhitespace[byteInput[position]]) {
position++;
};
} while (byteInput[position++] === 44);
if (byteInput[(position - 1)] !== 93){
throw (new Error(("Expected , or ] at " + (position - 1))));
};
return (_local1);
}, 116:function ():Boolean{
if ((((((byteInput[position] === 114)) && ((byteInput[(position + 1)] === 117)))) && ((byteInput[(position + 2)] === 101)))){
(position = (position + 3));
return (true);
};
throw (new Error(("Expected \"true\" at position " + position)));
}, 102:function ():Boolean{
if ((((((((byteInput[position] === 97)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 115)))) && ((byteInput[(position + 3)] === 101)))){
(position = (position + 4));
return (false);
};
throw (new Error(("Expected \"false\" at position " + (position - 1))));
}, 110:function ():Object{
if ((((((byteInput[position] === 117)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 108)))){
(position = (position + 3));
return (null);
};
throw (new Error(("Expected \"null\" at position " + position)));
}, 110:function ():void{
throw (new Error(("Unexpected end of array at " + position)));
}, 125:function ():void{
throw (new Error(("Unexpected end of object at " + position)));
}, 44:function ():void{
throw (new Error(("Unexpected comma at " + position)));
}, 45:parseNumber, 48:parseNumber, 49:parseNumber, 50:parseNumber, 51:parseNumber, 52:parseNumber, 53:parseNumber, 54:parseNumber, 55:parseNumber, 56:parseNumber, 57:parseNumber, 13:parseWhitespace, 10:parseWhitespace, 9:parseWhitespace, 32:parseWhitespace};
return (function (parse):Object{
var input = parse;
if ((input is String)){
(byteInput = new ByteArray());
byteInput.writeUTFBytes((input as String));
} else {
if ((input is ByteArray)){
(byteInput = (input as ByteArray));
} else {
throw (new Error((("Unexpected input <" + input) + ">")));
};
};
(position = 0);
try {
return (parse[byteInput[position++]]());
} catch(e:TypeError) {
if ((position - 1) < byteInput.length){
(e.message = ((((((((("Unexpected character " + String.fromCharCode(byteInput[(position - 1)])) + " (0x") + byteInput[(position - 1)].toString(16)) + ")") + " at position ") + (position - 1)) + " (") + e.message) + ")"));
};
throw (e);
};
return (null);
});
};
Section 10
//encodeJson (com.newgrounds.encoders.json.encodeJson)
package com.newgrounds.encoders.json {
public const encodeJson:Function = initDecodeJson();
}//package com.newgrounds.encoders.json
import flash.utils.*;
private const initDecodeJson:Function = function ():Function{
var result:IDataOutput;
var i:int;
var j:int;
var strLen:int;
var str:String;
var char:int;
var tempBytes:ByteArray;
var blockNonFiniteNumbers:Boolean;
var charConvert:Array;
var parseString:Function;
var parse:Object;
tempBytes = new ByteArray();
charConvert = new Array(0x0100);
j = 0;
while (j < 10) {
(charConvert[j] = ((j + 48) | 808464384));
j = (j + 1);
};
while (j < 16) {
(charConvert[j] = ((j + 55) | 808464384));
j = (j + 1);
};
while (j < 26) {
(charConvert[j] = ((j + 32) | 808464640));
j = (j + 1);
};
while (j < 32) {
(charConvert[j] = ((j + 39) | 808464640));
j = (j + 1);
};
while (j < 0x0100) {
(charConvert[j] = j);
j = (j + 1);
};
(charConvert[10] = 23662);
(charConvert[13] = 23666);
(charConvert[9] = 23668);
(charConvert[8] = 23650);
(charConvert[12] = 23654);
(charConvert[8] = 23650);
(charConvert[34] = 23586);
(charConvert[92] = 0x5C5C);
(charConvert[127] = 808466246);
var parseArray:Function = function (:Array):void{
result.writeByte(91);
var _local2:int;
var _local3:int = (length - 1);
if (_local3 >= 0){
while (_local2 < _local3) {
parse[typeof([_local2])]([_local2]);
result.writeByte(44);
var _temp1 = _local2;
_local2 = (_local2 + 1);
_temp1;
};
parse[typeof([_local2])]([_local2]);
};
result.writeByte(93);
};
parseString = function (:String):void{
result.writeByte(34);
(tempBytes.position = 0);
(tempBytes.length = 0);
tempBytes.writeUTFBytes();
(i = 0);
(j = 0);
(strLen = tempBytes.length);
while (j < strLen) {
(char = charConvert[tempBytes[j++]]);
if (char > 0x0100){
if ((j - 1) > i){
result.writeBytes(tempBytes, i, ((j - 1) - i));
};
if (char > 65536){
result.writeShort(23669);
result.writeUnsignedInt(char);
} else {
result.writeShort(char);
};
(i = j);
};
};
if (strLen > i){
result.writeBytes(tempBytes, i, (strLen - i));
};
result.writeByte(34);
};
parse = {object:function (:Object):void{
var _local2:*;
if (){
if (( is Array)){
parseArray();
} else {
result.writeByte(123);
_local2 = true;
for (str in ) {
if (_local2){
_local2 = false;
_local2;
} else {
result.writeByte(44);
};
parseString(str);
result.writeByte(58);
parse[typeof([str])]([str]);
};
result.writeByte(125);
};
} else {
result.writeUnsignedInt(1853189228);
};
}, string:parseString, number:function (:Number):void{
if (((blockNonFiniteNumbers) && (!(isFinite())))){
throw (new Error((("Number " + ) + " is not encodable")));
};
result.writeUTFBytes(String());
}, boolean:function (:Boolean):void{
if (){
result.writeUnsignedInt(1953658213);
} else {
result.writeByte(102);
result.writeUnsignedInt(1634497381);
};
}, xml:function (:Object):void{
if ((((!(toXMLString) is Function)) || ((_temp2 == null)))){
throw (new Error("unserializable XML object encountered"));
};
parseString();
}, undefined:function (:Boolean):void{
result.writeUnsignedInt(1853189228);
}};
return (function (charConvert:Object, charConvert:IDataOutput=null, charConvert:Boolean=false):String{
var byteOutput:*;
var input = charConvert;
var writeTo = charConvert;
var strictNumberSupport = charConvert;
(blockNonFiniteNumbers = strictNumberSupport);
try {
if (writeTo){
(result = writeTo);
(result.endian = "bigEndian");
parse[typeof(input)](input);
(byteOutput.position = 0);
return (byteOutput.readUTFBytes(byteOutput.length));
} else {
switch (typeof(input)){
case "xml":
if ((((!(input.toXMLString) is Function)) || ((_local5 == null)))){
throw (new Error("unserializable XML object encountered"));
};
case "object":
case "string":
var _local5 = new ByteArray();
byteOutput = _local5;
(result = _local5);
(result.endian = "bigEndian");
parse[typeof(input)](input);
(byteOutput.position = 0);
return (byteOutput.readUTFBytes(byteOutput.length));
case "number":
if (((blockNonFiniteNumbers) && (!(isFinite((input as Number)))))){
throw (new Error((("Number " + input) + " is not encodable")));
};
return (String(input));
case "boolean":
return ((input) ? "true" : "false");
case "undefined":
return ("null");
default:
throw (new Error((("Unexpected type \"" + typeof(input)) + "\" encountered")));
};
};
} catch(e:TypeError) {
throw (new Error("Unexpected type encountered"));
};
return (null);
});
};
Section 11
//JSON (com.newgrounds.encoders.json.JSON)
package com.newgrounds.encoders.json {
public class JSON {
public static function encode(:Object):String{
return (encodeJson());
}
public static function decode(encodeJson:String):Object{
return (decodeJson(encodeJson));
}
}
}//package com.newgrounds.encoders.json
Section 12
//BaseN (com.newgrounds.encoders.BaseN)
package com.newgrounds.encoders {
import flash.utils.*;
public class BaseN {
private var _hash:String;
private var _base:uint;
private var _reverseHash:Dictionary;
private static const DEFAULT_HASH:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
public function BaseN(*:String){
if (*){
this._hash = *;
} else {
this._hash = DEFAULT_HASH;
};
this._base = this._hash.length;
this._reverseHash = new Dictionary();
var _local2:uint;
while (_local2 < this._hash.length) {
this._reverseHash[this._hash.charAt(_local2)] = _local2;
_local2++;
};
}
public function encodeUint(flash.utils:uint, flash.utils:uint=1):String{
var _local3 = "";
var _local4:uint = flash.utils;
while (_local4 != 0) {
_local3 = (this._hash.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
while (_local3.length < flash.utils) {
_local3 = (this._hash.charAt(0) + _local3);
};
return (_local3);
}
public function decodeUint(_reverseHash:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _reverseHash.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._reverseHash[_reverseHash.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds.encoders
Section 13
//PNGEncoder (com.newgrounds.encoders.PNGEncoder)
package com.newgrounds.encoders {
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(crcTableComputed:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(crcTableComputed.width);
_local3.writeInt(crcTableComputed.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < crcTableComputed.height) {
_local4.writeByte(0);
if (!crcTableComputed.transparent){
_local7 = 0;
while (_local7 < crcTableComputed.width) {
_local6 = crcTableComputed.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < crcTableComputed.width) {
_local6 = crcTableComputed.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(crcTable:ByteArray, crcTable:uint, crcTable:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (crcTable != null){
_local4 = crcTable.length;
};
crcTable.writeUnsignedInt(_local4);
var _local5:uint = crcTable.position;
crcTable.writeUnsignedInt(crcTable);
if (crcTable != null){
crcTable.writeBytes(crcTable);
};
var _local6:uint = crcTable.position;
crcTable.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ crcTable.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
crcTable.position = _local6;
crcTable.writeUnsignedInt(_local8);
}
}
}//package com.newgrounds.encoders
Section 14
//API (com.newgrounds.API)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import com.newgrounds.encoders.json.*;
import com.newgrounds.crypto.*;
import flash.system.*;
public class API {
public static const RELEASE_MODE:String = "releaseMode";
public static const DEBUG_MODE_LOGGED_IN:String = "debugModeLoggedIn";
public static const DEBUG_MODE_LOGGED_OUT:String = "debugModeLoggedOut";
public static const DEBUG_MODE_NEW_VERSION:String = "debugModeNewVersion";
public static const DEBUG_MODE_HOST_BLOCKED:String = "debugModeHostBlocked";
private static const TEST_AD_FEED_URL:String = "http://www.ngads.com/adtest.php";
public static const VERSION:String = "3.0.9 AS3";
private static var _bridge:Bridge;
private static var _dispatcher:APIEventDispatcher = new APIEventDispatcher();
private static var _movieName:String;
private static var _movieVersion:String;
private static var _root:DisplayObject;
private static var _connection:APIConnection = new APIConnection();
private static var _debugMode:String = "debugModeLoggedIn";
private static var _newVersion:Boolean;
private static var _adsApproved:Boolean = false;
private static var _adFeedURL:String;
private static var _medals:Object = new Object();
private static var _medalsArray:Array = [];
private static var _scoreBoards:Object = new Object();
private static var _scoreBoardsArray:Array = [];
private static var _saveGroups:Object = new Object();
private static var _saveGroupsArray:Array = [];
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _sharedObjects:Object = new Object();
private static var _requestedSaveFileId:uint;
private static var _requestedSaveGroupId:uint;
public static function get connected():Boolean{
return (_connection.connected);
}
public static function get isNetworkHost():Boolean{
return (_connection.isNetworkHost);
}
public static function get apiId():String{
_connection.assertInitialized();
return (_connection.apiId);
}
public static function get debugMode():String{
return (_debugMode);
}
public static function set debugMode(_saveGroupsArray:String):void{
_debugMode = _saveGroupsArray;
}
public static function get publisherId():uint{
_connection.assertInitialized();
return (_connection.publisherId);
}
public static function get sessionId():String{
_connection.assertInitialized();
return (_connection.sessionId);
}
public static function get hostDomain():String{
_connection.assertInitialized();
return (_connection.hostDomain);
}
public static function get hostURL():String{
_connection.assertInitialized();
return (_connection.hostURL);
}
public static function get isNewgrounds():Boolean{
return ((_connection.publisherId == 1));
}
public static function get hasUserSession():Boolean{
_connection.assertInitialized();
return (_connection.hasUserSession);
}
public static function get username():String{
_connection.assertInitialized();
return (_connection.username);
}
public static function get userId():uint{
_connection.assertInitialized();
return (_connection.userId);
}
private static function assertConnected(Object:String=null):Boolean{
if (_connection.assertConnected()){
return (true);
};
if (Object){
dispatchEvent(Object, null, APIEvent.ERROR_NOT_CONNECTED);
};
return (false);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function get adFeedURL():String{
return (_adFeedURL);
}
public static function get medals():Array{
return (_medalsArray);
}
public static function get scoreBoards():Array{
return (_scoreBoardsArray);
}
public static function get saveGroups():Array{
return (_saveGroupsArray);
}
public static function connect(_saveGroupsArray:DisplayObject, _saveGroupsArray:String, _saveGroupsArray:String=null, _saveGroupsArray:String=""):void{
var _local5:uint;
APIEventDispatcher.globalDispatcher = _dispatcher;
Security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml");
if (_connection.initialized){
Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection.");
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_NOT_CONNECTED);
return;
};
_saveGroupsArray = trimWhitespace(_saveGroupsArray);
if (_saveGroupsArray){
_saveGroupsArray = trimWhitespace(_saveGroupsArray);
};
if (((!(_saveGroupsArray)) || ((_saveGroupsArray == "")))){
Logger.logError("No apiId given. Please use the API ID from your API settings page.");
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
Logger.logMessage((("====== Newgrounds API v" + VERSION) + " ======"));
_connection.connectionState = APIConnection.CONNECTING;
_root = _saveGroupsArray;
_movieVersion = _saveGroupsArray;
_connection.apiId = _saveGroupsArray;
_local5 = _saveGroupsArray.indexOf(":");
if (_local5 != -1){
_connection.trackerId = uint(_saveGroupsArray.substring(0, _local5));
} else {
_connection.trackerId = uint(_saveGroupsArray);
};
if (!_connection.trackerId){
Logger.logError(("Invalid API ID: " + _saveGroupsArray));
dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
_connection.encryptionKey = _saveGroupsArray;
_connection.initialized = true;
if (!_root.loaderInfo){
Logger.logWarning("The root DisplayObject is currently not on the stage. Connection will be completed once it is added to stage.");
};
_root.addEventListener(Event.ENTER_FRAME, checkRootLoaderInfo);
checkRootLoaderInfo(null);
}
private static function doConnect(_saveGroupsArray:Object):void{
if (((isNetworkHost) && (!((_debugMode == RELEASE_MODE))))){
Logger.logMessage("Live file detected, turning off debug mode.");
_debugMode = RELEASE_MODE;
};
if (((_saveGroupsArray) && (_saveGroupsArray.NewgroundsAPI_SandboxID))){
_bridge = new Bridge(_saveGroupsArray.NewgroundsAPI_SandboxID);
APICommand.bridge = _bridge;
};
if (_debugMode == RELEASE_MODE){
if (_saveGroupsArray){
if (_saveGroupsArray.NewgroundsAPI_UserName){
_connection.username = _saveGroupsArray.NewgroundsAPI_UserName;
};
if (_saveGroupsArray.NewgroundsAPI_UserID){
_connection.userId = _saveGroupsArray.NewgroundsAPI_UserID;
};
if (_saveGroupsArray.NewgroundsAPI_PublisherID){
_connection.publisherId = _saveGroupsArray.NewgroundsAPI_PublisherID;
};
if (_saveGroupsArray.NewgroundsAPI_UserpageFormat){
_connection.userpageFormat = _saveGroupsArray.NewgroundsAPI_UserpageFormat;
};
if (_saveGroupsArray.NewgroundsAPI_SessionID){
_connection.sessionId = _saveGroupsArray.NewgroundsAPI_SessionID;
};
if (_saveGroupsArray.NewgroundsAPI_SaveGroupID){
_requestedSaveGroupId = _saveGroupsArray.NewgroundsAPI_SaveGroupID;
};
if (_saveGroupsArray.NewgroundsAPI_SaveFileID){
_requestedSaveFileId = _saveGroupsArray.NewgroundsAPI_SaveFileID;
};
};
} else {
_connection.debug = true;
if ((((_debugMode == DEBUG_MODE_LOGGED_IN)) || ((_debugMode == DEBUG_MODE_LOGGED_OUT)))){
_connection.publisherId = 1;
};
if (_debugMode == DEBUG_MODE_LOGGED_IN){
_connection.sessionId = "D3bu64p1U53R";
_connection.userId = 10;
_connection.username = "API-Debugger";
};
};
_connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId});
}
private static function onConnect(_saveGroupsArray:APIEvent):void{
var _local2:Object = _saveGroupsArray.data;
if (!_saveGroupsArray.success){
Logger.logError("Unable to connect to the API.");
_connection.reset();
dispatchEvent(APIEvent.API_CONNECTED, _saveGroupsArray.data, _saveGroupsArray.error);
return;
};
if (debugMode != RELEASE_MODE){
_adFeedURL = TEST_AD_FEED_URL;
} else {
if (_local2.ad_url){
_adFeedURL = unescape(_local2.ad_url);
};
};
switch (_local2.ad_status){
case -1:
Logger.logWarning("Your movie is not approved to run Flash Ads.");
break;
case 0:
Logger.logWarning("Your movie is still awaiting approval to run Flash Ads.");
break;
case 1:
Logger.logMessage("Your movie is approved to run Flash Ads!");
break;
};
_adsApproved = (_local2.ad_status == 1);
if ((((_debugMode == DEBUG_MODE_HOST_BLOCKED)) || (_local2.deny_host))){
Logger.logWarning((_connection.hostDomain + " does not have permission to host this movie!"), "Update your API configuration to allow this host.");
dispatchEvent(APIEvent.API_CONNECTED, {officialURL:unescape(_local2.movie_url)}, APIEvent.ERROR_HOST_BLOCKED);
_connection.reset();
return;
};
_movieName = (_local2.movieName) ? _local2.movieName : "";
Logger.logMessage("Connecting to the Newgrounds API Gateway...", (("----- " + _local2.movie_name) + " -----"));
if (_debugMode == DEBUG_MODE_NEW_VERSION){
_local2.movie_version = "Debug Mode";
};
if (_local2.movie_version){
Logger.logMessage("A new version of this movie is available.", ("Current version:\t" + _movieVersion), ("Newest version:\t" + _local2.movie_version), "Use API.loadOfficialVersion() to link to the latest version.");
_newVersion = true;
} else {
_newVersion = false;
};
if (_local2.request_portal_url){
_connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.hostURL});
};
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
}
private static function onMetadataLoaded(_saveGroupsArray:APIEvent):void{
var _local3:uint;
var _local4:uint;
var _local6:Object;
var _local7:Object;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Boolean;
var _local11:Medal;
var _local12:Object;
var _local13:ScoreBoard;
var _local14:Object;
var _local15:Array;
var _local16:Array;
var _local17:SaveGroup;
var _local18:Object;
var _local19:Object;
var _local2:Object = _saveGroupsArray.data;
if (!_saveGroupsArray.success){
Logger.logWarning("Unable to load movie metadata.");
disconnect();
dispatchEvent(APIEvent.API_CONNECTED, null, _saveGroupsArray.error);
return;
};
var _local5:uint;
if (_local2.medals){
_local5 = _local2.medals.length;
if (hasUserSession){
_local6 = loadLocal(("medals_unlocked_" + username));
} else {
_local6 = loadLocal("medals_unlocked");
};
_local3 = 0;
while (_local3 < _local5) {
_local7 = _local2.medals[_local3];
_local8 = _local7.medal_unlocked;
_local9 = ((_local6) && (_local6[_local7.medal_id]));
_local10 = (hasUserSession) ? _local8 : _local9;
if (debugMode != RELEASE_MODE){
_local10 = false;
};
_local11 = new Medal(_connection, _local7.medal_id, _local7.medal_name, _local7.medal_description, Boolean(int(_local7.secret)), _local10, _local7.medal_value, _local7.medal_difficulty, _local7.medal_icon);
_local11.addEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true);
_local11.addEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true);
_medals[_local11.name] = _local11;
_medalsArray.push(_local11);
Logger.logMessage(_local11);
if (((((hasUserSession) && (_local9))) && (!(_local8)))){
Logger.logMessage((("Server missed the \"" + _local11.name) + "\" unlock. Resending..."));
_local11.unlock();
};
_local3++;
};
};
Logger.logMessage((((_local5 + " medal") + ((_local5)!=1) ? "s" : "") + " initialized."));
_local5 = 0;
if (_local2.score_boards){
_local5 = _local2.score_boards.length;
_local3 = 0;
while (_local3 < _local5) {
_local12 = _local2.score_boards[_local3];
_local13 = new ScoreBoard(_connection, _local12.name, _local12.id);
_scoreBoards[_local13.name] = _local13;
_scoreBoardsArray.push(_local13);
Logger.logMessage(_local13);
_local3++;
};
};
Logger.logMessage((((_local5 + " scoreboard") + ((_local5)!=1) ? "s" : "") + " initialized."));
_local5 = 0;
if (_local2.save_groups){
_local5 = _local2.save_groups.length;
_local3 = 0;
while (_local3 < _local5) {
_local14 = _local2.save_groups[_local3];
_local15 = [];
if (_local14.keys){
_local4 = 0;
while (_local4 < _local14.keys.length) {
_local18 = _local14.keys[_local4];
_local15.push(new SaveKey(_local18.name, _local18.id, _local18.type));
_local4++;
};
};
_local16 = [];
if (_local14.ratings){
_local3 = 0;
while (_local3 < _local14.ratings.length) {
_local19 = _local14.ratings[_local3];
_local16.push(new SaveRating(_local19.name, _local19.id, _local19.float, _local19.min, _local19.max));
_local3++;
};
};
_local17 = new SaveGroup(_connection, _local14.group_name, _local14.group_id, _local14.group_type, _local15, _local16);
_saveGroups[_local17.name] = _local17;
_saveGroupsArray.push(_local17);
Logger.logMessage(_local17);
_local3++;
};
};
Logger.logMessage((((_local5 + " save group") + ((_local5)!=1) ? "s" : "") + " initialized."));
if (_local2.save_file_path){
_saveFilePath = (_local2.save_file_path + "/");
SaveFile._saveFilePath = _saveFilePath;
Logger.logInternal(("Save file path: " + _saveFilePath));
};
if (_local2.image_file_path){
_imageFilePath = (_local2.image_file_path + "/");
SaveFile._imageFilePath = _imageFilePath;
Logger.logInternal(("Image file path: " + _imageFilePath));
};
Logger.logMessage("Connection complete!");
_connection.connectionState = APIConnection.CONNECTED;
dispatchEvent(APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion});
if (((_requestedSaveFileId) && (_requestedSaveGroupId))){
API.addEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded);
API.loadSaveFile(_requestedSaveFileId, false);
};
}
public static function disconnect():void{
var _local1:Medal;
if (!_connection.connected){
Logger.logWarning("The Newgrounds API is already disconnected.");
return;
};
_connection.reset();
for each (_local1 in _medals) {
_local1.removeEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
_local1.removeEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed);
};
_newVersion = false;
_medals = new Object();
_medalsArray = [];
_scoreBoards = new Object();
_scoreBoardsArray = [];
_saveGroups = new Object();
_saveGroupsArray = [];
_sharedObjects = new Object();
_imageFilePath = null;
_saveFilePath = null;
Logger.logMessage("Disconnected from the Newgrounds API.");
}
public static function loadNewgrounds():void{
_connection.loadInBrowser("loadNewgrounds");
}
public static function loadOfficialVersion():void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadOfficialVersion", false);
};
}
public static function loadMySite():void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadMySite");
};
}
public static function loadCustomLink(_saveGroupsArray:String):void{
if (_connection.assertInitialized()){
_connection.loadInBrowser("loadCustomLink", true, {link:_saveGroupsArray});
};
}
public static function getMedal(Event:String):Medal{
return (_medals[Event]);
}
public static function unlockMedal(_saveGroupsArray:String):void{
if (!assertConnected()){
return;
};
var _local2:Medal = _medals[_saveGroupsArray];
if (!_local2){
Logger.logError((("No medal named \"" + _saveGroupsArray) + "\" was found."));
return;
};
_local2.unlock();
}
private static function onMedalUnlocked(_saveGroupsArray:APIEvent):void{
var _local2:Medal;
var _local3:Object;
if (_saveGroupsArray.success){
_local2 = Medal(_saveGroupsArray.data);
if (hasUserSession){
_local3 = loadLocal(("medals_unlocked_" + username));
if (!_local3){
_local3 = new Object();
};
_local3[_local2.id] = true;
saveLocal(("medals_unlocked_" + username), _local3);
} else {
_local3 = loadLocal("medals_unlocked");
if (!_local3){
_local3 = new Object();
};
_local3[Medal(_saveGroupsArray.data).id] = true;
saveLocal("medals_unlocked", _local3);
Logger.logMessage((("User is not logged in. Medal \"" + _local2.name) + "\" unlocked locally."));
};
};
}
private static function onMedalUnlockConfirmed(_saveGroupsArray:APIEvent):void{
var _local2:Object;
if (hasUserSession){
_local2 = loadLocal(("medals_unlocked_" + username));
if (!_local2){
_local2 = new Object();
} else {
delete _local2[Medal(_saveGroupsArray.data).id];
};
saveLocal(("medals_unlocked_" + username), _local2);
};
}
public static function clearLocalMedals():void{
var _local1:Medal;
for each (_local1 in _medals) {
_local1.setUnlocked(false);
};
if (!hasUserSession){
saveLocal("medals_unlocked", new Object());
};
}
public static function getScoreBoard(flash.events:String):ScoreBoard{
if (!assertConnected()){
return (null);
};
return (_scoreBoards[flash.events]);
}
public static function loadScores(flash.events:String, flash.events:String="All-Time", flash.events:uint=1, flash.events:uint=10, flash.events:String=null):ScoreBoard{
if (!assertConnected()){
return (null);
};
var _local6:ScoreBoard = _scoreBoards[flash.events];
if (!_local6){
Logger.logError((("No scoreboard named \"" + flash.events) + "\" was found."));
dispatchEvent(APIEvent.SCORES_LOADED, null, APIEvent.ERROR_INVALID_ARGUMENT);
return (null);
};
_local6.period = flash.events;
_local6.firstResult = flash.events;
_local6.numResults = flash.events;
_local6.tag = flash.events;
_local6.loadScores();
return (_local6);
}
public static function postScore(_saveGroupsArray:String, _saveGroupsArray:Number, _saveGroupsArray:String=null):void{
if (!assertConnected()){
return;
};
if (!hasUserSession){
Logger.logError("The user must be logged-in to post a score.");
dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_NOT_LOGGED_IN);
return;
};
var _local4:ScoreBoard = _scoreBoards[_saveGroupsArray];
if (!_local4){
Logger.logError((("No scoreboard named \"" + _saveGroupsArray) + "\" was found."));
dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT);
return;
};
_local4.postScore(_saveGroupsArray, _saveGroupsArray);
}
public static function getSaveGroup(ENTER_FRAME:String):SaveGroup{
if (!assertConnected()){
return (null);
};
return (_saveGroups[ENTER_FRAME]);
}
private static function getSaveGroupById(ENTER_FRAME:uint):SaveGroup{
var _local2:SaveGroup;
for each (_local2 in _saveGroups) {
if (_local2.id == ENTER_FRAME){
return (_local2);
};
};
return (null);
}
public static function createSaveFile(reset:String):SaveFile{
if (!assertConnected()){
return (null);
};
var _local2:SaveGroup = getSaveGroup(reset);
if (!_local2){
Logger.logError((("The save group \"" + reset) + "\" was not found."));
return (null);
};
return (new SaveFile(_local2));
}
public static function loadSaveFile(_saveGroupsArray:uint, _saveGroupsArray:Boolean=true):void{
_connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:_saveGroupsArray, get_contents:_saveGroupsArray});
}
private static function onFileLoaded(_saveGroupsArray:APIEvent):void{
var _local2:SaveFile;
if (_saveGroupsArray.success){
_local2 = SaveFile.fromObject(getSaveGroupById(_saveGroupsArray.data.group_id), _saveGroupsArray.data.file);
if (_saveGroupsArray.data.get_contents){
_local2.load();
} else {
dispatchEvent(APIEvent.FILE_LOADED, _local2);
};
} else {
Logger.logError("Unable to load file:", _saveGroupsArray.error);
dispatchEvent(APIEvent.FILE_LOADED, null, _saveGroupsArray.error);
};
}
public static function createSaveQuery(event:String):SaveQuery{
if (!assertConnected()){
return (null);
};
var _local2:SaveGroup = getSaveGroup(event);
if (!_local2){
Logger.logError((("The save group \"" + event) + "\" was not found."));
return (null);
};
var _local3:SaveQuery = new SaveQuery(_local2);
return (_local3);
}
public static function createSaveQueryByDate(event:String, event:Boolean=true):SaveQuery{
var _local3:SaveQuery = createSaveQuery(event);
if (!_local3){
return (null);
};
_local3.sortOn(SaveQuery.CREATED_ON, event);
return (_local3);
}
public static function createSaveQueryByName(event:String, event:String, event:Boolean=false, event:Boolean=false):SaveQuery{
var _local5:SaveQuery = createSaveQuery(event);
_local5.addCondition(SaveQuery.FILE_NAME, (event) ? SaveQuery.OPERATOR_EQUAL : SaveQuery.OPERATOR_CONTAINS, event);
return (_local5);
}
public static function createSaveQueryByRating(event:String, event:String, event:Boolean=true):SaveQuery{
var _local4:SaveQuery = createSaveQuery(event);
_local4.sortOn(event, event);
return (_local4);
}
private static function onRequestedFileLoaded(_saveGroupsArray:APIEvent):void{
var _local2:SaveFile;
API.removeEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded);
if (_saveGroupsArray.success){
_local2 = (_saveGroupsArray.data as SaveFile);
if (_local2){
dispatchEvent(APIEvent.FILE_REQUESTED, _local2);
};
};
}
public static function addEventListener(_saveGroupsArray:String, _saveGroupsArray:Function, _saveGroupsArray:int=0, _saveGroupsArray:Boolean=true):void{
_dispatcher.addEventListener(_saveGroupsArray, _saveGroupsArray, false, _saveGroupsArray, _saveGroupsArray);
}
public static function removeEventListener(_saveGroupsArray:String, _saveGroupsArray:Function):void{
_dispatcher.removeEventListener(_saveGroupsArray, _saveGroupsArray);
}
private static function dispatchEvent(_saveGroupsArray:String, _saveGroupsArray=null, _saveGroupsArray:String=null):void{
_dispatcher.dispatchEvent(new APIEvent(_saveGroupsArray, _saveGroupsArray, _saveGroupsArray));
}
public static function saveLocal(Object:String, Object:Object):Boolean{
var sharedObject:SharedObject;
var sharedObjectName:String;
var saveId = Object;
var saveData = Object;
try {
sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey));
if (!_sharedObjects[saveId]){
_sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName);
};
sharedObject = _sharedObjects[saveId];
sharedObject.data.data = encodeData(saveData);
} catch(error:Error) {
Logger.logError("Unable to save local data.", error);
return (false);
};
return (true);
}
public static function loadLocal(http://www.ngads.com/adtest.php:String):Object{
var sharedObject:SharedObject;
var sharedObjectName:String;
var saveId = http://www.ngads.com/adtest.php;
try {
sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey));
if (!_sharedObjects[saveId]){
_sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName);
};
sharedObject = _sharedObjects[saveId];
if (((((sharedObject) && (sharedObject.data))) && (sharedObject.data.data))){
return (decodeData(sharedObject.data.data));
};
return (null);
} catch(error:Error) {
Logger.logError("Unable to load local data.", error);
};
return (null);
}
public static function logCustomEvent(_saveGroupsArray:String):void{
if (assertConnected()){
Logger.logMessage(("Logged event: " + _saveGroupsArray));
_connection.sendSimpleCommand("logCustomEvent", null, {event:_saveGroupsArray});
};
}
private static function encodeData(_saveGroups:Object):String{
if (!_connection.assertInitialized()){
return (null);
};
return (RC4.encrypt(JSON.encode(_saveGroups), _connection.encryptionKey));
}
private static function decodeData(http://www.ngads.com/adtest.php:String):Object{
if (!_connection.assertInitialized()){
return (null);
};
try {
return ((JSON.decode(RC4.decrypt(http://www.ngads.com/adtest.php, _connection.encryptionKey)) as Object));
} catch(error:Error) {
};
return (null);
}
public static function stopPendingCommands():void{
APICommand.stopPendingCommands();
Logger.logMessage("Pending commands stopped.");
}
public static function setFont(_saveGroupsArray:TextField, _saveGroupsArray:String):void{
var _local3:TextFormat;
var _local4:Boolean;
var _local5:TextFormat;
if (((_saveGroupsArray) && (_saveGroupsArray))){
_local3 = _saveGroupsArray.getTextFormat();
_local4 = _saveGroupsArray.embedFonts;
_local5 = new TextFormat(_saveGroupsArray);
_saveGroupsArray.defaultTextFormat = _local5;
_saveGroupsArray.setTextFormat(_local5);
_saveGroupsArray.embedFonts = true;
if (_saveGroupsArray.textWidth == 0){
_saveGroupsArray.embedFonts = _local4;
_saveGroupsArray.setTextFormat(_local3);
_saveGroupsArray.defaultTextFormat = _local3;
} else {
_saveGroupsArray.antiAliasType = "advanced";
_saveGroupsArray.sharpness = 120;
};
};
}
private static function trimWhitespace(_saveGroups:String):String{
if (!_saveGroups){
return (null);
};
var _local2:int;
while (_saveGroups.charAt(_local2) == " ") {
_local2++;
};
var _local3:int = (_saveGroups.length - 1);
while ((((_saveGroups.charAt(_local3) == " ")) && ((_local3 >= 0)))) {
_local3--;
};
return (_saveGroups.slice(_local2, (_local3 + 1)));
}
private static function checkRootLoaderInfo(_saveGroupsArray:Event):void{
var event = _saveGroupsArray;
var loaderInfo:LoaderInfo = _root.loaderInfo;
if (loaderInfo){
try {
while (loaderInfo.loader) {
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
return;
};
_root.removeEventListener(Event.ENTER_FRAME, checkRootLoaderInfo);
_connection.hostURL = loaderInfo.url;
doConnect(loaderInfo.parameters);
};
}
}
}//package com.newgrounds
Section 15
//APICommand (com.newgrounds.APICommand)
package com.newgrounds {
import flash.utils.*;
import flash.events.*;
import flash.net.*;
import com.newgrounds.encoders.json.*;
import com.newgrounds.crypto.*;
import com.newgrounds.encoders.*;
public class APICommand extends APIEventDispatcher {
private var _command:String;
private var _parameters:Object;
private var _secureParameters:Object;
private var _files:Object;
private var _preventCache:Boolean;
private var _hasTimeout:Boolean;
private var _timeoutTimer:Timer;
private var _loader:URLLoader;
private static const TIMEOUT_INTERVAL:uint = 10000;
private static const THROTTLE_INTERVAL:uint = 10050;
private static const THROTTLE_TICK_INTERVAL:uint = 1000;
private static const THROTTLE_THRESHOLD:uint = 24;
private static const ENCRYPTOR_RADIX:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static const CRLF:String = "
";
public static var bridge:Bridge;
private static var _throttleTimestamp:uint;
private static var _throttleCount:int = 0;
private static var _commandQueue:Array = [];
private static var _encryptor:BaseN = new BaseN(ENCRYPTOR_RADIX);
private static var _pendingCommands:Array = [];
private static var _throttleTimer:Timer = function ():Timer{
var _local1:* = new Timer(THROTTLE_TICK_INTERVAL, 0);
_local1.addEventListener(TimerEvent.TIMER, onThrottleTimer);
_local1.start();
return (_local1);
}();
public function APICommand(*:String){
this._command = *;
this._parameters = new Object();
this._secureParameters = new Object();
this._timeoutTimer = new Timer(TIMEOUT_INTERVAL, 1);
this._timeoutTimer.addEventListener(TimerEvent.TIMER, this.onTimeout);
this._hasTimeout = true;
}
public function get command():String{
return (this._command);
}
public function set command(\r\n:String):void{
this._command = \r\n;
}
public function get hasTimeout():Boolean{
return (this._hasTimeout);
}
public function set hasTimeout(\r\n:Boolean):void{
this._hasTimeout = \r\n;
}
public function get parameters():Object{
return (this._parameters);
}
public function set parameters(\r\n:Object):void{
var _local2:String;
this._parameters = new Object();
if (\r\n){
for (_local2 in \r\n) {
this._parameters[_local2] = \r\n[_local2];
};
};
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(\r\n:Boolean):void{
this._preventCache = \r\n;
}
public function get secureParameters():Object{
return (this._secureParameters);
}
public function set secureParameters(\r\n:Object):void{
var _local2:String;
this._secureParameters = new Object();
if (\r\n){
for (_local2 in \r\n) {
this._secureParameters[_local2] = \r\n[_local2];
};
};
}
public function get hasSecureParameters():Boolean{
var _local1:String;
for (_local1 in this._secureParameters) {
return (true);
};
return (false);
}
public function addFile(\r\n:String, \r\n:ByteArray, \r\n:String, \r\n:String="application/octet-stream"):void{
if (!this._files){
this._files = new Object();
};
var _local5:Object = {filename:\r\n, data:\r\n, dataField:\r\n, contentType:\r\n};
this._files[\r\n] = _local5;
}
public function removeFile(\r\n:String):void{
if (this._files){
delete this._files[\r\n];
};
}
public function clearFiles():void{
this._files = null;
}
public function close():void{
var _local1:uint;
if (this._loader){
try {
this._loader.close();
} catch(error:Error) {
};
this._timeoutTimer.stop();
_local1 = 0;
while (_local1 < _pendingCommands.length) {
if (_pendingCommands[_local1] == this){
_pendingCommands.splice(_local1, 1);
break;
};
_local1++;
};
this._loader = null;
};
}
public function loadInBrowser(\r\n:APIConnection, \r\n:Boolean):void{
var _local4:String;
var _local5:String;
this._parameters.command_id = this._command;
this._parameters.tracker_id = (\r\n.apiId) ? \r\n.apiId : 1;
if (\r\n.debug){
this._parameters.debug = 1;
};
var _local3:String = ((\r\n.apiURL + "?host=") + escape(\r\n.hostDomain));
for (_local4 in this._parameters) {
_local3 = (_local3 + ((("&" + escape(_local4)) + "=") + escape(this._parameters[_local4])));
};
if (\r\n){
_local5 = "_blank";
} else {
_local5 = "_top";
};
navigateToURL(new URLRequest(_local3), _local5);
}
public function send(\r\n:APIConnection):void{
if (_throttleCount >= THROTTLE_THRESHOLD){
_commandQueue.push({connection:\r\n, command:this});
} else {
this.sendInternal(\r\n);
};
}
private function sendInternal(\r\n:APIConnection):void{
var _local2:Object;
var _local3:String;
var _local4:*;
var _local5:uint;
var _local6:String;
var _local7:Object;
var _local8:String;
var _local9:String;
var _local10:String;
var _local11:String;
_local2 = new URLVariables();
_local2.command_id = this._command;
_local2.tracker_id = \r\n.apiId;
if (\r\n.debug){
_local2.debug = 1;
};
if (this._preventCache){
_local2.seed = Math.random();
};
for (_local3 in this._parameters) {
_local4 = this._parameters[_local3];
if (_local4 != null){
if ((_local4 is Boolean)){
_local2[_local3] = int(_local4);
} else {
_local2[_local3] = _local4;
};
};
};
if (this.hasSecureParameters){
_local7 = new Object();
for (_local3 in this._secureParameters) {
_local4 = this._secureParameters[_local3];
if (_local4 != null){
if ((_local4 is Boolean)){
_local7[_local3] = int(_local4);
} else {
_local7[_local3] = _local4;
};
};
};
_local8 = "";
_local5 = 0;
while (_local5 < 16) {
_local8 = (_local8 + ENCRYPTOR_RADIX.charAt(uint((Math.random() * ENCRYPTOR_RADIX.length))));
_local5++;
};
_local2.command_id = "securePacket";
_local7.command_id = this._command;
_local7.as_version = 3;
_local7.session_id = \r\n.sessionId;
_local7.user_email = \r\n.userEmail;
_local7.publisher_id = \r\n.publisherId;
_local7.seed = _local8;
_local9 = MD5.hash(_local8);
_local10 = RC4.encrypt(JSON.encode(_local7), \r\n.encryptionKey);
_local2.secure = encryptHex((_local9 + _local10));
};
Logger.logInternal("Sending packet:", _local2);
if (this._files){
_local11 = "";
_local5 = 0;
while (_local5 < 32) {
_local11 = (_local11 + String.fromCharCode(uint((97 + (Math.random() * 25)))));
_local5++;
};
_local6 = (("multipart/form-data; boundary=\"" + _local11) + "\"");
_local2 = this.buildMultipartData(_local11, _local2, this._files);
} else {
for (_local3 in _local2) {
if (typeof(_local2[_local3]) == "object"){
_local2[_local3] = JSON.encode(_local2[_local3]);
};
};
_local6 = "application/x-www-form-urlencoded";
};
_pendingCommands.push(this);
_throttleCount++;
_throttleTimestamp = getTimer();
this.startLoader(\r\n.apiURL, _local2, _local6);
}
private function onTimeout(\r\n):void{
this.close();
Logger.logError("Command timed out.");
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_TIMED_OUT));
}
private function onError(\r\n:String):void{
Logger.logError("Error when sending command:", \r\n);
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_UNKNOWN));
this.close();
}
private function onComplete(\r\n:String):void{
var response:Object;
var data = \r\n;
try {
if (((!(data)) || ((data == "")))){
throw (new Error());
};
Logger.logInternal("Received packet:", data);
response = JSON.decode(data);
if (!response){
throw (new Error());
};
if (bridge){
bridge.sendEvent(response.command_id, response);
};
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, response, (((response) && (response.success))) ? APIEvent.ERROR_NONE : APIEvent.ERROR_COMMAND_FAILED));
} catch(e) {
Logger.logError(("Invalid response returned from server: " + data));
dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_BAD_RESPONSE));
};
this.close();
}
private function startLoader(\r\n:String, \r\n:Object, \r\n:String):void{
var url = \r\n;
var data = \r\n;
var contentType = \r\n;
var urlRequest:URLRequest = new URLRequest(url);
urlRequest.data = data;
urlRequest.method = URLRequestMethod.POST;
urlRequest.contentType = contentType;
this._loader = new URLLoader();
this._loader.addEventListener(Event.COMPLETE, this.as3CompleteHandler);
this._loader.addEventListener(Event.OPEN, this.as3UpdateHandler);
this._loader.addEventListener(ProgressEvent.PROGRESS, this.as3UpdateHandler);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.as3ErrorHandler);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3ErrorHandler);
try {
this._loader.load(urlRequest);
if (this._hasTimeout){
this._timeoutTimer.start();
};
} catch(error) {
onError("Security error");
};
}
private function as3CompleteHandler(\r\n:Event):void{
this.onComplete(this._loader.data);
}
private function as3UpdateHandler(\r\n:Event):void{
if (this._timeoutTimer.running){
this._timeoutTimer.reset();
this._timeoutTimer.start();
};
}
private function as3ErrorHandler(\r\n:Event):void{
this.onError(\r\n.toString());
}
private function buildMultipartData(Timer:String, Timer:Object, Timer:Object):ByteArray{
var _local5:String;
var _local6:Object;
var _local4:ByteArray = new ByteArray();
_local4.endian = Endian.BIG_ENDIAN;
Timer = ("--" + Timer);
for (_local5 in Timer) {
_local4.writeUTFBytes((Timer + CRLF));
_local4.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local5) + "\"") + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes((Timer[_local5].toString() + CRLF));
};
if (this._files){
for each (_local6 in Timer) {
_local4.writeUTFBytes((Timer + CRLF));
_local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes((_local6.filename + CRLF));
_local4.writeUTFBytes((Timer + CRLF));
_local4.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local6.dataField) + "\"; filename=\"") + _local6.filename) + "\"") + CRLF));
_local4.writeUTFBytes((("Content-Type: " + _local6.contentType) + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeBytes(_local6.data);
_local4.writeUTFBytes(CRLF);
};
_local4.writeUTFBytes((Timer + CRLF));
_local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local4.writeUTFBytes(CRLF);
_local4.writeUTFBytes(("Submit Query" + CRLF));
};
_local4.writeUTFBytes((Timer + "--"));
_local4.position = 0;
return (_local4);
}
public static function stopPendingCommands():void{
var _local1:APICommand;
for each (_local1 in _pendingCommands) {
_local1.close();
};
_pendingCommands = [];
}
private static function onThrottleTimer(\r\n):void{
var _local2:Object;
if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL){
_throttleCount = 0;
_throttleCount = 0;
while (((_commandQueue.length) && ((_throttleCount < THROTTLE_THRESHOLD)))) {
_local2 = _commandQueue.shift();
_local2.command.send(_local2.connection);
_throttleCount++;
};
};
}
private static function encryptHex(http://adobe.com/AS3/2006/builtin:String):String{
var _local2:uint = (http://adobe.com/AS3/2006/builtin.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < http://adobe.com/AS3/2006/builtin.length) {
_local3 = (_local3 + _encryptor.encodeUint(uint(("0x" + http://adobe.com/AS3/2006/builtin.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
}
}//package com.newgrounds
Section 16
//APIConnection (com.newgrounds.APIConnection)
package com.newgrounds {
import flash.system.*;
public class APIConnection {
public var initialized:Boolean;
public var connectionState:String;// = "notConnected"
public var apiURL:String;// = "http://www.ngads.com/gateway_v2.php"
public var apiId:String;
public var debug:Boolean;
public var trackerId:uint;
public var publisherId:uint;
public var encryptionKey:String;
public var sessionId:String;
public var userEmail:String;
public var username:String;
public var userId:uint;
public var userpageFormat:uint;
private var _hostURL:String;
public var hostDomain:String;
public static const NOT_CONNECTED:String = "notConnected";
public static const CONNECTING:String = "connecting";
public static const CONNECTED:String = "connected";
public function APIConnection(){
this.reset();
}
public function get hostURL():String{
return (this._hostURL);
}
public function set hostURL(_hostURL:String):void{
var _local2:Array;
this._hostURL = _hostURL;
this.hostDomain = null;
if (this._hostURL){
_local2 = this._hostURL.split("/");
if (((!((_local2[0] == "file:"))) && (!((this._hostURL == "localhost"))))){
this.hostDomain = _local2[2];
};
};
if (!this.hostDomain){
this.hostDomain = "localhost";
};
}
public function get sandboxType():String{
return (Security.sandboxType);
}
public function get isNetworkHost():Boolean{
switch (this.sandboxType){
case "localWithFile":
case "localWithNetwork":
case "localTrusted":
case "application":
return (false);
case "remote":
default:
return (true);
};
}
public function get hasUserSession():Boolean{
return (((((!((this.sessionId == null))) && (!((this.sessionId == ""))))) && (!((this.publisherId == 0)))));
}
public function get connected():Boolean{
return ((this.connectionState == CONNECTED));
}
public function reset():void{
this.connectionState = NOT_CONNECTED;
this.encryptionKey = null;
this.sessionId = null;
this.userEmail = null;
this.username = null;
this.userId = 0;
this.userpageFormat = 0;
}
public function assertInitialized():Boolean{
if (!this.initialized){
Logger.logError("You must initialized the API using API.connect() before using this command.");
return (false);
};
return (true);
}
public function assertConnected():Boolean{
if (!(this.connectionState) == CONNECTED){
Logger.logError("You must establish a connection using API.connect() before using this command.");
return (false);
};
return (true);
}
public function sendSimpleCommand(_hostURL:String, _hostURL:Function, _hostURL:Object=null, _hostURL:Object=null):void{
var _local5:APICommand = new APICommand(_hostURL);
_local5.parameters = _hostURL;
_local5.secureParameters = _hostURL;
if (_hostURL != null){
_local5.addEventListener(APIEvent.COMMAND_COMPLETE, _hostURL);
};
_local5.send(this);
}
public function sendCommand(_hostURL:APICommand):void{
_hostURL.send(this);
}
public function loadInBrowser(_hostURL:String, _hostURL:Boolean=true, _hostURL:Object=null):void{
var _local4:APICommand = new APICommand(_hostURL);
_local4.parameters = _hostURL;
_local4.loadInBrowser(this, _hostURL);
}
}
}//package com.newgrounds
Section 17
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _error:String;
static const COMMAND_COMPLETE:String = "commandComplete";
static const MEDAL_UNLOCK_CONFIRMED:String = "medalUnlockConfirmed";
static const ICON_LOADED:String = "iconLoaded";
public static const API_CONNECTED:String = "movieConnected";
public static const LOG:String = "log";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const SCORE_POSTED:String = "scorePosted";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_REQUESTED:String = "fileRequested";
public static const VOTE_COMPLETE:String = "voteComplete";
public static const ERROR_NONE:String = "noError";
public static const ERROR_UNKNOWN:String = "unknownError";
public static const ERROR_COMMAND_FAILED:String = "commandFailed";
public static const ERROR_NOT_CONNECTED:String = "notConnected";
public static const ERROR_INVALID_ARGUMENT:String = "invalidArgument";
public static const ERROR_TIMED_OUT:String = "timedOut";
public static const ERROR_BAD_FILE:String = "badFile";
public static const ERROR_BAD_RESPONSE:String = "badResponse";
public static const ERROR_SENDING_COMMAND:String = "errorSendingCommand";
public static const ERROR_HOST_BLOCKED:String = "hostBlocked";
public static const ERROR_ALREADY_VOTED:String = "alreadyVoted";
public static const ERROR_NOT_LOGGED_IN:String = "notLoggedIn";
public static const ERROR_WRONG_ENCRYPTION_KEY:String = "wrongEncryptionKey";
public function APIEvent(*:String, *=null, *:String=null){
super(*);
if (((((!(*)) || ((* == "")))) || ((* == ERROR_NONE)))){
this._error = ERROR_NONE;
this._success = true;
} else {
this._error = *;
this._success = false;
};
if (*){
this._data = *;
} else {
this._data = {};
};
}
override public function clone():Event{
return (new APIEvent(type, this._data, this._error));
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
public function get error():String{
return (this._error);
}
}
}//package com.newgrounds
Section 18
//APIEventDispatcher (com.newgrounds.APIEventDispatcher)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import com.newgrounds.*;
class APIEventDispatcher extends EventDispatcher {
private static var _globalDispatcher:EventDispatcher;
private static var _eventQueue:Array = initEventQueue();
private static var _ticker:Sprite;
override public function dispatchEvent(Array:Event):Boolean{
_eventQueue.push({dispatcher:this, event:Array});
return (true);
}
private function actualDispatchEvent(_globalDispatcher:Event):void{
var _local2:Boolean = super.dispatchEvent(_globalDispatcher);
if (((_globalDispatcher) && (!((this == _globalDispatcher))))){
_globalDispatcher.dispatchEvent(_globalDispatcher);
};
}
public static function get globalDispatcher():EventDispatcher{
return (_globalDispatcher);
}
public static function set globalDispatcher(_globalDispatcher:EventDispatcher):void{
_globalDispatcher = _globalDispatcher;
}
private static function initEventQueue():Array{
_ticker = new Sprite();
_ticker.addEventListener(Event.ENTER_FRAME, runEventQueue);
return ([]);
}
private static function runEventQueue(_globalDispatcher):void{
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local2:uint = _eventQueue.length;
if (_local2){
_local3 = _eventQueue;
_eventQueue = [];
_local4 = 0;
while (_local4 < _local2) {
_local5 = _local3[_local4];
_local5.dispatcher.actualDispatchEvent(_local5.event);
_local4++;
};
};
}
}
}//package com.newgrounds
Section 19
//BitmapLoader (com.newgrounds.BitmapLoader)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class BitmapLoader extends APIEventDispatcher {
private var _url:String;
private var _bitmapData:BitmapData;
private var _loaded:Boolean;// = true
private var _loader:Loader;
private static const LOADER_CONTEXT:LoaderContext = new LoaderContext(true);
static var _cacheSeed:uint = 0;
public function BitmapLoader(*:BitmapData, *:String){
this._bitmapData = *;
this._url = *;
}
public function get url():String{
return (this._url);
}
public function set url(_url:String):void{
this._loaded = false;
this._url = _url;
}
public function get bitmapData():BitmapData{
return (this._bitmapData);
}
public function set bitmapData(_url:BitmapData):void{
this._bitmapData = _url;
this._loaded = true;
}
public function get loaded():Boolean{
return (this._loaded);
}
private function createLoader():Loader{
var _local1:Loader = new Loader();
var _local2:URLRequest = new URLRequest(this._url);
_local2.method = URLRequestMethod.GET;
_local2.data = _cacheSeed.toString();
_local1.load(_local2, LOADER_CONTEXT);
return (_local1);
}
private function disposeLoader():void{
if (this._loader){
try {
this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.onLoadComplete);
this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete);
this._loader.unload();
} catch(error) {
};
this._loader = null;
};
}
public function load():void{
if (((!(this._url)) || ((this._url == "")))){
this.onLoadComplete(null);
return;
};
this.disposeLoader();
this._loader = this.createLoader();
this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onLoadComplete);
this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete);
}
public function attachBitmap(http://adobe.com/AS3/2006/builtin:DisplayObjectContainer):Sprite{
var _local2:Sprite = new Sprite();
if (((((!(this._loaded)) && (this._url))) && (!((this._url == ""))))){
if (!this._loader){
this.load();
};
_local2.addChild(this.createLoader());
} else {
_local2.addChild(new Bitmap(this._bitmapData));
};
if (http://adobe.com/AS3/2006/builtin){
http://adobe.com/AS3/2006/builtin.addChild(_local2);
};
return (_local2);
}
private function onLoadComplete(_url:Event):void{
var bitmapData:BitmapData;
var event = _url;
try {
if (((((((event) && ((event.type == Event.COMPLETE)))) && (this._loader))) && ((this._loader.content is Bitmap)))){
bitmapData = Bitmap(this._loader.content).bitmapData;
this._bitmapData = bitmapData;
this._loaded = true;
};
} catch(error:SecurityError) {
if (bitmapData){
bitmapData.dispose();
};
};
this.disposeLoader();
dispatchEvent(new APIEvent(APIEvent.ICON_LOADED, this, (this._loaded) ? null : APIEvent.ERROR_BAD_FILE));
}
}
}//package com.newgrounds
Section 20
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(*:String){
this._widgetId = *;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
try {
this._inConnection.connect(("rec_" + this._widgetId));
} catch(error) {
};
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
Logger.addEventListener(APIEvent.LOG, this.onLogMessage);
}
private function onLogMessage(APIEvent:APIEvent):void{
try {
this._outConnection.send(this._widgetId, "sendEvent", "trace", String(APIEvent.data));
} catch(error) {
};
}
public function sendEvent(APIEvent:String, APIEvent:Object):void{
if (this._outConnection){
APIEvent = {data:APIEvent};
this._outConnection.send(this._widgetId, "sendEvent", APIEvent, APIEvent);
};
}
public function receiveEvent(APIEvent:String, APIEvent:Object):void{
}
private function onStatus(APIEvent:Event):void{
}
}
}//package com.newgrounds
Section 21
//Logger (com.newgrounds.Logger)
package com.newgrounds {
import flash.events.*;
public class Logger {
static const PRIORITY_INTERNAL:uint = 0;
public static const PRIORITY_MESSAGE:uint = 1;
public static const PRIORITY_WARNING:uint = 2;
public static const PRIORITY_ERROR:uint = 3;
public static const PRIORITY_MAX:uint = 4;
private static const HEADER:String = "[Newgrounds API] :: ";
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var _messageLevel:uint = 1;
private static var _throwLevel:uint = 4;
static function logInternal(... _args):void{
log(PRIORITY_INTERNAL, _args);
}
public static function logMessage(... _args):void{
log(PRIORITY_MESSAGE, _args);
}
public static function logWarning(... _args):void{
log(PRIORITY_WARNING, _args);
}
public static function logError(... _args):void{
log(PRIORITY_ERROR, _args);
}
private static function log(EventDispatcher:uint=1, EventDispatcher:Array=null):void{
var _local3:uint;
if (EventDispatcher >= _messageLevel){
_local3 = 0;
while (_local3 < EventDispatcher.length) {
trace((HEADER + EventDispatcher[_local3]));
_eventDispatcher.dispatchEvent(new APIEvent(APIEvent.LOG, EventDispatcher[_local3]));
_local3++;
};
};
if (EventDispatcher >= _throwLevel){
throw (new Error(EventDispatcher.join("\n")));
};
}
public static function addEventListener(EventDispatcher:String, EventDispatcher:Function):void{
_eventDispatcher.addEventListener(EventDispatcher, EventDispatcher, false, 0, false);
}
}
}//package com.newgrounds
Section 22
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.display.*;
import com.newgrounds.assets.*;
public class Medal extends APIEventDispatcher {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _description:String;
private var _secret:Boolean;
private var _value:uint;
private var _unlocked:Boolean;
private var _difficulty:String;
private var _iconLoader:BitmapLoader;
public static const ICON_WIDTH:uint = 50;
public static const ICON_HEIGHT:uint = 50;
public static const DIFFICULTY_EASY:String = "Easy";
public static const DIFFICULTY_MODERATE:String = "Moderate";
public static const DIFFICULTY_CHALLENGING:String = "Challenging";
public static const DIFFICULTY_DIFFICULT:String = "Difficult";
public static const DIFFICULTY_BRUTAL:String = "Brutal";
private static const DIFFICULTIES:Array = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL];
public static const DEFAULT_ICON:BitmapData = new DefaultMedalIcon(ICON_WIDTH, ICON_HEIGHT);
public function Medal(*:APIConnection, *:uint, *:String, *:String, *:Boolean, *:Boolean, *:uint, *:uint, *:String){
this._connection = *;
this._id = *;
this._name = *;
this._description = *;
this._secret = *;
this._unlocked = *;
this._value = *;
this._difficulty = DIFFICULTIES[*];
this._iconLoader = new BitmapLoader(DEFAULT_ICON, *);
this._iconLoader.load();
}
public function get difficulty():String{
return (this._difficulty);
}
public function get icon():BitmapData{
return (this._iconLoader.bitmapData);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get description():String{
return (this._description);
}
public function get secret():Boolean{
return (this._secret);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function get value():uint{
return (this._value);
}
override public function toString():String{
return (((((((("Medal: " + this._name) + "\t\t(") + (this._unlocked) ? "unlocked, " : "locked, ") + this._value) + "pts, ") + this._difficulty) + ")"));
}
public function attachIcon(com.newgrounds:APIEventDispatcher:DisplayObjectContainer):Sprite{
return (this._iconLoader.attachBitmap(com.newgrounds:APIEventDispatcher));
}
public function unlock():void{
if (this._unlocked){
Logger.logWarning((("Medal \"" + this._name) + "\" is already unlocked."));
return;
};
Logger.logMessage((("Unlocking medal \"" + this.name) + "\"..."));
this._unlocked = true;
if (this._connection.hasUserSession){
this._connection.sendSimpleCommand("unlockMedal", this.onUnlockConfirmed, null, {medal_id:this.id});
};
dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCKED, this));
}
function setUnlocked(name:Boolean):void{
this._unlocked = name;
}
private function onUnlockConfirmed(name:APIEvent):void{
if (name.success){
Logger.logMessage((("Medal \"" + this.name) + "\" unlocked."));
} else {
Logger.logError((("Failed to unlock \"" + this.name) + "\"!"));
};
dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCK_CONFIRMED, this, name.error));
}
}
}//package com.newgrounds
Section 23
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.newgrounds.encoders.*;
import com.newgrounds.assets.*;
import flash.geom.*;
public class SaveFile extends APIEventDispatcher {
private var _group:SaveGroup;
private var _name:String;
private var _id:uint;
private var _description:String;
private var _authorId:uint;
private var _authorName:String;
private var _createdDate:String;
private var _modifiedDate:String;
private var _views:uint;
private var _readOnly:Boolean;
private var _public:Boolean;
private var _approved:Boolean;
private var _draft:Boolean;
private var _iconLoader:BitmapLoader;
private var _keys:Object;
private var _ratings:Object;
private var _dataURL:String;
private var _data;
private var _dataLoaded:Boolean;
private var _encodedData;
private var _encoderQueue:Array;
private var _encoding:Boolean;
private var _encodingParent:Object;
private var _encodingProperty:String;
private var _fileSize:uint;
private var _dataLoader:URLLoader;
public static const ICON_WIDTH:uint = 90;
public static const ICON_HEIGHT:uint = 90;
private static const STATUS_PRIVATE:uint = 0;
private static const STATUS_SHARED:uint = 1;
private static const STATUS_UNAPPROVED:uint = 2;
private static const STATUS_APPROVED:uint = 3;
public static const DEFAULT_ICON:BitmapData = new DefaultSaveIcon(ICON_WIDTH, ICON_HEIGHT);
private static var _currentFile:SaveFile;
static var _imageFilePath:String = "";
static var _saveFilePath:String = "";
public function SaveFile(*:SaveGroup){
this._keys = new Object();
this._ratings = new Object();
super();
this._iconLoader = new BitmapLoader(DEFAULT_ICON, null);
this._group = *;
}
public function get group():SaveGroup{
return (this._group);
}
public function get name():String{
return (this._name);
}
public function set name(ratings:String):void{
this._name = ratings;
}
public function get description():String{
return (this._description);
}
public function set description(ratings:String):void{
this._description = ratings;
}
public function get id():uint{
return (this._id);
}
public function get data():Object{
return (this._data);
}
public function set data(ratings:Object):void{
this._data = ratings;
}
public function get bytesLoaded():uint{
if (this._data){
return (this.bytesTotal);
};
if (!this._dataLoader){
return (0);
};
return (this._dataLoader.bytesLoaded);
}
public function get bytesTotal():uint{
return (this._fileSize);
}
public function get readOnly():Boolean{
return (this._readOnly);
}
public function get draft():Boolean{
return (this._draft);
}
public function set draft(ratings:Boolean):void{
this._draft = ratings;
}
public function get authorId():uint{
return (this._authorId);
}
public function get authorName():String{
return (this._authorName);
}
public function get keys():Object{
return (this._keys);
}
public function get ratings():Object{
return (this._ratings);
}
public function get views():uint{
return (this._views);
}
public function get createdDate():String{
return (this._createdDate);
}
public function get updatedDate():String{
return (this._modifiedDate);
}
override public function toString():String{
return (("Save File: " + this._name));
}
public function get icon():BitmapData{
return (this._iconLoader.bitmapData);
}
public function set icon(ratings:BitmapData):void{
this.createIcon(ratings);
}
public function get iconLoaded():Boolean{
return (this._iconLoader.loaded);
}
public function createIcon(ratings:IBitmapDrawable):void{
var _local3:Number;
var _local4:Number;
var _local8:Number;
var _local9:Rectangle;
var _local2:BitmapData = new BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
var _local5:Number = 0;
var _local6:Number = 0;
_local3 = Object(ratings).width;
_local4 = Object(ratings).height;
if ((ratings is DisplayObject)){
_local9 = DisplayObject(ratings).getBounds(null);
_local5 = _local9.left;
_local6 = _local9.top;
};
var _local7:Matrix = new Matrix();
_local8 = Math.min((ICON_WIDTH / _local3), (ICON_HEIGHT / _local4));
_local7.translate(-(_local5), -(_local6));
_local7.scale(_local8, _local8);
_local7.translate(((ICON_WIDTH - (_local3 * _local8)) / 2), ((ICON_HEIGHT - (_local4 * _local8)) / 2));
_local2.draw(ratings, _local7);
this._iconLoader.bitmapData = _local2;
}
public function attachIcon(com.newgrounds:SaveFile/readOnly/get:DisplayObjectContainer):Sprite{
if (this._iconLoader){
return (this._iconLoader.attachBitmap(com.newgrounds:SaveFile/readOnly/get));
};
Logger.logError("No icon available for this sumbission.");
return (null);
}
public function save():void{
if (!this._group.connection.hasUserSession){
Logger.logError("The user must be logged-in to save a file.");
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, null, APIEvent.ERROR_NOT_LOGGED_IN));
return;
};
BitmapLoader._cacheSeed++;
_currentFile = this;
this.encodeData(true);
}
private function doSave():void{
var _local3:String;
var _local4:Array;
var _local5:String;
var _local6:SaveKey;
var _local7:SaveRating;
var _local8:ByteArray;
var _local1:APICommand = new APICommand("saveFile");
_local1.secureParameters.group = this._group.id;
_local1.secureParameters.user_name = this._group.connection.username;
_local1.secureParameters.filename = this._name;
_local1.secureParameters.description = this._description;
if (this._draft){
_local1.secureParameters.draft = true;
};
if (((this._id) && (!(this._readOnly)))){
_local1.secureParameters.overwrite = 1;
_local1.secureParameters.save_id = this._id;
};
var _local2:Array = [];
for (_local3 in this._keys) {
_local6 = this._group.getKey(_local3);
if (_local6){
_local2.push({id:_local6.id, value:_local6.validateValue(this._keys[_local3])});
} else {
Logger.logError((((("No key named \"" + _local3) + "\" in save group \"") + this._group.name) + "\"."));
};
};
_local1.secureParameters.keys = _local2;
_local4 = [];
for (_local5 in this._ratings) {
_local7 = this._group.getRating(_local5);
if (_local7){
_local4.push({id:_local7.id, value:_local7.validateValue(this._ratings[_local5])});
} else {
Logger.logError((((("No rating named \"" + _local5) + "\" in save group \"") + this._group.name) + "\"."));
};
};
_local1.secureParameters.ratings = _local4;
_local8 = new ByteArray();
_local8.writeObject(this._encodedData);
_local8.compress();
_local1.addFile("file", _local8, "file");
if (this.iconLoaded){
_local1.addFile("thumbnail", PNGEncoder.encode(this.icon), "thumbnail");
};
_local1.addEventListener(APIEvent.COMMAND_COMPLETE, this.onSaveComplete);
this._group.connection.sendCommand(_local1);
}
private function encodeData(ratings:Boolean):void{
this._encoderQueue = [];
this._encoding = ratings;
if (ratings){
this._encodedData = this._data;
this.preEncodeObject(this, "_encodedData");
} else {
this.preEncodeObject(this, "_data");
};
this.encodeObject();
}
private function preEncodeObject(ratings:Object, ratings:String):void{
var _local4:Boolean;
var _local6:Boolean;
var _local7:String;
var _local3:Object = ratings[ratings];
try {
if (this._encoding){
_local4 = (_local3 is BitmapData);
} else {
_local4 = (_local3.type == "__bitmap");
};
} catch(error) {
};
var _local5:Object = _local3;
_local6 = (_local3 is ByteArray);
if (_local4){
this._encoderQueue.push({parent:ratings, property:ratings});
} else {
if ((((typeof(_local3) == "object")) && (!(_local6)))){
if (this._encoding){
if ((_local3 is Array)){
_local5 = [];
} else {
_local5 = {};
};
for (_local7 in _local3) {
_local5[_local7] = _local3[_local7];
};
ratings[ratings] = _local5;
};
for (_local7 in _local5) {
this.preEncodeObject(_local5, _local7);
};
};
};
}
private function encodeObject():void{
var _local5:Object;
if (!this._encoderQueue.length){
if (this._encoding){
this.doSave();
} else {
this._dataLoaded = true;
this.checkLoadComplete();
};
return;
};
var _local1:Object = this._encoderQueue.pop();
var _local2:Object = _local1.parent;
var _local3:String = _local1.property;
var _local4:Object = _local2[_local3];
if (this._encoding){
_local5 = {type:"__bitmap", width:_local4.width, height:_local4.height, transparent:_local4.transparent};
_local2[_local3] = _local5;
_local5.data = new ByteArray();
_local5.data.writeBytes(_local4.getPixels(_local4.rect));
_local5.data.position = 0;
} else {
_local5 = new BitmapData(_local4.width, _local4.height, _local4.transparent);
new BitmapData(_local4.width, _local4.height, _local4.transparent).setPixels(_local5.rect, _local4.data);
_local2[_local3] = _local5;
};
this.encodeObject();
}
private function onIconLoaded(ratings:APIEvent):void{
if (((!(ratings.success)) && (this._iconLoader.url))){
Logger.logWarning("Unable to load the icon for this save file.");
};
this._iconLoader.removeEventListener(APIEvent.ICON_LOADED, this.onIconLoaded);
this.checkLoadComplete();
}
private function checkLoadComplete():void{
if (((this._dataLoaded) && (this.iconLoaded))){
Logger.logMessage("Data loaded.");
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this));
};
}
private function onDataLoaded(ratings):void{
var byteArray:ByteArray;
var data = ratings;
try {
if (data){
byteArray = data;
byteArray.uncompress();
this._data = byteArray.readObject();
this.encodeData(false);
};
} catch(error:Error) {
Logger.logError("Error while loading data:", error);
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE));
};
}
private function onDataError(ratings:String):void{
Logger.logError("Unable to load data:", ratings);
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE));
}
private function onSaveComplete(ratings:APIEvent):void{
if (ratings.success){
Logger.logMessage((("File \"" + this._name) + "\" saved!"));
if (ratings.data){
this._id = ratings.data.save_id;
this._dataURL = unescape(ratings.data.file_url);
};
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this));
} else {
Logger.logError((("Error saving file \"" + this._name) + "\":"), ratings.error);
dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this, ratings.error));
};
}
public function sendVote(ratings:String, ratings:Number):void{
var _local3:SaveRating = this._group.getRating(ratings);
if (!_local3){
Logger.logError((("No save rating named \"" + ratings) + "\" exists for this save group."));
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
ratings = _local3.validateValue(ratings);
if (isNaN(ratings)){
Logger.logError((((((((("Invalid vote (" + ratings) + "). ") + ratings) + " allows a range of ") + _local3.minimum) + "-") + _local3.maximum) + "."));
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
Logger.logMessage((((((("Voting " + ratings) + " for ") + ratings) + " on ") + this._name) + "..."));
this._group.connection.sendSimpleCommand("rateSaveFile", this.onVoteComplete, null, {group:this._group.id, save_id:this._id, rating_id:_local3.id, vote:ratings});
}
private function onVoteComplete(ratings:APIEvent):void{
var _local3:SaveRating;
var _local2:String = ratings.error;
if (ratings.data.already_voted){
Logger.logError("Vote failed. You've already voted on this rating today.");
_local2 = APIEvent.ERROR_ALREADY_VOTED;
};
if (_local2 == APIEvent.ERROR_NONE){
_local3 = this._group.getRatingById(ratings.data.rating_id);
if (_local3){
this._ratings[_local3.name] = _local3.validateValue(ratings.data.score);
};
};
dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, this, _local2));
}
public function clone():SaveFile{
var _local2:String;
var _local1:SaveFile = new SaveFile(this._group);
_local1._data = this._data;
_local1._description = this._description;
_local1._draft = this._draft;
_local1._fileSize = this._fileSize;
_local1._iconLoader.bitmapData = this._iconLoader.bitmapData;
for (_local2 in this._keys) {
_local1._keys[_local2] = this._keys[_local2];
};
for (_local2 in this._ratings) {
_local1._ratings[_local2] = this._ratings[_local2];
};
_local1._name = this._name;
return (_local1);
}
public function load():void{
_currentFile = this;
this._dataLoaded = false;
this._data = null;
if (!this.iconLoaded){
this._iconLoader.addEventListener(APIEvent.ICON_LOADED, this.onIconLoaded);
this._iconLoader.load();
};
this._dataLoader = new URLLoader();
this._dataLoader.dataFormat = URLLoaderDataFormat.BINARY;
this._dataLoader.addEventListener(Event.COMPLETE, this.as3DataLoaded);
this._dataLoader.addEventListener(IOErrorEvent.IO_ERROR, this.as3DataError);
this._dataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3DataError);
this._dataLoader.load(new URLRequest(this._dataURL));
}
private function as3DataLoaded(ratings:Event):void{
this.onDataLoaded(this._dataLoader.data);
}
private function as3DataError(ratings:Event):void{
this.onDataError(ratings.toString());
}
private function decodeObject(DefaultSaveIcon:Object):Object{
var _local2:BitmapData;
var _local3:String;
if (getQualifiedClassName(DefaultSaveIcon) == "Object"){
if (DefaultSaveIcon.type == "__bitmap"){
_local2 = new BitmapData(DefaultSaveIcon.width, DefaultSaveIcon.height, DefaultSaveIcon.transparent);
_local2.setPixels(_local2.rect, DefaultSaveIcon.data);
DefaultSaveIcon = _local2;
} else {
for (_local3 in DefaultSaveIcon) {
DefaultSaveIcon[_local3] = this.decodeObject(DefaultSaveIcon[_local3]);
};
};
};
return (DefaultSaveIcon);
}
public static function get currentFile():SaveFile{
return (_currentFile);
}
static function fromObject(DEFAULT_ICON:SaveGroup, DEFAULT_ICON:Object):SaveFile{
var _local4:Object;
var _local5:Object;
var _local6:SaveKey;
var _local7:SaveRating;
var _local3:SaveFile = new SaveFile(DEFAULT_ICON);
_local3._name = DEFAULT_ICON.filename;
_local3._description = DEFAULT_ICON.description;
_local3._id = DEFAULT_ICON.save_id;
_local3._authorId = DEFAULT_ICON.user_id;
_local3._authorName = DEFAULT_ICON.user_name;
_local3._createdDate = DEFAULT_ICON.created;
_local3._modifiedDate = DEFAULT_ICON.last_update;
_local3._views = DEFAULT_ICON.views;
if (((DEFAULT_ICON.thumb) && (!((DEFAULT_ICON.thumb == ""))))){
_local3._iconLoader.url = (_imageFilePath + DEFAULT_ICON.thumb);
};
_local3._dataURL = (_saveFilePath + DEFAULT_ICON.file);
_local3._fileSize = DEFAULT_ICON.file_size;
_local3._approved = !((DEFAULT_ICON.status == STATUS_UNAPPROVED));
_local3._readOnly = false;
_local3._public = ((!((DEFAULT_ICON.status == STATUS_PRIVATE))) && (!((DEFAULT_ICON.status == STATUS_UNAPPROVED))));
for each (_local4 in DEFAULT_ICON.keys) {
_local6 = DEFAULT_ICON.getKeyById(_local4.id);
if (_local6){
_local3._keys[_local6.name] = _local6.validateValue(_local4.value);
};
};
for each (_local5 in DEFAULT_ICON.ratings) {
_local7 = DEFAULT_ICON.getRatingById(_local5.id);
if (_local7){
_local3._ratings[_local7.name] = _local7.validateValue(_local5.score);
};
};
return (_local3);
}
}
}//package com.newgrounds
Section 24
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keysArray:Array;
private var _ratingsArray:Array;
private var _keys:Object;
private var _ratings:Object;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public function SaveGroup(*:APIConnection, *:String, *:uint, *:uint, *:Array, *:Array){
var _local7:uint;
var _local8:SaveKey;
var _local9:SaveRating;
super();
this._connection = *;
this._id = *;
this._name = *;
this._type = *;
this._keysArray = *;
this._ratingsArray = *;
this._keys = new Object();
this._ratings = new Object();
for each (_local8 in *) {
this._keys[_local8.name] = _local8;
};
for each (_local9 in *) {
this._ratings[_local9.name] = _local9;
};
}
public function get connection():APIConnection{
return (this._connection);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function get id():uint{
return (this._id);
}
public function get keys():Array{
return (this._keysArray);
}
public function get ratings():Array{
return (this._ratingsArray);
}
public function getKey(TYPE_PUBLIC:String):SaveKey{
return (this._keys[TYPE_PUBLIC]);
}
public function getRating(TYPE_MODERATED:String):SaveRating{
return (this._ratings[TYPE_MODERATED]);
}
public function getKeyById(TYPE_PUBLIC:uint):SaveKey{
var _local2:SaveKey;
for each (_local2 in this._keys) {
if (_local2.id == TYPE_PUBLIC){
return (_local2);
};
};
return (null);
}
public function getRatingById(TYPE_MODERATED:uint):SaveRating{
var _local2:SaveRating;
for each (_local2 in this._ratings) {
if (_local2.id == TYPE_MODERATED){
return (_local2);
};
};
return (null);
}
public function toString():String{
return (((((("SaveGroup: " + this.name) + " Keys: ") + this._keysArray) + " Ratings: ") + this._ratingsArray));
}
}
}//package com.newgrounds
Section 25
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _name:String;
private var _id:uint;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(*:String, *:uint, *:uint){
this._name = *;
this._id = *;
this._type = *;
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function validateValue(*){
var _local2:int;
switch (this._type){
case TYPE_INTEGER:
* = Number(*);
if (!isNaN(*)){
_local2 = int(*);
if (_local2 != *){
Logger.logWarning((((((("Float value " + *) + " given for integer key \"") + this._name) + "\". Clamping to ") + _local2) + "."));
};
return (_local2);
};
break;
case TYPE_FLOAT:
* = Number(*);
if (!isNaN(*)){
return (isNaN(Number(*)));
};
break;
case TYPE_BOOLEAN:
return (Boolean(*));
case TYPE_STRING:
return ((*) ? *.toString() : "");
};
return (null);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 26
//SaveQuery (com.newgrounds.SaveQuery)
package com.newgrounds {
public class SaveQuery extends APIEventDispatcher {
private var _connection:APIConnection;
private var _group:SaveGroup;
private var _page:uint;// = 1
private var _resultsPerPage:uint;// = 10
private var _isRandomized:Boolean;// = false
private var _files:Array;
private var _totalResults:uint;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortFields:Array;
public static const FILE_ID:String = "fileId";
public static const AUTHOR_ID:String = "authorId";
public static const AUTHOR_NAME:String = "authorName";
public static const FILE_NAME:String = "fileName";
public static const CREATED_ON:String = "createdOn";
public static const UPDATED_ON:String = "updatedOn";
public static const FILE_VIEWS:String = "fileViews";
public static const FILE_STATUS:String = "fileStatus";
private static const FILE_FIELDS:Array = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS];
public static const OPERATOR_EQUAL:String = "=";
public static const OPERATOR_LESS_THAN:String = "<";
public static const OPERATOR_GREATER_THAN:String = ">";
public static const OPERATOR_NOT_EQUAL:String = "!=";
public static const OPERATOR_LESS_OR_EQUAL:String = "<=";
public static const OPERATOR_GREATER_OR_EQUAL:String = ">=";
public static const OPERATOR_CONTAINS:String = "*";
public static const OPERATOR_NOT_CONTAINS:String = "!*";
public static const OPERATOR_NOT_BEGINS_WITH:String = "!*=";
public static const OPERATOR_NOT_ENDS_WITH:String = "!=*";
public static const OPERATOR_BEGINS_WITH:String = "*=";
public static const OPERATOR_ENDS_WITH:String = "=*";
private static const TABLE_FILES:uint = 1;
private static const TABLE_KEYS:uint = 2;
private static const TABLE_RATINGS:uint = 3;
public function SaveQuery(*:SaveGroup){
this._files = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortFields = [];
super();
this._group = *;
this._connection = *.connection;
this.includeAllFields();
}
public function get group():SaveGroup{
return (this._group);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(OPERATOR_ENDS_WITH:uint):void{
this._resultsPerPage = Math.min(Math.max(OPERATOR_ENDS_WITH, 1), 100);
}
public function get page():uint{
return (this._page);
}
public function set page(OPERATOR_ENDS_WITH:uint):void{
this._page = Math.max(OPERATOR_ENDS_WITH, 1);
}
public function prevPage():void{
this.page--;
}
public function nextPage():void{
this.page++;
}
public function get isRandomized():Boolean{
return (this._isRandomized);
}
public function set isRandomized(OPERATOR_ENDS_WITH:Boolean):void{
this._isRandomized = OPERATOR_ENDS_WITH;
}
public function get files():Array{
return (this._files);
}
public function reset():void{
this._page = 1;
this._resultsPerPage = 10;
this._isRandomized = false;
this._lookupKeys = [];
this._lookupRatings = [];
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._files = [];
this.includeAllFields();
}
public function clone():SaveQuery{
var _local1:SaveQuery = new SaveQuery(this._group);
_local1._page = this._page;
_local1._resultsPerPage = this._resultsPerPage;
_local1._isRandomized = this._isRandomized;
_local1._lookupKeys = this._lookupKeys.concat();
_local1._lookupRatings = this._lookupRatings.concat();
_local1._fileConditions = this._fileConditions.concat();
_local1._keyConditions = this._keyConditions.concat();
_local1._ratingConditions = this._ratingConditions.concat();
return (_local1);
}
private function includeAllFields():void{
var _local1:SaveKey;
var _local2:SaveRating;
for each (_local1 in this._group.keys) {
this._lookupKeys.push(_local1.id);
};
for each (_local2 in this._group.ratings) {
this._lookupRatings.push(_local2.id);
};
}
public function addCondition(OPERATOR_ENDS_WITH:String, OPERATOR_ENDS_WITH:String, OPERATOR_ENDS_WITH):void{
var _local4:int;
var _local5:SaveKey;
var _local6:Array;
var _local7:SaveRating;
_local4 = FILE_FIELDS.indexOf(OPERATOR_ENDS_WITH);
if (_local4 >= 0){
this._fileConditions.push({field:_local4, operator:OPERATOR_ENDS_WITH, value:OPERATOR_ENDS_WITH});
} else {
_local5 = this._group.getKey(OPERATOR_ENDS_WITH);
if (_local5){
OPERATOR_ENDS_WITH = _local5.validateValue(OPERATOR_ENDS_WITH);
this._keyConditions.push({key_id:_local5.id, operator:OPERATOR_ENDS_WITH, value:OPERATOR_ENDS_WITH});
return;
};
_local6 = OPERATOR_ENDS_WITH.split(".");
_local7 = this._group.getRating(_local6[0]);
if (_local7){
OPERATOR_ENDS_WITH = _local7.validateValue(OPERATOR_ENDS_WITH);
this._ratingConditions.push({rating_id:_local7.id, operator:OPERATOR_ENDS_WITH, value:OPERATOR_ENDS_WITH, column:(_local6[1]) ? _local6[1] : "score"});
return;
};
Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + OPERATOR_ENDS_WITH) + "\"."));
};
}
public function sortOn(OPERATOR_ENDS_WITH:String, OPERATOR_ENDS_WITH:Boolean=false):void{
var _local3:int;
var _local4:SaveKey;
var _local5:Array;
var _local6:SaveRating;
_local3 = FILE_FIELDS.indexOf(OPERATOR_ENDS_WITH);
if (_local3 >= 0){
this._sortFields.push({table:TABLE_FILES, field:_local3, desc:OPERATOR_ENDS_WITH});
} else {
_local4 = this._group.getKey(OPERATOR_ENDS_WITH);
if (_local4){
this._sortFields.push({table:TABLE_KEYS, field:_local4.id, desc:OPERATOR_ENDS_WITH});
return;
};
_local5 = OPERATOR_ENDS_WITH.split(".");
_local6 = this._group.getRating(_local5[0]);
if (_local6){
this._sortFields.push({table:TABLE_RATINGS, field:_local6.id, desc:OPERATOR_ENDS_WITH, extra:(_local5[1]) ? _local5[1] : "score"});
return;
};
Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + OPERATOR_ENDS_WITH) + "\"."));
};
}
public function execute():void{
var _local1:Object = {};
_local1.page = this._page;
_local1.num_results = this._resultsPerPage;
if (this._isRandomized){
_local1.randomize = 1;
};
if (((this._lookupKeys) && (this._lookupKeys.length))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && (this._lookupRatings.length))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._fileConditions) && (this._fileConditions.length))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && (this._keyConditions.length))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && (this._ratingConditions.length))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortFields) && (this._sortFields.length))){
_local1.sort_conditions = this._sortFields;
};
this._connection.sendSimpleCommand("lookupSaveFiles", this.onQueryComplete, {publisher_id:this._connection.publisherId, group_id:this._group.id, query:_local1});
}
private function onQueryComplete(OPERATOR_ENDS_WITH:APIEvent):void{
var _local2:Object;
var _local3:uint;
var _local4:SaveFile;
if (OPERATOR_ENDS_WITH.success){
_local2 = OPERATOR_ENDS_WITH.data;
this._files = [];
if (_local2.files){
_local3 = 0;
while (_local3 < _local2.files.length) {
_local4 = SaveFile.fromObject(this._group, _local2.files[_local3]);
if (_local4){
this._files.push(_local4);
};
_local3++;
};
};
dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this));
} else {
Logger.logError(("Query failed: " + OPERATOR_ENDS_WITH.error));
dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this, OPERATOR_ENDS_WITH.error));
};
}
}
}//package com.newgrounds
Section 27
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _name:String;
private var _id:uint;
private var _isFloat:Boolean;
private var _minimum:Number;
private var _maximum:Number;
public function SaveRating(*:String, *:uint, *:Boolean, *:Number, *:Number){
this._name = *;
this._id = *;
this._isFloat = *;
this._minimum = *;
this._maximum = *;
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get minimum():Number{
return (this._minimum);
}
public function get maximum():Number{
return (this._maximum);
}
public function validateValue(String):Number{
var _local3:int;
var _local2:Number = Number(String);
if (isNaN(_local2)){
Logger.logError((("Invalid value for rating \"" + this._name) + "\"."));
return (NaN);
};
if (_local2 < this._minimum){
Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._minimum) + "."));
return (this._minimum);
};
if (_local2 > this._maximum){
Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._maximum) + "."));
return (this._maximum);
};
if (!this.isFloat){
_local3 = int(_local2);
if (_local3 != _local2){
Logger.logWarning((((((("Float value " + _local2) + " given for integer rating \"") + this._name) + "\". Clamping to ") + _local3) + "."));
};
return (_local3);
};
return (_local2);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 28
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _numericValue:Number;
private var _rank:uint;
private var _username:String;
private var _score:String;
private var _tag:String;
public function Score(*:uint, *:String, *:String, *:Number, *:String){
this._rank = *;
this._username = *;
this._score = *;
this._numericValue = *;
this._tag = *;
}
public function get numericValue():Number{
return (this._numericValue);
}
public function get rank():uint{
return (this._rank);
}
public function get score():String{
return (this._score);
}
public function get tag():String{
return (this._tag);
}
public function get username():String{
return (this._username);
}
public function toString():String{
return (((((this._rank + ".\t") + this._username) + "\t") + this._score));
}
}
}//package com.newgrounds
Section 29
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
public class ScoreBoard extends APIEventDispatcher {
private var _connection:APIConnection;
private var _name:String;
private var _id:uint;
private var _period:String;// = "All-Time"
private var _firstResult:uint;// = 1
private var _numResults:uint;// = 10
private var _tag:String;
private var _scores:Array;
public static const TODAY:String = "Today";
public static const THIS_WEEK:String = "This Week";
public static const THIS_MONTH:String = "This Month";
public static const THIS_YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
public function ScoreBoard(*:APIConnection, *:String, *:uint){
this._connection = *;
this._name = *;
this._id = *;
}
public function get name():String{
return (this._name);
}
public function get scores():Array{
return (this._scores);
}
public function get period():String{
return (this._period);
}
public function set period(_id:String):void{
this._period = _id;
}
public function get firstResult():uint{
return (this._firstResult);
}
public function set firstResult(_id:uint):void{
this._firstResult = Math.max(1, _id);
}
public function get numResults():uint{
return (this._numResults);
}
public function set numResults(_id:uint):void{
this._numResults = _id;
}
public function get tag():String{
return (this._tag);
}
public function set tag(_id:String):void{
this._tag = _id;
}
public function get page():uint{
return ((Math.ceil(((this._firstResult - 1) / this._numResults)) + 1));
}
public function prevPage():void{
if (this.firstResult > this._numResults){
this.firstResult = (this.firstResult - this._numResults);
};
}
public function nextPage():void{
this.firstResult = (this.firstResult + this._numResults);
}
public function loadScores():void{
this._connection.sendSimpleCommand("loadScores", this.onScoresLoaded, {publisher_id:this._connection.publisherId, board:this._id, page:(((this._firstResult - 1) / this._numResults) + 1), num_results:this._numResults, period:this._period, tag:this._tag});
}
public function postScore(_id:Number, _id:String=null):void{
if (isNaN(_id)){
Logger.logError(("Cannot post invalid score: " + _id));
dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT));
return;
};
Logger.logMessage((((((("Posting a score of " + _id) + " by ") + this._connection.username) + " to scoreboard \"") + this._name) + "\"..."));
this._connection.sendSimpleCommand("postScore", this.onScorePosted, null, {user_name:this._connection.username, board:this._id, value:_id, tag:_id});
}
private function onScoresLoaded(_id:APIEvent):void{
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local2:Object = _id.data;
this._scores = [];
if (_local2.first_result){
_local3 = _local2.first_result;
} else {
_local3 = this._firstResult;
};
if (_local2.scores){
_local4 = 0;
while (_local4 < _local2.scores.length) {
_local5 = _local2.scores[_local4];
if (_local5){
this._scores[_local4] = new Score(_local3, _local5.username, _local5.value, _local5.numeric_value, _local5.tag);
};
_local4++;
_local3++;
};
};
dispatchEvent(new APIEvent(APIEvent.SCORES_LOADED, this));
}
private function onScorePosted(_id:APIEvent):void{
var _local2:Object;
var _local3:Object;
if (_id.success){
Logger.logMessage("Score posted!");
_local2 = _id.data;
_local3 = {};
_local3.score = _local2.value;
_local3.scoreBoard = this;
} else {
Logger.logError(("Error posting score: " + _id.error));
};
dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, _local3, _id.error));
}
override public function toString():String{
return (("Scoreboard: " + this._name));
}
}
}//package com.newgrounds
Section 30
//alert_232 (level01_fla.alert_232)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class alert_232 extends MovieClip {
public function alert_232(){
super();
addFrameScript(0, frame1, 19, frame20, 53, frame54);
}
function frame1(){
stop();
if (SaveData.equipPrompt){
gotoAndPlay(2);
SaveData.equipPrompt = false;
} else {
if (SaveData.spellPrompt){
gotoAndPlay(33);
SaveData.spellPrompt = false;
};
};
}
function frame20(){
stop();
}
function frame54(){
stop();
}
}
}//package level01_fla
Section 31
//andkon_2 (level01_fla.andkon_2)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class andkon_2 extends MovieClip {
public var ak:SimpleButton;
public function andkon_2(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("ak").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"), "_blank");
});
}
}
}//package level01_fla
Section 32
//arm_132 (level01_fla.arm_132)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class arm_132 extends MovieClip {
public function arm_132(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(SaveData.armor.graphic);
}
}
}//package level01_fla
Section 33
//batbody_23 (level01_fla.batbody_23)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class batbody_23 extends MovieClip {
public function batbody_23(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 34
//batear_24 (level01_fla.batear_24)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class batear_24 extends MovieClip {
public function batear_24(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 35
//batwing_22 (level01_fla.batwing_22)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class batwing_22 extends MovieClip {
public function batwing_22(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 36
//behold1_32 (level01_fla.behold1_32)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class behold1_32 extends MovieClip {
public var eyepain:MovieClip;
public function behold1_32(){
super();
addFrameScript(0, frame1, 28, frame29, 61, frame62, 94, frame95, 142, frame143, 151, frame152);
}
function frame152(){
gotoAndStop(150);
}
function frame143(){
gotoAndStop(2);
}
function frame95(){
if (Math.random() > 0.5){
gotoAndStop(2);
};
}
function frame1(){
gotoAndStop(6);
}
function frame29(){
if (Math.random() > 0.5){
gotoAndStop(2);
};
}
function frame62(){
if (Math.random() > 0.5){
gotoAndStop(2);
};
}
}
}//package level01_fla
Section 37
//beholdarm1_645 (level01_fla.beholdarm1_645)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class beholdarm1_645 extends MovieClip {
public var animation:String;
public function beholdarm1_645(){
super();
addFrameScript(0, frame1, 50, frame51, 67, frame68);
}
function frame1(){
animation = "idle";
}
function frame51(){
gotoAndPlay(animation);
}
function frame68(){
stop();
}
}
}//package level01_fla
Section 38
//beholdarm2_642 (level01_fla.beholdarm2_642)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class beholdarm2_642 extends MovieClip {
public var face:MovieClip;
public var animation:String;
public function beholdarm2_642(){
super();
addFrameScript(0, frame1, 41, frame42, 79, frame80, 127, frame128, 152, frame153);
}
function frame153(){
stop();
}
function frame80(){
gotoAndPlay(animation);
}
function frame1(){
animation = "idle";
}
function frame128(){
gotoAndPlay(animation);
}
function frame42(){
gotoAndPlay(animation);
}
}
}//package level01_fla
Section 39
//blackflash_208 (level01_fla.blackflash_208)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class blackflash_208 extends MovieClip {
public function blackflash_208(){
super();
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package level01_fla
Section 40
//body_135 (level01_fla.body_135)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class body_135 extends MovieClip {
public function body_135(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(SaveData.armor.graphic);
}
}
}//package level01_fla
Section 41
//bushbody_57 (level01_fla.bushbody_57)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class bushbody_57 extends MovieClip {
public function bushbody_57(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 42
//cloudplatform_467 (level01_fla.cloudplatform_467)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class cloudplatform_467 extends MovieClip {
public var HP:int;
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function cloudplatform_467(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 10, frame11, 22, frame23, 85, frame86, 92, frame93);
}
function frame86(){
HP = 90;
}
function frame3(){
gotoAndStop(2);
HP++;
}
function frame93(){
gotoAndStop(2);
}
function frame1(){
stop();
parent.addPlatform(this);
HP = 60;
standable = true;
gotoAndStop(2);
}
function frame23(){
Medals.unlock(Medals.cloudsDisappear);
}
function frame2(){
HP++;
if (HP > 60){
HP = 60;
};
}
public function effect(){
if ((((Game.player.ySpeed > 0)) || (Game.player.onGround))){
HP = (HP - 1);
if (HP <= 0){
gotoAndStop(5);
HP = 90;
};
};
}
function frame11(){
SFX.sound("cloud");
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip){
return (true);
}
}
}//package level01_fla
Section 43
//clouds_416 (level01_fla.clouds_416)
package level01_fla {
import flash.display.*;
public dynamic class clouds_416 extends MovieClip {
public var clouds:MovieClip;
public function clouds_416(){
super();
}
}
}//package level01_fla
Section 44
//completionstar_227 (level01_fla.completionstar_227)
package level01_fla {
import flash.display.*;
public dynamic class completionstar_227 extends MovieClip {
public var rank:MovieClip;
public var star:MovieClip;
public function completionstar_227(){
super();
}
}
}//package level01_fla
Section 45
//doorend_460 (level01_fla.doorend_460)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class doorend_460 extends MovieClip {
public var cat:MovieClip;
public function doorend_460(){
super();
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package level01_fla
Section 46
//equipicons_127 (level01_fla.equipicons_127)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class equipicons_127 extends MovieClip {
public function equipicons_127(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 47
//eyepain_33 (level01_fla.eyepain_33)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class eyepain_33 extends MovieClip {
public function eyepain_33(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.parent.eye);
}
}
}//package level01_fla
Section 48
//face_136 (level01_fla.face_136)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class face_136 extends MovieClip {
public function face_136(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 49
//fgfhfh_640 (level01_fla.fgfhfh_640)
package level01_fla {
import flash.display.*;
public dynamic class fgfhfh_640 extends MovieClip {
public var sign0:MovieClip;
public function fgfhfh_640(){
super();
}
}
}//package level01_fla
Section 50
//foebubble_21 (level01_fla.foebubble_21)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class foebubble_21 extends MovieClip {
public function foebubble_21(){
super();
addFrameScript(0, frame1, 3, frame4, 18, frame19, 33, frame34);
}
function frame1(){
gotoAndStop(2);
}
function frame19(){
gotoAndStop(2);
}
function frame4(){
gotoAndStop(2);
}
function frame34(){
gotoAndStop(2);
}
}
}//package level01_fla
Section 51
//foestatus_14 (level01_fla.foestatus_14)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class foestatus_14 extends MovieClip {
public var status:MovieClip;
public function foestatus_14(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 52
//gameover_182 (level01_fla.gameover_182)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class gameover_182 extends MovieClip {
public var done:Boolean;
public var endMenu:MovieClip;
public function gameover_182(){
super();
addFrameScript(0, frame1, 3, frame4, 91, frame92, 125, frame126, 128, frame129, 166, frame167, 200, frame201, 204, frame205, 466, frame467, 500, frame501);
}
function frame167(){
done = true;
}
function frame201(){
stop();
}
function frame205(){
Game.gameover = true;
}
function frame501(){
stop();
}
function frame1(){
stop();
done = false;
}
function frame4(){
Game.gameover = true;
}
function frame467(){
done = true;
}
function frame92(){
done = true;
}
function frame126(){
stop();
}
function frame129(){
Game.gameover = true;
}
}
}//package level01_fla
Section 53
//gameovermenu_184 (level01_fla.gameovermenu_184)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class gameovermenu_184 extends MovieClip {
public var s1:MovieClip;
public var menuLength:int;
public var s0:MovieClip;
public var s2:MovieClip;
public var i:int;
public var selected:int;
public var adLink:Function;
public function gameovermenu_184(){
super();
addFrameScript(0, frame1);
}
public function clickSelection(button:String){
Keys.mouseClick = true;
selected = button.substr(1);
select(-1);
}
public function select(key:int){
this[("s" + selected)].s.visible = false;
if (key == Keys.downKey){
selected++;
SFX.sound("select", "m");
};
if (key == Keys.upKey){
selected--;
SFX.sound("select", "m");
};
if (((((Keys.anyKey(key)) && ((selected == 0)))) || ((key == Keys.escapeKey)))){
Game.root.gotoAndStop(2);
SFX.sound("unpause", "m");
};
if (((Keys.anyKey(key)) && ((selected == 1)))){
Game.retry = true;
Game.root.gotoAndStop(2);
SFX.sound("unpause", "m");
};
if (((Keys.anyKey(key)) && ((selected == 2)))){
adLink();
SFX.sound("unpause", "m");
};
if (selected < 0){
selected = (menuLength - 1);
};
if (selected == menuLength){
selected = 0;
};
if (key != -1){
this[("s" + selected)].s.visible = true;
};
}
public function init(){
i = 0;
while (i < menuLength) {
this[("s" + i)].s.visible = false;
i++;
};
selected = 0;
if (!Keys.mouseClick){
s0.s.visible = true;
};
}
function frame1(){
menuLength = 3;
i = 0;
selected = 0;
init();
}
}
}//package level01_fla
Section 54
//golem1_53 (level01_fla.golem1_53)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class golem1_53 extends MovieClip {
public function golem1_53(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.face);
}
}
}//package level01_fla
Section 55
//hat_139 (level01_fla.hat_139)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class hat_139 extends MovieClip {
public function hat_139(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(SaveData.hat.graphic);
}
}
}//package level01_fla
Section 56
//heal0_154 (level01_fla.heal0_154)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class heal0_154 extends MovieClip {
public function heal0_154(){
super();
addFrameScript(0, frame1);
}
function frame1(){
rotation = (Math.random() * 360);
}
}
}//package level01_fla
Section 57
//hitbox_13 (level01_fla.hitbox_13)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class hitbox_13 extends MovieClip {
public function hitbox_13(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 58
//hitbox3_38 (level01_fla.hitbox3_38)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class hitbox3_38 extends MovieClip {
public function hitbox3_38(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 59
//hitboxclip_72 (level01_fla.hitboxclip_72)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class hitboxclip_72 extends MovieClip {
public function hitboxclip_72(){
super();
addFrameScript(0, frame1);
}
function frame1(){
parent.hitPoint(this);
visible = false;
}
}
}//package level01_fla
Section 60
//hitboxpoint_250 (level01_fla.hitboxpoint_250)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class hitboxpoint_250 extends MovieClip {
public function hitboxpoint_250(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 61
//intro_148 (level01_fla.intro_148)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class intro_148 extends MovieClip {
public var levelName:MovieClip;
public function intro_148(){
super();
addFrameScript(0, frame1, 93, frame94);
}
function frame94(){
stop();
}
function frame1(){
levelName.gotoAndStop(SaveData.selectedLevel);
if (Game.hud.message != "derp"){
levelName.gotoAndStop(26);
};
}
}
}//package level01_fla
Section 62
//jllkkljk_570 (level01_fla.jllkkljk_570)
package level01_fla {
import flash.display.*;
public dynamic class jllkkljk_570 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function jllkkljk_570(){
super();
}
}
}//package level01_fla
Section 63
//keyconfig_164 (level01_fla.keyconfig_164)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class keyconfig_164 extends MovieClip {
public var error:MovieClip;
public var allKeys:Array;
public var face:MovieClip;
public var keyNo:int;
public var monster:int;
public function keyconfig_164(){
super();
addFrameScript(0, frame1, 4, frame5);
}
public function bad(key:int){
return ((((((key == Keys.pauseKey)) || ((key == Keys.selectKey)))) || ((key == Keys.escapeKey))));
}
function frame1(){
keyNo = 0;
stop();
allKeys = [];
}
function frame5(){
monster = 1;
}
public function configKey(key:int){
if (((bad(key)) && (!((keyNo == 10))))){
error.gotoAndPlay("badKey");
} else {
if (((used(key)) && (!((keyNo == 10))))){
error.gotoAndPlay("usedKey");
} else {
if (keyNo == 0){
Keys.leftKey = key;
};
if (keyNo == 1){
Keys.rightKey = key;
};
if (keyNo == 2){
Keys.upKey = key;
Keys.interactKey = key;
};
if (keyNo == 3){
Keys.downKey = key;
};
if (keyNo == 4){
Keys.jumpKey = key;
};
if (keyNo == 5){
Keys.attackKey = key;
};
if (keyNo == 6){
Keys.magicKey = key;
};
if (keyNo == 7){
Keys.hot1Key = key;
};
if (keyNo == 8){
Keys.hot2Key = key;
};
if (keyNo == 9){
Keys.hot3Key = key;
};
if (keyNo == 10){
parent.endConfig();
keyNo = -1;
};
allKeys.push(key);
trace(allKeys);
if (keyNo != -1){
nextFrame();
};
keyNo++;
error.gotoAndStop(1);
};
};
}
public function used(key:int){
var a:int;
trace(("used? " + keyNo));
a = 0;
while (a < keyNo) {
trace((allKeys[a] == key));
if (allKeys[a] == key){
return (true);
};
a++;
};
return (false);
}
}
}//package level01_fla
Section 64
//keywarnings_165 (level01_fla.keywarnings_165)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class keywarnings_165 extends MovieClip {
public function keywarnings_165(){
super();
addFrameScript(0, frame1, 60, frame61, 121, frame122);
}
function frame1(){
stop();
}
function frame122(){
gotoAndStop(1);
}
function frame61(){
gotoAndStop(1);
}
}
}//package level01_fla
Section 65
//land2_537 (level01_fla.land2_537)
package level01_fla {
import flash.display.*;
public dynamic class land2_537 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function land2_537(){
super();
}
}
}//package level01_fla
Section 66
//lavaplatform_741 (level01_fla.lavaplatform_741)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class lavaplatform_741 extends MovieClip {
public var land:MovieClip;
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function lavaplatform_741(){
super();
addFrameScript(0, frame1);
}
function frame1(){
standable = true;
parent.addPlatform(this);
}
public function effect(){
if (Game.player.onGround){
Game.player.heat++;
if (Game.player.heat > 90){
Game.player.hit(5);
Game.player.heat = 0;
Medals.unlock(Medals.lavaIsHot);
};
};
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip){
return (true);
}
}
}//package level01_fla
Section 67
//lavaplatformbig_744 (level01_fla.lavaplatformbig_744)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class lavaplatformbig_744 extends MovieClip {
public var land:MovieClip;
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function lavaplatformbig_744(){
super();
addFrameScript(0, frame1);
}
function frame1(){
standable = true;
parent.addPlatform(this);
}
public function effect(){
if (Game.player.onGround){
Game.player.heat++;
if (Game.player.heat > 90){
Game.player.hit(5);
Game.player.heat = 0;
Medals.unlock(Medals.lavaIsHot);
};
};
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip){
return (true);
}
}
}//package level01_fla
Section 68
//leg_133 (level01_fla.leg_133)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class leg_133 extends MovieClip {
public function leg_133(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(SaveData.armor.graphic);
}
}
}//package level01_fla
Section 69
//levelicons_221 (level01_fla.levelicons_221)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class levelicons_221 extends MovieClip {
public var icons:MovieClip;
public function levelicons_221(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 70
//levelicons_222 (level01_fla.levelicons_222)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class levelicons_222 extends MovieClip {
public var eyeball:MovieClip;
public function levelicons_222(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 71
//leveltitle_149 (level01_fla.leveltitle_149)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class leveltitle_149 extends MovieClip {
public var box:TextField;
public function leveltitle_149(){
super();
addFrameScript(0, frame1, 25, frame26);
}
function frame1(){
stop();
}
function frame26(){
box.text = Game.hud.message;
}
}
}//package level01_fla
Section 72
//levelunlocked_235 (level01_fla.levelunlocked_235)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class levelunlocked_235 extends MovieClip {
public function levelunlocked_235(){
super();
addFrameScript(0, frame1, 1, frame2, 4, frame5, 66, frame67);
}
function frame1(){
stop();
visible = false;
mouseEnabled = false;
mouseChildren = false;
if (root.levelUnlock){
trace("preparing newly unlocked level");
play();
root.levelUnlock = false;
parent.levelNo = SaveData.levelsUnlocked;
Level.levelNo = parent.levelNo;
SaveData.selectedLevel = SaveData.levelsUnlocked;
parent.showPreview();
parent.level = (getDefinitionByName((("Level" + SaveData.levelsUnlocked) + "_1")) as Class);
};
}
function frame5(){
SFX.sound("unlock");
}
function frame2(){
visible = true;
}
function frame67(){
stop();
}
}
}//package level01_fla
Section 73
//levelup_152 (level01_fla.levelup_152)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class levelup_152 extends MovieClip {
public function levelup_152(){
super();
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package level01_fla
Section 74
//medalBox_848 (level01_fla.medalBox_848)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class medalBox_848 extends MovieClip {
public function medalBox_848(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
this.visible = false;
}
function frame2(){
visible = true;
}
}
}//package level01_fla
Section 75
//medalBox3_849 (level01_fla.medalBox3_849)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class medalBox3_849 extends MovieClip {
public var icon:MedalIcon;
public var desc:TextField;
public function medalBox3_849(){
super();
addFrameScript(0, frame1);
}
function frame1(){
icon.gotoAndStop(Medals.current.pic);
desc.text = Medals.current.name;
}
}
}//package level01_fla
Section 76
//monlith1_95 (level01_fla.monlith1_95)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class monlith1_95 extends MovieClip {
public function monlith1_95(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 77
//mushroomplatform_491 (level01_fla.mushroomplatform_491)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class mushroomplatform_491 extends MovieClip {
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function mushroomplatform_491(){
super();
addFrameScript(0, frame1, 2, frame3, 14, frame15);
}
function frame3(){
gotoAndStop(2);
}
function frame15(){
gotoAndStop(2);
}
function frame1(){
stop();
parent.addPlatform(this);
standable = true;
gotoAndStop(2);
}
public function effect(){
if (Game.player.ySpeed > 0){
Game.player.bounce = 1;
Game.player.jump = false;
SFX.sound("shroom");
gotoAndStop(5);
Game.player.ySpeed = -30;
Game.player.effect2();
Medals.unlock(Medals.shroomsAreBouncy);
};
}
public function effect2(item:MovieClip){
item.ySpeed = -16;
}
public function effect3(foe:MovieClip):Boolean{
if (foe.ySpeed > 0){
gotoAndStop(5);
foe.ySpeed = -24;
foe.onGround = false;
};
return (false);
}
}
}//package level01_fla
Section 78
//number2_248 (level01_fla.number2_248)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class number2_248 extends MovieClip {
public var numberBox:TextField;
public function number2_248(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
numberBox.text = parent.damage;
}
function frame6(){
numberBox.text = parent.damage;
}
function frame1(){
stop();
gotoAndStop(parent.type);
numberBox.text = parent.damage;
}
function frame4(){
numberBox.text = parent.damage;
}
function frame5(){
numberBox.text = parent.damage;
}
function frame2(){
numberBox.text = parent.damage;
}
}
}//package level01_fla
Section 79
//pausemenu_155 (level01_fla.pausemenu_155)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class pausemenu_155 extends MovieClip {
public var s1:MovieClip;
public var s5:MovieClip;
public var menuLength:int;
public var s0:MovieClip;
public var s2:MovieClip;
public var s4:MovieClip;
public var s3:MovieClip;
public var i:int;
public var keyConfig:MovieClip;
public var selected:int;
public var config:Boolean;
public var box0:TextField;
public var box1:TextField;
public var box2:TextField;
public function pausemenu_155(){
super();
addFrameScript(0, frame1, 1, frame2);
}
public function clickSelection(button:String){
Keys.mouseClick = true;
selected = button.substr(1);
select(-1);
}
public function select(key:int){
if (((((!((key == -1))) && (!((key == Keys.escapeKey))))) && (!((key == Keys.pauseKey))))){
Keys.mouseClick = false;
};
this[("s" + selected)].s.visible = false;
if (key == Keys.downKey){
selected++;
SFX.sound("select", "m");
};
if (key == Keys.upKey){
selected--;
SFX.sound("select", "m");
};
if (((((((Keys.anyKey(key)) && ((selected == 0)))) || ((key == Keys.escapeKey)))) || ((key == Keys.pauseKey)))){
visible = false;
Game.pause = false;
SFX.sound("unpause", "m");
BGM.resume();
};
if (((Keys.anyKey(key)) && ((selected == 1)))){
nextFrame();
config = true;
SFX.sound("unpause", "m");
};
if (((Keys.anyKey(key)) && ((selected == 2)))){
Game.root.gotoAndStop(2);
SFX.sound("unpause", "m");
};
if (((((Keys.anyKey(key)) || ((key == Keys.leftKey)))) || ((key == Keys.rightKey)))){
if (selected == 4){
box1.text = Options.toggleMusic();
SFX.sound("select2", "m");
};
if (selected == 5){
box2.text = Options.toggleSound();
SFX.sound("select2", "m");
};
};
if (selected < 0){
selected = (menuLength - 1);
};
if (selected == menuLength){
selected = 0;
};
if (((this[("s" + selected)]) && (!((key == -1))))){
this[("s" + selected)].s.visible = true;
};
if (((Keys.anyKey(key)) || ((key == Keys.rightKey)))){
if (selected == 3){
box0.text = Options.setQuality(1);
SFX.sound("select2", "m");
};
};
if (key == Keys.leftKey){
if (selected == 3){
box0.text = Options.setQuality(-1);
SFX.sound("select2", "m");
};
};
}
public function init(){
i = 0;
while (i < menuLength) {
this[("s" + i)].s.visible = false;
i++;
};
selected = 0;
if (!Keys.mouseClick){
s0.s.visible = true;
};
}
function frame1(){
stop();
visible = false;
gotoAndStop(2);
box0.mouseEnabled = false;
box1.mouseEnabled = false;
box2.mouseEnabled = false;
menuLength = 6;
config = false;
selected = 0;
i = 0;
init();
}
function frame2(){
box0.text = Options.getQuality();
box1.text = Options.getMusic();
box2.text = Options.getSound();
init();
}
public function endConfig(){
gotoAndStop(2);
config = false;
}
}
}//package level01_fla
Section 80
//plantspore_19 (level01_fla.plantspore_19)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class plantspore_19 extends MovieClip {
public function plantspore_19(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 81
//platformhitbox_265 (level01_fla.platformhitbox_265)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class platformhitbox_265 extends MovieClip {
public function platformhitbox_265(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 82
//playerpreview_231 (level01_fla.playerpreview_231)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class playerpreview_231 extends MovieClip {
public var weapon:Equip;
public var armor:Equip;
public var face:MovieClip;
public var hat:Equip;
public function playerpreview_231(){
super();
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
weapon = SaveData.weapon;
hat = SaveData.hat;
armor = SaveData.armor;
prevFrame();
}
function frame1(){
weapon = SaveData.weapon;
hat = SaveData.hat;
armor = SaveData.armor;
gotoAndStop(2);
}
}
}//package level01_fla
Section 83
//pointerclip_262 (level01_fla.pointerclip_262)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class pointerclip_262 extends MovieClip {
public function pointerclip_262(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 84
//poitshard_102 (level01_fla.poitshard_102)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class poitshard_102 extends MovieClip {
public function poitshard_102(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(((Math.random() * 6) + 1));
}
}
}//package level01_fla
Section 85
//potskin_101 (level01_fla.potskin_101)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class potskin_101 extends MovieClip {
public function potskin_101(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 86
//sign_441 (level01_fla.sign_441)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sign_441 extends MovieClip {
public function sign_441(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 87
//spellbubble_144 (level01_fla.spellbubble_144)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class spellbubble_144 extends MovieClip {
public var mpbox:TextField;
public var lvlbox:TextField;
public var selected:MovieClip;
public function spellbubble_144(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 88
//spellbubble1_147 (level01_fla.spellbubble1_147)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class spellbubble1_147 extends MovieClip {
public function spellbubble1_147(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 89
//spellselect_143 (level01_fla.spellselect_143)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class spellselect_143 extends MovieClip {
public var sp:MovieClip;
public var spells:Array;
public var sp2:MovieClip;
public var sp3:MovieClip;
public var sp4:MovieClip;
public var sp5:MovieClip;
public var open:Boolean;
public var buttons:Array;
public var sp6:MovieClip;
public var s:Spell;
public var sp7:MovieClip;
public var selected:int;
public var n:int;
public function spellselect_143(){
super();
addFrameScript(0, frame1, 1, frame2, 6, frame7, 10, frame11);
}
function frame7(){
stop();
}
function frame1(){
stop();
open = false;
parent.spellInfo.visible = false;
selected = 3;
buttons = [sp2, sp3, sp4, sp, sp5, sp6, sp7];
spells = [Spells.heal, Spells.slash, Spells.seiken, null, Spells.ice, Spells.fire, Spells.thunder];
sp.gotoAndStop(2);
n = 2;
for each (s in Spells.spells) {
if (((s) && (!((s.getLevel() == 0))))){
this[("sp" + n)].gotoAndStop(s.graphic);
this[("sp" + n)].mpbox.text = (("" + s.MP[s.getLevel()]) + "MP");
this[("sp" + n)].lvlbox.text = ("lvl " + s.getLevel());
} else {
this[("sp" + n)].mpbox.text = "";
this[("sp" + n)].lvlbox.text = "";
};
this[("sp" + n)].mpbox.text = "";
this[("sp" + n)].selected.visible = false;
sp.mpbox.text = "";
sp.lvlbox.text = "";
n++;
};
}
function frame2(){
}
function frame11(){
gotoAndStop(1);
}
public function selectSpell(){
if (((((Keys.keyIsDown[Keys.leftKey]) && (!(Keys.keyIsDown[Keys.rightKey])))) && ((selected > 0)))){
buttons[selected].selected.visible = false;
selected--;
} else {
if (((((!(Keys.keyIsDown[Keys.leftKey])) && (Keys.keyIsDown[Keys.rightKey]))) && ((selected < (buttons.length - 1))))){
buttons[selected].selected.visible = false;
selected++;
};
};
Game.selectedSpell = spells[selected];
if (((Game.selectedSpell) && ((Game.selectedSpell.getLevel() == 0)))){
Game.selectedSpell = null;
};
buttons[selected].selected.visible = true;
if (((((!((selected == 3))) && (spells[selected]))) && (!((spells[selected].getLevel() == 0))))){
parent.spellInfo.gotoAndStop(spells[selected].graphic);
parent.spellInfo.visible = true;
} else {
parent.spellInfo.visible = false;
};
parent.spellInfo.x = (buttons[selected].x + 345);
}
}
}//package level01_fla
Section 90
//spikes_274 (level01_fla.spikes_274)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class spikes_274 extends MovieClip {
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function spikes_274(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
parent.addPlatform(this);
standable = false;
gotoAndStop(2);
}
public function effect(){
if (Game.player.onGround){
Game.player.hit(10);
Medals.unlock(Medals.spikesArePainful);
};
return (false);
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip):Boolean{
Medals.unlock(Medals.animalCruelty);
foe.hit(10, true);
foe.jump(14);
foe.xSpeed = 0;
foe.y = (this.y + 10);
return (false);
}
}
}//package level01_fla
Section 91
//spikesmoving_607 (level01_fla.spikesmoving_607)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class spikesmoving_607 extends MovieClip {
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function spikesmoving_607(){
super();
addFrameScript(0, frame1, 143, frame144);
}
function frame144(){
gotoAndStop(2);
}
function frame1(){
stop();
parent.addPlatform(this);
standable = false;
gotoAndStop(2);
}
public function effect(){
if (Game.player.onGround){
Game.player.hit(10);
Medals.unlock(Medals.spikesArePainful);
};
return (false);
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip):Boolean{
Medals.unlock(Medals.animalCruelty);
foe.hit(10, true);
foe.jump(14);
foe.xSpeed = 0;
foe.y = (this.y + 10);
return (false);
}
}
}//package level01_fla
Section 92
//sprite1_117 (level01_fla.sprite1_117)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sprite1_117 extends MovieClip {
public function sprite1_117(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 93
//sprite2_115 (level01_fla.sprite2_115)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sprite2_115 extends MovieClip {
public function sprite2_115(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 94
//sprite3_116 (level01_fla.sprite3_116)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sprite3_116 extends MovieClip {
public function sprite3_116(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 95
//stonefallingplatform_586 (level01_fla.stonefallingplatform_586)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class stonefallingplatform_586 extends MovieClip {
public var active:Boolean;
public var standable:Boolean;
public var ySpeed:Number;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public var oy:Number;
public function stonefallingplatform_586(){
super();
addFrameScript(0, frame1, 3, frame4, 14, frame15, 99, frame100);
}
function frame15(){
gotoAndStop(2);
}
function frame1(){
stop();
this.y = Math.round(this.y);
active = false;
standable = true;
ySpeed = -3;
oy = y;
parent.addPlatform(this);
gotoAndStop(2);
}
function frame4(){
gotoAndStop(2);
}
function frame100(){
y = oy;
active = false;
gotoAndStop(5);
ySpeed = -3;
}
public function effect(){
if (Game.player.onGround){
if (!active){
gotoAndStop(20);
};
active = true;
};
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip):Boolean{
if (!active){
gotoAndStop(20);
};
active = true;
return (true);
}
public function move(){
if (active){
if (ySpeed > 0){
y = (y + Math.round(ySpeed));
};
if (ySpeed < 7){
ySpeed = (ySpeed + 0.3);
};
};
}
}
}//package level01_fla
Section 96
//sword_131 (level01_fla.sword_131)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class sword_131 extends MovieClip {
public function sword_131(){
super();
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
gotoAndStop(SaveData.weapon.graphic);
}
function frame8(){
SFX.sound("umbrella", "p");
}
}
}//package level01_fla
Section 97
//swordLoader_5 (level01_fla.swordLoader_5)
package level01_fla {
import flash.display.*;
import flash.text.*;
public dynamic class swordLoader_5 extends MovieClip {
public var bar:MovieClip;
public var percent:TextField;
public var playButton:SimpleButton;
public function swordLoader_5(){
super();
}
}
}//package level01_fla
Section 98
//Symbol102_552 (level01_fla.Symbol102_552)
package level01_fla {
import flash.display.*;
public dynamic class Symbol102_552 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol102_552(){
super();
}
}
}//package level01_fla
Section 99
//Symbol106_549 (level01_fla.Symbol106_549)
package level01_fla {
import flash.display.*;
public dynamic class Symbol106_549 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol106_549(){
super();
}
}
}//package level01_fla
Section 100
//Symbol107_41 (level01_fla.Symbol107_41)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol107_41 extends MovieClip {
public function Symbol107_41(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.eye);
}
}
}//package level01_fla
Section 101
//Symbol119_545 (level01_fla.Symbol119_545)
package level01_fla {
import flash.display.*;
public dynamic class Symbol119_545 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol119_545(){
super();
}
}
}//package level01_fla
Section 102
//Symbol120_547 (level01_fla.Symbol120_547)
package level01_fla {
import flash.display.*;
public dynamic class Symbol120_547 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol120_547(){
super();
}
}
}//package level01_fla
Section 103
//Symbol127_557 (level01_fla.Symbol127_557)
package level01_fla {
import flash.display.*;
public dynamic class Symbol127_557 extends MovieClip {
public var sign0:MovieClip;
public var sign1:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol127_557(){
super();
}
}
}//package level01_fla
Section 104
//Symbol128_266 (level01_fla.Symbol128_266)
package level01_fla {
import flash.display.*;
public dynamic class Symbol128_266 extends MovieClip {
public var chest0:Chest;
public function Symbol128_266(){
super();
}
}
}//package level01_fla
Section 105
//Symbol129_561 (level01_fla.Symbol129_561)
package level01_fla {
import flash.display.*;
public dynamic class Symbol129_561 extends MovieClip {
public var chest1:Chest;
public var chest5:Chest;
public var chest7:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest6:Chest;
public var chest0:Chest;
public function Symbol129_561(){
super();
}
}
}//package level01_fla
Section 106
//Symbol13_186 (level01_fla.Symbol13_186)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol13_186 extends MovieClip {
public var b:SimpleButton;
public var s:MovieClip;
public function Symbol13_186(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("b").addEventListener(MouseEvent.CLICK, function (e:Event=null){
parent.clickSelection(name);
});
}
}
}//package level01_fla
Section 107
//Symbol130_91 (level01_fla.Symbol130_91)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol130_91 extends MovieClip {
public function Symbol130_91(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 108
//Symbol131_83 (level01_fla.Symbol131_83)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol131_83 extends MovieClip {
public function Symbol131_83(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 109
//Symbol132_84 (level01_fla.Symbol132_84)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol132_84 extends MovieClip {
public function Symbol132_84(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 110
//Symbol133_85 (level01_fla.Symbol133_85)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol133_85 extends MovieClip {
public function Symbol133_85(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 111
//Symbol134_28 (level01_fla.Symbol134_28)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol134_28 extends MovieClip {
public function Symbol134_28(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 112
//Symbol135_29 (level01_fla.Symbol135_29)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol135_29 extends MovieClip {
public function Symbol135_29(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 113
//Symbol136_82 (level01_fla.Symbol136_82)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol136_82 extends MovieClip {
public function Symbol136_82(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 114
//Symbol13copy_156 (level01_fla.Symbol13copy_156)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol13copy_156 extends MovieClip {
public var b:SimpleButton;
public var s:MovieClip;
public function Symbol13copy_156(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("b").addEventListener(MouseEvent.CLICK, function (e:Event=null){
parent.clickSelection(name);
});
}
}
}//package level01_fla
Section 115
//Symbol14_160 (level01_fla.Symbol14_160)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol14_160 extends MovieClip {
public var b:SimpleButton;
public var s:MovieClip;
public function Symbol14_160(){
super();
addFrameScript(0, frame1);
}
function frame1(){
getChildByName("b").addEventListener(MouseEvent.CLICK, function (e:Event=null){
parent.clickSelection(name);
});
}
}
}//package level01_fla
Section 116
//Symbol143copy_422 (level01_fla.Symbol143copy_422)
package level01_fla {
import flash.display.*;
public dynamic class Symbol143copy_422 extends MovieClip {
public var c1:MovieClip;
public var c2:MovieClip;
public function Symbol143copy_422(){
super();
}
}
}//package level01_fla
Section 117
//Symbol150_568 (level01_fla.Symbol150_568)
package level01_fla {
import flash.display.*;
public dynamic class Symbol150_568 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol150_568(){
super();
}
}
}//package level01_fla
Section 118
//Symbol151_575 (level01_fla.Symbol151_575)
package level01_fla {
import flash.display.*;
public dynamic class Symbol151_575 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol151_575(){
super();
}
}
}//package level01_fla
Section 119
//Symbol152_577 (level01_fla.Symbol152_577)
package level01_fla {
import flash.display.*;
public dynamic class Symbol152_577 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol152_577(){
super();
}
}
}//package level01_fla
Section 120
//Symbol153_573 (level01_fla.Symbol153_573)
package level01_fla {
import flash.display.*;
public dynamic class Symbol153_573 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol153_573(){
super();
}
}
}//package level01_fla
Section 121
//Symbol154_589 (level01_fla.Symbol154_589)
package level01_fla {
import flash.display.*;
public dynamic class Symbol154_589 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol154_589(){
super();
}
}
}//package level01_fla
Section 122
//Symbol156_602 (level01_fla.Symbol156_602)
package level01_fla {
import flash.display.*;
public dynamic class Symbol156_602 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol156_602(){
super();
}
}
}//package level01_fla
Section 123
//Symbol157_604 (level01_fla.Symbol157_604)
package level01_fla {
import flash.display.*;
public dynamic class Symbol157_604 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol157_604(){
super();
}
}
}//package level01_fla
Section 124
//Symbol158_597 (level01_fla.Symbol158_597)
package level01_fla {
import flash.display.*;
public dynamic class Symbol158_597 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol158_597(){
super();
}
}
}//package level01_fla
Section 125
//Symbol159_600 (level01_fla.Symbol159_600)
package level01_fla {
import flash.display.*;
public dynamic class Symbol159_600 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol159_600(){
super();
}
}
}//package level01_fla
Section 126
//Symbol163_66 (level01_fla.Symbol163_66)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol163_66 extends MovieClip {
public function Symbol163_66(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 127
//Symbol164_67 (level01_fla.Symbol164_67)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol164_67 extends MovieClip {
public function Symbol164_67(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 128
//Symbol165_68 (level01_fla.Symbol165_68)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol165_68 extends MovieClip {
public function Symbol165_68(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 129
//Symbol166_69 (level01_fla.Symbol166_69)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol166_69 extends MovieClip {
public function Symbol166_69(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 130
//Symbol167_70 (level01_fla.Symbol167_70)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol167_70 extends MovieClip {
public function Symbol167_70(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 131
//Symbol169_609 (level01_fla.Symbol169_609)
package level01_fla {
import flash.display.*;
public dynamic class Symbol169_609 extends MovieClip {
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol169_609(){
super();
}
}
}//package level01_fla
Section 132
//Symbol170_616 (level01_fla.Symbol170_616)
package level01_fla {
import flash.display.*;
public dynamic class Symbol170_616 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol170_616(){
super();
}
}
}//package level01_fla
Section 133
//Symbol173_611 (level01_fla.Symbol173_611)
package level01_fla {
import flash.display.*;
public dynamic class Symbol173_611 extends MovieClip {
public var chest0:Chest;
public function Symbol173_611(){
super();
}
}
}//package level01_fla
Section 134
//Symbol174_614 (level01_fla.Symbol174_614)
package level01_fla {
import flash.display.*;
public dynamic class Symbol174_614 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol174_614(){
super();
}
}
}//package level01_fla
Section 135
//Symbol176_620 (level01_fla.Symbol176_620)
package level01_fla {
import flash.display.*;
public dynamic class Symbol176_620 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol176_620(){
super();
}
}
}//package level01_fla
Section 136
//Symbol177_627 (level01_fla.Symbol177_627)
package level01_fla {
import flash.display.*;
public dynamic class Symbol177_627 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol177_627(){
super();
}
}
}//package level01_fla
Section 137
//Symbol178_636 (level01_fla.Symbol178_636)
package level01_fla {
import flash.display.*;
public dynamic class Symbol178_636 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol178_636(){
super();
}
}
}//package level01_fla
Section 138
//Symbol179_632 (level01_fla.Symbol179_632)
package level01_fla {
import flash.display.*;
public dynamic class Symbol179_632 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol179_632(){
super();
}
}
}//package level01_fla
Section 139
//Symbol181_634 (level01_fla.Symbol181_634)
package level01_fla {
import flash.display.*;
public dynamic class Symbol181_634 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol181_634(){
super();
}
}
}//package level01_fla
Section 140
//Symbol182_638 (level01_fla.Symbol182_638)
package level01_fla {
import flash.display.*;
public dynamic class Symbol182_638 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol182_638(){
super();
}
}
}//package level01_fla
Section 141
//Symbol184_229 (level01_fla.Symbol184_229)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol184_229 extends MovieClip {
public function Symbol184_229(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 142
//Symbol189_336 (level01_fla.Symbol189_336)
package level01_fla {
import flash.display.*;
public dynamic class Symbol189_336 extends MovieClip {
public var land:MovieClip;
public function Symbol189_336(){
super();
}
}
}//package level01_fla
Section 143
//Symbol190_282 (level01_fla.Symbol190_282)
package level01_fla {
import flash.display.*;
public dynamic class Symbol190_282 extends MovieClip {
public var land:MovieClip;
public function Symbol190_282(){
super();
}
}
}//package level01_fla
Section 144
//Symbol193_361 (level01_fla.Symbol193_361)
package level01_fla {
import flash.display.*;
public dynamic class Symbol193_361 extends MovieClip {
public var land:MovieClip;
public function Symbol193_361(){
super();
}
}
}//package level01_fla
Section 145
//Symbol208_650 (level01_fla.Symbol208_650)
package level01_fla {
import flash.display.*;
public dynamic class Symbol208_650 extends MovieClip {
public var chest1:Chest;
public var chest8:Chest;
public var chest5:Chest;
public var chest7:Chest;
public var chest9:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest6:Chest;
public var chest0:Chest;
public function Symbol208_650(){
super();
}
}
}//package level01_fla
Section 146
//Symbol221_681 (level01_fla.Symbol221_681)
package level01_fla {
import flash.display.*;
public dynamic class Symbol221_681 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol221_681(){
super();
}
}
}//package level01_fla
Section 147
//Symbol222_657 (level01_fla.Symbol222_657)
package level01_fla {
import flash.display.*;
public dynamic class Symbol222_657 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol222_657(){
super();
}
}
}//package level01_fla
Section 148
//Symbol223_666 (level01_fla.Symbol223_666)
package level01_fla {
import flash.display.*;
public dynamic class Symbol223_666 extends MovieClip {
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol223_666(){
super();
}
}
}//package level01_fla
Section 149
//Symbol225_677 (level01_fla.Symbol225_677)
package level01_fla {
import flash.display.*;
public dynamic class Symbol225_677 extends MovieClip {
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol225_677(){
super();
}
}
}//package level01_fla
Section 150
//Symbol226_698 (level01_fla.Symbol226_698)
package level01_fla {
import flash.display.*;
public dynamic class Symbol226_698 extends MovieClip {
public var chest0:Chest;
public function Symbol226_698(){
super();
}
}
}//package level01_fla
Section 151
//Symbol227_700 (level01_fla.Symbol227_700)
package level01_fla {
import flash.display.*;
public dynamic class Symbol227_700 extends MovieClip {
public var chest0:Chest;
public function Symbol227_700(){
super();
}
}
}//package level01_fla
Section 152
//Symbol228_683 (level01_fla.Symbol228_683)
package level01_fla {
import flash.display.*;
public dynamic class Symbol228_683 extends MovieClip {
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol228_683(){
super();
}
}
}//package level01_fla
Section 153
//Symbol229_688 (level01_fla.Symbol229_688)
package level01_fla {
import flash.display.*;
public dynamic class Symbol229_688 extends MovieClip {
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol229_688(){
super();
}
}
}//package level01_fla
Section 154
//Symbol230_694 (level01_fla.Symbol230_694)
package level01_fla {
import flash.display.*;
public dynamic class Symbol230_694 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol230_694(){
super();
}
}
}//package level01_fla
Section 155
//Symbol236_703 (level01_fla.Symbol236_703)
package level01_fla {
import flash.display.*;
public dynamic class Symbol236_703 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol236_703(){
super();
}
}
}//package level01_fla
Section 156
//Symbol237_715 (level01_fla.Symbol237_715)
package level01_fla {
import flash.display.*;
public dynamic class Symbol237_715 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol237_715(){
super();
}
}
}//package level01_fla
Section 157
//Symbol238_717 (level01_fla.Symbol238_717)
package level01_fla {
import flash.display.*;
public dynamic class Symbol238_717 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol238_717(){
super();
}
}
}//package level01_fla
Section 158
//Symbol239_713 (level01_fla.Symbol239_713)
package level01_fla {
import flash.display.*;
public dynamic class Symbol239_713 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol239_713(){
super();
}
}
}//package level01_fla
Section 159
//Symbol240_705 (level01_fla.Symbol240_705)
package level01_fla {
import flash.display.*;
public dynamic class Symbol240_705 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol240_705(){
super();
}
}
}//package level01_fla
Section 160
//Symbol245_137 (level01_fla.Symbol245_137)
package level01_fla {
import flash.display.*;
public dynamic class Symbol245_137 extends MovieClip {
public var face:MovieClip;
public function Symbol245_137(){
super();
}
}
}//package level01_fla
Section 161
//Symbol250_719 (level01_fla.Symbol250_719)
package level01_fla {
import flash.display.*;
public dynamic class Symbol250_719 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol250_719(){
super();
}
}
}//package level01_fla
Section 162
//Symbol251_725 (level01_fla.Symbol251_725)
package level01_fla {
import flash.display.*;
public dynamic class Symbol251_725 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol251_725(){
super();
}
}
}//package level01_fla
Section 163
//Symbol252_727 (level01_fla.Symbol252_727)
package level01_fla {
import flash.display.*;
public dynamic class Symbol252_727 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol252_727(){
super();
}
}
}//package level01_fla
Section 164
//Symbol254_721 (level01_fla.Symbol254_721)
package level01_fla {
import flash.display.*;
public dynamic class Symbol254_721 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol254_721(){
super();
}
}
}//package level01_fla
Section 165
//Symbol255_723 (level01_fla.Symbol255_723)
package level01_fla {
import flash.display.*;
public dynamic class Symbol255_723 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol255_723(){
super();
}
}
}//package level01_fla
Section 166
//Symbol256_729 (level01_fla.Symbol256_729)
package level01_fla {
import flash.display.*;
public dynamic class Symbol256_729 extends MovieClip {
public var chest0:Chest;
public function Symbol256_729(){
super();
}
}
}//package level01_fla
Section 167
//Symbol258_733 (level01_fla.Symbol258_733)
package level01_fla {
import flash.display.*;
public dynamic class Symbol258_733 extends MovieClip {
public var chest1:Chest;
public var chest8:Chest;
public var chest5:Chest;
public var chest7:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest6:Chest;
public var chest0:Chest;
public function Symbol258_733(){
super();
}
}
}//package level01_fla
Section 168
//Symbol260_54 (level01_fla.Symbol260_54)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol260_54 extends MovieClip {
public function Symbol260_54(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 169
//Symbol272_373 (level01_fla.Symbol272_373)
package level01_fla {
import flash.display.*;
public dynamic class Symbol272_373 extends MovieClip {
public var land:MovieClip;
public function Symbol272_373(){
super();
}
}
}//package level01_fla
Section 170
//Symbol277_746 (level01_fla.Symbol277_746)
package level01_fla {
import flash.display.*;
public dynamic class Symbol277_746 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol277_746(){
super();
}
}
}//package level01_fla
Section 171
//Symbol278_753 (level01_fla.Symbol278_753)
package level01_fla {
import flash.display.*;
public dynamic class Symbol278_753 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol278_753(){
super();
}
}
}//package level01_fla
Section 172
//Symbol279_749 (level01_fla.Symbol279_749)
package level01_fla {
import flash.display.*;
public dynamic class Symbol279_749 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol279_749(){
super();
}
}
}//package level01_fla
Section 173
//Symbol280_751 (level01_fla.Symbol280_751)
package level01_fla {
import flash.display.*;
public dynamic class Symbol280_751 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol280_751(){
super();
}
}
}//package level01_fla
Section 174
//Symbol281_760 (level01_fla.Symbol281_760)
package level01_fla {
import flash.display.*;
public dynamic class Symbol281_760 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol281_760(){
super();
}
}
}//package level01_fla
Section 175
//Symbol282_774 (level01_fla.Symbol282_774)
package level01_fla {
import flash.display.*;
public dynamic class Symbol282_774 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol282_774(){
super();
}
}
}//package level01_fla
Section 176
//Symbol283_768 (level01_fla.Symbol283_768)
package level01_fla {
import flash.display.*;
public dynamic class Symbol283_768 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol283_768(){
super();
}
}
}//package level01_fla
Section 177
//Symbol284_770 (level01_fla.Symbol284_770)
package level01_fla {
import flash.display.*;
public dynamic class Symbol284_770 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol284_770(){
super();
}
}
}//package level01_fla
Section 178
//Symbol285_772 (level01_fla.Symbol285_772)
package level01_fla {
import flash.display.*;
public dynamic class Symbol285_772 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol285_772(){
super();
}
}
}//package level01_fla
Section 179
//Symbol286_778 (level01_fla.Symbol286_778)
package level01_fla {
import flash.display.*;
public dynamic class Symbol286_778 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol286_778(){
super();
}
}
}//package level01_fla
Section 180
//Symbol288_787 (level01_fla.Symbol288_787)
package level01_fla {
import flash.display.*;
public dynamic class Symbol288_787 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol288_787(){
super();
}
}
}//package level01_fla
Section 181
//Symbol289_789 (level01_fla.Symbol289_789)
package level01_fla {
import flash.display.*;
public dynamic class Symbol289_789 extends MovieClip {
public var chest0:Chest;
public function Symbol289_789(){
super();
}
}
}//package level01_fla
Section 182
//Symbol290_796 (level01_fla.Symbol290_796)
package level01_fla {
import flash.display.*;
public dynamic class Symbol290_796 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol290_796(){
super();
}
}
}//package level01_fla
Section 183
//Symbol291_793 (level01_fla.Symbol291_793)
package level01_fla {
import flash.display.*;
public dynamic class Symbol291_793 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol291_793(){
super();
}
}
}//package level01_fla
Section 184
//Symbol292_798 (level01_fla.Symbol292_798)
package level01_fla {
import flash.display.*;
public dynamic class Symbol292_798 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol292_798(){
super();
}
}
}//package level01_fla
Section 185
//Symbol293_391 (level01_fla.Symbol293_391)
package level01_fla {
import flash.display.*;
public dynamic class Symbol293_391 extends MovieClip {
public var land:MovieClip;
public function Symbol293_391(){
super();
}
}
}//package level01_fla
Section 186
//Symbol294_327 (level01_fla.Symbol294_327)
package level01_fla {
import flash.display.*;
public dynamic class Symbol294_327 extends MovieClip {
public var land:MovieClip;
public function Symbol294_327(){
super();
}
}
}//package level01_fla
Section 187
//Symbol295_407 (level01_fla.Symbol295_407)
package level01_fla {
import flash.display.*;
public dynamic class Symbol295_407 extends MovieClip {
public var land:MovieClip;
public function Symbol295_407(){
super();
}
}
}//package level01_fla
Section 188
//Symbol296_809 (level01_fla.Symbol296_809)
package level01_fla {
import flash.display.*;
public dynamic class Symbol296_809 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol296_809(){
super();
}
}
}//package level01_fla
Section 189
//Symbol298_817 (level01_fla.Symbol298_817)
package level01_fla {
import flash.display.*;
public dynamic class Symbol298_817 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol298_817(){
super();
}
}
}//package level01_fla
Section 190
//Symbol299_811 (level01_fla.Symbol299_811)
package level01_fla {
import flash.display.*;
public dynamic class Symbol299_811 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol299_811(){
super();
}
}
}//package level01_fla
Section 191
//Symbol300_813 (level01_fla.Symbol300_813)
package level01_fla {
import flash.display.*;
public dynamic class Symbol300_813 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol300_813(){
super();
}
}
}//package level01_fla
Section 192
//Symbol301_819 (level01_fla.Symbol301_819)
package level01_fla {
import flash.display.*;
public dynamic class Symbol301_819 extends MovieClip {
public var chest1:Chest;
public var chest0:Chest;
public function Symbol301_819(){
super();
}
}
}//package level01_fla
Section 193
//Symbol304_48 (level01_fla.Symbol304_48)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol304_48 extends MovieClip {
public function Symbol304_48(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.face);
stop();
}
}
}//package level01_fla
Section 194
//Symbol305_47 (level01_fla.Symbol305_47)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol305_47 extends MovieClip {
public function Symbol305_47(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.face);
stop();
}
}
}//package level01_fla
Section 195
//Symbol309_49 (level01_fla.Symbol309_49)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol309_49 extends MovieClip {
public function Symbol309_49(){
super();
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package level01_fla
Section 196
//Symbol312_824 (level01_fla.Symbol312_824)
package level01_fla {
import flash.display.*;
public dynamic class Symbol312_824 extends MovieClip {
public var chest1:Chest;
public var chest8:Chest;
public var chest5:Chest;
public var chest7:Chest;
public var chest9:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest6:Chest;
public var chest0:Chest;
public function Symbol312_824(){
super();
}
}
}//package level01_fla
Section 197
//Symbol313_823 (level01_fla.Symbol313_823)
package level01_fla {
import flash.display.*;
public dynamic class Symbol313_823 extends MovieClip {
public var face:MovieClip;
public function Symbol313_823(){
super();
}
}
}//package level01_fla
Section 198
//Symbol316_830 (level01_fla.Symbol316_830)
package level01_fla {
import flash.display.*;
public dynamic class Symbol316_830 extends MovieClip {
public var chest1:Chest;
public var chest8:Chest;
public var chest5:Chest;
public var chest7:Chest;
public var chest9:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest6:Chest;
public var chest0:Chest;
public function Symbol316_830(){
super();
}
}
}//package level01_fla
Section 199
//Symbol320_58 (level01_fla.Symbol320_58)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol320_58 extends MovieClip {
public function Symbol320_58(){
super();
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
}
}
}//package level01_fla
Section 200
//Symbol37_438 (level01_fla.Symbol37_438)
package level01_fla {
import flash.display.*;
public dynamic class Symbol37_438 extends MovieClip {
public var sign0:MovieClip;
public var sign1:MovieClip;
public var sign2:MovieClip;
public var sign3:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest0:Chest;
public function Symbol37_438(){
super();
}
}
}//package level01_fla
Section 201
//Symbol40_449 (level01_fla.Symbol40_449)
package level01_fla {
import flash.display.*;
public dynamic class Symbol40_449 extends MovieClip {
public var sign0:MovieClip;
public var sign1:MovieClip;
public var sign2:MovieClip;
public var sign3:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol40_449(){
super();
}
}
}//package level01_fla
Section 202
//Symbol49_455 (level01_fla.Symbol49_455)
package level01_fla {
import flash.display.*;
public dynamic class Symbol49_455 extends MovieClip {
public var sign0:MovieClip;
public var sign1:MovieClip;
public var sign2:MovieClip;
public var sign3:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest0:Chest;
public function Symbol49_455(){
super();
}
}
}//package level01_fla
Section 203
//Symbol52_106 (level01_fla.Symbol52_106)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol52_106 extends MovieClip {
public function Symbol52_106(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 204
//Symbol53_107 (level01_fla.Symbol53_107)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol53_107 extends MovieClip {
public function Symbol53_107(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 205
//Symbol58_465 (level01_fla.Symbol58_465)
package level01_fla {
import flash.display.*;
public dynamic class Symbol58_465 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest0:Chest;
public function Symbol58_465(){
super();
}
}
}//package level01_fla
Section 206
//Symbol63_472 (level01_fla.Symbol63_472)
package level01_fla {
import flash.display.*;
public dynamic class Symbol63_472 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol63_472(){
super();
}
}
}//package level01_fla
Section 207
//Symbol65_474 (level01_fla.Symbol65_474)
package level01_fla {
import flash.display.*;
public dynamic class Symbol65_474 extends MovieClip {
public var spawnPoint:MovieClip;
public function Symbol65_474(){
super();
}
}
}//package level01_fla
Section 208
//Symbol67_478 (level01_fla.Symbol67_478)
package level01_fla {
import flash.display.*;
public dynamic class Symbol67_478 extends MovieClip {
public var sign0:MovieClip;
public var sign1:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol67_478(){
super();
}
}
}//package level01_fla
Section 209
//Symbol72_486 (level01_fla.Symbol72_486)
package level01_fla {
import flash.display.*;
public dynamic class Symbol72_486 extends MovieClip {
public var chest0:Chest;
public function Symbol72_486(){
super();
}
}
}//package level01_fla
Section 210
//Symbol80_492 (level01_fla.Symbol80_492)
package level01_fla {
import flash.display.*;
public dynamic class Symbol80_492 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest0:Chest;
public function Symbol80_492(){
super();
}
}
}//package level01_fla
Section 211
//Symbol9_177 (level01_fla.Symbol9_177)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol9_177 extends MovieClip {
public function Symbol9_177(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 212
//Symbol90_500 (level01_fla.Symbol90_500)
package level01_fla {
import flash.display.*;
public dynamic class Symbol90_500 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest0:Chest;
public function Symbol90_500(){
super();
}
}
}//package level01_fla
Section 213
//Symbol97_509 (level01_fla.Symbol97_509)
package level01_fla {
import flash.display.*;
public dynamic class Symbol97_509 extends MovieClip {
public var sign0:MovieClip;
public var chest1:Chest;
public var chest2:Chest;
public var chest3:Chest;
public var chest4:Chest;
public var chest0:Chest;
public function Symbol97_509(){
super();
}
}
}//package level01_fla
Section 214
//Timeline_11 (level01_fla.Timeline_11)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_11 extends MovieClip {
public function Timeline_11(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 215
//Timeline_125 (level01_fla.Timeline_125)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_125 extends MovieClip {
public function Timeline_125(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 216
//Timeline_185 (level01_fla.Timeline_185)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_185 extends MovieClip {
public function Timeline_185(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
parent.adLink = function (e:Event=null){
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"), "_blank");
};
}
}
}//package level01_fla
Section 217
//Timeline_209 (level01_fla.Timeline_209)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_209 extends MovieClip {
public var face:MovieClip;
public function Timeline_209(){
super();
addFrameScript(0, frame1, 501, frame502, 521, frame522);
}
function frame502(){
parent.movie = false;
}
function frame1(){
monster = 1;
if (!parent.movie){
gotoAndStop(522);
};
}
function frame522(){
stop();
}
}
}//package level01_fla
Section 218
//Timeline_260 (level01_fla.Timeline_260)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_260 extends MovieClip {
public function Timeline_260(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 219
//Timeline_873 (level01_fla.Timeline_873)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_873 extends MovieClip {
public function Timeline_873(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
buttonMode = true;
}
}
}//package level01_fla
Section 220
//Timeline_877 (level01_fla.Timeline_877)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Timeline_877 extends MovieClip {
public function Timeline_877(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package level01_fla
Section 221
//treebottom_63 (level01_fla.treebottom_63)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class treebottom_63 extends MovieClip {
public function treebottom_63(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 222
//treetop_62 (level01_fla.treetop_62)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class treetop_62 extends MovieClip {
public function treetop_62(){
super();
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(parent.monster);
}
}
}//package level01_fla
Section 223
//upgradecomplete_246 (level01_fla.upgradecomplete_246)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class upgradecomplete_246 extends MovieClip {
public function upgradecomplete_246(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
SFX.sound("unlock");
}
function frame1(){
stop();
visible = false;
}
function frame2(){
visible = true;
}
}
}//package level01_fla
Section 224
//woodenplatformfalling_508 (level01_fla.woodenplatformfalling_508)
package level01_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class woodenplatformfalling_508 extends MovieClip {
public var standable:Boolean;
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function woodenplatformfalling_508(){
super();
addFrameScript(0, frame1, 2, frame3, 8, frame9, 21, frame22);
}
function frame3(){
gotoAndStop(2);
}
function frame1(){
stop();
parent.addPlatform(this);
standable = true;
gotoAndStop(2);
}
function frame22(){
Medals.unlock(Medals.watchYourStep);
}
function frame9(){
SFX.sound("tree");
}
public function effect(){
if (Game.player.onGround){
gotoAndStop(5);
};
}
public function effect2(item:MovieClip){
}
public function effect3(foe:MovieClip){
return (true);
}
}
}//package level01_fla
Section 225
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public function MochiCoins(){
super();
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function requestFunding(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", properties);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 226
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function set value(v:Number):void{
setValue(v);
}
public function reencode():void{
var newEncode:uint;
newEncode = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function toString():String{
var s:String;
s = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String;
s = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 227
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 228
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
public class MochiEvents {
public static const FORMAT_NONE:String = "NoForm";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const IO_ERROR:String = "IOError";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ACHIEVEMENTS_OWNED:String = "AchievementOwned";
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_NEW:String = "AchievementReceived";
public static const GAME_ACHIEVEMENTS:String = "GameAchievements";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const IO_PENDING:String = "IOPending";
public static const ERROR:String = "Error";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var gameStart:Number;
private static var levelStart:Number;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiEvents(){
super();
}
public static function showAwards(options:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("events_showAwards", options);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function getAchievements(properties:Object=null):void{
MochiServices.send("events_getAchievements", properties);
}
public static function setNotifications(style:Object):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("events_setNotifications", style, null, null);
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function unlockAchievement(properties:Object):void{
MochiServices.send("events_unlockAchievement", properties);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
}
}//package mochi.as3
Section 229
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.utils.*;
import flash.events.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (((event.privateProperties) && (event.privateProperties.consumable))){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function sync(e:Event=null):void{
var output:Object;
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
output = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[(key + KEY_SALT)].value);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 230
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
cb = pkg.callbackID;
cblst = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function detach(event:Event):void{
var loader:LoaderInfo;
loader = LoaderInfo(event.target);
loader.removeEventListener(Event.COMPLETE, detach);
loader.removeEventListener(IOErrorEvent.IO_ERROR, detach);
loader.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(e:Event):void{
var loader:Loader;
loader = LoaderInfo(e.target).loader;
_mochiLocalConnection = MovieClip(loader.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.9.4 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
var i:Number;
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
i = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String;
var event:String;
target = pkg.target;
event = pkg.event;
switch (target){
case "services":
MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social":
MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var opts:Object;
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
opts = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
var rect:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
rect = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError("NotConnected");
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError("NotConnected");
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var servicesURL:String;
var req:URLRequest;
var vars:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
MochiServices.onError("NotConnected");
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
servicesURL = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
req = new URLRequest(servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 231
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiSocial(){
super();
}
public static function requestFan(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", properties);
}
public static function postToStream(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", properties);
}
public static function getFriendsList(properties:Object=null):void{
MochiServices.send("social_getFriendsList", properties);
}
public static function requestLogin(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", properties);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("social_saveUserProperties", properties);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function inviteFriends(properties:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:options});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function showProfile(options:Object=null):void{
MochiServices.setContainer();
MochiServices.stayOnTop();
MochiServices.send("social_showProfile", options);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 232
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.utils.*;
import flash.events.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(key:String="", callback:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = key;
this.callback = callback;
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function request(_operation:String, _data:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _operation;
var _data = _data;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function serialize(obj):ByteArray{
var arr:ByteArray;
arr = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData;
userData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 233
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
public var background:MovieClip;
public function Background(){
super();
}
}
}//package
Section 234
//Background2 (Background2)
package {
import flash.display.*;
public dynamic class Background2 extends MovieClip {
public var background2:MovieClip;
public function Background2(){
super();
}
}
}//package
Section 235
//Bat (Bat)
package {
public class Bat extends Foe {
public var accel:Number;// = 0.5
public function Bat(){
accel = 0.5;
super();
addFrameScript(0, frame1, 10, frame11, 22, frame23);
EXP = 4;
HP = 55;
maxSpeed = 5;
recoilType = 1;
attack = (attack * 5);
dropRate = 0.4;
soundHit = "bat";
soundDie = "hit2";
monster = 3;
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
xSpeed = (xSpeed - (rx * 0.5));
ySpeed = (ySpeed - (ry * 0.5));
} else {
contact = false;
ySpeed = (ySpeed * 0.8);
xSpeed = (xSpeed * 0.8);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
};
}
function frame11(){
gotoAndStop(animation);
}
function frame23(){
kill();
}
function frame1(){
init();
stop();
}
}
}//package
Section 236
//BatBlood (BatBlood)
package {
public class BatBlood extends Foe {
public var ox:Number;// = 0
public var accel:Number;// = 0.5
public var timer:int;// = 0
public var oy:Number;// = 100
public function BatBlood(){
accel = 0.5;
ox = 0;
oy = 100;
timer = 0;
super();
addFrameScript(0, frame1, 7, frame8, 19, frame20);
EXP = 50;
HP = 120;
maxSpeed = 10;
recoilType = 1;
attack = (attack * 11);
dropRate = 0.3;
soundHit = "bat";
soundDie = "hit2";
monster = 1;
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
}
override public function behave(){
timer++;
if (timer == 60){
oy = (oy * -1);
};
if (((aggro) || (seePlayer()))){
contact = true;
rx = (((x - player.x) + parent.x) + ox);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
xSpeed = (xSpeed - (rx * 2));
ySpeed = (ySpeed - (ry * 2));
} else {
contact = false;
ySpeed = (ySpeed * 0.8);
xSpeed = (xSpeed * 0.8);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
} else {
xSpeed = (xSpeed + (rx * 4));
};
}
function frame1(){
init();
stop();
}
function frame8(){
gotoAndStop(animation);
}
function frame20(){
kill();
}
}
}//package
Section 237
//BatFluffy (BatFluffy)
package {
import flash.display.*;
public class BatFluffy extends Foe {
public var sightbox2:MovieClip;
public var accel:Number;// = 0.5
public function BatFluffy(){
accel = 0.5;
super();
addFrameScript(0, frame1, 10, frame11, 22, frame23);
EXP = 8;
HP = 70;
maxSpeed = 6;
recoilType = 1;
attack = (attack * 6);
dropRate = 0.4;
soundHit = "bat";
soundDie = "hit2";
monster = 2;
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
}
override public function behave(){
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
if (((((seePlayer()) || (aggro))) && (((((Game.player.facing) && ((rx < 0)))) || (((!(Game.player.facing)) && ((rx > 0)))))))){
contact = true;
xSpeed = (xSpeed - (rx * 1));
ySpeed = (ySpeed - (ry * 1));
} else {
if (seePlayer2()){
xSpeed = (xSpeed + (rx * 1));
ySpeed = (ySpeed + (ry * 1));
} else {
contact = false;
ySpeed = (ySpeed * 0.7);
xSpeed = (xSpeed * 0.7);
};
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
};
}
function frame11(){
gotoAndStop(animation);
}
function frame23(){
kill();
}
function frame1(){
init();
stop();
}
public function seePlayer2(){
return (sightbox2.hitTestPoint(player.x, (player.y - 40)));
}
}
}//package
Section 238
//Bee (Bee)
package {
public class Bee extends Foe {
public var ox:Number;// = 0
public var fear2:int;// = 1
public var fear:int;// = 0
public var oy:Number;// = 0
public function Bee(){
ox = 0;
oy = 0;
fear = 0;
fear2 = 1;
super();
addFrameScript(0, frame1, 5, frame6, 18, frame19);
EXP = 40;
HP = 90;
recoilType = 1;
attack = (attack * 10);
dropRate = 0.3;
maxSpeed = 11;
soundHit = "bat";
soundDie = "hit2";
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
monster = 2;
ox = ((Math.random() * 200) - 100);
oy = ((Math.random() * 200) - 100);
}
override public function behave(){
ox = ((Math.random() * 300) - 150);
oy = ((Math.random() * 300) - 150);
fear--;
if (fear < 0){
fear2 = 1;
} else {
fear2 = -1;
};
if (((aggro) || (seePlayer()))){
contact = true;
rx = (((x - player.x) + parent.x) + ox);
ry = ((((y - player.y) + 40) + parent.y) + oy);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
xSpeed = (xSpeed - ((rx * 2) * fear2));
ySpeed = (ySpeed - ((ry * 2) * fear2));
} else {
contact = false;
ySpeed = (ySpeed * 0.8);
xSpeed = (xSpeed * 0.8);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
} else {
fear = 30;
};
}
function frame6(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame19(){
kill();
}
}
}//package
Section 239
//BGM (BGM)
package {
import flash.media.*;
public class BGM {
static var paus:Boolean = false;
static var thisSong:int = -1;
static var mute:Boolean = false;
static var volume:Number = 0;
static var music:SoundChannel = new SoundChannel();
static var nextSong:int = 0;
static var maxvol:Number = 1;
static var fader:SoundTransform = new SoundTransform();
static var fade:Boolean = false;
public function BGM(){
super();
}
public static function levelMusic(){
if (Level.levelNo <= 5){
play(2);
} else {
if (Level.levelNo <= 10){
play(3);
} else {
if (Level.levelNo <= 15){
play(4);
} else {
if (Level.levelNo <= 20){
play(5);
} else {
play(6);
};
};
};
};
}
public static function stop(){
music.stop();
}
public static function resume(){
trace("Resume music.");
paus = false;
volume = maxvol;
setVolume();
}
static function getSong():Sound{
if (nextSong == 1){
return (new Music1());
};
if (nextSong == 2){
return (new Music2());
};
if (nextSong == 3){
return (new Music3());
};
if (nextSong == 4){
return (new Music4());
};
if (nextSong == 5){
return (new Music5());
};
if (nextSong == 6){
return (new Music6());
};
return (new Music1());
}
static function setVolume(){
fader.volume = volume;
music.soundTransform = fader;
}
public static function loop(){
if (!Options.music){
volume = 0;
} else {
if (paus){
volume = 0.2;
} else {
if ((((volume < maxvol)) && (fade))){
volume = (volume + 0.02);
};
if ((((volume > 0)) && (!(fade)))){
volume = (volume - 0.02);
};
if ((((volume <= 0)) && (!((nextSong == 0))))){
music.stop();
trace(("Playing music: " + nextSong));
music = getSong().play(0, int.MAX_VALUE);
music.soundTransform = fader;
thisSong = nextSong;
nextSong = 0;
volume = 0.02;
fade = true;
};
};
};
setVolume();
}
public static function play(track:int){
paus = false;
if (!(((thisSong == track)) && (fade))){
trace("Prepared next song.");
fade = false;
nextSong = track;
} else {
trace("Same song already playing.");
};
}
public static function pause(){
trace("Pause music.");
paus = true;
volume = 0.2;
setVolume();
}
}
}//package
Section 240
//BGpreview (BGpreview)
package {
import flash.display.*;
public dynamic class BGpreview extends MovieClip {
public function BGpreview(){
super();
}
}
}//package
Section 241
//blacklandformbig (blacklandformbig)
package {
public dynamic class blacklandformbig extends Landform {
public function blacklandformbig(){
super();
}
}
}//package
Section 242
//blackplatformbig (blackplatformbig)
package {
public dynamic class blackplatformbig extends Platform {
public function blackplatformbig(){
super();
}
}
}//package
Section 243
//blackplatformbigcopy (blackplatformbigcopy)
package {
public dynamic class blackplatformbigcopy extends Platform {
public function blackplatformbigcopy(){
super();
}
}
}//package
Section 244
//blackplatformmedium (blackplatformmedium)
package {
public dynamic class blackplatformmedium extends Platform {
public function blackplatformmedium(){
super();
}
}
}//package
Section 245
//blackplatformmediumcopy (blackplatformmediumcopy)
package {
public dynamic class blackplatformmediumcopy extends Landform {
public function blackplatformmediumcopy(){
super();
}
}
}//package
Section 246
//blackplatformsmallcopy (blackplatformsmallcopy)
package {
public dynamic class blackplatformsmallcopy extends Landform {
public function blackplatformsmallcopy(){
super();
}
}
}//package
Section 247
//BlueBubble (BlueBubble)
package {
public class BlueBubble extends Foe {
public var lifeTime:int;// = 60
public function BlueBubble(sp:Number=0){
lifeTime = 60;
super();
addFrameScript(0, frame1, 18, frame19, 21, frame22);
xSpeed = sp;
ySpeed = ((Math.random() * 4) - 2);
EXP = 0;
HP = 30;
recoilType = 1;
attack = (attack * 7);
dropRate = 0;
soundHit = "pop";
soundDie = "pop";
monster = 1;
landFoe = false;
dynamicFoe = true;
noTurn = true;
projectile = true;
}
override public function behave(){
lifeTime--;
xSpeed = (xSpeed * 0.98);
ySpeed = (ySpeed - 0.05);
if (lifeTime == 0){
die();
};
}
function frame22(){
kill();
}
function frame1(){
init();
stop();
}
function frame19(){
gotoAndStop("idle2");
}
}
}//package
Section 248
//BossBeholder (BossBeholder)
package {
import flash.display.*;
import flash.geom.*;
public class BossBeholder extends Foe {
public var hitbox2:MovieClip;
public var eye:int;// = 1
public var accel:Number;// = 0.7
public var tentacles:Boolean;// = false
public var delay:int;// = 0
public var eyeball:MovieClip;
public function BossBeholder(){
accel = 0.7;
delay = 0;
eye = 1;
tentacles = false;
super();
addFrameScript(0, frame1, 4, frame5, 60, frame61, 67, frame68, 88, frame89, 91, frame92, 136, frame137, 138, frame139, 146, frame147, 165, frame166, 244, frame245, 250, frame251, 293, frame294, 326, frame327, 332, frame333, 382, frame383, 442, frame443, 448, frame449, 497, frame498, 538, frame539, 548, frame549, 578, frame579, 591, frame592, 597, frame598, 604, frame605, 613, frame614, 618, frame619, 623, frame624, 627, frame628);
EXP = 240;
HP = 2300;
recoilType = -1;
attack = (attack * 10);
dropRate = 1;
soundHit = "bat";
soundDie = "hit2";
hidden = true;
immortal = true;
startAnim = "sleep";
stopped = false;
boss = true;
noTurn = true;
}
function frame166(){
parent.nolegs.animation = "die";
parent.nolegs.gotoAndPlay("die");
}
public function attackPattern(){
var a:int;
if (seePlayer()){
delay++;
};
if (delay == 2){
a = (Math.random() * 4);
if (pattern == 1){
if ((((a == 0)) || ((a == 1)))){
animate("attack5");
delay = 0;
};
if ((((a == 2)) || ((a == 3)))){
animate("attack4");
delay = 0;
};
};
if (pattern == 2){
if ((((a == 0)) || ((a == 1)))){
animate("attack4");
delay = 0;
};
if ((((((a == 2)) || ((a == 3)))) && ((parent.y < 350)))){
animate("attack");
delay = 0;
} else {
if ((((a == 2)) || ((a == 3)))){
animate("attack2");
delay = 0;
};
};
};
if (pattern == 3){
if (a == 0){
animate("attack5");
delay = 0;
};
if (a == 1){
animate("attack4");
delay = 0;
};
if ((((((a == 2)) || ((a == 3)))) && ((parent.y < 350)))){
animate("attack3");
delay = 0;
} else {
if ((((a == 2)) || ((a == 3)))){
animate("attack2");
delay = 0;
};
};
};
} else {
gotoAndStop("idle");
};
}
override public function behave(){
var p:Point;
if (hitbox2){
for each (p in player.hitPoints) {
if (hitbox2.hitTestPoint((player.x + p.x), (player.y + p.y), true)){
player.hit((attack * 2.2));
break;
};
};
for each (f in Game.level.foes) {
if (((((((f) && (!((f == this))))) && (f.hitbox))) && (hitbox2.hitTestPoint((f.x + parent.x), (f.y + parent.y), true)))){
f.hit(50, true);
};
};
};
if (eyeball){
eyeball.nextFrame();
};
if (seePlayer()){
contact = true;
} else {
contact = false;
};
if (HP < (maxHP / 3)){
pattern = 3;
} else {
if (HP < ((maxHP * 2) / 3)){
pattern = 2;
} else {
pattern = 1;
};
};
eye = pattern;
if (eyeball){
eyeball.eyepain.gotoAndStop(pattern);
};
}
function frame605(){
spawnMoth();
}
function frame614(){
spawnMoth();
}
function frame619(){
spawnMoth();
}
function frame628(){
animate("idle");
}
function frame1(){
init();
stop();
}
function frame624(){
spawnMoth();
}
function frame5(){
Game.level.natalie.visible = true;
Game.level.nolegs.visible = true;
}
function frame294(){
SFX.sound("lazor");
}
function frame539(){
animate("idle");
}
function frame549(){
tentacles = true;
}
function frame68(){
immortal = false;
}
function frame61(){
gotoAndStop("sleep");
}
function frame327(){
animate("idle");
}
function frame449(){
parent.natalie.gotoAndPlay("wave");
}
function frame89(){
animate("idle");
hidden = false;
ready = true;
}
function frame443(){
animate("idle");
}
function frame92(){
if (Game.level.foes.length < 11){
spawnEyeball();
};
}
function frame579(){
tentacles = false;
}
override public function wakeUp(){
animate("intro");
}
function frame333(){
parent.natalie.gotoAndPlay("wave");
}
function frame592(){
animate("idle");
}
function frame598(){
spawnMoth();
}
function frame245(){
kill();
}
function frame251(){
parent.natalie.gotoAndPlay("wave");
}
function frame137(){
attackPattern();
}
function frame498(){
SFX.sound("lazor");
}
function frame139(){
eyeball.gotoAndStop(150);
}
function frame383(){
SFX.sound("lazor");
}
public function spawnEyeball(a:Number=0){
shot = new Eyeball();
parent.addChild(shot);
shot.x = (this.x + 600);
shot.y = ((this.y + (Math.random() * 400)) - 200);
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
}
public function spawnMoth(){
if (Game.level.foes.length < 13){
shot = new Moth();
parent.addChild(shot);
shot.x = ((this.x + 600) + (Math.random() * 150));
shot.y = ((this.y + (Math.random() * 400)) - 200);
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
};
}
function frame147(){
parent.natalie.animation = "die";
parent.natalie.gotoAndPlay("die");
}
}
}//package
Section 249
//BossBush (BossBush)
package {
import flash.display.*;
public class BossBush extends Foe {
public var eye:int;// = 1
public var a:int;
public var eyes:MovieClip;
public var delay:int;// = 0
public function BossBush(){
delay = 0;
eye = 1;
super();
addFrameScript(0, frame1, 34, frame35, 39, frame40, 72, frame73, 105, frame106, 145, frame146, 147, frame148, 158, frame159, 170, frame171, 194, frame195, 195, frame196, 196, frame197, 197, frame198, 198, frame199, 199, frame200, 200, frame201, 201, frame202, 202, frame203, 203, frame204, 204, frame205, 210, frame211, 237, frame238, 239, frame240, 242, frame243, 245, frame246, 247, frame248, 249, frame250, 252, frame253, 254, frame255, 0x0101, frame258, 260, frame261, 269, frame270, 270, frame271, 296, frame297, 297, frame298, 298, frame299, 299, frame300, 300, frame301, 301, frame302, 302, frame303, 303, frame304, 304, frame305, 305, frame306, 306, frame307, 307, frame308, 308, frame309, 316, frame317, 318, frame319, 319, frame320, 360, frame361, 361, frame362, 362, frame363, 363, frame364, 364, frame365, 365, frame366, 366, frame367, 367, frame368, 368, frame369, 369, frame370, 370, frame371, 371, frame372, 381, frame382);
EXP = 80;
HP = 1500;
recoilType = -1;
attack = (attack * 7);
dropRate = 1;
soundHit = "bush";
soundDie = "bush";
monster = 1;
hidden = true;
immortal = true;
startAnim = "sleep";
stopped = false;
boss = true;
noTurn = true;
}
function frame370(){
root.y = 1;
}
function frame382(){
kill();
}
public function wind(){
if (seePlayer()){
player.xSpeed = (player.xSpeed - 5);
if (player.xSpeed > 25){
player.xSpeed = 25;
};
};
}
function frame159(){
animate("idle");
}
public function shoot(a:Number=0){
var s:Number;
shot = new BlueBubble((-3 - (Math.random() * 10)));
parent.addChild(shot);
shot.x = (this.x - (a * 2));
shot.y = (this.y + 80);
s = (0.8 + (Math.random() / 2));
shot.scaleX = s;
shot.scaleY = s;
(shot as BlueBubble).lifeTime = (50 + (Math.random() * 50));
}
override public function behave(){
if (seePlayer()){
contact = true;
} else {
contact = false;
};
if (HP < (maxHP / 3)){
pattern = 3;
} else {
if (HP < ((maxHP * 2) / 3)){
pattern = 2;
} else {
pattern = 1;
};
};
eye = pattern;
if (eyes){
eyes.gotoAndStop(pattern);
};
}
function frame171(){
SFX.sound("bush");
}
function frame297(){
SFX.sound("wind");
wind();
}
function frame299(){
wind();
}
function frame298(){
wind();
shoot(58);
}
function frame1(){
init();
stop();
}
function frame198(){
root.y = -4;
}
function frame35(){
gotoAndStop("sleep");
}
function frame196(){
root.y = -8;
}
function frame197(){
root.y = 6;
}
function frame195(){
spawn();
SFX.sound("pound");
root.y = 10;
if (((Game.player.onGround) && (seePlayer()))){
Game.player.hit((attack * 1.5));
};
}
function frame199(){
root.y = 3;
}
function frame40(){
immortal = false;
}
function frame300(){
wind();
}
function frame303(){
shoot(50);
wind();
}
function frame304(){
shoot(53);
wind();
}
function frame305(){
shoot(56);
wind();
}
function frame307(){
wind();
}
function frame302(){
wind();
}
function frame306(){
shoot(58);
wind();
}
function frame308(){
wind();
shoot(58);
}
function frame301(){
wind();
shoot(58);
}
function frame317(){
animate("idle");
}
function frame319(){
SFX.sound("tree");
eyes.gotoAndStop(4);
eye = 4;
}
function frame309(){
wind();
}
function frame204(){
root.y = -1;
}
function frame205(){
root.y = 0;
}
function frame73(){
animate("idle");
hidden = false;
ready = true;
}
function frame200(){
root.y = -2;
}
function frame320(){
SFX.sound("tree");
}
function frame201(){
root.y = 1;
}
function frame202(){
root.y = -1;
}
function frame211(){
animate("idle");
}
function frame203(){
root.y = 1;
}
override public function wakeUp(){
animate("intro");
}
function frame106(){
delay++;
if (delay == 2){
a = (Math.random() * 4);
if (pattern == 1){
if ((((a == 0)) || ((a == 1)))){
animate("attack3");
delay = 0;
};
if ((((a == 2)) || ((a == 3)))){
animate("attack2");
delay = 0;
};
};
if (pattern == 2){
if (a == 0){
animate("attack3");
delay = 0;
};
if (a == 1){
animate("attack");
delay = 0;
};
if (a == 2){
animate("attack2");
delay = 0;
};
if (a == 3){
animate("attack4");
delay = -1;
};
};
if (pattern == 3){
if ((((a == 0)) || ((a == 1)))){
animate("attack");
delay = 1;
};
if (a == 2){
animate("attack4");
delay = -1;
};
if (a == 3){
animate("attack2");
delay = 0;
};
};
} else {
gotoAndStop("idle");
};
}
public function spawn(){
var i:int;
i = 0;
while ((((i < 2)) && ((Game.level.foes.length < 6)))) {
shot = new Bush();
parent.addChild(shot);
shot.x = ((this.x - 90) + Math.round((Math.random() * 150)));
shot.y = (this.y + 100);
shot.hidden = false;
shot.aggro = 1;
shot.immortal = false;
shot.ready = true;
shot.EXP = 0;
shot.wakeUp();
shot.dynamicFoe = true;
i++;
};
}
function frame238(){
shoot(30);
}
function frame240(){
shoot(35);
}
function frame243(){
shoot(40);
}
function frame366(){
SFX.sound("explode");
root.y = 3;
}
function frame246(){
shoot(43);
}
function frame361(){
SFX.sound("pound");
}
function frame248(){
shoot(45);
}
function frame365(){
root.y = -4;
}
function frame363(){
root.y = -8;
spawn();
spawn();
spawn();
}
function frame364(){
SFX.sound("explode");
root.y = 6;
}
function frame367(){
root.y = -2;
}
function frame368(){
root.y = 1;
}
function frame362(){
SFX.sound("explode");
root.y = 10;
}
function frame369(){
root.y = -1;
}
function frame253(){
shoot(50);
}
function frame255(){
shoot(53);
}
function frame258(){
shoot(56);
}
function frame250(){
shoot(47);
}
function frame372(){
root.y = 0;
}
function frame148(){
shot = new SeaBomb((-5 - (Math.random() * 15)), (4 - (Math.random() * 18)));
parent.addChild(shot);
shot.x = (this.x - 100);
shot.y = (this.y - 100);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
shot.father = this;
shot.dynamicFoe = true;
}
function frame146(){
SFX.sound("throw");
}
function frame261(){
shoot(58);
}
function frame371(){
root.y = -1;
}
function frame270(){
animate("idle");
}
function frame271(){
root.y = 0;
}
}
}//package
Section 250
//BossCar (BossCar)
package {
public class BossCar extends Foe {
private var bulletPattern:int;// = 0
private var pos:int;// = 0
public var face:int;// = 1
private var moving:int;// = 0
private var count:int;// = 0
private var combo:int;// = 0
public function BossCar(){
combo = 0;
pos = 0;
bulletPattern = 0;
face = 1;
count = 0;
moving = 0;
super();
addFrameScript(0, frame1, 22, frame23, 53, frame54, 68, frame69, 101, frame102, 131, frame132, 150, frame151, 161, frame162, 176, frame177, 200, frame201, 210, frame211, 234, frame235, 244, frame245, 268, frame269, 276, frame277, 291, frame292, 352, frame353, 364, frame365, 402, frame403, 404, frame405, 421, frame422, 432, frame433, 441, frame442, 453, frame454, 455, frame456, 471, frame472, 482, frame483, 490, frame491, 503, frame504, 505, frame506, 508, frame509, 556, frame557, 557, frame558, 558, frame559, 559, frame560, 560, frame561, 561, frame562, 563, frame564, 565, frame566, 567, frame568, 657, frame658);
EXP = 300;
HP = 3800;
recoilType = -1;
attack = (attack * 20);
dropRate = 1;
soundHit = "metal";
soundDie = "metal";
hidden = true;
immortal = true;
startAnim = "sleep";
stopped = false;
boss = true;
noTurn = true;
}
function frame151(){
reloadBomb();
}
public function reloadBullets(){
if ((((pattern == 1)) && ((combo < 4)))){
randomizeBullets();
} else {
if ((((pattern == 2)) && ((combo < 5)))){
randomizeBullets();
} else {
if ((((pattern == 3)) && ((combo < 6)))){
randomizeBullets();
} else {
gotoAndStop("attack24");
};
};
};
}
function frame491(){
spawn();
}
function frame277(){
reloadBullets();
}
function frame162(){
animate("idle");
}
public function attackPattern(){
combo = 0;
if (pos == 1){
if (facing){
animate("attack4");
pos++;
} else {
if (!facing){
animate("attack5");
pos--;
};
};
count = 0;
} else {
if ((((count == 0)) || (((!((count == 3))) && ((Math.random() < 0.7)))))){
count++;
if (pos == 0){
if (pattern == 1){
animate("attack");
} else {
if ((((pattern == 2)) && ((Math.random() < 0.3)))){
animate("attack3");
} else {
if ((((pattern == 3)) && ((Math.random() < 0.8)))){
animate("attack3");
} else {
animate("attack");
};
};
};
};
if (pos == 2){
animate("attack2");
};
} else {
if (pos == 2){
animate("attack5");
pos--;
facing = false;
} else {
if (pos == 0){
animate("attack4");
pos++;
facing = true;
};
};
};
};
}
override public function behave(){
if (moving == 1){
xSpeed = (xSpeed - 0.5);
};
if (moving == -1){
xSpeed = (xSpeed + 0.5);
};
if (Math.abs(xSpeed) == 13.5){
moving = (moving * -1);
};
if (xSpeed == 0){
moving = 0;
};
if (HP < (maxHP * 0.33)){
pattern = 3;
} else {
if (HP < (maxHP * 0.66)){
pattern = 2;
} else {
pattern = 1;
};
};
face = pattern;
}
function frame292(){
animate("idle");
}
function frame23(){
gotoAndStop("sleep");
}
function frame177(){
randomizeBullets();
}
function frame1(){
init();
stop();
}
public function shootBullets(){
var bulletArray:Array;
var e:int;
bulletArray = [];
if (bulletPattern == 1){
bulletArray = [40, 0, -40, -80];
};
if (bulletPattern == 2){
bulletArray = [80, -80];
};
if (bulletPattern == 3){
bulletArray = [0, 40, 80];
};
for each (e in bulletArray) {
shot = new Bullet(180);
shot.x = (this.x + 150);
shot.y = (this.y + e);
shot.turn();
shot.attack = 14;
parent.addChild(shot);
};
SFX.sound("explode");
combo++;
}
function frame504(){
animate("idle");
}
function frame405(){
SFX.sound("engine");
}
function frame403(){
animate("idle");
}
function frame509(){
SFX.sound("explode");
}
function frame506(){
SFX.sound("explode");
}
public function randomizeBullets(){
var b:int;
b = (Math.random() * 3);
if (b == 0){
bulletPattern = 1;
gotoAndStop("attack21");
};
if (b == 1){
bulletPattern = 2;
gotoAndStop("attack22");
};
if (b == 2){
bulletPattern = 3;
gotoAndStop("attack23");
};
}
function frame54(){
immortal = false;
}
function frame658(){
kill();
}
public function shootFire(){
shot = new Fireball();
parent.addChild(shot);
shot.x = (this.x - 100);
shot.y = (this.y - 20);
shot.xSpeed = (-(Math.random()) * 7);
shot.ySpeed = (8 - (Math.random() * 16));
shot.father = this;
shot.dynamicFoe = true;
SFX.sound("fire1");
combo++;
}
function frame422(){
moving = 1;
}
function frame558(){
y = (y - 3);
SFX.sound("explode");
}
function frame69(){
animate("idle");
hidden = false;
ready = true;
}
function frame559(){
y = (y - 3);
}
function frame557(){
y = (y - 3);
SFX.sound("pound");
}
function frame560(){
y = (y - 3);
SFX.sound("explode");
}
function frame561(){
y = (y - 3);
}
function frame433(){
if (Math.abs(xSpeed) > 5){
gotoAndStop("attack41");
};
}
function frame568(){
SFX.sound("explode");
}
function frame562(){
y = (y - 3);
SFX.sound("explode");
}
function frame442(){
spawn();
}
function frame201(){
shootBullets();
}
function frame564(){
SFX.sound("explode");
}
function frame211(){
reloadBullets();
}
function frame456(){
SFX.sound("engine");
}
function frame454(){
animate("idle");
}
override public function wakeUp(){
animate("intro");
}
public function shootBomb(){
shot = new SeaBomb((-2 - (Math.random() * 33)), (-(Math.random()) * 19));
parent.addChild(shot);
shot.x = (this.x - 100);
shot.y = (this.y - 20);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
shot.father = this;
shot.dynamicFoe = true;
SFX.sound("explode");
combo++;
}
function frame102(){
attackPattern();
}
public function spawn(){
var foeType:Class;
if (Math.random() < 0.33){
foeType = SpriteFire;
} else {
if (Math.random() < 0.5){
foeType = IdolFire;
} else {
foeType = SeaBomb;
};
};
if ((((Game.level.foes.length < 7)) && ((pos == 1)))){
shot = new (foeType);
parent.addChild(shot);
shot.x = (this.x - 180);
shot.y = (this.y + 350);
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
shot.ySpeed = -33;
shot.edgeFall = true;
shot = new (foeType);
parent.addChild(shot);
shot.x = (this.x + 180);
shot.y = (this.y + 350);
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
shot.ySpeed = -33;
shot.edgeFall = true;
};
}
function frame472(){
moving = -1;
}
function frame235(){
shootBullets();
}
function frame566(){
SFX.sound("explode");
}
function frame245(){
reloadBullets();
}
function frame483(){
if (Math.abs(xSpeed) > 5){
gotoAndStop("attack51");
};
}
function frame365(){
if (combo < 5){
gotoAndStop("attack31");
};
}
function frame132(){
shootBomb();
}
public function reloadBomb(){
if ((((pattern == 1)) && ((combo < 3)))){
gotoAndStop("attack1");
};
if ((((pattern == 2)) && ((combo < 4)))){
gotoAndStop("attack1");
};
if ((((pattern == 3)) && ((combo < 5)))){
gotoAndStop("attack1");
};
}
function frame269(){
shootBullets();
}
function frame353(){
shootFire();
}
}
}//package
Section 251
//BossGolem (BossGolem)
package {
public class BossGolem extends Foe {
private var pos:int;// = 0
public var face:int;// = 1
private var dir:Boolean;// = false
private var count:int;// = 0
private var rightMono:MonolithIce;
private var leftMono:MonolithIce;
public function BossGolem(){
pos = 0;
dir = false;
face = 1;
count = 0;
super();
addFrameScript(0, frame1, 13, frame14, 20, frame21, 25, frame26, 48, frame49, 103, frame104, 107, frame108, 121, frame122, 122, frame123, 126, frame127, 130, frame131, 131, frame132, 132, frame133, 133, frame134, 135, frame136, 136, frame137, 213, frame214, 223, frame224, 225, frame226, 227, frame228, 228, frame229, 232, frame233, 234, frame235, 237, frame238, 238, frame239, 269, frame270, 294, frame295, 298, frame299, 301, frame302, 304, frame305, 306, frame307, 308, frame309, 310, frame311, 311, frame312, 312, frame313, 313, frame314, 314, frame315, 315, frame316, 316, frame317, 317, frame318, 319, frame320, 321, frame322, 323, frame324, 325, frame326, 341, frame342, 343, frame344, 344, frame345, 345, frame346, 346, frame347, 348, frame349, 350, frame351, 405, frame406);
EXP = 900;
HP = 2800;
recoilType = -1;
attack = (attack * 14);
dropRate = 1;
soundHit = "rock";
soundDie = "rock2";
monster = 1;
hidden = true;
immortal = true;
startAnim = "sleep";
stopped = false;
boss = true;
noTurn = true;
}
public function shoot(){
var sc:Number;
shot = new Rock(1);
parent.addChild(shot);
shot.ySpeed = (-11 - (Math.random() * 14));
if (facing){
shot.xSpeed = ((Math.random() * 7) + 2);
} else {
shot.xSpeed = ((-(Math.random()) * 7) - 2);
};
sc = (0.85 + (Math.random() / 4));
shot.scaleX = sc;
shot.scaleY = sc;
shot.y = (this.y + 90);
shot.x = ((this.x + (Math.random() * 160)) - 80);
}
public function attackPattern(){
var a:int;
a = (Math.random() * 4);
if ((((pos == 1)) || ((pos == 2)))){
animate("hide");
} else {
if (((((!((a == 0))) && ((count < 4)))) || ((count == 0)))){
animate("attack");
count++;
} else {
animate("hide");
count = 0;
};
};
}
override public function behave(){
if (seePlayer()){
contact = true;
} else {
contact = false;
};
if (HP < (maxHP / 3)){
pattern = 3;
} else {
if (HP < ((maxHP * 2) / 3)){
pattern = 2;
} else {
pattern = 1;
};
};
face = pattern;
}
public function destroyMono(){
var victim:MonolithIce;
victim = null;
if (pos == 0){
victim = rightMono;
};
if (pos == 3){
victim = leftMono;
};
if (((victim) && (!(victim.dead)))){
victim.die();
};
}
function frame299(){
if (pattern > 1){
shoot2();
};
}
function frame14(){
gotoAndStop("sleep");
}
function frame295(){
shoot2();
}
function frame26(){
SFX.sound("rumble");
}
function frame21(){
immortal = false;
}
function frame1(){
init();
stop();
}
function frame406(){
kill();
}
function frame49(){
animate("idle");
hidden = false;
ready = true;
}
function frame305(){
if (pattern > 1){
shoot2();
};
}
function frame307(){
shoot2();
}
function frame302(){
shoot2();
}
function frame309(){
if (pattern > 2){
shoot2();
};
}
function frame311(){
shoot2();
}
function frame316(){
if (pattern > 1){
shoot2();
};
}
public function spawnMono(){
if ((((((pos == 0)) || ((pos == 3)))) && ((pattern == 3)))){
shot = new MonolithIce();
parent.addChild(shot);
shot.y = (this.y + 104);
shot.x = this.x;
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
if (pos == 0){
rightMono = shot;
} else {
leftMono = shot;
};
};
}
function frame317(){
shoot2();
}
function frame315(){
shoot2();
}
function frame318(){
if (pattern > 2){
shoot2();
};
}
public function position(){
if (pos == 0){
pos = 1;
x = (x - 230);
y = (y + 100);
dir = false;
} else {
if ((((pos == 1)) && (!(dir)))){
pos = 2;
turn();
x = (x - 240);
} else {
if ((((pos == 1)) && (dir))){
pos = 0;
x = (x + 230);
y = (y - 100);
} else {
if ((((pos == 2)) && (!(dir)))){
pos = 3;
x = (x - 230);
y = (y - 100);
} else {
if ((((pos == 2)) && (dir))){
pos = 1;
turn();
x = (x + 240);
} else {
if (pos == 3){
pos = 2;
x = (x + 230);
y = (y + 100);
dir = true;
};
};
};
};
};
};
}
function frame313(){
shoot2();
}
function frame314(){
if (pattern > 1){
shoot2();
};
}
function frame320(){
shoot2();
}
function frame322(){
if (pattern > 2){
shoot2();
};
}
function frame214(){
position();
animate("unhide");
}
function frame324(){
shoot2();
}
function frame326(){
if (pattern > 1){
spawn();
} else {
shoot2();
};
}
function frame312(){
if (pattern > 2){
shoot2();
};
}
function frame342(){
animate("idle");
}
function frame226(){
destroyMono();
}
override public function wakeUp(){
animate("intro");
}
function frame104(){
attackPattern();
}
function frame347(){
shoot();
}
function frame228(){
if (pattern > 1){
shoot();
};
}
function frame344(){
SFX.sound("pound");
}
function frame346(){
shoot();
}
function frame349(){
shoot();
}
public function spawn(){
shot = new IdolIce();
parent.addChild(shot);
shot.x = this.x;
shot.y = this.y;
shot.aggro = 1;
shot.EXP = 0;
shot.dynamicFoe = true;
}
function frame224(){
SFX.sound("rumble");
}
function frame233(){
shoot();
SFX.sound("rock");
}
function frame235(){
SFX.sound("rumble");
}
function frame345(){
shoot();
}
function frame108(){
SFX.sound("rumble");
}
function frame238(){
shoot();
}
function frame239(){
SFX.sound("rumble");
}
function frame229(){
SFX.sound("rumble");
}
function frame122(){
SFX.sound("rumble");
}
function frame127(){
shoot();
SFX.sound("rumble");
}
function frame123(){
if (pattern > 1){
shoot();
};
}
function frame132(){
shoot();
}
function frame134(){
spawnMono();
}
function frame137(){
SFX.sound("rumble");
}
function frame136(){
shoot();
}
function frame351(){
shoot();
}
function frame131(){
SFX.sound("rock");
}
function frame133(){
SFX.sound("rumble");
}
public function shoot2(){
if (!facing){
shot = new Icicle2((-60 + (Math.random() * 120)));
} else {
shot = new Icicle2(((-60 + (Math.random() * 120)) + 180));
};
parent.addChild(shot);
shot.x = ((this.x + (Math.random() * 50)) - 25);
shot.y = ((this.y + (Math.random() * 50)) - 25);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
shot.father = this;
SFX.sound("ice", "f");
}
function frame270(){
animate("idle");
}
}
}//package
Section 252
//BrickLandformSmall (BrickLandformSmall)
package {
public dynamic class BrickLandformSmall extends Landform {
public function BrickLandformSmall(){
super();
}
}
}//package
Section 253
//BrickPlatformMedium (BrickPlatformMedium)
package {
public dynamic class BrickPlatformMedium extends Platform {
public function BrickPlatformMedium(){
super();
}
}
}//package
Section 254
//Bubble (Bubble)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Bubble extends MovieClip {
public var item:MovieClip;
public var face:MovieClip;
public var box:TextField;
public function Bubble(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 255
//Bullet (Bullet)
package {
import flash.utils.*;
public class Bullet extends Foe {
public var lifeTime:int;// = 50
public function Bullet(angle:Number=0){
lifeTime = 50;
super();
addFrameScript(0, frame1, 13, frame14, 19, frame20);
rotation = 200;
rotation = angle;
if ((((rotation > 90)) || ((rotation <= -90)))){
rotation = (rotation + 180);
};
angle = (angle * (Math.PI / 180));
xSpeed = -((Math.cos(angle) * 23));
ySpeed = -((Math.sin(angle) * 23));
EXP = 0;
HP = 9999;
recoilType = 0;
attack = (attack * 7);
dropRate = 0;
soundHit = "metal";
soundDie = "";
monster = 1;
landFoe = false;
dynamicFoe = true;
noTurn = true;
projectile = true;
}
override public function behave(){
lifeTime--;
xSpeed = (xSpeed * 0.98);
ySpeed = (ySpeed * 0.98);
hitFoes();
if (lifeTime == 0){
die();
};
}
function frame14(){
gotoAndStop("idle2");
}
function frame1(){
init();
stop();
}
function frame20(){
kill();
}
public function hitFoes(){
for each (f in Game.level.foes) {
if (((((((((((((f) && (!((f == this))))) && (f.hitbox))) && (f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == Gunslinger))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == GunslingerDark))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == Bullet))))){
f.hit(30, true);
};
};
}
}
}//package
Section 256
//Bush (Bush)
package {
public class Bush extends Foe {
public var accel:Number;// = 0.7
public function Bush(){
accel = 0.7;
super();
addFrameScript(0, frame1, 2, frame3, 9, frame10, 21, frame22, 32, frame33);
EXP = 3;
HP = 40;
recoilType = 1;
attack = (attack * 3);
dropRate = 0.4;
soundHit = "bush";
soundDie = "hit2";
monster = 1;
maxSpeed = 5;
hidden = true;
immortal = true;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
stopped = true;
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.5));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if (((((((onGround) && ((Math.random() < 0.03)))) && (ready))) && (seePlayer()))){
jump(17);
};
}
function frame10(){
animate("idle");
hidden = false;
ready = true;
}
function frame22(){
gotoAndStop(animation);
}
function frame3(){
immortal = false;
SFX.sound("bush");
}
function frame1(){
init();
stop();
}
function frame33(){
kill();
}
override public function wakeUp(){
jump((15 + Math.round((Math.random() * 14))));
}
}
}//package
Section 257
//BushDark (BushDark)
package {
public class BushDark extends Foe {
private var dir:Boolean;// = false
public var accel:Number;// = 0.7
private var xx:Number;// = 0
private var delay:int;// = 0
public function BushDark(){
accel = 0.7;
dir = false;
xx = 0;
delay = 0;
super();
addFrameScript(0, frame1, 12, frame13, 23, frame24);
EXP = 20;
HP = 120;
recoilType = 1;
attack = (attack * 9);
dropRate = 0.3;
soundHit = "bush";
soundDie = "hit2";
monster = 3;
maxSpeed = 7;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
edgeFall = false;
noTurn = true;
}
override public function behave(){
if ((((Math.abs((xx - x)) < 0.5)) && ((delay > 12)))){
dir = !(dir);
turn();
delay = 0;
};
if (dir){
xSpeed = (xSpeed + 1);
};
if (!dir){
xSpeed = (xSpeed - 1);
};
xx = x;
limitSpeed();
gravity();
delay++;
}
function frame13(){
gotoAndStop(animation);
}
function frame24(){
kill();
}
function frame1(){
init();
stop();
}
}
}//package
Section 258
//BushSnow (BushSnow)
package {
public class BushSnow extends Foe {
public var accel:Number;// = 0.7
public function BushSnow(){
accel = 0.7;
super();
addFrameScript(0, frame1, 2, frame3, 9, frame10, 21, frame22, 32, frame33);
EXP = 15;
HP = 90;
recoilType = 1;
attack = (attack * 7);
dropRate = 0.3;
soundHit = "snow";
soundDie = "hit2";
monster = 2;
maxSpeed = 7;
hidden = true;
immortal = true;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
stopped = true;
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.6));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if (((((((((onGround) && ((Math.random() < 0.05)))) && (ready))) && (seePlayer()))) || ((flash == 250)))){
jump(22);
};
}
function frame10(){
animate("idle");
hidden = false;
ready = true;
}
function frame22(){
gotoAndStop(animation);
}
function frame3(){
immortal = false;
SFX.sound("snow");
}
function frame1(){
init();
stop();
}
function frame33(){
kill();
}
override public function wakeUp(){
jump((15 + Math.round((Math.random() * 14))));
}
}
}//package
Section 259
//Cactus (Cactus)
package {
public class Cactus extends Foe {
public var wait:int;
public function Cactus(){
super();
addFrameScript(0, frame1, 14, frame15, 41, frame42, 55, frame56, 66, frame67);
EXP = 12;
HP = 130;
recoilType = 0;
attack = (attack * 8);
dropRate = 0.5;
soundHit = "tree";
soundDie = "tree";
monster = 2;
}
public function shoot(){
var a:int;
a = 0;
while (a < 360) {
shot = new CactusSpike(a);
parent.addChild(shot);
shot.x = this.x;
shot.y = (this.y - 40);
shot.scaleX = (this.scaleX * 0.8);
shot.scaleY = (this.scaleY * 0.8);
if (facing){
shot.turn();
};
a = (a + 30);
};
}
function frame15(){
if (seePlayer()){
contact = true;
wait++;
};
if (wait == 4){
wait = 0;
animate("attack");
} else {
gotoAndStop(animation);
};
}
function frame1(){
init();
stop();
wait = 2;
}
function frame42(){
shoot();
}
function frame56(){
animate("idle");
}
function frame67(){
kill();
}
}
}//package
Section 260
//CactusSpike (CactusSpike)
package {
public class CactusSpike extends Foe {
public var lifeTime:int;// = 30
public function CactusSpike(angle:Number=0){
lifeTime = 30;
super();
addFrameScript(0, frame1, 13, frame14, 19, frame20);
rotation = 200;
rotation = angle;
angle = (angle * (Math.PI / 180));
xSpeed = -((Math.cos(angle) * 15));
ySpeed = -((Math.sin(angle) * 15));
EXP = 0;
HP = 1;
recoilType = 1;
attack = (attack * 6);
dropRate = 0;
soundHit = "";
soundDie = "";
monster = 1;
landFoe = false;
dynamicFoe = true;
immortal = true;
noTurn = true;
projectile = true;
}
override public function behave(){
lifeTime--;
xSpeed = (xSpeed * 0.93);
ySpeed = (ySpeed * 0.93);
if (lifeTime == 0){
die();
};
}
function frame14(){
gotoAndStop("idle2");
}
function frame1(){
init();
stop();
}
function frame20(){
kill();
}
}
}//package
Section 261
//Camera (Camera)
package {
public class Camera {
public static var tx:Number = 0;
public static var ty:Number = 0;
public static var cameraMode:String = "follow";
public function Camera(){
super();
}
public static function move(xs:int, ys:int){
if (cameraMode == "move"){
if (Game.player.door == -1){
xs = (-(((tx - Game.level.spawnPoint.x) + 350)) / 12);
ys = (-(((ty - Game.level.spawnPoint.y) + 270)) / 12);
} else {
xs = (-((tx - (Game.level[("door" + Game.player.door)].x - 350))) / 12);
ys = (-((ty - (Game.level[("door" + Game.player.door)].y - 320))) / 12);
};
if ((((Math.abs(xs) <= 1)) && ((Math.abs(ys) <= 1)))){
cameraMode = "follow";
Game.player.alpha = 1;
Game.player.setColor(0, 0, 0);
Game.player.superArmor = 60;
spawn();
};
};
xs = Math.round(xs);
ys = Math.round(ys);
tx = (tx + xs);
ty = (ty + ys);
if ((((ty > 100)) && ((cameraMode == "follow")))){
if (Game.player.face){
Game.player.face.gotoAndStop(3);
};
Game.player.alpha = ((100 - ((ty - 100) / 2)) / 100);
};
if ((((ty > 450)) && ((cameraMode == "follow")))){
if (Options.difficulty == 0){
Game.player.HP = (Game.player.HP - 5);
};
if (Options.difficulty == 1){
Game.player.HP = (Game.player.HP - 10);
};
if (Options.difficulty == 2){
Game.player.HP = (Game.player.HP - 15);
};
if (Options.difficulty == 3){
Game.player.HP = (Game.player.HP - 20);
};
if (Game.player.HP <= 0){
Game.player.die();
Game.player.animate("die2");
} else {
cameraMode = "move";
Game.player.respawning = true;
Game.player.face.gotoAndStop(2);
Game.player.alpha = 0;
};
Game.hud.updateHP();
};
Game.level.x = -(tx);
if (Options.background){
Game.level.background.x = ((tx * 0.85) - 300);
Game.level.background2.x = ((tx * 0.88) - 300);
Game.level.clouds.x = tx;
Game.level.clouds.y = (ty * 0.5);
Game.level.background.y = (ty * 0.35);
Game.level.background2.y = (ty * 0.4);
};
Game.level.sky.x = tx;
Game.level.pit.x = tx;
Game.level.y = -(ty);
Game.level.sky.y = (-120 + (ty * 0.6));
}
public static function spawn(){
if (Game.player.door == -1){
tx = (Game.level.spawnPoint.x - Game.player.x);
ty = (Game.level.spawnPoint.y - Game.player.y);
} else {
tx = (Game.level[("door" + Game.player.door)].x - 350);
ty = (Game.level[("door" + Game.player.door)].y - 320);
};
tx = Math.round(tx);
ty = Math.round(ty);
e = new Heal();
Game.level.addChild(e);
e.x = (Game.player.x + tx);
e.y = (Game.player.y + ty);
Game.player.respawning = false;
Game.player.onGround = false;
}
}
}//package
Section 262
//Chest (Chest)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Chest extends MovieClip {
public var ID:int;
public var opened:Boolean;
public function Chest(){
super();
addFrameScript(0, frame1, 5, frame6, 26, frame27);
}
function frame1(){
stop();
opened = false;
if (parent.addChest){
parent.addChest(this);
} else {
parent.parent.addChest(this);
};
if ((((LevelState.getChest(name.slice(5)) == 2)) || ((LevelState.getChest(name.slice(5)) == 1)))){
gotoAndStop(27);
opened = true;
};
}
function frame6(){
SFX.sound("chest", "p");
}
function frame27(){
stop();
}
}
}//package
Section 263
//ChestBubble (ChestBubble)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class ChestBubble extends MovieClip {
public var item:MovieClip;
public var e:MovieClip;
public var numberBox:TextField;
public function ChestBubble(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 264
//ClayDark (ClayDark)
package {
import flash.display.*;
public class ClayDark extends Foe {
public var sightbox3:MovieClip;
public var sightbox2:MovieClip;
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function ClayDark(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 8, frame9, 25, frame26, 36, frame37, 44, frame45, 52, frame53, 55, frame56, 61, frame62, 72, frame73, 73, frame74, 83, frame84, 88, frame89, 89, frame90, 92, frame93, 132, frame133, 135, frame136, 148, frame149);
EXP = 110;
HP = 280;
maxSpeed = 3;
recoilType = 1;
attack = (attack * 10);
dropRate = 0.5;
ready = true;
edgeFall = false;
monster = 2;
}
function frame149(){
kill();
}
override public function behave(){
if (((((seePlayer()) || (aggro))) && (ready))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - rx);
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if ((((((Math.abs(xSpeed) > 1)) && (!((animation == "attack1"))))) && (!((animation == "attack2"))))){
animate("walk");
};
}
function frame26(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame9(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame1(){
init();
stop();
}
function frame45(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame37(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
} else {
gotoAndStop(animation);
};
};
}
function frame53(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
} else {
gotoAndStop(animation);
};
};
}
function frame56(){
ready = false;
noTurn = true;
attacking = true;
attackPower = 1.4;
}
function frame62(){
recoilType = -1;
}
function frame74(){
rock();
}
function frame84(){
recoilType = 1;
}
function frame73(){
rock();
SFX.sound("pound");
}
function frame89(){
ready = true;
noTurn = false;
attacking = false;
}
function frame90(){
animate("idle");
}
function frame93(){
ready = false;
noTurn = true;
attacking = true;
attackPower = 1.4;
}
public function rock(){
shot = new Rock(1);
parent.addChild(shot);
shot.y = this.y;
shot.x = (this.x - 25);
shot.ySpeed = (-17 - (Math.random() * 8));
if (facing){
shot.xSpeed = ((Math.random() * 10) + 2);
} else {
shot.xSpeed = ((-(Math.random()) * 10) - 2);
};
shot.scaleX = 0.8;
shot.scaleY = 0.8;
}
public function seePlayer2(){
return (sightbox2.hitTestPoint(player.x, (player.y - 40), true));
}
public function seePlayer3(){
return (sightbox3.hitTestPoint(player.x, (player.y - 40), true));
}
function frame136(){
animate("idle");
}
function frame133(){
ready = true;
noTurn = false;
attacking = false;
}
}
}//package
Section 265
//ClayRed (ClayRed)
package {
import flash.display.*;
public class ClayRed extends Foe {
public var sightbox3:MovieClip;
public var sightbox2:MovieClip;
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function ClayRed(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 8, frame9, 25, frame26, 36, frame37, 44, frame45, 52, frame53, 55, frame56, 73, frame74, 74, frame75, 86, frame87, 87, frame88, 90, frame91, 130, frame131, 133, frame134, 146, frame147);
EXP = 16;
HP = 180;
maxSpeed = 3;
recoilType = 1;
attack = (attack * 6);
dropRate = 0.5;
ready = true;
edgeFall = false;
}
override public function behave(){
if (((((seePlayer()) || (aggro))) && (ready))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - rx);
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if ((((((Math.abs(xSpeed) > 1)) && (!((animation == "attack1"))))) && (!((animation == "attack2"))))){
animate("walk");
};
}
function frame26(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame9(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame1(){
init();
stop();
}
function frame45(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
};
};
}
function frame37(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
} else {
gotoAndStop(animation);
};
};
}
function frame53(){
if (seePlayer2()){
animate("attack2");
} else {
if (seePlayer3()){
animate("attack1");
} else {
gotoAndStop(animation);
};
};
}
function frame56(){
ready = false;
noTurn = true;
attacking = true;
attackPower = 1.4;
}
function frame75(){
xSpeed = (xSpeed * 2);
}
function frame74(){
xSpeed = (xSpeed * 2);
}
function frame87(){
ready = true;
noTurn = false;
attacking = false;
}
function frame88(){
animate("idle");
}
function frame91(){
ready = false;
noTurn = true;
attacking = true;
attackPower = 1.4;
}
public function seePlayer2(){
return (sightbox2.hitTestPoint(player.x, (player.y - 40)));
}
public function seePlayer3(){
return (sightbox3.hitTestPoint(player.x, (player.y - 40)));
}
function frame134(){
animate("idle");
}
function frame147(){
kill();
}
function frame131(){
ready = true;
noTurn = false;
attacking = false;
}
}
}//package
Section 266
//Clouds (Clouds)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Clouds extends MovieClip {
public var c1:MovieClip;
public var c2:MovieClip;
public var cc3:MovieClip;
public var cc4:MovieClip;
public function Clouds(){
super();
addFrameScript(0, frame1);
}
function frame1(){
}
public function move(){
if (c1){
c1.x = (c1.x - 3);
if (c1.x < -1270){
c1.x = -50;
};
c2.x = (c2.x - 5);
if (c2.x < -1270){
c2.x = -50;
};
};
}
}
}//package
Section 267
//Coin (Coin)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Coin extends MovieClip {
public var ID:int;
public var old:Boolean;
public function Coin(){
super();
addFrameScript(0, frame1, 2, frame3, 3, frame4, 20, frame21);
}
function frame3(){
old = true;
}
function frame1(){
gotoAndStop(2);
if (parent.parent.addCoin){
parent.parent.addCoin(this);
};
old = false;
}
function frame4(){
SFX.sound("coin", "p");
}
function frame21(){
stop();
parent.removeChild(this);
}
}
}//package
Section 268
//Door (Door)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Door extends MovieClip {
public function Door(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
visible = true;
}
}
}//package
Section 269
//Equip (Equip)
package {
public class Equip {
public var attack:Number;
public var graphic:int;
public var type:int;
public var name:String;
public var magic:Number;
public var HP:Number;
public var special:int;
public var ID:int;
public var description:String;
public function Equip(name:String, description:String, graphic:int, HP:Number, attack:Number, magic:Number, special:int, type:int){
super();
this.name = name;
this.description = description;
this.graphic = graphic;
this.HP = HP;
this.attack = attack;
this.magic = magic;
this.special = special;
this.type = type;
}
}
}//package
Section 270
//Equips (Equips)
package {
public class Equips {
public static var pirateHat:Equip = new Equip("Pirate Hat", "+10% HP, +20% atk, +20% mag", 1, 0.1, 0.2, 0.2, 0, 0);
public static var equips:Array = [pirateHat, ninjaHood, knightHelm, vikingHelm, mageHat, pirateArmor, ninjaGear, knightArmor, vikingArmor, mageRobe, cutlass, katana, blade, claymore, umbrella];
public static var umbrella:Equip = new Equip("Umbrella", "+20% atk, +20% mag, hold Jump to float", 3, 0, 0.2, 0.2, 2, 2);
public static var ninjaHood:Equip = new Equip("Ninja Hood", "+30% atk, +30% mag", 4, 0, 0.3, 0.3, 0, 0);
public static var mageHat:Equip = new Equip("Mage Hat", "-20% atk, +60% mag", 5, 0, -0.2, 0.6, 0, 0);
public static var vikingArmor:Equip = new Equip("Viking Armor", "+20% HP, +30% atk", 5, 0.2, 0.3, 0, 0, 1);
public static var cutlass:Equip = new Equip("Cutlass", "+10% HP, +20% atk, +20% mag", 1, 0.1, 0.2, 0.2, 0, 2);
public static var blade:Equip = new Equip("Mana Staff", "-50% atk, +40% mag, absorbs MP from foes", 5, 0, -0.5, 0.4, 3, 2);
public static var mageRobe:Equip = new Equip("Mage Robe", "-10% HP, +40% mag, 1 extra MP", 4, -0.1, 0, 0.4, 6, 1);
public static var pirateArmor:Equip = new Equip("Pirate Jacket", "+10% HP, +20% atk, +20% mag", 1, 0.1, 0.2, 0.2, 0, 1);
public static var vikingHelm:Equip = new Equip("Viking Helm", "+20% HP, +70% atk, can't use magic", 3, 0.2, 0.7, -5, 4, 0);
public static var knightHelm:Equip = new Equip("Knight Helm", "+40% HP", 2, 0.4, 0, 0, 0, 0);
public static var knightArmor:Equip = new Equip("Knight Armor", "+40% HP", 2, 0.4, 0, 0, 0, 1);
public static var katana:Equip = new Equip("Katana", "+20% atk, +10% mag, faster slashes", 2, 0, 0.2, 0.1, 1, 2);
public static var ninjaGear:Equip = new Equip("Ninja Gear", "+10% atk, +10% mag, jump a bit higher", 3, 0, 0.1, 0.1, 5, 1);
public static var claymore:Equip = new Equip("Claymore", "+20% HP, +40% atk, -20% mag", 6, 0.2, 0.4, -0.2, 0, 2);
public function Equips(){
super();
}
public static function init(){
var a:int;
a = 0;
while (a < equips.length) {
equips[a].ID = a;
a++;
};
}
public static function getEquip(equip:Equip){
SaveData.equipData[equip.ID] = true;
trace(("Got Equip: " + equip.ID));
}
}
}//package
Section 271
//Eyeball (Eyeball)
package {
public class Eyeball extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function Eyeball(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 23, frame24, 28, frame29, 44, frame45, 57, frame58);
EXP = 12;
HP = 110;
recoilType = 1;
attack = (attack * 8);
dropRate = 0.3;
soundHit = "bat";
soundDie = "hit2";
maxSpeed = 14;
monster = 1;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
landFoe = false;
ready = false;
}
override public function behave(){
seePlayer();
if (ready){
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
xSpeed = (xSpeed - (rx * 10));
ySpeed = (ySpeed - (ry * 10));
} else {
ySpeed = (ySpeed * 0.92);
xSpeed = (xSpeed * 0.92);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = maxSpeed;
};
if (ySpeed > (maxSpeed / 2)){
ySpeed = (maxSpeed / 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = -(maxSpeed);
};
if (ySpeed < (-(maxSpeed) / 2)){
ySpeed = (-(maxSpeed) / 2);
};
};
}
function frame29(){
ready = false;
}
function frame24(){
if (((seePlayer()) || (aggro))){
wait++;
};
if (wait == 2){
animate("dash");
ready = true;
wait = 0;
} else {
gotoAndStop(animation);
};
}
function frame1(){
init();
stop();
}
function frame45(){
animate("idle");
}
function frame58(){
kill();
}
}
}//package
Section 272
//EyeballIce (EyeballIce)
package {
public class EyeballIce extends Foe {
public var accel:Number;// = 0.5
public var fear2:int;// = 1
public var fear:int;// = 0
public var wait:int;// = 0
public var ball:Spikeball;
public function EyeballIce(){
accel = 0.5;
wait = 0;
fear = 0;
fear2 = 1;
super();
addFrameScript(0, frame1, 23, frame24, 28, frame29, 49, frame50, 62, frame63);
EXP = 80;
HP = 250;
recoilType = 2;
attack = (attack * 12);
dropRate = 0.4;
soundHit = "bat";
soundDie = "hit2";
maxSpeed = 8;
monster = 1;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
landFoe = false;
ready = false;
}
override public function behave(){
if (((ball) && (parent.contains(ball)))){
parent.setChildIndex(ball, (parent.getChildIndex(this) - 1));
};
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
if (rt == 0){
rt = 1;
};
rx = (rx / rt);
ry = (ry / rt);
fear--;
if (fear < 0){
fear2 = 1;
} else {
fear2 = (-1 * (fear / 30));
};
xSpeed = (xSpeed - ((rx * 2) * fear2));
ySpeed = (ySpeed - ((ry * 2) * fear2));
ySpeed = (ySpeed * 0.86);
xSpeed = (xSpeed * 0.86);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = maxSpeed;
};
if (ySpeed > (maxSpeed / 2)){
ySpeed = (maxSpeed / 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = -(maxSpeed);
};
if (ySpeed < (-(maxSpeed) / 2)){
ySpeed = (-(maxSpeed) / 2);
};
} else {
fear = 30;
ySpeed = (ySpeed + 2);
};
}
function frame29(){
ready = false;
}
function frame24(){
if (((seePlayer()) || (aggro))){
wait++;
};
if (wait == 2){
animate("dash");
ready = true;
wait = 0;
} else {
gotoAndStop(animation);
};
}
function frame1(){
init();
init2();
stop();
}
function frame50(){
gotoAndStop("dash");
ready = true;
}
public function init2(){
if (deathType != 3){
ball = new Spikeball(3);
parent.addChildAt(ball, (parent.getChildIndex(this) - 1));
ball.x = this.x;
ball.y = this.y;
ball.father = this;
};
}
function frame63(){
kill();
}
}
}//package
Section 273
//fire (fire)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class fire extends MovieClip {
public function fire(){
super();
addFrameScript(25, frame26);
}
function frame26(){
this.removeMovieClip();
}
}
}//package
Section 274
//FireAttack (FireAttack)
package {
public class FireAttack extends Foe {
public function FireAttack(){
super();
addFrameScript(0, frame1, 1, frame2, 21, frame22);
attack = (attack * 14);
dynamicFoe = true;
attacking = true;
projectile = true;
}
function frame2(){
SFX.sound("fire");
}
function frame22(){
kill();
}
function frame1(){
init();
stop();
}
}
}//package
Section 275
//Fireball (Fireball)
package {
import flash.utils.*;
public class Fireball extends Foe {
public var lifeTime:int;// = 90
public function Fireball(){
lifeTime = 90;
super();
addFrameScript(0, frame1, 16, frame17, 28, frame29);
EXP = 0;
HP = 1;
maxSpeed = 14;
attack = (attack * 14);
dropRate = 0;
soundDie = "fire";
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
immortal = true;
dynamicFoe = true;
noTurn = true;
projectile = true;
}
override public function behave(){
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
if (lifeTime == 90){
xSpeed = (xSpeed - ((rx * 15) * (1 + (Math.random() / 5))));
ySpeed = (ySpeed - ((ry * 15) * (1 + (Math.random() / 5))));
} else {
xSpeed = (xSpeed - (rx * 1));
ySpeed = (ySpeed - (ry * 1));
};
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
lifeTime--;
hitFoes();
if (lifeTime == 0){
die();
};
}
function frame17(){
gotoAndStop("idle2");
}
function frame29(){
kill();
}
function frame1(){
init();
stop();
}
public function hitFoes(){
for each (f in Game.level.foes) {
if ((((((((((((lifeTime < 82)) && (f))) && (!((f == this))))) && (f.hitbox))) && (f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == Fireball))))){
f.hit(60, true);
if (!dead){
die();
};
};
};
}
}
}//package
Section 276
//Foe (Foe)
package {
import flash.display.*;
import flash.geom.*;
public class Foe extends MovieClip {
protected var pl:MovieClip;
protected var soundHit:String;// = "target"
public var dynamicFoe:Boolean;// = false
protected var contact:Boolean;// = false
protected var cruiser:Number;// = 0
public var onGround:Boolean;// = false
public var attack:Number;// = 1
public var rt:Number;// = 0
public var dots:MovieClip;
public var statusType:String;// = ""
protected var rr:Number;// = 0
public var ry:Number;// = 0
public var f:Foe;
public var rx:Number;// = 0
public var airCombo:int;// = 0
protected var dropRate:Number;// = 0.4
public var p:Point;
public var dead:Boolean;// = false
protected var w:int;// = 0
public var bubble:MovieClip;
protected var attacking:Boolean;// = false
protected var killed:Boolean;// = false
public var superArmor:int;// = 0
public var xSpeed:Number;// = 0
public var immortal:Boolean;// = false
protected var landFoe:Boolean;// = true
public var edgeFall:Boolean;// = true
protected var player:Player;
protected var fatness:int;// = 15
protected var soundDie:String;// = "target2"
public var shot:Foe;
public var HP:int;// = 50
public var aggro:int;// = 0
public var sightbox:MovieClip;
public var ID:int;
public var homeLandform:MovieClip;
protected var displace:int;// = 0
public var slip:Number;// = 1
public var maxSpeed:Number;// = 5
public var ySpeed:Number;// = 0
public var hitbox:MovieClip;
protected var color:ColorTransform;
public var father:Foe;
public var maxHP:int;// = 50
public var boss:Boolean;// = false
public var animation:String;// = ""
protected var dropSize:Number;// = 1
public var pattern:int;// = 0
public var recoilType:int;// = 0
public var attackPower:Number;// = 1
public var ready:Boolean;// = false
public var contactDamage:Boolean;// = true
public var hidden:Boolean;// = false
protected var startAnim:String;// = "idle"
public var knockback:int;// = 1
protected var stopped:Boolean;// = false
public var deathType:int;// = 2
public var hitCombo:int;// = 0
protected var groundFoe:Boolean;// = false
protected var facing:Boolean;// = false
protected var noTurn:Boolean;// = false
public var monster:int;// = 1
public var statusTime:int;// = 0
protected var projectile:Boolean;// = false
protected var flash:int;// = 0
public var status:MovieClip;
public var EXP:int;// = 0
public function Foe(){
HP = 50;
maxHP = 50;
EXP = 0;
dropRate = 0.4;
dropSize = 1;
attack = 1;
attackPower = 1;
soundHit = "target";
soundDie = "target2";
flash = 0;
monster = 1;
xSpeed = 0;
ySpeed = 0;
maxSpeed = 5;
cruiser = 0;
noTurn = false;
facing = false;
hidden = false;
immortal = false;
fatness = 15;
onGround = false;
ready = false;
w = 0;
startAnim = "idle";
landFoe = true;
stopped = false;
edgeFall = true;
slip = 1;
rx = 0;
ry = 0;
rt = 0;
rr = 0;
recoilType = 0;
displace = 0;
knockback = 1;
hitCombo = 0;
superArmor = 0;
airCombo = 0;
aggro = 0;
contact = false;
contactDamage = true;
dead = false;
killed = false;
statusType = "";
statusTime = 0;
animation = "";
p = new Point();
pattern = 0;
dynamicFoe = false;
deathType = 2;
boss = false;
attacking = false;
projectile = false;
groundFoe = false;
super();
color = new ColorTransform();
}
function hitWalls(){
if (isNaN(xSpeed)){
xSpeed = 0;
};
w = 0;
for each (pl in Game.level.landforms) {
while (pl.hitbox2.hitTestPoint(((((localToGlobal(p).x + fatness) + 1) + xSpeed) + w), (localToGlobal(p).y - 6), true)) {
w--;
};
while (pl.hitbox2.hitTestPoint(((((localToGlobal(p).x - fatness) - 1) + xSpeed) + w), (localToGlobal(p).y - 6), true)) {
w++;
};
};
while (parent.land3.hitTestPoint(((((localToGlobal(p).x + fatness) + 1) + xSpeed) + w), (localToGlobal(p).y - 6), true)) {
w--;
};
while (parent.land3.hitTestPoint(((((localToGlobal(p).x - fatness) - 1) + xSpeed) + w), (localToGlobal(p).y - 6), true)) {
w++;
};
x = (x + w);
}
function hitLand(o:int=0):Boolean{
for each (pl in Game.level.specialPlatforms) {
if (((((((pl.hitbox2) && (((pl.hitbox2.hitTestPoint((localToGlobal(p).x + fatness), ((localToGlobal(p).y + displace) + o), true)) || (pl.hitbox2.hitTestPoint((localToGlobal(p).x - fatness), ((localToGlobal(p).y + displace) + o), true)))))) && ((ySpeed >= -1)))) && (((!(pl.hitbox2.hitTestPoint((localToGlobal(p).x + fatness), ((((localToGlobal(p).y - 5) + displace) + o) - ySpeed), true))) && (!(pl.hitbox2.hitTestPoint((localToGlobal(p).x - fatness), ((((localToGlobal(p).y - 5) + displace) + o) - ySpeed), true))))))){
if (((pl.slippery) && (onGround))){
slip = 0.5;
};
return (pl.effect3(this));
};
};
if (((((parent.land3.hitTestPoint((localToGlobal(p).x + fatness), ((localToGlobal(p).y + displace) + o), true)) || (parent.land3.hitTestPoint((localToGlobal(p).x - fatness), ((localToGlobal(p).y + displace) + o), true)))) || (((((((parent.platforms2.hitTestPoint((localToGlobal(p).x + fatness), ((localToGlobal(p).y + displace) + o), true)) && ((ySpeed >= -1)))) || (((parent.platforms2.hitTestPoint((localToGlobal(p).x - fatness), ((localToGlobal(p).y + displace) + o), true)) && ((ySpeed >= -1)))))) && (((((((!(parent.platforms2.hitTestPoint((localToGlobal(p).x + fatness), ((((localToGlobal(p).y - 5) - ySpeed) + displace) + o), true))) && ((ySpeed >= -1)))) || (((!(parent.platforms2.hitTestPoint((localToGlobal(p).x - fatness), ((((localToGlobal(p).y - 5) - ySpeed) + displace) + o), true))) && ((ySpeed >= -1)))))) || (onGround))))))){
return (true);
};
for each (pl in Game.level.landforms) {
if (((pl.hitbox2) && (((pl.hitbox2.hitTestPoint((localToGlobal(p).x + fatness), ((localToGlobal(p).y + displace) + o), true)) || (pl.hitbox2.hitTestPoint((localToGlobal(p).x - fatness), ((localToGlobal(p).y + displace) + o), true)))))){
if (((pl.slippery) && (onGround))){
slip = 0.5;
};
return (true);
};
};
return (false);
}
public function setColor(r:int, g:int, b:int){
color.redOffset = r;
color.greenOffset = g;
color.blueOffset = b;
this.transform.colorTransform = color;
}
public function behave(){
}
public function jump(h:Number){
if (!(statusType) != "freeze"){
ySpeed = -(h);
onGround = false;
};
}
function gravity(){
if (!hitLand()){
ySpeed = (ySpeed + 1.8);
if (ySpeed > 14){
ySpeed = 14;
};
if (!hitLand(1)){
onGround = false;
};
} else {
onGround = true;
airCombo = 0;
groundFoe = true;
while (hitLand()) {
y--;
};
ySpeed = 0;
};
hitWalls();
if (y > 450){
die();
};
}
public function die(){
if (((boss) && (Medals.stats.noHit))){
Medals.unlock(Medals.bossImmunity);
};
superArmor = 0;
attacking = false;
Items.dropItem(this, dropRate, 0, dropSize);
if (EXP != 0){
Numbers.expNumber(this, (("+" + EXP) + "EXP"), 5, 1.4);
};
player.getEXP(EXP);
dead = true;
gotoAndPlay("die");
if (status){
status.status.visible = false;
status.gotoAndStop(1);
};
if (!projectile){
Medals.stats.kills++;
trace(("Kills: " + Medals.stats.kills));
if (!Main.offline){
Game.root.kongregate.stats.submit("kills", 1);
};
};
statusTime = 0;
SFX.sound(soundDie, "f");
if (bubble){
bubble.visible = false;
};
if (!dynamicFoe){
LevelState.setFoe(ID, deathType);
};
}
function turn(){
scaleX = (scaleX * -1);
facing = !(facing);
}
public function getHomePlatform(){
for each (pl in Game.level.landforms) {
if (((pl.hitbox2) && (pl.hitbox2.hitTestPoint(localToGlobal(p).x, ((localToGlobal(p).y + displace) + 20), true)))){
homeLandform = pl;
};
};
for each (pl in Game.level.specialPlatforms) {
if (((((pl.standable) && (pl.hitbox2))) && (pl.hitbox2.hitTestPoint(localToGlobal(p).x, ((localToGlobal(p).y + displace) + 20), true)))){
homeLandform = pl;
};
};
}
public function animate(a:String){
if (a != animation){
gotoAndStop(a);
animation = a;
};
}
public function init(){
if (Game.levelNo != 22){
parent.setChildIndex(this, (parent.numChildren - 1));
};
ID = parent.foes.length;
parent.foes.push(this);
player = Game.player;
EXP = (EXP * Math.abs((scaleX * ((1 + scaleY) / 2))));
HP = (HP * (Math.abs((scaleX * scaleY)) * (0.9 + (Options.difficulty / 10))));
maxHP = HP;
animate(startAnim);
cruiser = xSpeed;
p.x = 0;
p.y = 0;
if ((((LevelState.getFoe(ID) == 2)) && (!(dynamicFoe)))){
deathType = 3;
} else {
if (boss){
BGM.play(6);
Medals.stats.noHit = true;
Game.hud.bossBar.visible = true;
Game.hud.bossBar2.visible = true;
Game.hud.updateBossBar(1);
};
};
getHomePlatform();
}
public function seePlayer():Boolean{
var b:Boolean;
b = sightbox.hitTestPoint(player.x, (player.y - 40), true);
if (((((b) && (!(contact)))) && (bubble))){
if (!aggro){
bubble.gotoAndPlay("exclaim");
};
contact = true;
} else {
if (!b){
contact = false;
};
};
return (b);
}
function getAngle(){
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
}
public function setStatus(status:String, time:int){
if (((((this) && (!(dead)))) && (this.status))){
this.status.gotoAndStop(status);
statusType = status;
statusTime = time;
if (this.status.status){
this.status.status.alpha = 1;
};
if (this.status.status){
this.status.status.visible = true;
};
};
}
function recoil(){
var pr:Number;
getAngle();
homeLandform = null;
if (((!(player.onGround)) && (Keys.keyIsDown[Keys.jumpKey]))){
pr = ((-(ry) * 19) - 5);
if ((((pr < 0)) && ((pr < player.ySpeed)))){
player.ySpeed = (pr * player.bounce);
if ((((player.bounce > 0)) && ((player.comboFall < 2)))){
player.bounce = (player.bounce - 0.1);
if (player.bounce < 0.4){
Medals.unlock(Medals.foeBouncer);
};
};
player.comboFall = 5;
};
};
if (recoilType == 0){
x = (x + (rx * 8));
y = (y + (ry * 8));
} else {
if (recoilType >= 1){
xSpeed = (((rx * 11) * player.knockBack) * recoilType);
ySpeed = (((ry * 11) * player.knockBack) * recoilType);
};
};
rr = 4;
}
public function limitSpeed(){
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = maxSpeed;
};
if (xSpeed < -(maxSpeed)){
xSpeed = -(maxSpeed);
};
};
}
function edgeStop(){
if (((!(edgeFall)) && (homeLandform))){
if (homeLandform.hitbox2){
if (x > ((homeLandform.x + ((homeLandform.hitbox2.x + homeLandform.hitbox2.width) * homeLandform.scaleX)) - fatness)){
x = ((homeLandform.x + ((homeLandform.hitbox2.x + homeLandform.hitbox2.width) * homeLandform.scaleX)) - fatness);
xSpeed = 0;
};
if (x < ((homeLandform.x + (homeLandform.hitbox2.x * homeLandform.scaleX)) + fatness)){
x = ((homeLandform.x + (homeLandform.hitbox2.x * homeLandform.scaleX)) + fatness);
xSpeed = 0;
};
} else {
homeLandform = null;
};
};
}
public function wakeUp(){
}
public function kill(){
stop();
killed = true;
Game.level.foes.splice(Game.level.foes.indexOf(this), 1);
trace("foe killed");
if (Game.level.foes.length == 0){
Game.level.allDead();
};
parent.removeChild(this);
}
public function hitPoint(m:MovieClip){
var p:Point;
p = new Point();
p.x = m.x;
p.y = m.y;
if (((((((m) && (attacking))) && (Game.player))) && (Game.player.hitbox.hitTestPoint(localToGlobal(p).x, localToGlobal(p).y, true)))){
Game.player.hit((attackPower * attack), this);
};
}
public function hit(damage:int, fromFoe:Boolean=false):Boolean{
if ((((((((flash <= 0)) && (!(dead)))) && (!(immortal)))) && ((superArmor <= 0)))){
if (statusType == "burn"){
damage = (damage * 1.5);
};
Numbers.damageNumber(this, ("" + damage));
flash = 250;
HP = (HP - damage);
if ((((aggro == 0)) && (bubble))){
bubble.gotoAndPlay("anger");
};
aggro++;
contact = true;
if (recoilType == 1){
airCombo++;
};
if (airCombo == 3){
Medals.unlock(Medals.foeJuggler);
};
if (boss){
Game.hud.updateBossBar((HP / maxHP));
if (fromFoe){
hitCombo = (hitCombo + 23);
} else {
hitCombo = (hitCombo + (Game.player.attackPower * 20));
};
if (hitCombo > 60){
superArmor = 60;
hitCombo = 0;
};
};
if (HP <= 0){
if (((fromFoe) && (boss))){
Medals.unlock(Medals.selfDestruction);
};
if (boss){
BGM.levelMusic();
};
die();
} else {
SFX.sound(soundHit, "f");
};
if (!fromFoe){
recoil();
};
return (true);
};
return (false);
}
public function move(){
var damage:int;
var p:Point;
if (!onGround){
slip = 1;
};
if (deathType == 3){
kill();
};
if (hidden){
if (dots){
dots.nextFrame();
};
if (stopped){
gotoAndStop(2);
} else {
nextFrame();
};
if (seePlayer()){
hidden = false;
wakeUp();
};
} else {
if (!killed){
if (statusType != "freeze"){
nextFrame();
if (bubble){
bubble.nextFrame();
};
};
if (status){
statusTime--;
if (statusTime < 30){
status.status.visible = true;
status.status.alpha = (statusTime / 30);
};
if (statusTime < 0){
status.status.visible = false;
statusType = "";
};
if (((((((statusTime % 15) == 0)) && (!(dead)))) && ((statusType == "poison")))){
damage = 1;
Numbers.damageNumber(this, ("" + damage));
HP = (HP - damage);
if (HP <= 0){
die();
};
};
};
setColor(0, 0, 0);
if (flash > 0){
setColor(flash, flash, flash);
flash = (flash - 50);
};
if (boss){
alpha = 1;
superArmor--;
if (hitCombo > 0){
hitCombo--;
};
if ((((superArmor > 0)) && (((superArmor % 2) == 0)))){
setColor(90, -40, -40);
};
};
if (((((!(dead)) && (!((statusType == "freeze"))))) && (!((animation == ""))))){
if (landFoe){
ySpeed = Math.round(ySpeed);
};
y = (y + ySpeed);
behave();
x = (x + xSpeed);
edgeStop();
};
if (((((contactDamage) && (hitbox))) && (!((statusType == "freeze"))))){
for each (p in player.hitPoints) {
if (hitbox.hitTestPoint((player.x + p.x), (player.y + p.y), true)){
player.hit(attack, this);
break;
};
};
};
if (((p) && (!(noTurn)))){
if ((((localToGlobal(p).x < player.x)) && (!(facing)))){
turn();
};
if ((((localToGlobal(p).x > player.x)) && (facing))){
turn();
};
};
if ((((rr > 0)) && ((recoilType == 0)))){
x = (x + (-(rx) * 2));
y = (y + (-(ry) * 2));
rr--;
};
if (((((!(edgeFall)) && ((flash == 0)))) && ((homeLandform == null)))){
getHomePlatform();
};
};
};
}
}
}//package
Section 277
//ForestLandformBig (ForestLandformBig)
package {
public dynamic class ForestLandformBig extends Landform {
public function ForestLandformBig(){
super();
}
}
}//package
Section 278
//ForestLandformSmall (ForestLandformSmall)
package {
public dynamic class ForestLandformSmall extends Landform {
public function ForestLandformSmall(){
super();
}
}
}//package
Section 279
//ForestLogPlatform (ForestLogPlatform)
package {
public dynamic class ForestLogPlatform extends Platform {
public function ForestLogPlatform(){
super();
}
}
}//package
Section 280
//ForestPlatformBig (ForestPlatformBig)
package {
public dynamic class ForestPlatformBig extends Platform {
public function ForestPlatformBig(){
super();
}
}
}//package
Section 281
//ForestPlatformSmall (ForestPlatformSmall)
package {
public dynamic class ForestPlatformSmall extends Platform {
public function ForestPlatformSmall(){
super();
}
}
}//package
Section 282
//Game (Game)
package {
import flash.utils.*;
import flash.display.*;
import mochi.as3.*;
public class Game {
private var c:MovieClip;
private var ch:Array;
private var i:int;
private var p:MovieClip;
public var tim2:int;// = 0
public var tim3:int;// = 0
public var tim4:int;// = 0
static var ydif:Number = 0;
public static var hot1:Spell;
public static var hot2:Spell = Spells.fire;
public static var hot3:Spell;
static var xdif:Number = 0;
public static var level:Level;
public static var init:Boolean = false;
public static var tim:int = 0;
static var prevTime:int = 0;
public static var retry:Boolean = false;
public static var magic:int = 0;
public static var spell:SpellMC;
static var prevLevel:Class;
public static var winlevel:Boolean = false;
public static var hots:Array = [hot1, hot2, hot3];
public static var selectedSpell:Spell;
static var nextLevel:Class;
static var time:int;
public static var gameover:Boolean = false;
public static var player:Player;
public static var root:Main;
public static var levelType:Class = Level1_1;
public static var levelNo:int = 1;
public static var magicDown:Boolean = false;
static var fps:int;
static var ti:int;
public static var pause:Boolean = false;
public static var hud:Hud;
public function Game(){
tim2 = 0;
tim3 = 0;
tim4 = 0;
super();
}
static function limitAim(){
if (hud.aim.x < 0){
hud.aim.x = 0;
};
if (hud.aim.x > 700){
hud.aim.x = 700;
};
if (hud.aim.y > 450){
hud.aim.y = 450;
};
if (hud.aim.y < 0){
hud.aim.y = 0;
};
}
static function createLevel(l:Class){
if (level){
level.teardown();
root.removeChild(level);
level = null;
root.level = null;
};
levelType = l;
level = new (l);
root.addChild(level);
level.init();
if (player){
root.setChildIndex(player, (root.numChildren - 1));
};
if (hud){
root.setChildIndex(hud, (root.numChildren - 1));
};
}
static function closeSpellMenu(){
hud.spells.gotoAndPlay(10);
hud.spells.selected = 3;
hud.spells.open = false;
magic = 2;
}
static function checkSwitches(){
if (((((((player.onGround) && (Keys.keyIsDown[Keys.interactKey]))) && (!(player.attacking)))) && (!(player.magic)))){
for (i in level.switchs) {
if (((((level.switchs[i].hitTestPoint(player.x, (player.y - player.n), true)) && (!(level.switchs[i].switching)))) && (!(player.interacting)))){
level.switchs[i].play();
level.switchs[i].switching = true;
if (!player.facing){
player.turn();
};
if (!level.switchs[i].opened){
player.animate("switch2");
} else {
player.animate("switch");
};
level.switchs[i].opened = !(level.switchs[i].opened);
player.interacting = true;
player.xSpeed = 0;
break;
};
};
};
}
static function checkItems(){
for (i in level.items) {
if (((level.items[i]) && (!(player.dead)))){
if (((((((level.items[i].hitTestPoint(player.x, ((player.y - player.n) - 40), true)) || (level.items[i].hitTestPoint(player.x, (player.y - player.n), true)))) && (!(level.items[i].taken)))) && (!(player.respawning)))){
level.items[i].take(player);
};
level.items[i].move();
};
};
}
static function keyDown(key:int){
if ((((((((key == Keys.pauseKey)) || ((key == Keys.escapeKey)))) && (!(pause)))) && (!(player.dead)))){
pause = true;
hud.pause.visible = true;
hud.pause.init();
SFX.sound("pause", "m");
BGM.pause();
} else {
if (hud.pause.visible){
if (!hud.pause.config){
hud.pause.select(key);
} else {
hud.pause.keyConfig.configKey(key);
};
} else {
if (hud.gameover.done){
hud.gameover.endMenu.select(key);
};
};
};
if (hud.spells.open){
if ((((key == Keys.leftKey)) || ((key == Keys.rightKey)))){
hud.spells.selectSpell();
} else {
if ((((key == Keys.hot1Key)) && (selectedSpell))){
hot1 = selectedSpell;
} else {
if ((((key == Keys.hot2Key)) && (selectedSpell))){
hot2 = selectedSpell;
} else {
if ((((key == Keys.hot3Key)) && (selectedSpell))){
hot3 = selectedSpell;
};
};
};
};
hud.updateHots();
};
if (!magicDown){
if ((((((key == Keys.jumpKey)) || ((key == Keys.attackKey)))) && ((magic >= 1)))){
trace("cancel spell");
hud.spells.gotoAndPlay(10);
hud.spells.selected = 3;
magic = 0;
hud.aim.visible = false;
pause = false;
Keys.hotKey = 0;
magicDown = true;
} else {
if ((((((((((((key == Keys.magicKey)) && ((magic == 1)))) && (selectedSpell))) && (!((selectedSpell == Spells.heal))))) && (!((selectedSpell == Spells.slash))))) && (!((selectedSpell == Spells.seiken))))){
aimSpell();
magicDown = true;
} else {
if ((((((key == Keys.magicKey)) || ((key == Keys.hotKey)))) && ((magic >= 1)))){
castSpell();
} else {
if (((((((((((((!(player.attacking)) && ((magic == 0)))) && (!(player.magic)))) && (!(pause)))) && (!(player.respawning)))) && (!(player.interacting)))) && (!(player.dead)))){
if (key == Keys.magicKey){
if (player.MP == 0){
magicDown = true;
Numbers.miscNumber("No MP", 6, 1.2);
} else {
trace("choose a spell");
magicDown = true;
pause = true;
magic = 1;
hud.spells.gotoAndPlay(1);
hud.spells.open = true;
selectedSpell = null;
};
} else {
if (key == Keys.hot1Key){
hotSpell(hot1, key);
} else {
if (key == Keys.hot2Key){
hotSpell(hot2, key);
} else {
if (key == Keys.hot3Key){
hotSpell(hot3, key);
};
};
};
};
};
};
};
};
};
level.setChildIndex(level.pit, (level.numChildren - 1));
}
static function castSpell(){
trace("casting spell!!");
if ((((((selectedSpell == Spells.heal)) || ((selectedSpell == Spells.slash)))) || ((selectedSpell == Spells.seiken)))){
closeSpellMenu();
};
player.knockBack = 0.6;
pause = false;
magic = 0;
hud.aim.visible = false;
Keys.hotKey = 0;
magicDown = true;
if (!selectedSpell){
hud.spells.gotoAndPlay(10);
hud.spells.selected = 3;
};
if (selectedSpell){
if (spell){
spell.kill();
};
spell = new SpellMC(selectedSpell);
level.addChild(spell);
trace(selectedSpell.graphic);
trace(selectedSpell.getLevel());
spell.gotoAndStop((("" + selectedSpell.graphic) + selectedSpell.getLevel()));
spell.x = (-(level.x) + hud.aim.x);
spell.y = (-(level.y) + hud.aim.y);
if ((((((selectedSpell == Spells.heal)) || ((selectedSpell == Spells.slash)))) || ((selectedSpell == Spells.seiken)))){
spell.x = (350 - level.x);
spell.y = (225 - level.y);
};
if (selectedSpell == Spells.seiken){
spell.y = (spell.y + 7);
if (!player.facing){
spell.scaleX = (spell.scaleX * -1);
};
};
magicDown = true;
player.MP--;
hud.updateMP();
player.attackPower = 1.2;
if (player.onGround){
player.animate("magic");
} else {
player.animate("magic2");
};
Medals.unlock(Medals.newbieMage);
if (selectedSpell.getLevel() == 3){
Medals.unlock(Medals.masterMage);
};
player.magic = true;
};
}
static function checkSigns(){
if (!player.respawning){
for (i in level.signs) {
if (level.land2[("sign" + i)].hitTestPoint(player.x, (player.y - player.n), true)){
hud.bubble1.fadeIn = true;
hud.bubble1.scaleX = 0.9;
hud.bubble1.scaleY = 0.9;
if (level.signs[i].length <= 3){
hud.bubble1.gotoAndStop(int(level.signs[i]));
} else {
hud.bubble1.gotoAndStop(1);
if (hud.bubble1.box){
hud.bubble1.box.text = level.signs[i];
};
};
break;
};
};
};
}
static function changeLevel(){
player.interacting = true;
player.animate("falling");
trace(((("Going from " + prevLevel) + " to ") + nextLevel));
Game.createLevel(nextLevel);
Camera.spawn();
hud.mapBox.text = level.map;
}
static function gameLoop(){
SFX.countSound = 0;
SFX.prevSound = "";
hud.bubble1.fadeIn = false;
hud.bubble2.fadeIn = false;
if (((((((!(Keys.keyIsDown[Keys.magicKey])) && (!(Keys.keyIsDown[Keys.hot1Key])))) && (!(Keys.keyIsDown[Keys.hot2Key])))) && (!(Keys.keyIsDown[Keys.hot3Key])))){
magicDown = false;
} else {
if ((((((((magic == 0)) && (Keys.keyIsDown[Keys.magicKey]))) && (!(magicDown)))) && (!(pause)))){
keyDown(Keys.magicKey);
} else {
if ((((((((magic == 0)) && (Keys.keyIsDown[Keys.hot1Key]))) && (!(magicDown)))) && (!(pause)))){
keyDown(Keys.hot1Key);
} else {
if ((((((((magic == 0)) && (Keys.keyIsDown[Keys.hot2Key]))) && (!(magicDown)))) && (!(pause)))){
keyDown(Keys.hot2Key);
} else {
if ((((((((magic == 0)) && (Keys.keyIsDown[Keys.hot3Key]))) && (!(magicDown)))) && (!(pause)))){
keyDown(Keys.hot3Key);
};
};
};
};
};
if (hud.aim.visible){
if (Keys.keyIsDown[Keys.upKey]){
hud.aim.y = (hud.aim.y - 15);
};
if (Keys.keyIsDown[Keys.downKey]){
hud.aim.y = (hud.aim.y + 15);
};
if (Keys.keyIsDown[Keys.rightKey]){
hud.aim.x = (hud.aim.x + 15);
};
if (Keys.keyIsDown[Keys.leftKey]){
hud.aim.x = (hud.aim.x - 15);
};
limitAim();
};
if (!pause){
if (level){
checkItems();
checkSigns();
checkChests();
checkSwitches();
checkCoins();
checkDoors();
checkSpells();
checkFoes();
checkPlatforms();
if (level.clouds){
level.clouds.move();
};
if (player){
player.move();
};
};
};
getfps();
}
static function checkPlatforms(){
for each (p in level.specialPlatforms) {
p.nextFrame();
if (p.move){
p.move();
};
};
}
static function checkChests(){
if (((player.onGround) && (!(player.dead)))){
for each (c in level.chestsMC) {
if (c.hitTestPoint(player.x, (player.y - player.n), true)){
ch = level.chests[c.name.slice(5)];
if (((((((!(c.opened)) && (Keys.keyIsDown[Keys.interactKey]))) && (!(player.attacking)))) && (!(player.magic)))){
c.gotoAndPlay(2);
c.opened = true;
player.animate("chest");
player.interacting = true;
player.xSpeed = 0;
if (LevelState.getChest(c.name.slice(5)) != 3){
player.chests++;
};
LevelState.setChest(c.name.slice(5), 2);
if (ch[0] == "mp"){
player.recoverMP(player.maxMP);
Numbers.damageNumber(c, (("+" + player.maxMP) + "MP"), 3, 1.5);
LevelState.setChest(c.name.slice(5), 1);
};
if (ch[0] == "hp"){
player.recoverHP(Math.floor(player.maxHP));
Numbers.damageNumber(c, (("+" + Math.floor(player.maxHP)) + "HP"), 4, 1.5);
LevelState.setChest(c.name.slice(5), 1);
};
if (ch[0] == "exp"){
player.getEXP(ch[1]);
Numbers.expNumber(c, (("+" + ch[1]) + "EXP"), 5, 1.4);
};
if (ch[0] == "mpup"){
player.increaseMP();
Numbers.damageNumber(c, (("+" + player.maxMP) + "MP"), 3, 1.5);
};
if (ch[0] == "hpup"){
player.increaseHP();
Numbers.damageNumber(c, (("+" + Math.floor(player.maxHP)) + "HP"), 4, 1.5);
};
if (ch[0] == "coins"){
player.coins = (player.coins + ch[1]);
LevelState.chestCoins[LevelState.level] = (LevelState.chestCoins[LevelState.level] + ch[1]);
};
if (ch[0] == "equip"){
SaveData.equipPrompt = true;
Equips.getEquip(ch[1]);
};
break;
} else {
if (((c.opened) || ((((LevelState.getChest(c.name.slice(5)) == 3)) && ((((ch[0] == "hp")) || ((ch[0] == "mp")))))))){
hud.bubble2.fadeIn = true;
hud.bubble2.gotoAndStop(ch[0]);
if (hud.bubble2.e){
hud.bubble2.e.gotoAndStop((ch[1].ID + 1));
};
hud.bubble2.numberBox.text = "";
if (ch[0] == "coins"){
hud.bubble2.numberBox.text = ("+£" + ch[1]);
} else {
if (ch[0] == "exp"){
hud.bubble2.numberBox.text = (("+" + ch[1]) + "EXP");
};
};
break;
};
};
};
};
};
}
static function getfps(){
ti++;
if ((ti % 30) == 0){
if (((!(pause)) && (!(gameover)))){
hud.tick();
};
ti = 0;
time = getTimer();
fps = ((30000 / (time - prevTime)) + 1);
if (fps > 30){
fps = 30;
};
hud.fps((("" + fps) + "fps"));
prevTime = getTimer();
};
}
static function hotSpell(sp:Spell, key:int){
trace("hotkey");
magicDown = true;
if (player.MP == 0){
Numbers.miscNumber("No MP", 6, 1.2);
} else {
if (sp){
Keys.hotKey = key;
pause = true;
selectedSpell = sp;
if (magic != 2){
if (((((!((selectedSpell == Spells.heal))) && (!((selectedSpell == Spells.slash))))) && (!((selectedSpell == Spells.seiken))))){
aimSpell();
} else {
castSpell();
};
};
};
};
}
static function checkDoors(){
if (((((((((((((player.onGround) && (Keys.keyIsDown[Keys.interactKey]))) && (!(hud.transitioning)))) && (!(player.attacking)))) && (!(player.magic)))) && (!(player.respawning)))) && (!(player.dead)))){
for (i in level.doors) {
if (((level[("door" + i)].hitTestPoint(player.x, (player.y - player.n), true)) && (level[("door" + i)].visible))){
if (level.doors[i][0] == "end"){
player.animate("end");
level[("door" + i)].cat.visible = false;
} else {
player.animate("door");
prevLevel = Class(getDefinitionByName(getQualifiedClassName(level)));
nextLevel = level.doors[i][0];
};
player.door = level.doors[i][1];
player.interacting = true;
player.xSpeed = 0;
break;
};
};
};
}
static function aimSpell(){
var closest:int;
var f:Foe;
var xd:int;
var yd:int;
hud.aim.visible = true;
hud.aim.x = 350;
hud.aim.y = 225;
closest = 900;
Game.player.alpha = 1;
if (Options.aim){
for each (f in level.foes) {
xd = ((350 - f.x) - level.x);
yd = (((225 - f.y) - level.y) + 25);
if ((((((((((Math.abs(xd) < 390)) && ((Math.abs(yd) < 260)))) && (!(f.immortal)))) && (!(f.dead)))) && ((closest > (Math.abs(xd) + Math.abs(yd)))))){
trace(((("D: " + xd) + " ") + yd));
closest = (Math.abs(xd) + Math.abs(yd));
hud.aim.x = (350 - xd);
hud.aim.y = (225 - yd);
limitAim();
};
};
};
if (selectedSpell.getLevel() == 1){
hud.aim.scaleX = 1.2;
hud.aim.scaleY = 1.2;
} else {
if (selectedSpell.getLevel() == 2){
hud.aim.scaleX = 1.42;
hud.aim.scaleY = 1.42;
} else {
if (selectedSpell.getLevel() == 3){
hud.aim.scaleX = 1.7;
hud.aim.scaleY = 1.7;
};
};
};
closeSpellMenu();
}
static function checkFoes(){
if (((!(player.interacting)) && (!(player.respawning)))){
for (i in level.foes) {
if (level.foes[i]){
level.foes[i].move();
};
};
};
}
static function checkCoins(){
for (i in level.coins) {
if (((((level.coins[i].hitTestPoint(player.x, ((player.y - player.n) - 30), true)) && (!(level.coins[i].opened)))) && (!(player.respawning)))){
level.coins[i].gotoAndPlay(4);
level.coins[i].opened = true;
if (!level.coins[i].old){
player.coins++;
};
LevelState.setCoin(level.coins[i].ID);
};
};
}
static function endGame(){
LevelState.save();
SaveData.playerEXP = player.EXP;
if ((((Game.player.coins == 100)) && ((Game.player.chests == 10)))){
LevelState.perfects[LevelState.level] = true;
};
root.removeChild(hud);
hud = null;
root.hud = null;
root.removeChild(player);
player = null;
root.player = null;
level.teardown();
root.removeChild(level);
level = null;
root.level = null;
root.playing = false;
pause = false;
SaveData.saveGame();
trace("ending gameplay");
MochiEvents.endPlay();
if (LevelState.getCoins() >= 200){
SaveData.spellPrompt = true;
};
}
static function startGame(r:MovieClip, l:Class){
root = r;
trace(("Starting level: " + l));
gameover = false;
winlevel = false;
LevelState.load(levelNo);
createLevel(l);
player = new Player();
root.addChild(player);
player.init();
hud = new Hud(player);
root.addChild(hud);
hud.init();
root.playing = true;
MochiEvents.trackEvent("Level Started", Game.levelNo);
MochiEvents.trackEvent("Level Difficulty", Options.difficulty);
MochiEvents.trackEvent("Music Setting", Options.music);
MochiEvents.trackEvent("Quality Setting", Options.quality);
MochiEvents.startPlay();
trace("Starting gameplay");
BGM.levelMusic();
}
static function checkSpells(){
if (spell){
spell.nextFrame();
};
}
}
}//package
Section 283
//Gunslinger (Gunslinger)
package {
public class Gunslinger extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function Gunslinger(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 24, frame25, 41, frame42, 43, frame44, 53, frame54, 56, frame57, 69, frame70);
EXP = 10;
HP = 90;
recoilType = 1;
maxSpeed = 3;
attack = (attack * 6);
dropRate = 0.5;
soundHit = "metal";
soundDie = "hit2";
monster = 1;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
ready = true;
edgeFall = false;
}
public function shoot(){
if (facing){
shot = new Bullet(180);
shot.x = (this.x + 40);
shot.turn();
} else {
shot = new Bullet(0);
shot.x = (this.x - 40);
};
parent.addChild(shot);
shot.y = (this.y - 45);
SFX.sound("explode");
}
override public function behave(){
if (((((aggro) || (seePlayer()))) && (ready))){
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * accel));
} else {
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
}
function frame2(){
gotoAndStop(((Math.random() * 20) + 2));
}
function frame4(){
if (Math.random() > 0.5){
nextFrame();
};
}
function frame3(){
if (Math.random() > 0.5){
nextFrame();
};
}
function frame1(){
init();
stop();
}
function frame25(){
if (seePlayer()){
wait++;
};
if (wait == 3){
animate("shoot");
wait = 0;
} else {
gotoAndStop(animation);
};
}
function frame42(){
ready = false;
}
function frame44(){
shoot();
}
function frame54(){
ready = true;
}
function frame57(){
animate("idle");
}
function frame70(){
kill();
}
}
}//package
Section 284
//GunslingerDark (GunslingerDark)
package {
public class GunslingerDark extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function GunslingerDark(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 24, frame25, 38, frame39, 40, frame41, 49, frame50, 59, frame60, 65, frame66, 68, frame69, 81, frame82);
EXP = 55;
HP = 200;
recoilType = 1;
maxSpeed = 3;
attack = (attack * 12);
dropRate = 0.5;
soundHit = "metal";
soundDie = "hit2";
monster = 2;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
ready = true;
edgeFall = false;
}
public function shoot(){
if (facing){
shot = new Bullet(180);
shot.x = (this.x + 40);
shot.turn();
} else {
shot = new Bullet(0);
shot.x = (this.x - 40);
};
parent.addChild(shot);
shot.y = (this.y - 45);
shot.attack = 10;
SFX.sound("explode");
}
override public function behave(){
if (((((aggro) || (seePlayer()))) && (ready))){
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * accel));
} else {
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
}
function frame2(){
gotoAndStop(((Math.random() * 20) + 2));
}
function frame4(){
if (Math.random() > 0.5){
nextFrame();
};
}
function frame3(){
if (Math.random() > 0.5){
nextFrame();
};
}
function frame1(){
init();
stop();
}
function frame25(){
if (seePlayer()){
wait++;
};
if (wait == 3){
animate("shoot");
wait = 0;
} else {
gotoAndStop(animation);
};
}
function frame39(){
ready = false;
}
function frame41(){
shoot();
}
function frame66(){
ready = true;
}
function frame50(){
shoot();
}
function frame60(){
shoot();
}
function frame69(){
animate("idle");
}
function frame82(){
kill();
}
}
}//package
Section 285
//Heal (Heal)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Heal extends MovieClip {
public function Heal(){
super();
addFrameScript(23, frame24);
}
function frame24(){
stop();
parent.removeChild(this);
}
}
}//package
Section 286
//Hit (Hit)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Hit extends MovieClip {
public function Hit(){
super();
addFrameScript(4, frame5);
}
function frame5(){
stop();
parent.removeChild(this);
}
}
}//package
Section 287
//Hit2 (Hit2)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Hit2 extends MovieClip {
public function Hit2(){
super();
addFrameScript(8, frame9);
}
function frame9(){
stop();
parent.removeChild(this);
}
}
}//package
Section 288
//Hud (Hud)
package {
import flash.display.*;
import flash.text.*;
import mochi.as3.*;
public class Hud extends MovieClip {
public var pause:MovieClip;
public var message:String;// = "derp"
public var clock:MovieClip;
public var fpsBox:TextField;
public var spells:MovieClip;
public var transitioning:Boolean;// = false
public var intro:MovieClip;
public var seconds:int;// = -2
public var expBar:MovieClip;
public var mapBox:TextField;
public var minutes:int;// = 0
public var mp0:MovieClip;
public var mp1:MovieClip;
public var mp2:MovieClip;
public var mp4:MovieClip;
public var mp6:MovieClip;
public var mp3:MovieClip;
public var mp5:MovieClip;
public var mp7:MovieClip;
public var chestBox:TextField;
public var bubble1:MovieClip;
public var levelup:MovieClip;
public var bubble2:MovieClip;
public var mpBox:TextField;
public var mps:Array;
public var aim:MovieClip;
public var transition:MovieClip;
public var bossBar:MovieClip;
public var mpBar:MovieClip;
public var coinBox:TextField;
public var hot1:MovieClip;
public var hot2:MovieClip;
public var hot3:MovieClip;
public var bossBar2:MovieClip;
public var hpBox:TextField;
public var timeBox:TextField;
public var gameover:MovieClip;
public var hots:Array;
public var hpBar:MovieClip;
public var spellInfo:MovieClip;
public function Hud(p:Player){
message = "derp";
transitioning = false;
seconds = -2;
minutes = 0;
super();
addFrameScript(0, frame1);
x = 0;
y = 0;
hots = [hot1, hot2, hot3];
mps = [mp0, mp1, mp2, mp3, mp4, mp5, mp6, mp7];
hotKeys();
mapBox.text = Game.level.map;
bossBar.visible = false;
bossBar2.visible = false;
if (LevelState.getRank(Game.levelNo) == undefined){
clock.visible = false;
timeBox.visible = false;
};
}
public function updateMP(){
var i:int;
i = 0;
while (i < 8) {
if (i < Game.player.maxMP){
this[("mp" + i)].visible = true;
} else {
this[("mp" + i)].visible = false;
};
i++;
};
i = 0;
while (i < Game.player.maxMP) {
if (i < Game.player.MP){
this[("mp" + i)].gotoAndStop(2);
} else {
this[("mp" + i)].gotoAndStop(1);
};
i++;
};
}
public function updateHots(){
if (Game.hot1){
hot1.gotoAndStop(Game.hot1.graphic);
};
if (Game.hot2){
hot2.gotoAndStop(Game.hot2.graphic);
};
if (Game.hot3){
hot3.gotoAndStop(Game.hot3.graphic);
};
}
public function updateBossBar(HP:Number){
trace(("BOSS HP: " + HP));
bossBar.scaleX = (2.72 * HP);
if (HP <= 0){
bossBar.visible = false;
bossBar2.visible = false;
};
}
function frame1(){
aim.visible = false;
hot1.selected.visible = false;
hot2.selected.visible = false;
hot3.selected.visible = false;
spellInfo.gotoAndStop(8);
init();
}
public function update(){
var b:MovieClip;
expBar.scaleX = ((Game.player.EXP / Game.player.nextEXP) * 1.27);
coinBox.text = Game.player.coins;
chestBox.text = Game.player.chests;
for each (b in [bubble1, bubble2]) {
if (b.fadeIn){
b.alpha = (b.alpha + 0.2);
if (b.alpha > 1){
b.alpha = 1;
};
} else {
b.alpha = (b.alpha - 0.2);
if (b.alpha < 0){
b.alpha = 0;
};
};
};
}
public function levelComplete(){
if (Game.levelNo == 20){
gameover.gotoAndPlay("theEnd");
Medals.unlock(Medals.theEnd);
} else {
gameover.gotoAndPlay("levelComplete");
};
LevelState.setRank();
MochiEvents.trackEvent("Level Complete", Game.levelNo);
trace("unlocking new level");
if ((((SaveData.levelsUnlocked <= Game.levelNo)) && (!((Game.levelNo == 22))))){
MochiEvents.trackEvent("New Level Complete", Game.levelNo);
SaveData.levelsUnlocked = (Game.levelNo + 1);
Game.root.levelUnlock = true;
};
if (!Main.offline){
Game.root.kongregate.stats.submit("levelsCompleted", Game.levelNo);
};
if ((((Game.levelNo == 3)) && ((getTime() <= 40)))){
Medals.unlock(Medals.forestJog);
};
if ((((Game.levelNo == 7)) && ((getTime() <= 50)))){
Medals.unlock(Medals.desertDash);
};
if ((((Game.levelNo == 13)) && ((getTime() <= 60)))){
Medals.unlock(Medals.glacierRun);
};
if ((((Game.levelNo == 19)) && ((getTime() <= 70)))){
Medals.unlock(Medals.volcanoSprint);
};
if ((((Game.levelNo == 21)) && ((Options.difficulty > 1)))){
Medals.unlock(Medals.foeExterminator);
};
if ((((Game.levelNo == 22)) && ((Options.difficulty > 1)))){
Medals.unlock(Medals.bossHunter);
};
}
public function fps(f:String){
fpsBox.text = f;
}
public function init(){
tick();
updateMP();
updateHP();
updateHots();
transition.gotoAndPlay(33);
message = "derp";
}
public function displayLevelNo(){
if (intro.currentFrame > 5){
intro.gotoAndPlay(1);
message = ("" + Game.level.map);
};
}
public function getTime(){
return ((seconds + (minutes * 60)));
}
public function playLevelup(){
levelup.gotoAndPlay(2);
}
public function updateHP(){
hpBox.text = Game.player.HP;
hpBar.scaleX = ((Game.player.HP / Game.player.maxHP) * 0.89);
}
public function tick(){
seconds++;
if (seconds == 60){
seconds = 0;
minutes++;
};
timeBox.text = Options.formatTime(minutes, seconds);
}
public function showSpells(){
spells.gotoAndPlay(2);
}
public function hotKeys(){
var i:int;
i = 0;
while (i < 3) {
if (!Game.hots[i]){
hots[i].lvlbox.text = "";
hots[i].mpbox.text = "";
hots[i].gotoAndStop(2);
};
i++;
};
}
public function gameOver(){
gameover.gotoAndPlay("gameOver");
}
}
}//package
Section 289
//iceplatformbig (iceplatformbig)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class iceplatformbig extends Platform {
public function iceplatformbig(){
super();
addFrameScript(0, frame1);
}
function frame1(){
slippery = true;
}
}
}//package
Section 290
//iceplatformsmall (iceplatformsmall)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class iceplatformsmall extends Platform {
public function iceplatformsmall(){
super();
addFrameScript(0, frame1);
}
function frame1(){
slippery = true;
}
}
}//package
Section 291
//Icicle (Icicle)
package {
public class Icicle extends Foe {
public var spin:Number;// = 0
public var falling:Boolean;// = false
public function Icicle(){
falling = false;
spin = 0;
super();
addFrameScript(0, frame1, 3, frame4, 10, frame11, 19, frame20);
EXP = 0;
HP = 80;
recoilType = 1;
attack = (attack * 7);
dropRate = 0;
contactDamage = false;
noTurn = true;
soundDie = "ice2";
projectile = true;
}
override public function behave(){
if (((aggro) && ((spin == 0)))){
spin = ((Math.random() * 20) + 5);
};
if (((aggro) || (seePlayer()))){
falling = true;
animate("idle2");
contactDamage = true;
};
rotation = (rotation + spin);
if (contactDamage){
hitFoes();
};
if (((falling) && ((ySpeed < 20)))){
ySpeed = (ySpeed + 2);
};
}
function frame11(){
gotoAndStop(animation);
}
function frame4(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame20(){
kill();
}
public function hitFoes(){
for each (f in Game.level.foes) {
if (((((((f) && (!((f == this))))) && (f.hitbox))) && (((((f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))) || (f.hitbox.hitTestPoint((x + parent.x), ((y + parent.y) + 15))))) || (f.hitbox.hitTestPoint((x + parent.x), ((y + parent.y) - 15))))))){
if (((f.hit(60, true)) && (!(dead)))){
Medals.unlock(Medals.frostBite);
die();
};
};
};
}
}
}//package
Section 292
//Icicle2 (Icicle2)
package {
import flash.utils.*;
public class Icicle2 extends Foe {
public var lifeTime:int;// = 60
public var spin:Number;// = 0
public var falling:Boolean;// = false
public function Icicle2(angle:Number=0){
lifeTime = 60;
falling = false;
spin = 0;
super();
addFrameScript(0, frame1, 8, frame9, 18, frame19, 29, frame30);
rotation = 200;
rotation = angle;
if ((((rotation > 90)) || ((rotation <= -90)))){
rotation = (rotation + 180);
};
angle = (angle * (Math.PI / 180));
xSpeed = -((Math.cos(angle) * 15));
ySpeed = -((Math.sin(angle) * 15));
startAnim = "intro";
EXP = 0;
HP = 80;
recoilType = 1;
attack = (attack * 12);
dropRate = 0;
monster = 1;
soundDie = "ice2";
landFoe = false;
dynamicFoe = true;
noTurn = true;
projectile = true;
}
override public function behave(){
if (((aggro) && ((spin == 0)))){
spin = ((Math.random() * 20) + 5);
};
if (aggro){
ySpeed = (ySpeed + 1.2);
};
rotation = (rotation + (spin * 2));
lifeTime--;
hitFoes();
if (lifeTime == 0){
soundDie = "";
die();
};
}
function frame1(){
init();
stop();
}
function frame30(){
kill();
}
function frame9(){
animate("idle");
}
function frame19(){
gotoAndStop("idle2");
}
public function hitFoes(){
for each (f in Game.level.foes) {
if (((((((((((((f) && (!((f == this))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == MonolithIce))))) && (((!((getDefinitionByName(getQualifiedClassName(f)) == BossGolem))) || (aggro))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == Icicle2))))) && (f.hitbox))) && (f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))))){
if (((f.hit(30, true)) && (!(dead)))){
die();
};
};
};
}
}
}//package
Section 293
//Idol (Idol)
package {
public class Idol extends Foe {
public var accel:Number;// = 0.2
public function Idol(){
accel = 0.2;
super();
addFrameScript(0, frame1, 12, frame13, 24, frame25);
EXP = 8;
HP = 65;
recoilType = 1;
attack = (attack * 6);
dropRate = 0.4;
monster = 1;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
displace = (20 * scaleY);
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if (((onGround) && (((seePlayer()) || ((Math.abs(xSpeed) > 1)))))){
jump(20);
};
if (Math.abs(ySpeed) > 0.5){
rotation = ySpeed;
};
}
function frame13(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame25(){
kill();
}
}
}//package
Section 294
//IdolFire (IdolFire)
package {
public class IdolFire extends Foe {
public var spawn2:IdolFire;
public var accel:Number;// = 0.2
public var spawn:IdolFire;
public var broken:Boolean;// = false
public function IdolFire(monster:int=3){
accel = 0.2;
broken = false;
super();
addFrameScript(0, frame1, 1, frame2, 12, frame13, 14, frame15, 19, frame20);
EXP = 18;
HP = 80;
recoilType = 1;
attack = (attack * 10);
dropRate = 0.3;
this.monster = monster;
maxSpeed = (maxSpeed * (1 + (Math.random() / 2)));
displace = (20 * scaleY);
trace(("scale: " + scaleX));
trace(HP);
flash = 250;
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if (((onGround) && (((seePlayer()) || ((Math.abs(xSpeed) > 1)))))){
jump(21);
};
if (Math.abs(ySpeed) > 0.5){
rotation = ySpeed;
};
}
function frame15(){
split();
}
function frame2(){
if (monster > 3){
hitbox.scaleX = 0.6;
hitbox.x = -11;
};
}
function frame13(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame20(){
kill();
}
public function split(){
if (!broken){
spawn = new IdolFire(5);
parent.addChild(spawn);
spawn.x = this.x;
spawn.y = this.y;
spawn.xSpeed = (xSpeed + 8);
spawn.aggro = 1;
spawn.dynamicFoe = true;
spawn.broken = true;
spawn2 = new IdolFire(4);
parent.addChild(spawn2);
spawn2.x = this.x;
spawn2.y = this.y;
spawn2.xSpeed = (xSpeed - 8);
spawn2.aggro = 1;
spawn2.dynamicFoe = true;
spawn2.broken = true;
if (facing){
spawn.turn();
spawn2.turn();
};
};
}
}
}//package
Section 295
//IdolIce (IdolIce)
package {
public class IdolIce extends Foe {
public var accel:Number;// = 0.2
public function IdolIce(){
accel = 0.2;
super();
addFrameScript(0, frame1, 12, frame13, 24, frame25);
EXP = 18;
HP = 100;
recoilType = 1;
attack = (attack * 8);
dropRate = 0.3;
monster = 2;
maxSpeed = (maxSpeed * (1 + (Math.random() / 2)));
displace = (20 * scaleY);
soundDie = "ice2";
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
if (((onGround) && (((seePlayer()) || ((Math.abs(xSpeed) > 1)))))){
jump(22);
};
if (Math.abs(ySpeed) > 0.5){
rotation = ySpeed;
};
}
function frame13(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame25(){
kill();
}
}
}//package
Section 296
//Item (Item)
package {
import flash.display.*;
public class Item extends MovieClip {
public var size:Number;
public var power:int;
public var pl:MovieClip;
public var gravity:Number;// = 2
public var grounded:Boolean;// = false
public var ySpeed:Number;// = 0
public var type:int;
public var xSpeed:Number;// = 0
public var fallSpeed:Number;// = 11
public var time:int;// = 240
public var taken:Boolean;// = false
public var index:int;
public function Item(type:int=1, size:Number=1){
gravity = 2;
fallSpeed = 11;
time = 240;
taken = false;
grounded = false;
xSpeed = 0;
ySpeed = 0;
super();
addFrameScript(0, frame1, 3, frame4, 19, frame20, 21, frame22, 37, frame38);
this.type = type;
this.size = size;
cacheAsBitmap = true;
power = (9 * size);
scaleX = (size * 1);
scaleY = (size * 1);
if (type == 1){
gotoAndStop(2);
} else {
gotoAndStop(3);
};
ySpeed = (-(Math.random()) * 22);
xSpeed = ((Math.random() * 6) - 3);
}
function frame1(){
stop();
}
public function kill(){
stop();
parent.removeItem(this);
parent.removeChild(this);
}
function frame22(){
SFX.sound("mp", "p");
}
function frame4(){
SFX.sound("hp", "p");
}
function frame20(){
kill();
}
public function take(player:Player){
taken = true;
if (type == 1){
gotoAndPlay("hp");
Numbers.damageNumber(this, (("+" + power) + "HP"), 4, 1.5);
player.recoverHP(power);
} else {
gotoAndPlay("mp");
Numbers.damageNumber(this, "+1MP", 3, 1.5);
player.recoverMP(1);
};
ySpeed = 0;
xSpeed = 0;
}
function frame38(){
kill();
}
public function move(){
grounded = false;
if (!taken){
time--;
if (time < 60){
visible = !(visible);
};
if ((((y > 820)) || ((time == 0)))){
kill();
} else {
ySpeed = (ySpeed + gravity);
if (ySpeed > fallSpeed){
ySpeed = fallSpeed;
};
y = (y + ySpeed);
while (((parent.land3.hitTestPoint((x + parent.x), (y + parent.y), true)) || (parent.platforms2.hitTestPoint((x + parent.x), (y + parent.y), true)))) {
y--;
ySpeed = 0;
grounded = true;
};
for each (pl in Game.level.landforms) {
while (((pl.hitbox2) && (pl.hitbox2.hitTestPoint((x + parent.x), (y + parent.y), true)))) {
y--;
ySpeed = 0;
grounded = true;
};
};
for each (pl in Game.level.specialPlatforms) {
while (((pl.hitbox2) && (pl.hitbox2.hitTestPoint((x + parent.x), (y + parent.y), true)))) {
y--;
ySpeed = 0;
pl.effect2(this);
grounded = true;
};
};
};
};
}
}
}//package
Section 297
//Items (Items)
package {
import flash.display.*;
public class Items {
public function Items(){
super();
}
static function dropItem(foe:MovieClip, chance:Number=0.5, type:int=0, size:Number=1){
var item:Item;
if (Math.random() <= chance){
if (type == 0){
if ((((Math.random() > 0.45)) || ((Game.player.hat == Equips.vikingHelm)))){
type = 1;
} else {
type = 2;
};
};
size = ((0.7 + (Math.random() / 3)) * size);
item = new Item(type, size);
foe.parent.addChild(item);
foe.parent.addItem(item);
item.x = ((foe.x + (Math.random() * 40)) - 20);
item.y = ((foe.y + (Math.random() * 20)) - 10);
};
}
}
}//package
Section 298
//Keys (Keys)
package {
import flash.events.*;
public class Keys {
public static var hot3Key:Number;
public static var selectKey:Number;
public static var upKey:Number;
public static var interactKey:Number;
public static var pauseKey:Number;
public static var jumpKey:Number;
public static var hotKey:Number;
public static var leftKey:Number;
public static var hot2Key:Number;
public static var downKey:Number;
public static var escapeKey:Number;
public static var rightKey:Number;
public static var mouseClick:Boolean = false;
public static var keyIsDown:Array = [];
public static var attackKey:Number;
public static var magicKey:Number;
public static var hot1Key:Number;
public function Keys(){
super();
}
public static function resetKeys(){
jumpKey = 65;
attackKey = 83;
magicKey = 68;
upKey = 38;
leftKey = 37;
rightKey = 39;
downKey = 40;
interactKey = upKey;
selectKey = 13;
escapeKey = 27;
pauseKey = 80;
hot1Key = 81;
hot2Key = 87;
hot3Key = 69;
}
public static function anyKey(key:int):Boolean{
return ((((((((((((key == selectKey)) || ((key == jumpKey)))) || ((key == attackKey)))) || ((key == magicKey)))) || ((key == 32)))) || ((key == -1))));
}
public static function keyUpGet(e:KeyboardEvent){
keyIsDown[e.keyCode] = false;
}
public static function keyDownGet(e:KeyboardEvent){
keyIsDown[e.keyCode] = true;
if (Game.root.playing){
Game.keyDown(e.keyCode);
} else {
if (Game.root.mainMenu){
if (((!(anyKey(e.keyCode))) && (!((e.keyCode == escapeKey))))){
mouseClick = false;
trace("key control");
};
Game.root.mainMenu.keyDown(e.keyCode);
};
};
}
}
}//package
Section 299
//Landform (Landform)
package {
import flash.display.*;
public class Landform extends MovieClip {
public var land:MovieClip;
public var slippery:Boolean;// = false
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function Landform(){
slippery = false;
super();
parent.addLandform(this);
gotoAndStop(2);
if (land){
land.cacheAsBitmap = true;
};
x = Math.round(x);
y = Math.round(y);
hitbox.x = Math.round(hitbox.x);
hitbox.y = Math.round(hitbox.y);
hitbox2.x = Math.round(hitbox2.x);
hitbox2.y = Math.round(hitbox2.y);
}
}
}//package
Section 300
//Level (Level)
package {
import flash.display.*;
public class Level extends MovieClip {
public var background2F:int;// = 1
public var pitF:int;// = 1
public var coins:Array;
public var coinCounter:int;// = 0
public var door1:MovieClip;
public var door2:MovieClip;
public var door0:MovieClip;
public var signs:Array;
public var platforms:MovieClip;
public var signsMC:Array;
public var f0:MovieClip;
public var f2:MovieClip;
public var f3:MovieClip;
public var f4:MovieClip;
public var f1:MovieClip;
public var bubble:Bubble;
public var doors:Array;
public var chestsMC:Array;
public var background2:MovieClip;
public var spawnPoint:MovieClip;
public var backgroundF:int;// = 1
public var clouds:MovieClip;
public var length:Number;
public var switches:Array;
public var coinCount:int;// = 0
public var ID:int;
public var bubble2:ChestBubble;
public var cloudsF:int;// = 1
public var landforms:Array;
public var background:MovieClip;
public var rightEnd:MovieClip;
public var sky:MovieClip;
public var skyF:int;// = 1
public var foes:Array;
public var leftEnd:MovieClip;
public var map:String;// = "0-0"
public var chests:Array;
public var pit:MovieClip;
public var land2:MovieClip;
public var land3:MovieClip;
public var specialPlatforms:Array;
public var items:Array;
public var switchs:Array;
public var platforms2:MovieClip;
public var land:MovieClip;
public static var levelNo:int = 1;
public function Level(){
var m:String;
map = "0-0";
skyF = 1;
cloudsF = 1;
pitF = 1;
backgroundF = 1;
background2F = 1;
signs = [];
switches = [];
chests = [];
switchs = [];
chestsMC = [];
signsMC = [];
coinCounter = 0;
coinCount = 0;
coins = [];
specialPlatforms = [];
landforms = [];
foes = [];
items = [];
doors = [];
super();
trace("created level");
Game.root.y = 0;
if (door0){
setChildIndex(door0, (numChildren - 1));
};
if (door1){
setChildIndex(door1, (numChildren - 1));
};
if (door2){
setChildIndex(door2, (numChildren - 1));
};
Levels.initLevel(this);
ID = Levels.ID;
signs = Levels.signs;
chests = Levels.chests;
doors = Levels.doors;
trace(("chests:" + chests));
m = ("" + ID);
if (Game.levelNo <= 20){
if (ID == 4){
m = "A";
};
if (ID == 5){
m = "B";
};
if (ID == 6){
m = "C";
};
};
map = ((Game.levelNo + "-") + m);
}
public function teardown(){
var h:int;
sky.cacheAsBitmap = false;
pit.cacheAsBitmap = false;
if (background){
background.cacheAsBitmap = false;
};
if (background2){
background2.cacheAsBitmap = false;
};
h = 0;
while (h < numChildren) {
removeChild(getChildAt(h));
h++;
};
chestsMC = null;
foes = null;
signsMC = null;
doors = null;
sky = null;
pit = null;
background = null;
background2 = null;
land = null;
land2 = null;
land3 = null;
}
public function addPlatform(p:MovieClip){
specialPlatforms.push(p);
}
public function setFoes(){
trace(("Foes: " + Game.level.foes.length));
}
public function addCoin(c:MovieClip){
coins.push(c);
c.ID = coinCount;
if (LevelState.getCoin(coinCount) == 1){
c.gotoAndStop(3);
c.old = true;
} else {
if (LevelState.getCoin(coinCount) == 2){
c.opened = true;
c.gotoAndStop(21);
};
};
coinCount++;
}
public function addChest(c:MovieClip){
chestsMC.push(c);
}
public function addLandform(p:MovieClip){
landforms.push(p);
}
public function init(){
var h:int;
sky = new Sky();
addChild(sky);
if (Options.background){
clouds = new Clouds();
addChild(clouds);
background2 = new Background2();
addChild(background2);
background = new Background();
addChild(background);
background.cacheAsBitmap = true;
background2.cacheAsBitmap = true;
};
pit = new Pit();
addChild(pit);
pit.y = 175;
sky.cacheAsBitmap = true;
pit.cacheAsBitmap = true;
land.visible = false;
platforms.visible = false;
land3.visible = false;
platforms2.visible = false;
if (Options.background){
setChildIndex(background, 0);
setChildIndex(background2, 0);
setChildIndex(clouds, 0);
};
setChildIndex(sky, 0);
setChildIndex(pit, (numChildren - 1));
if (Options.background){
background.gotoAndStop(backgroundF);
background2.gotoAndStop(background2F);
clouds.gotoAndStop(cloudsF);
};
sky.gotoAndStop(skyF);
pit.gotoAndStop(pitF);
setFoes();
h = 0;
while (h < numChildren) {
getChildAt(h).x = Math.round(getChildAt(h).x);
getChildAt(h).y = Math.round(getChildAt(h).y);
h++;
};
}
public function addSwitch(s:MovieClip){
switchs.push(s);
}
public function addItem(i:MovieClip){
i.index = items.length;
items.push(i);
}
public function allDead(){
var i:int;
trace("EVERYTHING IS DEAD!!!!");
for (i in doors) {
if (!this[("door" + i)].visible){
this[("door" + i)].gotoAndPlay(2);
};
};
}
public function removeItem(i:MovieClip){
items[i.index] = null;
}
public function addDoor(d:MovieClip){
doors.push(d);
}
public function addSign(s:MovieClip){
signsMC.push(s);
}
}
}//package
Section 301
//Level0_0 (Level0_0)
package {
public class Level0_0 extends Level {
public var p1:Landform;
public static var levelNo:int = 0;
public function Level0_0(){
super();
LevelBackground.setBackground(this, "desert2");
ID = 1;
map = "TEST";
signs = [];
chests = [];
doors = [];
}
override public function setFoes(){
}
}
}//package
Section 302
//Level1_1 (Level1_1)
package {
public dynamic class Level1_1 extends Level {
public function Level1_1(){
super();
}
}
}//package
Section 303
//Level1_2 (Level1_2)
package {
public dynamic class Level1_2 extends Level {
public function Level1_2(){
super();
}
}
}//package
Section 304
//Level1_3 (Level1_3)
package {
public dynamic class Level1_3 extends Level {
public function Level1_3(){
super();
}
}
}//package
Section 305
//Level10_1 (Level10_1)
package {
public dynamic class Level10_1 extends Level {
public function Level10_1(){
super();
}
}
}//package
Section 306
//Level10_2 (Level10_2)
package {
public dynamic class Level10_2 extends Level {
public function Level10_2(){
super();
}
}
}//package
Section 307
//Level10_3 (Level10_3)
package {
public dynamic class Level10_3 extends Level {
public function Level10_3(){
super();
}
}
}//package
Section 308
//Level11_1 (Level11_1)
package {
public dynamic class Level11_1 extends Level {
public function Level11_1(){
super();
}
}
}//package
Section 309
//Level11_2 (Level11_2)
package {
public dynamic class Level11_2 extends Level {
public function Level11_2(){
super();
}
}
}//package
Section 310
//Level11_3 (Level11_3)
package {
public dynamic class Level11_3 extends Level {
public function Level11_3(){
super();
}
}
}//package
Section 311
//Level11_4 (Level11_4)
package {
public dynamic class Level11_4 extends Level {
public function Level11_4(){
super();
}
}
}//package
Section 312
//Level12_1 (Level12_1)
package {
public dynamic class Level12_1 extends Level {
public function Level12_1(){
super();
}
}
}//package
Section 313
//Level12_2 (Level12_2)
package {
public dynamic class Level12_2 extends Level {
public function Level12_2(){
super();
}
}
}//package
Section 314
//Level12_3 (Level12_3)
package {
public dynamic class Level12_3 extends Level {
public function Level12_3(){
super();
}
}
}//package
Section 315
//Level12_4 (Level12_4)
package {
public dynamic class Level12_4 extends Level {
public function Level12_4(){
super();
}
}
}//package
Section 316
//Level12_5 (Level12_5)
package {
public dynamic class Level12_5 extends Level {
public function Level12_5(){
super();
}
}
}//package
Section 317
//Level13_1 (Level13_1)
package {
public dynamic class Level13_1 extends Level {
public function Level13_1(){
super();
}
}
}//package
Section 318
//Level13_2 (Level13_2)
package {
public dynamic class Level13_2 extends Level {
public function Level13_2(){
super();
}
}
}//package
Section 319
//Level13_3 (Level13_3)
package {
public dynamic class Level13_3 extends Level {
public function Level13_3(){
super();
}
}
}//package
Section 320
//Level13_4 (Level13_4)
package {
public dynamic class Level13_4 extends Level {
public function Level13_4(){
super();
}
}
}//package
Section 321
//Level13_5 (Level13_5)
package {
public dynamic class Level13_5 extends Level {
public function Level13_5(){
super();
}
}
}//package
Section 322
//Level14_1 (Level14_1)
package {
public dynamic class Level14_1 extends Level {
public function Level14_1(){
super();
}
}
}//package
Section 323
//Level14_2 (Level14_2)
package {
public dynamic class Level14_2 extends Level {
public function Level14_2(){
super();
}
}
}//package
Section 324
//Level14_3 (Level14_3)
package {
public dynamic class Level14_3 extends Level {
public function Level14_3(){
super();
}
}
}//package
Section 325
//Level14_4 (Level14_4)
package {
public dynamic class Level14_4 extends Level {
public function Level14_4(){
super();
}
}
}//package
Section 326
//Level14_5 (Level14_5)
package {
public dynamic class Level14_5 extends Level {
public function Level14_5(){
super();
}
}
}//package
Section 327
//Level15_1 (Level15_1)
package {
public dynamic class Level15_1 extends Level {
public function Level15_1(){
super();
}
}
}//package
Section 328
//Level15_2 (Level15_2)
package {
public dynamic class Level15_2 extends Level {
public function Level15_2(){
super();
}
}
}//package
Section 329
//Level15_3 (Level15_3)
package {
public dynamic class Level15_3 extends Level {
public function Level15_3(){
super();
}
}
}//package
Section 330
//Level16_1 (Level16_1)
package {
public dynamic class Level16_1 extends Level {
public function Level16_1(){
super();
}
}
}//package
Section 331
//Level16_2 (Level16_2)
package {
public dynamic class Level16_2 extends Level {
public function Level16_2(){
super();
}
}
}//package
Section 332
//Level16_3 (Level16_3)
package {
public dynamic class Level16_3 extends Level {
public function Level16_3(){
super();
}
}
}//package
Section 333
//Level16_4 (Level16_4)
package {
public dynamic class Level16_4 extends Level {
public function Level16_4(){
super();
}
}
}//package
Section 334
//Level16_5 (Level16_5)
package {
public dynamic class Level16_5 extends Level {
public function Level16_5(){
super();
}
}
}//package
Section 335
//Level17_1 (Level17_1)
package {
public dynamic class Level17_1 extends Level {
public function Level17_1(){
super();
}
}
}//package
Section 336
//Level17_2 (Level17_2)
package {
public dynamic class Level17_2 extends Level {
public function Level17_2(){
super();
}
}
}//package
Section 337
//Level17_3 (Level17_3)
package {
public dynamic class Level17_3 extends Level {
public function Level17_3(){
super();
}
}
}//package
Section 338
//Level17_4 (Level17_4)
package {
public dynamic class Level17_4 extends Level {
public function Level17_4(){
super();
}
}
}//package
Section 339
//Level17_5 (Level17_5)
package {
public dynamic class Level17_5 extends Level {
public function Level17_5(){
super();
}
}
}//package
Section 340
//Level18_1 (Level18_1)
package {
public dynamic class Level18_1 extends Level {
public function Level18_1(){
super();
}
}
}//package
Section 341
//Level18_2 (Level18_2)
package {
public dynamic class Level18_2 extends Level {
public function Level18_2(){
super();
}
}
}//package
Section 342
//Level18_3 (Level18_3)
package {
public dynamic class Level18_3 extends Level {
public function Level18_3(){
super();
}
}
}//package
Section 343
//Level18_4 (Level18_4)
package {
public dynamic class Level18_4 extends Level {
public function Level18_4(){
super();
}
}
}//package
Section 344
//Level18_5 (Level18_5)
package {
public dynamic class Level18_5 extends Level {
public function Level18_5(){
super();
}
}
}//package
Section 345
//Level18_6 (Level18_6)
package {
public dynamic class Level18_6 extends Level {
public function Level18_6(){
super();
}
}
}//package
Section 346
//Level19_1 (Level19_1)
package {
public dynamic class Level19_1 extends Level {
public function Level19_1(){
super();
}
}
}//package
Section 347
//Level19_2 (Level19_2)
package {
public dynamic class Level19_2 extends Level {
public function Level19_2(){
super();
}
}
}//package
Section 348
//Level19_3 (Level19_3)
package {
public dynamic class Level19_3 extends Level {
public function Level19_3(){
super();
}
}
}//package
Section 349
//Level19_4 (Level19_4)
package {
public dynamic class Level19_4 extends Level {
public function Level19_4(){
super();
}
}
}//package
Section 350
//Level19_5 (Level19_5)
package {
public dynamic class Level19_5 extends Level {
public function Level19_5(){
super();
}
}
}//package
Section 351
//Level19_6 (Level19_6)
package {
public dynamic class Level19_6 extends Level {
public function Level19_6(){
super();
}
}
}//package
Section 352
//Level2_1 (Level2_1)
package {
public dynamic class Level2_1 extends Level {
public function Level2_1(){
super();
}
}
}//package
Section 353
//Level2_2 (Level2_2)
package {
public dynamic class Level2_2 extends Level {
public function Level2_2(){
super();
}
}
}//package
Section 354
//Level2_3 (Level2_3)
package {
public dynamic class Level2_3 extends Level {
public function Level2_3(){
super();
}
}
}//package
Section 355
//Level2_4 (Level2_4)
package {
public dynamic class Level2_4 extends Level {
public function Level2_4(){
super();
}
}
}//package
Section 356
//Level20_1 (Level20_1)
package {
public dynamic class Level20_1 extends Level {
public function Level20_1(){
super();
}
}
}//package
Section 357
//Level20_2 (Level20_2)
package {
public dynamic class Level20_2 extends Level {
public function Level20_2(){
super();
}
}
}//package
Section 358
//Level20_3 (Level20_3)
package {
public dynamic class Level20_3 extends Level {
public function Level20_3(){
super();
}
}
}//package
Section 359
//Level21_1 (Level21_1)
package {
public dynamic class Level21_1 extends Level {
public function Level21_1(){
super();
}
}
}//package
Section 360
//Level21_10 (Level21_10)
package {
public dynamic class Level21_10 extends Level {
public function Level21_10(){
super();
}
}
}//package
Section 361
//Level21_11 (Level21_11)
package {
public dynamic class Level21_11 extends Level {
public function Level21_11(){
super();
}
}
}//package
Section 362
//Level21_12 (Level21_12)
package {
public dynamic class Level21_12 extends Level {
public function Level21_12(){
super();
}
}
}//package
Section 363
//Level21_13 (Level21_13)
package {
public dynamic class Level21_13 extends Level {
public function Level21_13(){
super();
}
}
}//package
Section 364
//Level21_14 (Level21_14)
package {
public dynamic class Level21_14 extends Level {
public function Level21_14(){
super();
}
}
}//package
Section 365
//Level21_15 (Level21_15)
package {
public dynamic class Level21_15 extends Level {
public function Level21_15(){
super();
}
}
}//package
Section 366
//Level21_16 (Level21_16)
package {
public dynamic class Level21_16 extends Level {
public function Level21_16(){
super();
}
}
}//package
Section 367
//Level21_2 (Level21_2)
package {
public dynamic class Level21_2 extends Level {
public function Level21_2(){
super();
}
}
}//package
Section 368
//Level21_3 (Level21_3)
package {
public dynamic class Level21_3 extends Level {
public function Level21_3(){
super();
}
}
}//package
Section 369
//Level21_4 (Level21_4)
package {
public dynamic class Level21_4 extends Level {
public function Level21_4(){
super();
}
}
}//package
Section 370
//Level21_5 (Level21_5)
package {
public dynamic class Level21_5 extends Level {
public function Level21_5(){
super();
}
}
}//package
Section 371
//Level21_6 (Level21_6)
package {
public dynamic class Level21_6 extends Level {
public function Level21_6(){
super();
}
}
}//package
Section 372
//Level21_7 (Level21_7)
package {
public dynamic class Level21_7 extends Level {
public function Level21_7(){
super();
}
}
}//package
Section 373
//Level21_8 (Level21_8)
package {
public dynamic class Level21_8 extends Level {
public function Level21_8(){
super();
}
}
}//package
Section 374
//Level21_9 (Level21_9)
package {
public dynamic class Level21_9 extends Level {
public function Level21_9(){
super();
}
}
}//package
Section 375
//Level22_1 (Level22_1)
package {
public dynamic class Level22_1 extends Level {
public function Level22_1(){
super();
}
}
}//package
Section 376
//Level22_2 (Level22_2)
package {
public dynamic class Level22_2 extends Level {
public function Level22_2(){
super();
}
}
}//package
Section 377
//Level22_3 (Level22_3)
package {
public dynamic class Level22_3 extends Level {
public function Level22_3(){
super();
}
}
}//package
Section 378
//Level22_4 (Level22_4)
package {
public dynamic class Level22_4 extends Level {
public function Level22_4(){
super();
}
}
}//package
Section 379
//Level22_5 (Level22_5)
package {
public dynamic class Level22_5 extends Level {
public function Level22_5(){
super();
}
}
}//package
Section 380
//Level3_1 (Level3_1)
package {
public dynamic class Level3_1 extends Level {
public function Level3_1(){
super();
}
}
}//package
Section 381
//Level3_2 (Level3_2)
package {
public dynamic class Level3_2 extends Level {
public function Level3_2(){
super();
}
}
}//package
Section 382
//Level3_3 (Level3_3)
package {
public dynamic class Level3_3 extends Level {
public function Level3_3(){
super();
}
}
}//package
Section 383
//Level3_4 (Level3_4)
package {
public dynamic class Level3_4 extends Level {
public function Level3_4(){
super();
}
}
}//package
Section 384
//Level4_1 (Level4_1)
package {
public dynamic class Level4_1 extends Level {
public function Level4_1(){
super();
}
}
}//package
Section 385
//Level4_2 (Level4_2)
package {
public dynamic class Level4_2 extends Level {
public function Level4_2(){
super();
}
}
}//package
Section 386
//Level4_3 (Level4_3)
package {
public dynamic class Level4_3 extends Level {
public function Level4_3(){
super();
}
}
}//package
Section 387
//Level4_4 (Level4_4)
package {
public dynamic class Level4_4 extends Level {
public function Level4_4(){
super();
}
}
}//package
Section 388
//Level4_5 (Level4_5)
package {
public dynamic class Level4_5 extends Level {
public function Level4_5(){
super();
}
}
}//package
Section 389
//Level5_1 (Level5_1)
package {
public dynamic class Level5_1 extends Level {
public function Level5_1(){
super();
}
}
}//package
Section 390
//Level5_2 (Level5_2)
package {
public dynamic class Level5_2 extends Level {
public function Level5_2(){
super();
}
}
}//package
Section 391
//Level5_3 (Level5_3)
package {
public dynamic class Level5_3 extends Level {
public function Level5_3(){
super();
}
}
}//package
Section 392
//Level6_1 (Level6_1)
package {
public dynamic class Level6_1 extends Level {
public function Level6_1(){
super();
}
}
}//package
Section 393
//Level6_2 (Level6_2)
package {
public dynamic class Level6_2 extends Level {
public function Level6_2(){
super();
}
}
}//package
Section 394
//Level6_3 (Level6_3)
package {
public dynamic class Level6_3 extends Level {
public function Level6_3(){
super();
}
}
}//package
Section 395
//Level6_4 (Level6_4)
package {
public dynamic class Level6_4 extends Level {
public function Level6_4(){
super();
}
}
}//package
Section 396
//Level6_5 (Level6_5)
package {
public dynamic class Level6_5 extends Level {
public function Level6_5(){
super();
}
}
}//package
Section 397
//Level7_1 (Level7_1)
package {
public dynamic class Level7_1 extends Level {
public function Level7_1(){
super();
}
}
}//package
Section 398
//Level7_2 (Level7_2)
package {
public dynamic class Level7_2 extends Level {
public function Level7_2(){
super();
}
}
}//package
Section 399
//Level7_3 (Level7_3)
package {
public dynamic class Level7_3 extends Level {
public function Level7_3(){
super();
}
}
}//package
Section 400
//Level7_4 (Level7_4)
package {
public dynamic class Level7_4 extends Level {
public function Level7_4(){
super();
}
}
}//package
Section 401
//Level7_5 (Level7_5)
package {
public dynamic class Level7_5 extends Level {
public function Level7_5(){
super();
}
}
}//package
Section 402
//Level8_1 (Level8_1)
package {
public dynamic class Level8_1 extends Level {
public function Level8_1(){
super();
}
}
}//package
Section 403
//Level8_2 (Level8_2)
package {
public dynamic class Level8_2 extends Level {
public function Level8_2(){
super();
}
}
}//package
Section 404
//Level8_3 (Level8_3)
package {
public dynamic class Level8_3 extends Level {
public function Level8_3(){
super();
}
}
}//package
Section 405
//Level8_4 (Level8_4)
package {
public dynamic class Level8_4 extends Level {
public function Level8_4(){
super();
}
}
}//package
Section 406
//Level8_5 (Level8_5)
package {
public dynamic class Level8_5 extends Level {
public function Level8_5(){
super();
}
}
}//package
Section 407
//Level9_1 (Level9_1)
package {
public dynamic class Level9_1 extends Level {
public function Level9_1(){
super();
}
}
}//package
Section 408
//Level9_2 (Level9_2)
package {
public dynamic class Level9_2 extends Level {
public function Level9_2(){
super();
}
}
}//package
Section 409
//Level9_3 (Level9_3)
package {
public dynamic class Level9_3 extends Level {
public function Level9_3(){
super();
}
}
}//package
Section 410
//Level9_4 (Level9_4)
package {
public dynamic class Level9_4 extends Level {
public function Level9_4(){
super();
}
}
}//package
Section 411
//Level9_5 (Level9_5)
package {
public dynamic class Level9_5 extends Level {
public function Level9_5(){
super();
}
}
}//package
Section 412
//LevelBackground (LevelBackground)
package {
public class LevelBackground {
public function LevelBackground(){
super();
}
public static function setBackground(l:Level, bg:String){
if (bg == "forest day"){
l.skyF = 1;
l.cloudsF = 1;
l.pitF = 1;
l.backgroundF = 1;
l.background2F = 1;
};
if (bg == "forest sunset"){
l.skyF = 3;
l.cloudsF = 2;
l.pitF = 1;
l.backgroundF = 2;
l.background2F = 2;
};
if (bg == "forest night"){
l.skyF = 5;
l.cloudsF = 5;
l.pitF = 1;
l.backgroundF = 3;
l.background2F = 3;
};
if (bg == "sandstorm"){
l.skyF = 6;
l.cloudsF = 4;
l.pitF = 3;
l.backgroundF = 5;
l.background2F = 5;
};
if (bg == "desert"){
l.skyF = 7;
l.cloudsF = 5;
l.pitF = 3;
l.backgroundF = 4;
l.background2F = 4;
};
if (bg == "desert2"){
l.skyF = 7;
l.cloudsF = 5;
l.pitF = 3;
l.backgroundF = 4;
l.background2F = 6;
};
if (bg == "clouds"){
l.skyF = 9;
l.cloudsF = 6;
l.pitF = 2;
l.backgroundF = 5;
l.background2F = 5;
};
if (bg == "snow"){
l.skyF = 10;
l.cloudsF = 5;
l.pitF = 2;
l.backgroundF = 6;
l.background2F = 7;
};
if (bg == "snow2"){
l.skyF = 11;
l.cloudsF = 5;
l.pitF = 2;
l.backgroundF = 7;
l.background2F = 8;
};
if (bg == "ice"){
l.skyF = 10;
l.cloudsF = 5;
l.pitF = 2;
l.backgroundF = 8;
l.background2F = 9;
};
if (bg == "fire"){
l.skyF = 12;
l.cloudsF = 5;
l.pitF = 1;
l.backgroundF = 9;
l.background2F = 10;
};
if (bg == "dark"){
l.skyF = 13;
l.cloudsF = 5;
l.pitF = 1;
l.backgroundF = 10;
l.background2F = 11;
};
}
}
}//package
Section 413
//Levels (Levels)
package {
public class Levels {
public static var chests:Array;
public static var doors:Array;
public static var signs:Array;
public static var ID:int;
public function Levels(){
super();
}
public static function initLevel(l){
signs = [];
chests = [];
doors = [];
if (Game.levelType == Level1_1){
LevelBackground.setBackground(l, "forest day");
ID = 1;
signs = ["2", "3", "5", "4"];
chests = [["coins", 5], ["coins", 5], ["exp", 10], ["exp", 10]];
doors = [[Level1_2, 0]];
};
if (Game.levelType == Level1_2){
LevelBackground.setBackground(l, "forest day");
ID = 2;
signs = ["6", "Watch out for bottomless pits! They won't kill you instantly but will still do lots of damage.", "7", "8"];
chests = [["coins", 5], ["coins", 5]];
doors = [[Level1_1, 0], [Level1_3, 0]];
};
if (Game.levelType == Level1_3){
LevelBackground.setBackground(l, "forest day");
ID = 3;
signs = ["9", "10", "11", "13"];
chests = [["hpup"], ["mpup"], ["coins", 10], ["exp", 20]];
doors = [[Level1_2, 1], ["end", 0]];
};
if (Game.levelType == Level2_1){
LevelBackground.setBackground(l, "forest day");
ID = 1;
signs = ["Watch out for Slimes and Bushes, they can actually hurt you."];
chests = [["hp"], ["exp", 10], ["coins", 10], ["exp", 20]];
doors = [[Level2_2, 0]];
};
if (Game.levelType == Level2_2){
LevelBackground.setBackground(l, "forest day");
ID = 2;
signs = ["The map icon in the top left shows what level and map you are on. Maps ending with a letter are optional."];
chests = [["hpup"], ["mp"], ["coins", 10]];
doors = [[Level2_1, 0], [Level2_3, 0]];
};
if (Game.levelType == Level2_3){
LevelBackground.setBackground(l, "forest day");
ID = 3;
signs = ["Keep a look out for new equipment. You can change your equips from the level select screen.", "12"];
chests = [["exp", 20], ["equip", Equips.knightHelm]];
doors = [[Level2_2, 1], ["end", 0], [Level2_4, 0]];
};
if (Game.levelType == Level2_4){
LevelBackground.setBackground(l, "forest day");
ID = 4;
chests = [["coins", 20]];
doors = [[Level2_3, 2]];
};
if (Game.levelType == Level3_1){
LevelBackground.setBackground(l, "forest sunset");
ID = 1;
signs = ["Get on a mushroom and hold Jump to bounce really high."];
chests = [["exp", 25], ["coins", 6], ["hpup"]];
doors = [[Level3_2, 0]];
};
if (Game.levelType == Level3_2){
LevelBackground.setBackground(l, "forest sunset");
ID = 2;
signs = ["If the game runs slowly, try adjusting the Quality setting in the Pause Menu or Options Menu."];
chests = [["mp"], ["coins", 9]];
doors = [[Level3_1, 0], [Level3_3, 0], [Level3_4, 0]];
};
if (Game.levelType == Level3_3){
LevelBackground.setBackground(l, "forest sunset");
ID = 3;
chests = [["exp", 25], ["hp"], ["exp", 25], ["equip", Equips.katana], ["mp"]];
doors = [[Level3_2, 1], ["end", 0]];
signs = ["Make sure to check out the Options Menu and change the difficulty if you find the game too hard or too easy."];
};
if (Game.levelType == Level3_4){
LevelBackground.setBackground(l, "forest sunset");
ID = 4;
doors = [[Level3_2, 2]];
};
if (Game.levelType == Level4_1){
LevelBackground.setBackground(l, "forest night");
ID = 1;
chests = [["coins", 6], ["exp", 20]];
doors = [[Level4_2, 0], [Level4_4, 0]];
};
if (Game.levelType == Level4_2){
LevelBackground.setBackground(l, "forest night");
ID = 2;
chests = [["mp"], ["exp", 20]];
doors = [[Level4_1, 0], [Level4_3, 0]];
};
if (Game.levelType == Level4_3){
LevelBackground.setBackground(l, "forest night");
ID = 3;
chests = [["mp"], ["exp", 30]];
doors = [[Level4_2, 1], [Level4_5, 0], ["end", 0]];
};
if (Game.levelType == Level4_4){
LevelBackground.setBackground(l, "forest night");
ID = 4;
signs = ["If you destroy wooden platforms you'll have to leave the area and come back to reset them."];
chests = [["hp"], ["equip", Equips.mageRobe]];
doors = [[Level4_1, 1], [Level4_1, 1]];
};
if (Game.levelType == Level4_5){
LevelBackground.setBackground(l, "forest night");
ID = 5;
signs = ["Warning: Danger!"];
chests = [["exp", 30], ["hpup"]];
doors = [[Level4_3, 1]];
};
if (Game.levelType == Level5_1){
LevelBackground.setBackground(l, "forest day");
ID = 1;
signs = ["Jump when the ground shakes.", "Remember that most enemy projectiles can be destroyed or knocked back."];
chests = [["hpup", 6], ["exp", 30]];
doors = [[Level5_2, 0]];
};
if (Game.levelType == Level5_2){
LevelBackground.setBackground(l, "forest day");
ID = 2;
doors = [[Level5_1, 0], [Level5_3, 0]];
l.door0.visible = false;
l.door1.visible = false;
};
if (Game.levelType == Level5_3){
LevelBackground.setBackground(l, "forest day");
ID = 3;
chests = [["coins", 20], ["hp", 30], ["coins", 20], ["exp", 50], ["mp", 30], ["coins", 30], ["exp", 50], ["coins", 30]];
doors = [[Level5_2, 1], ["end", 0]];
};
if (Game.levelType == Level6_1){
LevelBackground.setBackground(l, "sandstorm");
ID = 1;
signs = ["Remember that you can always revisit completed levels if you've missed anything, especially HP power-ups."];
chests = [["exp", 20], ["exp", 20]];
doors = [[Level6_2, 0]];
};
if (Game.levelType == Level6_2){
LevelBackground.setBackground(l, "sandstorm");
ID = 2;
chests = [["mp"], ["exp", 30]];
doors = [[Level6_1, 0], [Level6_4, 0], [Level6_3, 0]];
};
if (Game.levelType == Level6_3){
LevelBackground.setBackground(l, "sandstorm");
ID = 3;
chests = [["exp", 20], ["exp", 20]];
doors = [[Level6_2, 2], [Level6_5, 0], ["end", 0]];
};
if (Game.levelType == Level6_4){
LevelBackground.setBackground(l, "sandstorm");
ID = 4;
chests = [["equip", Equips.ninjaHood], ["exp", 30]];
doors = [[Level6_2, 1], [Level6_2, 1]];
};
if (Game.levelType == Level6_5){
LevelBackground.setBackground(l, "sandstorm");
ID = 5;
chests = [["mp"], ["hpup"]];
doors = [[Level6_3, 1]];
};
if (Game.levelType == Level7_1){
LevelBackground.setBackground(l, "desert");
ID = 1;
chests = [["mp"], ["exp", 30]];
doors = [[Level7_4, 0], [Level7_2, 0]];
};
if (Game.levelType == Level7_2){
LevelBackground.setBackground(l, "desert");
ID = 2;
chests = [["hp"], ["exp", 30]];
doors = [[Level7_1, 1], [Level7_5, 0], [Level7_3, 0]];
};
if (Game.levelType == Level7_3){
LevelBackground.setBackground(l, "desert");
ID = 3;
chests = [["hp"], ["exp", 30]];
doors = [[Level7_2, 2], ["end", 0]];
};
if (Game.levelType == Level7_4){
LevelBackground.setBackground(l, "desert");
ID = 4;
chests = [["mp", 50], ["hpup"]];
doors = [[Level7_1, 0]];
};
if (Game.levelType == Level7_5){
LevelBackground.setBackground(l, "desert");
ID = 5;
chests = [["equip", Equips.blade], ["exp", 40]];
doors = [[Level7_2, 1], [Level7_2, 1]];
};
if (Game.levelType == Level8_1){
LevelBackground.setBackground(l, "desert");
ID = 1;
chests = [["exp", 30], ["mp"], ["exp", 30]];
doors = [[Level8_4, 0], [Level8_2, 0]];
};
if (Game.levelType == Level8_2){
LevelBackground.setBackground(l, "desert");
ID = 2;
chests = [["mpup"]];
doors = [[Level8_1, 1], [Level8_3, 0]];
};
if (Game.levelType == Level8_3){
LevelBackground.setBackground(l, "desert");
ID = 3;
chests = [["exp", 35], ["exp", 35]];
doors = [[Level8_2, 1], [Level8_5, 0], ["end", 0]];
};
if (Game.levelType == Level8_4){
LevelBackground.setBackground(l, "desert");
ID = 4;
chests = [["exp", 50], ["hpup"]];
doors = [[Level8_1, 0]];
};
if (Game.levelType == Level8_5){
LevelBackground.setBackground(l, "desert");
ID = 5;
chests = [["exp", 50], ["equip", Equips.vikingHelm]];
doors = [[Level8_3, 1], [Level8_3, 1]];
};
if (Game.levelType == Level9_1){
LevelBackground.setBackground(l, "desert2");
ID = 1;
chests = [["exp", 30], ["exp", 40]];
doors = [[Level9_4, 0], [Level9_2, 0]];
};
if (Game.levelType == Level9_2){
LevelBackground.setBackground(l, "desert2");
ID = 2;
chests = [["hp"], ["exp", 30]];
doors = [[Level9_1, 1], [Level9_3, 0]];
};
if (Game.levelType == Level9_3){
LevelBackground.setBackground(l, "desert2");
ID = 3;
chests = [["mp"], ["exp", 40]];
doors = [[Level9_2, 1], [Level9_5, 0], ["end", 0]];
};
if (Game.levelType == Level9_4){
LevelBackground.setBackground(l, "desert2");
ID = 4;
chests = [["exp", 50], ["equip", Equips.knightArmor]];
doors = [[Level9_1, 0]];
};
if (Game.levelType == Level9_5){
LevelBackground.setBackground(l, "desert2");
ID = 5;
chests = [["hpup"], ["exp", 50]];
doors = [[Level9_3, 1]];
};
if (Game.levelType == Level10_1){
LevelBackground.setBackground(l, "sandstorm");
ID = 1;
signs = ["Protip: Stab the beholder in the eye."];
chests = [];
doors = [[Level10_2, 0]];
};
if (Game.levelType == Level10_2){
LevelBackground.setBackground(l, "sandstorm");
ID = 2;
l.door0.visible = false;
l.door1.visible = false;
l.natalie.visible = false;
l.nolegs.visible = false;
chests = [];
doors = [[Level10_1, 0], [Level10_3, 0]];
};
if (Game.levelType == Level10_3){
LevelBackground.setBackground(l, "desert2");
ID = 3;
chests = [["exp", 30], ["exp", 70], ["hp"], ["exp", 10], ["mp"], ["exp", 100], ["exp", 40], ["hpup"], ["exp", 40], ["exp", 50]];
doors = [[Level10_2, 1], ["end", 1]];
};
if (Game.levelType == Level11_1){
LevelBackground.setBackground(l, "snow");
ID = 1;
chests = [["exp", 50], ["exp", 60]];
doors = [[Level11_4, 0], [Level11_2, 0]];
};
if (Game.levelType == Level11_2){
LevelBackground.setBackground(l, "snow");
ID = 2;
chests = [["exp", 60], ["mp"], ["exp", 50]];
doors = [[Level11_1, 1], [Level11_3, 0]];
};
if (Game.levelType == Level11_3){
LevelBackground.setBackground(l, "snow");
ID = 3;
chests = [["exp", 60], ["hpup"], ["exp", 80]];
doors = [[Level11_2, 1], ["end", 0]];
};
if (Game.levelType == Level11_4){
LevelBackground.setBackground(l, "snow");
ID = 4;
chests = [["exp", 100], ["equip", Equips.claymore]];
doors = [[Level11_1, 0]];
};
if (Game.levelType == Level12_1){
LevelBackground.setBackground(l, "snow2");
ID = 1;
chests = [["exp", 80], ["exp", 70], ["hp"]];
doors = [[Level12_2, 0]];
};
if (Game.levelType == Level12_2){
LevelBackground.setBackground(l, "snow2");
ID = 2;
chests = [["mp"], ["exp", 80], ["exp", 80]];
doors = [[Level12_1, 0], [Level12_4, 0], [Level12_3, 0]];
};
if (Game.levelType == Level12_3){
LevelBackground.setBackground(l, "snow2");
ID = 3;
chests = [["exp", 100], ["hpup"]];
doors = [[Level12_2, 2], [Level12_5, 0], ["end", 0]];
};
if (Game.levelType == Level12_4){
LevelBackground.setBackground(l, "snow2");
ID = 4;
chests = [["hp"]];
doors = [[Level12_2, 1], [Level12_2, 1]];
};
if (Game.levelType == Level12_5){
LevelBackground.setBackground(l, "snow2");
ID = 5;
chests = [["mpup"]];
doors = [[Level12_3, 1]];
};
if (Game.levelType == Level13_1){
LevelBackground.setBackground(l, "ice");
ID = 1;
chests = [["exp", 80], ["exp", 90]];
doors = [[Level13_2, 0]];
};
if (Game.levelType == Level13_2){
LevelBackground.setBackground(l, "ice");
ID = 2;
chests = [["mp"], ["exp", 120]];
doors = [[Level13_1, 0], [Level13_4, 0], [Level13_3, 0]];
};
if (Game.levelType == Level13_3){
LevelBackground.setBackground(l, "ice");
ID = 3;
chests = [["hp"], ["exp", 130]];
doors = [[Level13_2, 2], [Level13_5, 0], ["end", 0]];
};
if (Game.levelType == Level13_4){
LevelBackground.setBackground(l, "ice");
ID = 4;
chests = [["hp"], ["equip", Equips.vikingArmor]];
doors = [[Level13_2, 1]];
};
if (Game.levelType == Level13_5){
LevelBackground.setBackground(l, "ice");
ID = 5;
chests = [["exp", 160], ["hpup"]];
doors = [[Level13_3, 1]];
};
if (Game.levelType == Level14_1){
LevelBackground.setBackground(l, "clouds");
ID = 1;
chests = [["exp", 120], ["exp", 110]];
doors = [[Level14_2, 0], [Level14_4, 0]];
};
if (Game.levelType == Level14_2){
LevelBackground.setBackground(l, "clouds");
ID = 2;
chests = [["hp"], ["exp", 130]];
doors = [[Level14_1, 0], [Level14_5, 0], [Level14_3, 0]];
};
if (Game.levelType == Level14_3){
LevelBackground.setBackground(l, "clouds");
ID = 3;
chests = [["mp"], ["exp", 150]];
doors = [[Level14_2, 2], ["end", 0]];
};
if (Game.levelType == Level14_4){
LevelBackground.setBackground(l, "clouds");
ID = 4;
chests = [["exp", 200], ["hpup"]];
doors = [[Level14_1, 1]];
};
if (Game.levelType == Level14_5){
LevelBackground.setBackground(l, "clouds");
ID = 5;
chests = [["exp", 200], ["equip", Equips.mageHat]];
doors = [[Level14_2, 1], [Level14_2, 1]];
};
if (Game.levelType == Level15_1){
LevelBackground.setBackground(l, "ice");
ID = 1;
chests = [["exp", 250]];
doors = [[Level15_2, 0]];
};
if (Game.levelType == Level15_2){
LevelBackground.setBackground(l, "ice");
ID = 2;
l.door0.visible = false;
l.door1.visible = false;
doors = [[Level15_1, 0], [Level15_3, 0]];
};
if (Game.levelType == Level15_3){
LevelBackground.setBackground(l, "ice");
ID = 3;
chests = [["exp", 100], ["exp", 110], ["exp", 120], ["exp", 130], ["hp"], ["exp", 140], ["mp"], ["exp", 150], ["hpup"]];
doors = [[Level15_2, 1], ["end", 0]];
};
if (Game.levelType == Level16_1){
LevelBackground.setBackground(l, "fire");
ID = 1;
chests = [["exp", 140], ["exp", 140]];
doors = [[Level16_4, 0], [Level16_2, 0]];
};
if (Game.levelType == Level16_2){
LevelBackground.setBackground(l, "fire");
ID = 2;
chests = [["hp"], ["exp", 150]];
doors = [[Level16_1, 1], [Level16_3, 0]];
};
if (Game.levelType == Level16_3){
LevelBackground.setBackground(l, "fire");
ID = 3;
chests = [["mp"], ["exp", 200]];
doors = [[Level16_2, 1], [Level16_5, 0], ["end", 0]];
};
if (Game.levelType == Level16_4){
LevelBackground.setBackground(l, "fire");
ID = 4;
chests = [["exp", 220], ["hpup"]];
doors = [[Level16_1, 0]];
};
if (Game.levelType == Level16_5){
LevelBackground.setBackground(l, "fire");
ID = 5;
chests = [["hp"], ["exp", 220]];
doors = [[Level16_3, 1]];
};
if (Game.levelType == Level17_1){
LevelBackground.setBackground(l, "dark");
ID = 1;
chests = [["exp", 160], ["exp", 200]];
doors = [[Level17_4, 0], [Level17_2, 0]];
};
if (Game.levelType == Level17_2){
LevelBackground.setBackground(l, "dark");
ID = 2;
chests = [["mp"], ["exp", 200]];
doors = [[Level17_1, 1], [Level17_5, 0], [Level17_3, 0]];
};
if (Game.levelType == Level17_3){
LevelBackground.setBackground(l, "dark");
ID = 3;
chests = [["hp"], ["exp", 200]];
doors = [[Level17_2, 2], ["end", 0]];
};
if (Game.levelType == Level17_4){
LevelBackground.setBackground(l, "dark");
ID = 4;
chests = [["exp", 250], ["mpup"]];
doors = [[Level17_1, 0]];
};
if (Game.levelType == Level17_5){
LevelBackground.setBackground(l, "dark");
ID = 5;
chests = [["exp", 220], ["hpup"]];
doors = [[Level17_2, 1]];
};
if (Game.levelType == Level18_1){
LevelBackground.setBackground(l, "dark");
ID = 1;
chests = [["exp", 200], ["exp", 200]];
doors = [[Level18_4, 0], [Level18_2, 0]];
};
if (Game.levelType == Level18_2){
LevelBackground.setBackground(l, "dark");
ID = 2;
chests = [["hp"]];
doors = [[Level18_1, 1], [Level18_5, 0], [Level18_3, 0]];
};
if (Game.levelType == Level18_3){
LevelBackground.setBackground(l, "dark");
ID = 3;
chests = [["exp", 220], ["exp", 220]];
doors = [[Level18_2, 2], [Level18_6, 0], ["end", 0]];
};
if (Game.levelType == Level18_4){
LevelBackground.setBackground(l, "dark");
ID = 4;
chests = [["hpup"]];
doors = [[Level18_1, 0]];
};
if (Game.levelType == Level18_5){
LevelBackground.setBackground(l, "dark");
ID = 5;
chests = [["mp"], ["exp", 250]];
doors = [[Level18_2, 1]];
};
if (Game.levelType == Level18_6){
LevelBackground.setBackground(l, "dark");
ID = 6;
chests = [["exp", 250], ["equip", Equips.ninjaGear]];
doors = [[Level18_3, 1]];
};
if (Game.levelType == Level19_1){
LevelBackground.setBackground(l, "fire");
ID = 1;
chests = [["exp", 250], ["exp", 250]];
doors = [[Level19_4, 0], [Level19_2, 0]];
};
if (Game.levelType == Level19_2){
LevelBackground.setBackground(l, "fire");
ID = 2;
chests = [["mp"], ["exp", 250]];
doors = [[Level19_1, 1], [Level19_5, 0], [Level19_3, 0]];
};
if (Game.levelType == Level19_3){
LevelBackground.setBackground(l, "fire");
ID = 3;
chests = [["exp", 250], ["exp", 250]];
doors = [[Level19_2, 2], [Level19_6, 0], ["end", 0]];
};
if (Game.levelType == Level19_4){
LevelBackground.setBackground(l, "fire");
ID = 4;
doors = [[Level19_1, 0]];
};
if (Game.levelType == Level19_5){
LevelBackground.setBackground(l, "fire");
ID = 5;
chests = [["exp", 330], ["equip", Equips.umbrella]];
doors = [[Level19_2, 1]];
};
if (Game.levelType == Level19_6){
LevelBackground.setBackground(l, "fire");
ID = 6;
chests = [["exp", 300], ["hpup"]];
doors = [[Level19_3, 1]];
};
if (Game.levelType == Level20_1){
LevelBackground.setBackground(l, "fire");
ID = 1;
doors = [[Level20_2, 0]];
};
if (Game.levelType == Level20_2){
LevelBackground.setBackground(l, "fire");
ID = 2;
l.door0.visible = false;
l.door1.visible = false;
doors = [[Level20_1, 0], [Level20_3, 0]];
};
if (Game.levelType == Level20_3){
LevelBackground.setBackground(l, "fire");
ID = 3;
chests = [["exp", 200], ["mp"], ["exp", 250], ["exp", 300], ["exp", 350], ["exp", 400], ["hp"], ["exp", 450], ["hpup"], ["exp", 500]];
doors = [[Level20_2, 1], ["end", 0]];
};
if (Game.levelType == Level21_1){
LevelBackground.setBackground(l, "forest day");
ID = 1;
doors = [[Level21_2, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_2){
LevelBackground.setBackground(l, "forest day");
ID = 2;
doors = [[Level21_3, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_3){
LevelBackground.setBackground(l, "forest day");
ID = 3;
chests = [["coins", 10]];
doors = [[Level21_4, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_4){
LevelBackground.setBackground(l, "desert");
ID = 4;
chests = [["coins", 10]];
doors = [[Level21_5, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_5){
LevelBackground.setBackground(l, "desert");
ID = 5;
doors = [[Level21_6, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_6){
LevelBackground.setBackground(l, "desert");
ID = 6;
chests = [["coins", 10]];
doors = [[Level21_7, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_7){
LevelBackground.setBackground(l, "desert");
ID = 7;
chests = [["coins", 10]];
doors = [[Level21_8, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_8){
LevelBackground.setBackground(l, "snow");
ID = 8;
doors = [[Level21_9, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_9){
LevelBackground.setBackground(l, "snow");
ID = 9;
chests = [["coins", 10]];
doors = [[Level21_10, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_10){
LevelBackground.setBackground(l, "snow");
ID = 10;
doors = [[Level21_11, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_11){
LevelBackground.setBackground(l, "snow");
ID = 11;
chests = [["coins", 10]];
doors = [[Level21_12, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_12){
LevelBackground.setBackground(l, "snow");
ID = 12;
chests = [["coins", 10]];
doors = [[Level21_13, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_13){
LevelBackground.setBackground(l, "fire");
ID = 13;
chests = [["coins", 10]];
doors = [[Level21_14, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_14){
LevelBackground.setBackground(l, "fire");
ID = 14;
doors = [[Level21_15, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_15){
LevelBackground.setBackground(l, "fire");
ID = 15;
chests = [["coins", 10]];
doors = [[Level21_16, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level21_16){
LevelBackground.setBackground(l, "fire");
ID = 16;
chests = [["coins", 10]];
doors = [[Level21_16, 1], ["end", 0]];
l.door0.visible = false;
};
if (Game.levelType == Level22_1){
LevelBackground.setBackground(l, "forest day");
ID = 1;
doors = [[Level22_2, 0]];
l.door0.visible = false;
};
if (Game.levelType == Level22_2){
LevelBackground.setBackground(l, "sandstorm");
ID = 2;
l.door0.visible = false;
l.natalie.visible = false;
l.nolegs.visible = false;
doors = [[Level22_3, 0]];
};
if (Game.levelType == Level22_3){
LevelBackground.setBackground(l, "ice");
ID = 3;
l.door0.visible = false;
doors = [[Level22_4, 0]];
};
if (Game.levelType == Level22_4){
LevelBackground.setBackground(l, "fire");
ID = 4;
l.door0.visible = false;
doors = [[Level22_5, 0]];
};
if (Game.levelType == Level22_5){
LevelBackground.setBackground(l, "forest day");
ID = 5;
chests = [["exp", 222], ["hp"], ["exp", 333], ["exp", 444], ["exp", 555], ["exp", 666], ["mp"], ["exp", 777], ["exp", 888], ["exp", 999]];
l.door0.visible = false;
doors = [[Level22_4, 0], ["end", 0]];
};
}
}
}//package
Section 414
//LevelState (LevelState)
package {
public class LevelState {
public static var chestCoins:Array;
public static var coins:Array;
public static var perfects:Array;
public static var ranks:Array;
public static var level:int;
public static var chestCount:int;
public static var chests:Array;
public static var totalFoes:Array;
public static var totalCoins:Array;
public static var totalTimes:Array;
public static var totalChests:Array;
public static var foes:Array;
public static var coinCount:int;
public function LevelState(){
super();
}
public static function getFoe(i:int):int{
return (foes[Game.level.ID][i]);
}
public static function getChests(){
var chests:int;
var i:int;
chests = 0;
i = 0;
while (i < 23) {
load(i);
chests = (chests + chestCount);
i++;
};
load(SaveData.selectedLevel);
if (!Main.offline){
Game.root.kongregate.stats.submit("chestsCollected", chests);
};
return (chests);
}
public static function init(){
totalTimes = [];
totalCoins = [];
totalChests = [];
totalFoes = [];
chestCoins = [];
ranks = new Array(23);
perfects = new Array(23);
}
public static function getCoin(i:int):int{
return (coins[Game.level.ID][i]);
}
public static function getPerfect(i:int){
return (!((perfects[i] == null)));
}
public static function getChest(i:int):int{
return (chests[Game.level.ID][i]);
}
public static function save(){
trace(("saving level: " + level));
totalCoins[level] = coins;
totalChests[level] = chests;
totalFoes[level] = foes;
if (Game.winlevel){
if (((!(totalTimes[level])) || ((((totalTimes[level][0] * 60) + totalTimes[level][1]) > ((Game.hud.minutes * 60) + Game.hud.seconds))))){
totalTimes[level] = [Game.hud.minutes, Game.hud.seconds];
};
};
}
public static function load(l:int){
var i:int;
var j:int;
level = l;
coinCount = 0;
chestCount = 0;
trace(("LOADING DATA FOR LEVEL: " + l));
if (totalCoins[level]){
coins = totalCoins[level];
} else {
coins = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
};
if (totalChests[level]){
chests = totalChests[level];
} else {
chests = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
};
if (chestCoins[level]){
coinCount = (coinCount + chestCoins[level]);
} else {
chestCoins[level] = 0;
};
foes = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
i = 0;
while (i < coins.length) {
j = 0;
while (j < coins[i].length) {
if (coins[i][j] == 2){
coins[i][j] = 1;
};
if (coins[i][j] == 1){
coinCount++;
};
j++;
};
i++;
};
i = 0;
while (i < chests.length) {
j = 0;
while (j < chests[i].length) {
if ((((((chests[i][j] == 1)) || ((chests[i][j] == 2)))) || ((chests[i][j] == 3)))){
chestCount++;
};
if (chests[i][j] == 1){
chests[i][j] = 3;
};
j++;
};
i++;
};
}
public static function setCoin(i:int){
coins[Game.level.ID][i] = 2;
}
public static function getRank(i:int){
return (ranks[i]);
}
public static function setRank(){
if ((((ranks[level] < Options.difficulty)) || ((ranks[level] == undefined)))){
ranks[level] = Options.difficulty;
};
}
public static function getCoins(){
var coins:int;
var i:int;
coins = 0;
i = 0;
while (i < 23) {
load(i);
coins = (coins + coinCount);
i++;
};
load(SaveData.selectedLevel);
if (!Main.offline){
Game.root.kongregate.stats.submit("coinsCollected", coins);
};
return ((coins - SaveData.spentMoney));
}
public static function setFoe(i:int, b:int){
foes[Game.level.ID][i] = b;
}
public static function setChest(i:int, b:int){
chests[Game.level.ID][i] = b;
trace(chests);
}
}
}//package
Section 415
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.net.*;
import flash.ui.*;
public class Main extends MovieClip {
public var loaded:Number;
public var hud:MovieClip;
public var loader:MovieClip;
public var myMenu:ContextMenu;
public var mattLink;
public var medalBox:MovieClip;
public var h:int;
public var moreGames;
public var level:Level;
public var playing:Boolean;// = false
public var loadingComplete:Boolean;
public var konglink:SimpleButton;
public var allowed:String;
public var adBox:MovieClip;
public var musicLink;
public var domain:String;
public var mainMenu:MovieClip;
public var kongregate;
public var levelType:Class;
public var player:Player;
public var levelUnlock:Boolean;// = false
public static var offline:Boolean = false;
public function Main(){
var loadComplete:*;
levelType = Level1_1;
playing = false;
levelUnlock = false;
super();
loadComplete = function (event:Event):void{
kongregate = event.target.content;
kongregate.services.connect();
};
addFrameScript(0, frame1, 1, frame2, 2, frame3, 4, frame5);
stage.stageFocusRect = false;
stage.addEventListener(KeyboardEvent.KEY_DOWN, Keys.keyDownGet);
stage.addEventListener(KeyboardEvent.KEY_UP, Keys.keyUpGet);
addEventListener(Event.ENTER_FRAME, move);
Equips.init();
Keys.resetKeys();
MochiServices.connect("690843dc862af0a4", root, onConnectError);
MochiEvents.trackEvent("Viewed Preloader");
}
public function enterFrameHandler(e:Event=null){
if (!loadingComplete){
if (loaderInfo){
loaded = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (loader.bar){
loader.bar.scaleY = loaded;
loader.percent.text = (("" + int((loaded * 100))) + "%");
};
if ((((loaded >= 1)) && ((loader.currentFrame == 1)))){
loader.gotoAndPlay(3);
};
if (((loader.playButton) && (!(loader.playButton.hasEventListener(MouseEvent.CLICK))))){
loadingComplete = true;
loader.stop();
loader.playButton.addEventListener(MouseEvent.CLICK, playButtonClickHandler, false, 0, true);
};
};
}
public function playButtonClickHandler(e:Event=null):void{
trace("derp");
startMovie();
}
function frame3(){
stop();
Game.root = this;
if (playing){
Game.endGame();
SaveData.menuState = 1;
};
if (Game.retry){
gotoAndPlay(4);
Game.retry = false;
} else {
mainMenu = new MainMenu();
addChild(mainMenu);
mainMenu.x = 350;
mainMenu.y = 225;
setChildIndex(medalBox, (numChildren - 1));
};
trace("ROOT CHILDREN: ");
h = 0;
while (h < numChildren) {
trace(getChildAt(h));
h++;
};
}
public function openLink(e:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"));
}
function frame1(){
stop();
loader.stop();
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
loadingComplete = false;
loaded = 0;
stop();
SaveData.loadGame();
allowed = "andkon";
domain = this.root.loaderInfo.url.split("/")[2];
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
moreGames = new ContextMenuItem("Andkon Arcade");
mattLink = new ContextMenuItem("Game by Matt Roszak");
musicLink = new ContextMenuItem("Music by Halcyonic Falcon X");
mattLink.separatorBefore = true;
musicLink.separatorBefore = true;
moreGames.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
myMenu.customItems.push(moreGames, mattLink, musicLink);
contextMenu = myMenu;
}
public function startGame(level:Class){
Game.startGame(this);
playing = true;
}
function frame2(){
SFX.init(this);
nextFrame();
if ((((domain.indexOf(allowed) >= 0)) || ((domain == "")))){
Main.offline = true;
} else {
Main.offline = true;
gotoAndStop("sitelock");
};
}
function frame5(){
trace(("selected level: " + levelType));
Game.startGame(this, levelType);
if (mainMenu){
removeChild(mainMenu);
};
mainMenu = null;
playing = true;
stop();
}
public function onConnectError(status:String):void{
trace("Mochi connect error");
}
public function move(e:Event){
BGM.loop();
if (playing){
Game.gameLoop();
};
}
public function startMovie():void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
}
}
}//package
Section 416
//MainMenu (MainMenu)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class MainMenu extends MovieClip {
public var clock:MovieClip;
public var b1:SimpleButton;
public var b2:SimpleButton;
public var b3:SimpleButton;
public var b4:SimpleButton;
public var b5:SimpleButton;
public var b6:SimpleButton;
public var b7:SimpleButton;
public var c1:MovieClip;
public var levelName:MovieClip;
public var doubleClick:Boolean;
public var st10:MovieClip;
public var st11:MovieClip;
public var st12:MovieClip;
public var st13:MovieClip;
public var st15:MovieClip;
public var st19:MovieClip;
public var st16:MovieClip;
public var st18:MovieClip;
public var X:int;
public var Y:int;
public var li10:MovieClip;
public var li11:MovieClip;
public var li13:MovieClip;
public var li14:MovieClip;
public var li15:MovieClip;
public var li16:MovieClip;
public var li17:MovieClip;
public var li18:MovieClip;
public var li12:MovieClip;
public var st20:MovieClip;
public var st21:MovieClip;
public var st22:MovieClip;
public var st17:MovieClip;
public var j:int;
public var e0:MovieClip;
public var e1:MovieClip;
public var e2:MovieClip;
public var e3:MovieClip;
public var e4:MovieClip;
public var e5:MovieClip;
public var e6:MovieClip;
public var e8:MovieClip;
public var li20:MovieClip;
public var li21:MovieClip;
public var li22:MovieClip;
public var e9:MovieClip;
public var li19:MovieClip;
public var e7:MovieClip;
public var i:int;
public var levelMask:MovieClip;
public var st14:MovieClip;
public var screen:String;
public var a:int;
public var l:int;
public var levelNo:int;
public var ic11:MovieClip;
public var ic12:MovieClip;
public var ic14:MovieClip;
public var ic10:MovieClip;
public var background2:MovieClip;
public var ic13:MovieClip;
public var screenPrev:String;
public var clouds:MovieClip;
public var menuLength:int;
public var sky:MovieClip;
public var background:MovieClip;
public var es0:MovieClip;
public var es1:MovieClip;
public var e10:MovieClip;
public var l1:MovieClip;
public var e12:MovieClip;
public var e13:MovieClip;
public var e14:MovieClip;
public var l5:MovieClip;
public var l6:MovieClip;
public var e11:MovieClip;
public var l9:MovieClip;
public var l3:MovieClip;
public var l4:MovieClip;
public var l7:MovieClip;
public var es2:MovieClip;
public var l2:MovieClip;
public var l8:MovieClip;
public var preview2:MovieClip;
public var kk:MovieClip;
public var player1:MovieClip;
public var player2:MovieClip;
public var coinBox:TextField;
public var film:MovieClip;
public var me1:MedalIcon;
public var me2:MedalIcon;
public var me3:MedalIcon;
public var me4:MedalIcon;
public var me5:MedalIcon;
public var me6:MedalIcon;
public var me7:MedalIcon;
public var me8:MedalIcon;
public var me9:MedalIcon;
public var o1:MovieClip;
public var choice:String;
public var o2:MovieClip;
public var o4:MovieClip;
public var o3:MovieClip;
public var me10:MedalIcon;
public var me12:MedalIcon;
public var me13:MedalIcon;
public var me14:MedalIcon;
public var me15:MedalIcon;
public var me16:MedalIcon;
public var me17:MedalIcon;
public var me19:MedalIcon;
public var p1:MovieClip;
public var me11:MedalIcon;
public var me18:MedalIcon;
public var s10:MovieClip;
public var s11:MovieClip;
public var me20:MedalIcon;
public var me21:MedalIcon;
public var me22:MedalIcon;
public var me23:MedalIcon;
public var me24:MedalIcon;
public var me25:MedalIcon;
public var me27:MedalIcon;
public var me28:MedalIcon;
public var me26:MedalIcon;
public var me29:MedalIcon;
public var st1:MovieClip;
public var st2:MovieClip;
public var st3:MovieClip;
public var st4:MovieClip;
public var st5:MovieClip;
public var me30:MedalIcon;
public var st7:MovieClip;
public var st8:MovieClip;
public var st9:MovieClip;
public var st6:MovieClip;
public var s0:MovieClip;
public var s1:MovieClip;
public var s3:MovieClip;
public var s4:MovieClip;
public var s5:MovieClip;
public var s6:MovieClip;
public var s2:MovieClip;
public var medalDesc:TextField;
public var s7:MovieClip;
public var s8:MovieClip;
public var s9:MovieClip;
public var medalName:TextField;
public var li2:MovieClip;
public var ic0:MovieClip;
public var ic1:MovieClip;
public var ic2:MovieClip;
public var li6:MovieClip;
public var li8:MovieClip;
public var li9:MovieClip;
public var face:MovieClip;
public var ic8:MovieClip;
public var ic9:MovieClip;
public var ic3:MovieClip;
public var li7:MovieClip;
public var ic5:MovieClip;
public var li1:MovieClip;
public var li3:MovieClip;
public var li4:MovieClip;
public var li5:MovieClip;
public var ic4:MovieClip;
public var ic6:MovieClip;
public var ic7:MovieClip;
public var keyConfig:MovieClip;
public var selected:int;
public var choice2:String;
public var mo0:TextField;
public var mo1:TextField;
public var mo2:TextField;
public var mo3:TextField;
public var mo4:TextField;
public var mo5:TextField;
public var choices:Array;
public var shopBox:TextField;
public var lo0:TextField;
public var lo1:TextField;
public var lo3:TextField;
public var chestBox:TextField;
public var lo5:TextField;
public var lo2:TextField;
public var lo4:TextField;
public var movie:Boolean;
public var purchased:MovieClip;
public var level:Class;
public var l10:MovieClip;
public var l12:MovieClip;
public var l14:MovieClip;
public var l16:MovieClip;
public var l13:MovieClip;
public var l18:MovieClip;
public var l15:MovieClip;
public var l17:MovieClip;
public var l19:MovieClip;
public var l11:MovieClip;
public var keyDown:Function;
public var l20:MovieClip;
public var l23:MovieClip;
public var l24:MovieClip;
public var l25:MovieClip;
public var l27:MovieClip;
public var l29:MovieClip;
public var l26:MovieClip;
public var l28:MovieClip;
public var l22:MovieClip;
public var l21:MovieClip;
public var timeBox:TextField;
public var box1:TextField;
public var box2:TextField;
public var preview:MovieClip;
public var box4:TextField;
public var box5:TextField;
public var box0:TextField;
public var box3:TextField;
public var l30:MovieClip;
public var a1:MovieClip;
public var black:MovieClip;
public function MainMenu(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13);
}
public function linearSelection(key:int, horizontal:Boolean){
getChildByName(("s" + selected)).s.visible = false;
if ((((((key == Keys.downKey)) && (!(horizontal)))) || ((((key == Keys.rightKey)) && (horizontal))))){
selected++;
SFX.sound("select", "m");
};
if ((((((key == Keys.upKey)) && (!(horizontal)))) || ((((key == Keys.leftKey)) && (horizontal))))){
selected--;
SFX.sound("select", "m");
};
if (selected < 0){
selected = (menuLength - 1);
};
if (selected == menuLength){
selected = 0;
};
if (key != -1){
getChildByName(("s" + selected)).s.visible = true;
};
}
public function highlightEquips(){
var HP:Number;
var atk:Number;
var mag:Number;
getChildByName("es0").x = getChildByName(("e" + Equips.equips.indexOf(SaveData.hat))).x;
getChildByName("es0").y = getChildByName(("e" + Equips.equips.indexOf(SaveData.hat))).y;
getChildByName("es1").x = getChildByName(("e" + Equips.equips.indexOf(SaveData.armor))).x;
getChildByName("es1").y = getChildByName(("e" + Equips.equips.indexOf(SaveData.armor))).y;
getChildByName("es2").x = getChildByName(("e" + Equips.equips.indexOf(SaveData.weapon))).x;
getChildByName("es2").y = getChildByName(("e" + Equips.equips.indexOf(SaveData.weapon))).y;
getChildByName("box0").text = ((SaveData.hat.name + ": ") + SaveData.hat.description);
getChildByName("box1").text = ((SaveData.armor.name + ": ") + SaveData.armor.description);
getChildByName("box2").text = ((SaveData.weapon.name + ": ") + SaveData.weapon.description);
HP = (Math.round(((((1 + SaveData.weapon.HP) + SaveData.hat.HP) + SaveData.armor.HP) * 10)) / 10);
atk = (Math.round(((((1 + SaveData.weapon.attack) + SaveData.hat.attack) + SaveData.armor.attack) * 10)) / 10);
mag = (Math.round(((((1 + SaveData.weapon.magic) + SaveData.hat.magic) + SaveData.armor.magic) * 10)) / 10);
if (mag < 0){
mag = 0;
};
getChildByName("box3").text = (((((((((((((((((((((("" + (SaveData.playerLevel + 1)) + "\n") + Math.floor((HP * (20 + (SaveData.HPups * 2))))) + " \t( ") + (20 + (SaveData.HPups * 2))) + " x ") + HP) + " )") + "\n") + Math.floor(((5 + ((8 / 20) * SaveData.playerLevel)) * atk))) + " \t( ") + Math.floor((5 + ((8 / 20) * SaveData.playerLevel)))) + " x ") + atk) + " )") + "\n") + Math.floor(((5 + ((8 / 20) * SaveData.playerLevel)) * mag))) + " \t( ") + Math.floor((5 + ((8 / 20) * SaveData.playerLevel)))) + " x ") + mag) + " )");
}
public function deleteProgressSelect(key:int){
linearSelection(key, true);
if (Keys.anyKey(key)){
if (selected == 0){
SaveData.initProgress();
};
SFX.sound("select2", "m");
fadeTo("options");
};
}
public function resetEquipsSelect(key:int){
linearSelection(key, true);
if (Keys.anyKey(key)){
if (selected == 0){
SaveData.initEquips();
};
SFX.sound("select2", "m");
fadeTo("options");
};
}
function frame12(){
s0.s.visible = false;
menuLength = 2;
selected = 1;
if (Keys.mouseClick){
getChildByName("s1").s.visible = false;
};
}
function frame10(){
s0.s.visible = false;
menuLength = 2;
selected = 1;
if (Keys.mouseClick){
getChildByName("s1").s.visible = false;
};
}
function frame5(){
menuLength = 12;
selected = 11;
init();
SaveData.menuChoice[2] = 5;
SaveData.menuChoice[3] = 1;
box5.text = Options.getAim();
box0.text = Options.getQuality();
box2.text = Options.getMusic();
box3.text = Options.getSound();
box1.text = Options.getBackground();
box4.text = Options.getDifficulty();
box0.mouseEnabled = false;
box1.mouseEnabled = false;
box2.mouseEnabled = false;
box3.mouseEnabled = false;
box4.mouseEnabled = false;
box5.mouseEnabled = false;
}
function frame3(){
if (Medals.stats.kills >= 1000){
Medals.unlock(Medals.endangeredSpecies);
};
if (!Main.offline){
Game.root.kongregate.stats.submit("experienceLevel", SaveData.playerLevel);
};
player1.mouseEnabled = false;
player1.mouseChildren = false;
choice = SaveData.menuChoice[1];
X = SaveData.menuChoice[2];
Y = SaveData.menuChoice[3];
coinBox.text = "0/200";
chestBox.text = "0/20";
shopBox.text = ("" + LevelState.getCoins());
timeBox.text = "???";
choices = [["l1", "l2", "l3", "l4", "l5", "s1", "s2"], ["l6", "l7", "l8", "l9", "l10", "o2", "o3"], ["l11", "l12", "l13", "l14", "l15", "o1", "o4"], ["l16", "l17", "l18", "l19", "l20", "p1", "p1"], ["l21", "l21", "l21", "l22", "l22", "p1", "p1"]];
initChoices();
showPreview();
if ((LevelState.getCoins() + SaveData.spentMoney) >= 2200){
Medals.unlock(Medals.goldHoarder);
};
if (LevelState.getChests() >= 220){
Medals.unlock(Medals.greatAdventurer);
};
trace(("Total chests:" + LevelState.getChests()));
trace(("Total coins:" + (LevelState.getCoins() + SaveData.spentMoney)));
movie = false;
level = (getDefinitionByName((("Level" + Level.levelNo) + "_1")) as Class);
Medals.countMedals();
BGM.play(1);
shopBox.mouseEnabled = false;
j = 1;
while (j <= 22) {
getChildByName(("st" + j)).star.visible = false;
getChildByName(("st" + j)).rank.gotoAndStop(2);
if (SaveData.levelsUnlocked >= j){
getChildByName(("li" + j)).icons.gotoAndStop((j + 1));
getChildByName(("li" + j)).height = (getChildByName(("li" + j)).height * 1.05);
getChildByName(("li" + j)).width = (getChildByName(("li" + j)).width * 1.05);
getChildByName(("li" + j)).x = (getChildByName(("li" + j)).x - 1);
getChildByName(("li" + j)).y = (getChildByName(("li" + j)).y - 1);
if (LevelState.getRank(j) != null){
getChildByName(("st" + j)).rank.gotoAndStop((3 + LevelState.getRank(j)));
};
if (LevelState.getPerfect(j)){
getChildByName(("st" + j)).star.visible = true;
};
};
j++;
};
if (SaveData.levelsUnlocked < 21){
getChildByName("li21").visible = false;
};
if (SaveData.levelsUnlocked < 22){
getChildByName("li22").visible = false;
};
SaveData.menuState = 0;
doubleClick = false;
SaveData.saveGame();
}
public function medalsSelect(key:int){
var medalNo:int;
choice2 = choice;
getChildByName(choices[Y][X]).s.visible = false;
if (key == Keys.escapeKey){
fadeTo("levelMenu");
SFX.sound("select", "m");
} else {
if (Keys.anyKey(key)){
if (choice.substr(0, 1) == "l"){
medalNo = choice.substr(1);
medalName.text = Medals.medals[(medalNo - 1)].name;
medalDesc.text = Medals.medals[(medalNo - 1)].desc;
};
if (choice == "p1"){
fadeTo("levelMenu");
};
SFX.sound("select", "m");
} else {
if (key == Keys.downKey){
while (choice2 == choice) {
Y++;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.upKey){
while (choice2 == choice) {
Y--;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.leftKey){
while (choice2 == choice) {
X--;
moveLevel();
if (choice == "p1"){
break;
};
};
SFX.sound("select", "m");
};
if (key == Keys.rightKey){
while (choice2 == choice) {
X++;
moveLevel();
if (choice == "p1"){
break;
};
};
SFX.sound("select", "m");
};
};
};
if (((getChildByName(choices[Y][X])) && (!((key == -1))))){
getChildByName(choices[Y][X]).s.visible = true;
};
}
function frame4(){
Medals.unlock(Medals.theCredits);
if (Keys.mouseClick){
getChildByName("p1").s.visible = false;
};
SaveData.menuChoice[2] = 6;
SaveData.menuChoice[3] = 1;
}
function frame11(){
s0.s.visible = false;
menuLength = 2;
selected = 1;
if (Keys.mouseClick){
getChildByName("s1").s.visible = false;
};
}
function frame13(){
s0.s.visible = false;
menuLength = 2;
selected = 1;
if (Keys.mouseClick){
getChildByName("s1").s.visible = false;
};
}
function frame6(){
if (Keys.mouseClick){
getChildByName("p1").s.visible = false;
};
SaveData.menuChoice[2] = 5;
SaveData.menuChoice[3] = 2;
X = 0;
Y = 3;
choice = "p1";
choices = [["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8", "l9", "l10"], ["l11", "l12", "l13", "l14", "l15", "l16", "l17", "l18", "l19", "l20"], ["l21", "l22", "l23", "l24", "l25", "l26", "l27", "l28", "l29", "l30"], ["p1", "p1", "p1", "p1", "p1", "p1", "p1", "p1", "p1", "p1"]];
a = 1;
while (a <= Medals.medals.length) {
trace(Medals.medals[(a - 1)]);
if (Medals.medals[(a - 1)].unlocked){
this[("me" + a)].gotoAndStop(Medals.medals[(a - 1)].pic);
};
a++;
};
initChoices();
Medals.resendMedals();
}
function frame1(){
stage.focus = root;
movie = true;
screen = "ads";
screenPrev = "";
selected = 0;
choice = "p1";
choice2 = "";
X = 6;
Y = 5;
level = parent.levelType;
stop();
keyDown = adsSelect;
menuLength = 5;
i = 0;
stop();
stage.quality = Options.getQuality();
getChildByName("b1").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy/?haref=adventurestory&src=spon-rpg-adventurestory-site-x"), "_blank");
});
getChildByName("b2").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-2/?haref=adventurestory&src=spon-rpg-adventurestory-site-x"), "_blank");
});
getChildByName("b3").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/epic-battle-fantasy-3/?haref=adventurestory&src=spon-rpg-adventurestory-site-x"), "_blank");
});
getChildByName("b4").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.kongregate.com/games/kupo707/bullet-heaven/?haref=adventurestory&src=spon-rpg-adventurestory-site-x"), "_blank");
});
getChildByName("b5").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://kupo707.deviantart.com/"), "_blank");
});
getChildByName("b6").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Epic-Battle-Fantasy-3/121491377896263"), "_blank");
});
getChildByName("b7").addEventListener(MouseEvent.CLICK, function (e:Event=null){
navigateToURL(new URLRequest("http://www.facebook.com/pages/Halcyonic-Falcon-X/148298581863486"), "_blank");
});
if (SaveData.menuState == 1){
fadeTo("levelMenu");
} else {
fadeTo("mainMenu");
};
}
function frame7(){
SaveData.menuChoice[2] = 6;
SaveData.menuChoice[3] = 0;
l = 0;
while (l < 15) {
if (SaveData.equipData[l]){
getChildByName(("ic" + l)).gotoAndStop((l + 1));
} else {
getChildByName(("ic" + l)).gotoAndStop(16);
};
l++;
};
X = 0;
Y = 3;
choice = "b1";
choices = [["e0", "e1", "e2", "e3", "e4"], ["e5", "e6", "e7", "e8", "e9"], ["e10", "e11", "e12", "e13", "e14"], ["b1", "b1", "b1", "b1", "b1"]];
initChoices();
highlightEquips();
getChildByName("b1").visible = true;
}
function frame8(){
menuLength = 7;
selected = 6;
init();
shopBox.text = ("" + LevelState.getCoins());
SaveData.menuChoice[2] = 5;
SaveData.menuChoice[3] = 0;
showSpells();
}
public function clickSelection(button:String){
if (getChildByName(("s" + selected))){
getChildByName(("s" + selected)).s.visible = false;
};
if (getChildByName(choice)){
getChildByName(choice).s.visible = false;
};
if (currentFrame == 3){
SaveData.menuChoice[1] = choice;
};
choice = button;
selected = button.substr(1);
keyDown(-1);
trace(("Clicked on: " + button));
Keys.mouseClick = true;
}
function frame2(){
menuLength = 4;
selected = SaveData.menuChoice[0];
init();
BGM.play(1);
}
public function init(){
i = 0;
while (i < menuLength) {
if (getChildByName(("s" + i)).s){
getChildByName(("s" + i)).s.visible = false;
};
i++;
};
if (!Keys.mouseClick){
getChildByName(("s" + selected)).s.visible = true;
};
}
function frame9(){
}
public function equipsSelect(key:int){
var item:int;
choice2 = choice;
getChildByName(choices[Y][X]).s.visible = false;
if (key == Keys.escapeKey){
fadeTo("levelMenu");
SFX.sound("select", "m");
} else {
if (Keys.anyKey(key)){
if (choice.substr(0, 1) == "e"){
item = choice.substr(1);
if (SaveData.equipData[item]){
if (item <= 4){
SaveData.hat = Equips.equips[item];
} else {
if (item <= 9){
SaveData.armor = Equips.equips[item];
} else {
if (item <= 14){
SaveData.weapon = Equips.equips[item];
};
};
};
highlightEquips();
player1.nextFrame();
player2.nextFrame();
};
};
if (choice == "b1"){
fadeTo("levelMenu");
};
SFX.sound("select", "m");
} else {
if (key == Keys.downKey){
while (choice2 == choice) {
Y++;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.upKey){
while (choice2 == choice) {
Y--;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.leftKey){
while (choice2 == choice) {
X--;
moveLevel();
if (choice == "b1"){
break;
};
};
SFX.sound("select", "m");
};
if (key == Keys.rightKey){
while (choice2 == choice) {
X++;
moveLevel();
if (choice == "b1"){
break;
};
};
SFX.sound("select", "m");
};
};
};
if (((getChildByName(choices[Y][X])) && (!((key == -1))))){
getChildByName(choices[Y][X]).s.visible = true;
};
}
public function optionsSelect(key:int){
linearSelection(key, false);
if ((((key == Keys.escapeKey)) || (((Keys.anyKey(key)) && ((selected == 11)))))){
fadeTo(screenPrev);
SFX.sound("select", "m");
};
if (Keys.anyKey(key)){
if (selected == 0){
fadeTo("config");
SFX.sound("select2", "m");
};
if (selected == 1){
fadeTo("resetKeys");
SFX.sound("select2", "m");
};
if (selected == 3){
fadeTo("deleteProgress");
SFX.sound("select2", "m");
};
if (selected == 4){
fadeTo("resetEquips");
SFX.sound("select2", "m");
};
if (selected == 5){
fadeTo("resetExperience");
SFX.sound("select2", "m");
};
};
if (((((Keys.anyKey(key)) || ((key == Keys.leftKey)))) || ((key == Keys.rightKey)))){
if (selected == 8){
box2.text = Options.toggleMusic();
SFX.sound("select2", "m");
};
if (selected == 9){
box3.text = Options.toggleSound();
SFX.sound("select2", "m");
};
if (selected == 7){
box1.text = Options.toggleBackground();
SFX.sound("select2", "m");
};
if (selected == 2){
box5.text = Options.toggleAim();
SFX.sound("select2", "m");
};
};
if (((Keys.anyKey(key)) || ((key == Keys.rightKey)))){
if (selected == 6){
box0.text = Options.setQuality(1);
SFX.sound("select2", "m");
};
if (selected == 10){
box4.text = Options.setDifficulty(1);
SFX.sound("select2", "m");
};
};
if (key == Keys.leftKey){
if (selected == 6){
box0.text = Options.setQuality(-1);
SFX.sound("select2", "m");
};
if (selected == 10){
box4.text = Options.setDifficulty(-1);
SFX.sound("select2", "m");
};
};
}
public function showSpells(){
var v:int;
v = 0;
while (v < 6) {
if (SaveData.spellData[v] == 3){
getChildByName(("lo" + v)).text = "max";
getChildByName(("mo" + v)).text = "---";
} else {
getChildByName(("lo" + v)).text = ("lvl " + (SaveData.spellData[v] + 1));
getChildByName(("mo" + v)).text = ("" + Spells.spells[v].cost[SaveData.spellData[v]]);
};
v++;
};
}
public function adsSelect(key:int){
if (Keys.anyKey(key)){
fadeTo("mainMenu");
SFX.sound("select", "m");
};
}
public function mainMenuSelect(key:int){
if (!movie){
linearSelection(key, true);
if (Keys.anyKey(key)){
if (selected == 0){
if (SaveData.firstPlay){
SaveData.firstPlay = false;
Level.levelNo = 1;
SaveData.selectedLevel = 1;
parent.levelType = level;
parent.gotoAndPlay(3);
} else {
fadeTo("levelMenu");
};
};
if (selected == 1){
fadeTo("options");
};
if (selected == 2){
fadeTo("credits");
};
if (selected == 3){
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"));
};
SFX.sound("select", "m");
};
if ((((key == Keys.escapeKey)) || ((key == Keys.pauseKey)))){
fadeTo("ads");
SFX.sound("select", "m");
};
SaveData.menuChoice[0] = selected;
} else {
if (Keys.anyKey(key)){
film.gotoAndPlay(501);
SFX.sound("select", "m");
};
};
}
public function levelMenuSelect(key:int){
if (choice2 == choice){
doubleClick = true;
} else {
doubleClick = false;
};
choice2 = choice;
getChildByName(choices[Y][X]).s.visible = false;
if ((((key == Keys.escapeKey)) || ((key == Keys.pauseKey)))){
fadeTo("mainMenu");
SFX.sound("select", "m");
} else {
if (Keys.anyKey(key)){
if ((((choice.substr(0, 1) == "l")) && ((SaveData.levelsUnlocked >= choice.substr(1))))){
if (doubleClick){
choice = "p1";
} else {
levelNo = choice.substr(1);
Level.levelNo = levelNo;
SaveData.selectedLevel = choice.substr(1);
showPreview();
level = (getDefinitionByName((("Level" + choice.substr(1)) + "_1")) as Class);
};
};
if (choice == "p1"){
parent.levelType = level;
parent.gotoAndPlay(3);
};
if (choice == "o1"){
fadeTo("medals");
};
if (choice == "o2"){
fadeTo("options");
};
if (choice == "o3"){
fadeTo("credits");
};
if (choice == "o4"){
navigateToURL(new URLRequest("http://www.andkon.com/arcade/"));
};
if (choice == "s1"){
fadeTo("shop");
};
if (choice == "s2"){
fadeTo("equips");
};
SFX.sound("select", "m");
} else {
if (key == Keys.downKey){
while (choice2 == choice) {
Y++;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.upKey){
while (choice2 == choice) {
Y--;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.leftKey){
while (choice2 == choice) {
X--;
moveLevel();
};
SFX.sound("select", "m");
};
if (key == Keys.rightKey){
while (choice2 == choice) {
X++;
moveLevel();
};
SFX.sound("select", "m");
};
};
};
if (((getChildByName(choices[Y][X])) && (!((key == -1))))){
getChildByName(choices[Y][X]).s.visible = true;
};
SaveData.menuChoice[1] = choice;
SaveData.menuChoice[2] = X;
SaveData.menuChoice[3] = Y;
if (choice == "p1"){
SaveData.menuChoice[2] = 6;
SaveData.menuChoice[3] = 4;
};
trace(((("XY: " + X) + " ") + Y));
}
public function showPreview(){
trace(("Preview level: " + SaveData.selectedLevel));
preview2.icons.gotoAndStop((SaveData.selectedLevel + 1));
levelName.gotoAndStop(30);
levelName.gotoAndStop(SaveData.selectedLevel);
LevelState.load(SaveData.selectedLevel);
Game.levelNo = SaveData.selectedLevel;
coinBox.text = (("" + LevelState.coinCount) + "/100");
chestBox.text = (("" + LevelState.chestCount) + "/10");
if (LevelState.totalTimes[SaveData.selectedLevel]){
timeBox.text = Options.formatTime(LevelState.totalTimes[SaveData.selectedLevel][0], LevelState.totalTimes[SaveData.selectedLevel][1]);
} else {
timeBox.text = "---";
};
if (SaveData.selectedLevel == 22){
preview2.x = -220;
} else {
if (SaveData.selectedLevel == 21){
preview2.x = -323;
} else {
preview2.x = -157;
};
};
}
public function fadeTo(frame:String){
black.gotoAndPlay(1);
if ((((screen == "mainMenu")) || ((screen == "levelMenu")))){
screenPrev = screen;
};
screen = frame;
keyDown = this[(frame + "Select")];
gotoAndStop(frame);
}
public function moveLevel(){
if (X < 0){
X = (choices[0].length - 1);
};
if (X == choices[0].length){
X = 0;
};
if (Y < 0){
Y = (choices.length - 1);
};
if (Y == choices.length){
Y = 0;
};
choice = choices[Y][X];
}
public function creditsSelect(key:int){
if ((((key == Keys.escapeKey)) || (Keys.anyKey(key)))){
fadeTo(screenPrev);
SFX.sound("select", "m");
};
}
public function buySpell(s:int){
if ((((LevelState.getCoins() >= Spells.spells[s].cost[SaveData.spellData[s]])) && (!((SaveData.spellData[s] == 3))))){
purchased.gotoAndPlay(2);
purchased.y = (getChildByName(("s" + s)).y - 51);
SaveData.spentMoney = (SaveData.spentMoney + Spells.spells[s].cost[SaveData.spellData[s]]);
var _local2 = SaveData.spellData;
var _local3 = s;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
shopBox.text = ("" + LevelState.getCoins());
showSpells();
SFX.sound("buy", "m");
if ((((((((((((SaveData.spellData[0] >= 1)) && ((SaveData.spellData[1] >= 1)))) && ((SaveData.spellData[2] >= 1)))) && ((SaveData.spellData[3] >= 1)))) && ((SaveData.spellData[4] >= 1)))) && ((SaveData.spellData[5] >= 1)))){
Medals.unlock(Medals.balancedSkillset);
};
} else {
SFX.sound("select", "m");
};
}
public function resetExperienceSelect(key:int){
linearSelection(key, true);
if (Keys.anyKey(key)){
if (selected == 0){
SaveData.initExp();
};
SFX.sound("select2", "m");
fadeTo("options");
};
}
public function resetKeysSelect(key:int){
linearSelection(key, true);
if (Keys.anyKey(key)){
if (selected == 0){
Keys.resetKeys();
};
SFX.sound("select2", "m");
fadeTo("options");
};
}
public function playingSelect(key:int){
}
public function configSelect(key:int){
keyConfig.configKey(key);
}
public function initChoices(){
var arr:Array;
var str:String;
for each (arr in choices) {
for each (str in arr) {
getChildByName(str).s.visible = false;
};
};
if (((getChildByName(choice)) && (!(Keys.mouseClick)))){
getChildByName(choice).s.visible = true;
};
}
public function shopSelect(key:int){
linearSelection(key, false);
if ((((key == Keys.escapeKey)) || (((Keys.anyKey(key)) && ((selected == 6)))))){
fadeTo(screenPrev);
SFX.sound("select", "m");
} else {
if (Keys.anyKey(key)){
buySpell(selected);
};
};
}
public function endConfig(){
fadeTo("options");
}
}
}//package
Section 417
//MedalIcon (MedalIcon)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class MedalIcon extends MovieClip {
public function MedalIcon(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 418
//Medals (Medals)
package {
import com.newgrounds.*;
public class Medals {
public static var powerUp:Object = {name:"Power Up", desc:"Max out your HP and MP.", pic:6};
public static var foeJuggler:Object = {name:"Foe Juggler", desc:"Keep an enemy up in the air by attacking it.", pic:10};
public static var level:Level;
public static var newbieWarrior:Object = {name:"Newbie Warrior", desc:"Discover the standard 3-hit melee combo.", pic:12};
public static var shroomsAreBouncy:Object = {name:"Shrooms are Bouncy", desc:"Bounce off a mushroom and into the air.", pic:32};
public static var endangeredSpecies:Object = {name:"Endangered Species", desc:"Defeat 1000 foes in total.", pic:33};
public static var watchYourStep:Object = {name:"Watch Your Step", desc:"Collapse a wooden platform by walking over it.", pic:21};
public static var spikesArePainful:Object = {name:"Spikes are Painful", desc:"Fall into a pit of spikes and regret it.", pic:23};
public static var balancedSkillset:Object = {name:"Balanced Skillset", desc:"Buy the weakest version of every spell.", pic:5};
public static var levelGrinder:Object = {name:"Level Grinder", desc:"Reach an experience level of 30.", pic:7};
public static var stats:Object = {notHit:false, kills:0};
public static var goldHoarder:Object = {name:"Gold Hoarder", desc:"Collect every coin in every level.", pic:18};
public static var foeBouncer:Object = {name:"Foe Bouncer", desc:"Perform a massive aerial combo by bouncing off enemies.", pic:11};
public static var theEnd:Object = {name:"The End", desc:"Complete level 20, rescue the princess and finish the game.", pic:15};
public static var volcanoSprint:Object = {name:"Volcano Sprint", desc:"Beat Level 19 in under 70 seconds.", pic:24};
public static var masterWarrior:Object = {name:"Master Warrior", desc:"Lose your ability to cast spells, you don't need them.", pic:3};
public static var animalCruelty:Object = {name:"Animal Cruelty", desc:"Drop an enemy into some spikes, and watch it suffer.", pic:28};
public static var foeExterminator:Object = {name:"Foe Exterminator", desc:"Complete the Foe Rush on hard or epic difficulty.", pic:16};
public static var lavaIsHot:Object = {name:"Lava is Hot", desc:"Stand on lava for too long and get hurt.", pic:30};
public static var selfDestruction:Object = {name:"Self Destruction", desc:"Defeat any boss with their own projectiles.", pic:2};
public static var desertDash:Object = {name:"Desert Dash", desc:"Beat Level 7 in under 50 seconds.", pic:26};
public static var bossHunter:Object = {name:"Boss Hunter", desc:"Complete the Boss Rush on hard or epic difficulty.", pic:17};
public static var greatAdventurer:Object = {name:"Great Adventurer", desc:"Open every treasure chest in every level.", pic:19};
public static var bossImmunity:Object = {name:"Boss Immunity", desc:"Defeat any boss without getting hit.", pic:13};
public static var glacierRun:Object = {name:"Glacier Run", desc:"Beat Level 13 in under 60 seconds.", pic:25};
public static var frostBite:Object = {name:"Frost Bite", desc:"Hit an enemy with a dangling icicle.", pic:29};
public static var forestJog:Object = {name:"Forest Jog", desc:"Beat level 3 in under 40 seconds.", pic:27};
public static var theCredits:Object = {name:"The Credits", desc:"Check out the credits page and maybe visit some links.", pic:14};
public static var medals:Array = [levelGrinder, powerUp, balancedSkillset, goldHoarder, greatAdventurer, forestJog, desertDash, glacierRun, volcanoSprint, selfDestruction, bossImmunity, endangeredSpecies, animalCruelty, frostBite, watchYourStep, cloudsDisappear, spikesArePainful, lavaIsHot, iceIsSlippery, shroomsAreBouncy, foeJuggler, foeBouncer, newbieWarrior, masterWarrior, newbieMage, masterMage, foeExterminator, bossHunter, theEnd, theCredits];
public static var newbieMage:Object = {name:"Newbie Mage", desc:"Cast a spell for the first time.", pic:9};
public static var iceIsSlippery:Object = {name:"Ice is Slippery", desc:"Stand on ice and slide around.", pic:31};
public static var cloudsDisappear:Object = {name:"Clouds Disappear", desc:"Collapse a cloud by standing on it.", pic:22};
public static var current:Object;
public static var masterMage:Object = {name:"Master Mage", desc:"Cast a level 3 spell.", pic:8};
public function Medals(){
super();
}
public static function unlock(medal:Object){
if (medal.unlocked){
} else {
medal.unlocked = true;
current = medal;
Game.root.medalBox.gotoAndPlay(100);
Game.root.medalBox.gotoAndPlay(2);
Game.root.setChildIndex(Game.root.medalBox, (Game.root.numChildren - 1));
API.unlockMedal(medal.name);
countMedals();
};
}
public static function countMedals(){
var meds:int;
var a:int;
meds = 0;
a = 1;
while (a <= medals.length) {
if (medals[(a - 1)].unlocked){
meds++;
};
a++;
};
if (!Main.offline){
Game.root.kongregate.stats.submit("medals", meds);
};
}
public static function resendMedals(){
var meds:int;
var a:int;
meds = 0;
a = 1;
while (a <= medals.length) {
if (medals[(a - 1)].unlocked){
API.unlockMedal(medals[(a - 1)].name);
};
a++;
};
}
}
}//package
Section 419
//MonolithDark (MonolithDark)
package {
public class MonolithDark extends Foe {
public var wait:int;
public function MonolithDark(){
super();
addFrameScript(0, frame1, 14, frame15, 16, frame17, 32, frame33, 48, frame49, 65, frame66, 85, frame86, 86, frame87, 109, frame110);
EXP = 200;
HP = 280;
recoilType = 0;
attack = (attack * 7);
dropRate = 0.4;
soundHit = "rock";
soundDie = "rock2";
monster = 2;
}
public function shoot(){
shot = new Fireball();
parent.addChild(shot);
shot.x = this.x;
shot.y = (this.y - 50);
shot.scaleX = scaleX;
shot.scaleY = scaleY;
SFX.sound("fire", "f");
}
function frame15(){
if (seePlayer()){
contact = true;
wait++;
};
if (wait == 5){
wait = 0;
animate("attack");
} else {
gotoAndStop(animation);
};
}
function frame17(){
noTurn = true;
}
function frame1(){
init();
stop();
wait = 0;
}
function frame33(){
shoot();
}
function frame49(){
shoot();
}
function frame66(){
shoot();
}
function frame86(){
noTurn = false;
}
function frame87(){
animate("idle");
}
function frame110(){
kill();
}
}
}//package
Section 420
//MonolithIce (MonolithIce)
package {
public class MonolithIce extends Foe {
public var wait:int;
public function MonolithIce(){
super();
addFrameScript(0, frame1, 14, frame15, 16, frame17, 32, frame33, 39, frame40, 46, frame47, 53, frame54, 60, frame61, 67, frame68, 68, frame69, 91, frame92);
EXP = 60;
HP = 280;
recoilType = 0;
attack = (attack * 7);
dropRate = 0.7;
soundHit = "rock";
soundDie = "rock2";
}
public function shoot(){
if (!facing){
shot = new Icicle2((-30 + (Math.random() * 60)));
} else {
shot = new Icicle2(((-30 + (Math.random() * 60)) + 180));
};
parent.addChild(shot);
shot.x = this.x;
shot.y = (this.y - 50);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
shot.father = this;
SFX.sound("ice", "f");
}
function frame15(){
if (seePlayer()){
contact = true;
wait++;
};
if (wait == 5){
wait = 0;
animate("attack");
} else {
gotoAndStop(animation);
};
}
function frame17(){
noTurn = true;
}
function frame1(){
init();
stop();
wait = 0;
}
function frame33(){
shoot();
}
function frame47(){
shoot();
}
function frame40(){
shoot();
}
function frame54(){
shoot();
}
function frame61(){
shoot();
}
function frame68(){
noTurn = false;
}
function frame69(){
animate("idle");
}
function frame92(){
kill();
}
}
}//package
Section 421
//Moth (Moth)
package {
public class Moth extends Foe {
public var accel:Number;// = 1
public function Moth(){
accel = 1;
super();
addFrameScript(0, frame1, 5, frame6, 18, frame19);
EXP = 6;
HP = 60;
recoilType = 1;
attack = (attack * 6);
dropRate = 0.3;
maxSpeed = 11;
soundHit = "bat";
soundDie = "hit2";
maxSpeed = (maxSpeed * scaleX);
landFoe = false;
}
override public function behave(){
if (((aggro) || (seePlayer()))){
contact = true;
rx = ((x - player.x) + parent.x);
ry = (((y - player.y) + 40) + parent.y);
rt = (Math.abs(rx) + Math.abs(ry));
rx = (rx / rt);
ry = (ry / rt);
xSpeed = (xSpeed - (rx * accel));
ySpeed = (ySpeed - (ry * accel));
} else {
contact = false;
ySpeed = (ySpeed * 0.8);
xSpeed = (xSpeed * 0.8);
};
if (flash == 0){
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
};
}
function frame6(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
function frame19(){
kill();
}
}
}//package
Section 422
//Mushroom (Mushroom)
package {
public class Mushroom extends Foe {
public var wait:int;
public function Mushroom(){
super();
addFrameScript(0, frame1, 14, frame15, 37, frame38, 51, frame52, 62, frame63);
EXP = 7;
HP = 80;
recoilType = 0;
attack = (attack * 6);
dropRate = 0.5;
soundHit = "bat";
soundDie = "bat";
monster = 3;
}
public function shoot(){
if (!facing){
shot = new BlueBubble(-10);
} else {
shot = new BlueBubble(10);
};
parent.addChild(shot);
shot.x = this.x;
shot.y = (this.y - 20);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
}
function frame15(){
if (seePlayer()){
contact = true;
wait++;
};
if (wait == 4){
wait = 0;
animate("attack");
} else {
gotoAndStop(animation);
};
}
function frame1(){
init();
stop();
wait = 0;
}
function frame38(){
shoot();
}
function frame52(){
animate("idle");
}
function frame63(){
kill();
}
}
}//package
Section 423
//Music1 (Music1)
package {
import flash.media.*;
public dynamic class Music1 extends Sound {
public function Music1(){
super();
}
}
}//package
Section 424
//Music2 (Music2)
package {
import flash.media.*;
public dynamic class Music2 extends Sound {
public function Music2(){
super();
}
}
}//package
Section 425
//Music3 (Music3)
package {
import flash.media.*;
public dynamic class Music3 extends Sound {
public function Music3(){
super();
}
}
}//package
Section 426
//Music4 (Music4)
package {
import flash.media.*;
public dynamic class Music4 extends Sound {
public function Music4(){
super();
}
}
}//package
Section 427
//Music5 (Music5)
package {
import flash.media.*;
public dynamic class Music5 extends Sound {
public function Music5(){
super();
}
}
}//package
Section 428
//Music6 (Music6)
package {
import flash.media.*;
public dynamic class Music6 extends Sound {
public function Music6(){
super();
}
}
}//package
Section 429
//Num (Num)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Num extends MovieClip {
public var damage:String;
public var num:MovieClip;
public var type:int;
public function Num(){
super();
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
}
function frame30(){
stop();
parent.removeChild(this);
}
}
}//package
Section 430
//Numbers (Numbers)
package {
import flash.display.*;
public class Numbers {
public function Numbers(){
super();
}
static function damageNumber(foe:MovieClip, damage:String, type:int=1, scale:Number=1.5):MovieClip{
var num:MovieClip;
num = new Num();
foe.parent.addChild(num);
num.x = ((foe.x + (Math.random() * 30)) - 15);
num.y = ((foe.y + (Math.random() * 20)) - 10);
if ((((type == 4)) || ((type == 3)))){
num.y = (num.y - 40);
};
num.damage = damage;
num.scaleX = scale;
num.scaleY = scale;
num.type = type;
}
static function miscNumber(damage:String, type:int=1, scale:Number=1.5):MovieClip{
var num:MovieClip;
num = new Num();
Game.hud.addChild(num);
num.x = (((Game.hud.x + 350) + (Math.random() * 30)) - 15);
num.y = (((Game.hud.y + 200) + (Math.random() * 20)) - 10);
num.damage = damage;
num.scaleX = scale;
num.scaleY = scale;
num.type = type;
}
static function expNumber(foe:MovieClip, damage:String, type:int=1, scale:Number=1.5){
var num:MovieClip;
num = new Num();
foe.parent.addChild(num);
num.x = ((foe.x + (Math.random() * 10)) - 5);
num.y = (((foe.y + (Math.random() * 6)) - 3) - 30);
num.damage = damage;
num.scaleX = scale;
num.scaleY = scale;
num.type = type;
}
}
}//package
Section 431
//Options (Options)
package {
public class Options {
static var aim:Boolean = true;
static var sound:Boolean = true;
static var difficulties:Array = ["easy", "normal", "hard", "epic"];
static var qualities:Array = ["low", "medium", "high"];
static var music:Boolean = true;
private static var m:String = "";
static var background:Boolean = true;
private static var s:String = "";
static var difficulty:int = 1;
static var quality:int = 2;
public function Options(){
super();
}
public static function setQuality(i:int, q:int=-1):String{
quality = (quality + i);
if (quality == 3){
quality = 0;
};
if (quality == -1){
quality = 2;
};
Game.root.stage.quality = qualities[quality];
return (getQuality());
}
public static function getQuality(){
return (qualities[quality]);
}
public static function getAim(){
if (aim){
return ("on");
};
return ("off");
}
public static function toggleAim(){
aim = !(aim);
return (getAim());
}
public static function toggleSound(){
sound = !(sound);
return (getSound());
}
public static function getSound(){
if (sound){
return ("on");
};
return ("off");
}
public static function formatTime(minutes:int, seconds:int):String{
m = "";
s = "";
if (seconds < 10){
s = "0";
};
if (minutes < 10){
m = "0";
};
return (((((("" + m) + minutes) + ":") + s) + seconds));
}
public static function toggleBackground(){
background = !(background);
return (getBackground());
}
public static function getBackground(){
if (background){
return ("on");
};
return ("off");
}
public static function getMusic(){
if (music){
return ("on");
};
return ("off");
}
public static function getDifficulty(){
return (difficulties[difficulty]);
}
public static function toggleMusic(){
music = !(music);
return (getMusic());
}
public static function setDifficulty(i:int, q:int=-1):String{
difficulty = (difficulty + i);
if (difficulty == 4){
difficulty = 0;
};
if (difficulty == -1){
difficulty = 3;
};
return (getDifficulty());
}
}
}//package
Section 432
//Pit (Pit)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Pit extends MovieClip {
public var c1:MovieClip;
public function Pit(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 433
//Platform (Platform)
package {
import flash.display.*;
public class Platform extends MovieClip {
public var land:MovieClip;
public var standable:Boolean;// = true
public var slippery:Boolean;// = false
public var hitbox:MovieClip;
public var hitbox2:MovieClip;
public function Platform(){
standable = true;
slippery = false;
super();
parent.addPlatform(this);
gotoAndStop(2);
if (land){
land.cacheAsBitmap = true;
};
x = Math.round(x);
y = Math.round(y);
hitbox.x = Math.round(hitbox.x);
hitbox.y = Math.round(hitbox.y);
hitbox2.x = Math.round(hitbox2.x);
hitbox2.y = Math.round(hitbox2.y);
}
function effect(){
}
function effect2(item:MovieClip){
}
function effect3(foe:MovieClip):Boolean{
return (standable);
}
}
}//package
Section 434
//Player (Player)
package {
import flash.display.*;
import flash.geom.*;
public class Player extends MovieClip {
private var pl:MovieClip;
public var maxMP:int;// = 3
public var coins:int;// = 0
public var temperPower:Number;// = 1
public var sword:MovieClip;
private var noHit:Boolean;
public var weapon:Equip;
public var comboFall:int;// = 0
public var jump:Boolean;// = false
public var nextEXP:int;// = 50
public var onGround:Boolean;// = false
public var attack:Boolean;// = false
public var manablade:int;// = 0
public var face:MovieClip;
public var gravity:Number;// = 1.9
private var i:int;
public var dead:Boolean;// = false
public var m:int;// = 0
public var n:int;// = 0
private var e:MovieClip;
private var w:int;
public var hitPoints:Array;
public var superArmor:int;// = 0
public var bounce:Number;// = 1
public var feetPoint:MovieClip;
public var ducking:Boolean;// = false
public var attacking:Boolean;// = false
public var baseAttack:Number;// = 5
public var walkAccel:Number;// = 2.5
private var k:int;
public var headPoint2:MovieClip;
public var xSpeed:Number;// = 0
public var hat:Equip;
public var jumpSpeed:Number;// = 21
public var bodyPoint2:MovieClip;
public var drop:Boolean;// = false
public var fatness:Number;// = 8
public var jumping:Boolean;// = false
private var healHP:int;
public var bodyPoint:MovieClip;
public var HP:int;
public var armor:Equip;
public var slip:Number;// = 1
public var ySpeed:Number;// = 0
public var hitbox:MovieClip;
private var color:ColorTransform;
public var baseMagic:Number;// = 5
public var maxHP:Number;// = 20
public var manabladeMax:int;// = 10
public var animation:String;// = "fall"
public var combo:int;// = 1
public var neg:Number;// = 1
public var chests:int;// = 0
public var headPoint:MovieClip;
public var fallSpeed:Number;// = 14
public var MP:int;
private var my:Number;// = 0
public var magic:Boolean;// = false
private var mx:Number;// = 0
public var door:int;// = -1
public var respawning:Boolean;// = true
private var mc:MovieClip;
private var nx:Number;// = 0
private var ny:Number;// = 0
public var sword2:MovieClip;
public var attackPower:Number;// = 1
public var facing:Boolean;// = true
public var knockBack:Number;// = 1
public var noTurn:Boolean;// = false
public var interacting:Boolean;// = false
public var temperTime:int;// = 0
public var feetPoint2:MovieClip;
public var flash:int;// = 0
public var levelEXP:int;// = 1
public var EXP:int;// = 0
public var walkSpeed:Number;// = 12
public var heat:int;// = 0
public function Player(){
onGround = false;
jumping = false;
attacking = false;
attack = false;
magic = false;
ducking = false;
respawning = true;
noTurn = false;
interacting = false;
jump = false;
facing = true;
neg = 1;
combo = 1;
comboFall = 0;
bounce = 1;
drop = false;
animation = "fall";
superArmor = 0;
dead = false;
hitPoints = [new Point(), new Point(), new Point(), new Point(), new Point(), new Point()];
xSpeed = 0;
ySpeed = 0;
nx = 0;
ny = 0;
mx = 0;
my = 0;
n = 0;
m = 0;
walkSpeed = 12;
walkAccel = 2.5;
jumpSpeed = 21;
gravity = 1.9;
fallSpeed = 14;
door = -1;
fatness = 8;
slip = 1;
flash = 0;
heat = 0;
maxHP = 20;
maxMP = 3;
EXP = 0;
nextEXP = 50;
levelEXP = 1;
coins = 0;
chests = 0;
baseAttack = 5;
baseMagic = 5;
knockBack = 1;
attackPower = 1;
manablade = 0;
manabladeMax = 10;
temperTime = 0;
temperPower = 1;
super();
addFrameScript(0, frame1, 29, frame30, 30, frame31, 39, frame40, 44, frame45, 49, frame50, 50, frame51, 51, frame52, 52, frame53, 53, frame54, 54, frame55, 55, frame56, 56, frame57, 57, frame58, 58, frame59, 59, frame60, 60, frame61, 61, frame62, 62, frame63, 63, frame64, 64, frame65, 65, frame66, 66, frame67, 67, frame68, 68, frame69, 69, frame70, 70, frame71, 71, frame72, 72, frame73, 73, frame74, 74, frame75, 75, frame76, 76, frame77, 82, frame83, 109, frame110, 123, frame124, 124, frame125, 125, frame126, 128, frame129, 130, frame131, 132, frame133, 134, frame135, 135, frame136, 139, frame140, 140, frame141, 141, frame142, 143, frame144, 147, frame148, 148, frame149, 149, frame150, 150, frame151, 151, frame152, 153, frame154, 157, frame158, 158, frame159, 159, frame160, 161, frame162, 167, frame168, 169, frame170, 172, frame173, 173, frame174, 178, frame179, 179, frame180, 180, frame181, 181, frame182, 184, frame185, 185, frame186, 186, frame187, 187, frame188, 193, frame194, 240, frame241, 261, frame262, 284, frame285, 289, frame290, 290, frame291, 310, frame311, 321, frame322, 327, frame328, 328, frame329, 341, frame342, 365, frame366, 393, frame394, 432, frame433, 434, frame435, 467, frame468, 531, frame532);
trace("create player");
Game.root.stage.focus = Game.root;
coins = LevelState.coinCount;
chests = LevelState.chestCount;
color = new ColorTransform();
animate("fall");
weapon = SaveData.weapon;
hat = SaveData.hat;
armor = SaveData.armor;
k = 0;
while (k <= SaveData.playerLevel) {
levelUp();
k++;
};
EXP = SaveData.playerEXP;
maxMP = (3 + SaveData.MPups);
maxHP = (20 + (SaveData.HPups * 2));
if (hat.special == 4){
maxMP = 0;
Medals.unlock(Medals.masterWarrior);
};
if (armor.special == 6){
maxMP++;
};
maxHP = (maxHP * (((1 + weapon.HP) + hat.HP) + armor.HP));
HP = maxHP;
MP = maxMP;
y = 270;
x = 350;
}
public function heal(power:Number, spell:MovieClip){
healHP = ((Game.player.baseMagic * power) * 0.5);
Numbers.damageNumber(spell, (("+" + healHP) + "HP"), 4, 1.5);
recoverHP(healHP);
}
function frame150(){
attackPower = 2;
knockBack = 1.8;
}
function frame148(){
if (weapon.special == 1){
endAttack();
};
}
function frame151(){
SFX.sound("attack", "p");
}
function recoverMP(mp:int){
MP = (MP + mp);
if (MP > maxMP){
MP = maxMP;
};
flash = 250;
Game.hud.updateMP();
}
function frame159(){
endAttack();
}
function frame154(){
SFX.sound("attack3", "p");
}
private function hitLand(n:Number=0){
for each (pl in Game.level.landforms) {
if (((pl.hitbox) && (((pl.hitbox.hitTestPoint((x + fatness), (y - n), true)) || (pl.hitbox.hitTestPoint((x - fatness), (y - n), true)))))){
if (((pl.slippery) && (onGround))){
slip = 0.5;
};
return (true);
};
};
return (((Game.level.land.hitTestPoint((x + fatness), (y - n), true)) || (Game.level.land.hitTestPoint((x - fatness), (y - n), true))));
}
function frame162(){
SFX.sound("attack", "p");
}
public function setColor(r:int, g:int, b:int){
color.redOffset = r;
color.greenOffset = g;
color.blueOffset = b;
this.transform.colorTransform = color;
}
function frame285(){
animate("stand");
interacting = false;
}
function frame160(){
attackPower = 1.4;
knockBack = 1.3;
}
function frame262(){
animate("stand");
interacting = false;
}
function frame168(){
if (weapon.special == 1){
endAttack();
};
}
function frame140(){
if (weapon.special == 1){
endAttack();
};
}
private function hitWall(){
return (((hitLand()) && (((Game.level.land.hitTestPoint((x + fatness), (y - 26), true)) || (Game.level.land.hitTestPoint((x - fatness), (y - 26), true))))));
}
private function droppable(){
for each (pl in Game.level.landforms) {
if (((pl.hitbox) && (((pl.hitbox.hitTestPoint((x + fatness), (y + 28), true)) || (pl.hitbox.hitTestPoint((x - fatness), (y + 28), true)))))){
return (false);
};
};
return (((((((!(Game.level.platforms.hitTestPoint((x + fatness), (y + 28), true))) && (!(Game.level.land.hitTestPoint((x + fatness), (y + 28), true))))) && (!(Game.level.platforms.hitTestPoint((x - fatness), (y + 28), true))))) && (!(Game.level.land.hitTestPoint((x - fatness), (y + 28), true)))));
}
function frame290(){
Game.hud.transition.play();
}
function frame170(){
endAttack();
}
function frame135(){
attackPower = 1;
knockBack = 0.4;
SFX.sound("attack", "p");
}
function frame291(){
SFX.sound("door", "p");
}
function frame174(){
noTurn = true;
SFX.sound("attack2", "p");
}
function frame173(){
attackPower = 1.3;
knockBack = 1.3;
}
function frame185(){
if (weapon.special == 1){
animate("fall");
attacking = false;
noTurn = false;
};
}
function frame180(){
animate("fall");
attacking = false;
noTurn = false;
}
function frame179(){
if (weapon.special == 1){
animate("fall");
attacking = false;
noTurn = false;
};
}
function frame158(){
Medals.unlock(Medals.newbieWarrior);
if (weapon.special == 1){
endAttack();
};
}
function frame186(){
animate("fall");
attacking = false;
noTurn = false;
}
function frame1(){
stop();
}
function frame181(){
attackPower = 1.4;
knockBack = 1.8;
noTurn = true;
}
function frame182(){
SFX.sound("attack2", "p");
}
function frame187(){
attackPower = 1.6;
noTurn = true;
}
function frame188(){
SFX.sound("attack2", "p");
}
function frame194(){
animate("fall");
attacking = false;
noTurn = false;
}
public function die(){
if (HP < 0){
HP = 0;
};
dead = true;
superArmor = 0;
if (!Main.offline){
Game.root.kongregate.stats.submit("deaths", 1);
};
}
function frame30(){
gotoAndStop(animation);
}
private function turn(){
if (!noTurn){
scaleX = (scaleX * -1);
facing = !(facing);
neg = (neg * -1);
};
}
function frame152(){
noTurn = true;
}
function frame31(){
noTurn = true;
}
function frame45(){
effect();
}
function frame394(){
gotoAndStop("end2");
}
public function effect2(xx:int=0, yy:int=0){
e = new Hit();
Game.level.addChild(e);
e.x = ((this.x + Camera.tx) + xx);
e.y = ((this.y + Camera.ty) + yy);
if (facing){
e.scaleX = (e.scaleX * -1);
};
}
function frame532(){
stop();
}
function frame51(){
gotoAndStop(animation);
}
function frame40(){
magic = false;
noTurn = false;
animate("stand");
}
function frame54(){
umbrella();
}
function frame55(){
umbrella();
}
function frame56(){
umbrella();
}
function frame58(){
umbrella();
}
public function increaseHP(){
maxHP = (maxHP + (2 * (((1 + weapon.HP) + hat.HP) + armor.HP)));
recoverHP(maxHP);
SaveData.HPups++;
if ((((SaveData.HPups == 20)) && ((SaveData.MPups == 4)))){
Medals.unlock(Medals.powerUp);
};
}
function frame50(){
effect();
}
function frame52(){
attacking = false;
umbrella();
}
private function effectiveAttack():int{
return ((((baseAttack * attackPower) * (1 + (Math.random() / 10))) * temperPower));
}
function frame59(){
umbrella();
}
public function animate(a:String){
if (a != animation){
gotoAndStop(a);
animation = a;
};
}
function frame61(){
umbrella();
}
function frame62(){
umbrella();
}
function frame63(){
umbrella();
}
function frame53(){
umbrella();
}
function frame57(){
attacking = false;
animation = "fall";
umbrella();
}
function frame65(){
umbrella();
}
function frame67(){
umbrella();
}
public function getEXP(e:int){
EXP = (EXP + e);
if (EXP > nextEXP){
EXP = (EXP - nextEXP);
SaveData.playerLevel++;
levelUp();
Game.hud.playLevelup();
};
}
function frame70(){
umbrella();
}
function frame60(){
umbrella();
}
function frame75(){
umbrella();
}
function frame64(){
umbrella();
}
function frame77(){
noTurn = true;
}
function frame311(){
stop();
}
function frame74(){
umbrella();
}
function frame66(){
umbrella();
}
private function isDuck(){
if (((((((((ducking) && (attacking))) || (magic))) && (onGround))) || ((animation == "slash4")))){
return (0);
};
if (((noTurn) && (onGround))){
return (0.3);
};
if (((((ducking) || (attacking))) && (onGround))){
return (0.5);
};
return (1);
}
private function endAttack(){
animate("stand");
attacking = false;
noTurn = false;
}
private function hitPlatform(n:Number=0){
if (!respawning){
if (((Game.level.platforms.hitTestPoint((x + fatness), (y - n), true)) || (Game.level.platforms.hitTestPoint((x - fatness), (y - n), true)))){
return (true);
};
for each (pl in Game.level.specialPlatforms) {
if (((pl.hitbox) && (((pl.hitbox.hitTestPoint((x + fatness), (y - n), true)) || (pl.hitbox.hitTestPoint((x - fatness), (y - n), true)))))){
pl.effect();
if (((pl.slippery) && (onGround))){
slip = 0.5;
Medals.unlock(Medals.iceIsSlippery);
};
if (((pl.standable) || ((pl.standable == undefined)))){
return (true);
};
};
};
};
return (false);
}
function frame69(){
umbrella();
}
function frame322(){
stop();
Game.changeLevel();
}
function frame76(){
gotoAndStop(animation);
}
public function init(){
blendMode = BlendMode.LAYER;
trace("init player");
Camera.spawn();
Keys.keyIsDown[Keys.rightKey] = false;
Keys.keyIsDown[Keys.leftKey] = false;
}
function frame328(){
Game.winlevel = true;
}
function frame68(){
umbrella();
}
function frame329(){
Game.gameover = true;
}
function frame73(){
umbrella();
}
function frame435(){
face.gotoAndStop(4);
}
public function umbrella(){
if ((((weapon.special == 2)) && ((ySpeed > 4)))){
if (Keys.keyIsDown[Keys.jumpKey]){
sword.gotoAndStop(4);
sword2.gotoAndStop(8);
ySpeed = 4;
} else {
sword.gotoAndStop(7);
sword2.gotoAndStop(3);
};
} else {
sword.gotoAndStop(7);
sword2.gotoAndStop(weapon.graphic);
};
}
function frame83(){
magic = false;
noTurn = false;
animate("fall");
}
public function levelUp(){
if (SaveData.playerLevel == 30){
Medals.unlock(Medals.levelGrinder);
};
levelEXP++;
nextEXP = (nextEXP * 1.18);
baseAttack = (5 + ((10 / 30) * levelEXP));
baseMagic = (5 + ((10 / 30) * levelEXP));
baseAttack = (baseAttack * (((1 + weapon.attack) + hat.attack) + armor.attack));
baseMagic = (baseMagic * (((1 + weapon.magic) + hat.magic) + armor.magic));
}
function frame71(){
umbrella();
}
function frame342(){
SFX.sound("meow");
}
function frame468(){
Game.hud.gameOver();
}
public function increaseMP(){
maxMP++;
if (hat.special == 4){
maxMP = 0;
};
recoverMP(maxMP);
SaveData.MPups++;
if ((((SaveData.HPups == 20)) && ((SaveData.MPups == 4)))){
Medals.unlock(Medals.powerUp);
};
}
public function temper(power:Number, time:int){
temperPower = power;
temperTime = time;
}
function frame110(){
gotoAndStop(animation);
}
function frame433(){
stop();
Game.changeLevel();
}
public function effect(xx:int=0, yy:int=0){
e = new Hit2();
Game.level.addChild(e);
e.x = ((this.x + Camera.tx) + xx);
e.y = ((this.y + Camera.ty) + yy);
if (facing){
e.scaleX = (e.scaleX * -1);
};
}
public function recoverHP(hp:int){
if (!dead){
HP = (HP + hp);
if (HP > maxHP){
HP = maxHP;
};
flash = 250;
Game.hud.updateHP();
};
}
public function hit(damage:int, foe:Foe=null):Boolean{
Medals.stats.noHit = false;
if ((((((superArmor <= 0)) && (!(dead)))) && (!(interacting)))){
damage = (damage / temperPower);
damage = (damage * (Math.abs(scaleX) * (0.5 + (Options.difficulty / 2))));
Numbers.damageNumber(this, ("" + damage), 2);
superArmor = 60;
SFX.sound("hit", "p");
HP = (HP - damage);
if (HP <= 0){
animate("die");
trace("die");
die();
} else {
if (foe){
foe.getAngle();
if (foe.rx >= 0){
xSpeed = -18;
} else {
xSpeed = 18;
};
ySpeed = (ySpeed / 2);
};
};
Game.hud.updateHP();
return (true);
};
return (false);
}
function frame72(){
umbrella();
}
function frame241(){
animate("stand");
interacting = false;
}
function frame124(){
gotoAndStop(animation);
}
function frame125(){
attackPower = 1;
knockBack = 0.8;
SFX.sound("attack", "p");
}
function frame126(){
noTurn = true;
}
public function hitPoint(p:MovieClip){
for (i in Game.level.foes) {
if (((Game.level.foes[i].hitbox) && (Game.level.foes[i].hitbox.hitTestPoint((x + (p.x * neg)), ((y + p.y) - n), true)))){
if (Game.level.foes[i].hit(effectiveAttack())){
effect2((p.x * neg), (p.y - n));
if ((((weapon.special == 3)) && (!((MP == maxMP))))){
manablade++;
trace("mana get");
if (manablade == manabladeMax){
SFX.sound("hp", "p");
recoverMP(1);
Numbers.damageNumber(Game.level.foes[i], "+1MP", 3, 1.5);
manablade = 0;
};
};
};
};
};
}
function frame366(){
Game.hud.levelComplete();
}
function frame131(){
if (weapon.special == 1){
animate("duck");
attacking = false;
};
}
function frame129(){
noTurn = false;
}
function frame136(){
noTurn = true;
}
public function move(){
this.nextFrame();
nx = Camera.tx;
ny = Camera.ty;
if (!onGround){
slip = 1;
};
superArmor--;
comboFall--;
setColor(0, 0, 0);
if (comboFall <= 0){
combo = 1;
};
if (face){
face.gotoAndStop(1);
};
this.alpha = 1;
if (superArmor > 0){
if (face){
face.gotoAndStop(2);
};
if ((superArmor % 2) == 0){
this.alpha = 0;
};
};
if (temperTime > 0){
temperTime--;
if ((superArmor % 3) == 0){
setColor(80, 80, 80);
};
} else {
temperPower = 1;
};
if ((HP / maxHP) < 0.5){
if ((superArmor % 7) == 0){
setColor(120, 0, 0);
};
};
if (flash > 0){
if ((superArmor % 2) == 0){
setColor(flash, flash, flash);
flash = (flash - 25);
};
};
if (respawning){
this.alpha = 0;
};
if (((!(dead)) && (!(interacting)))){
if (!Keys.keyIsDown[Keys.attackKey]){
attack = true;
};
if (!Keys.keyIsDown[Keys.jumpKey]){
jump = true;
};
if (((Keys.keyIsDown[Keys.leftKey]) && (!(Keys.keyIsDown[Keys.rightKey])))){
if (xSpeed > 0){
xSpeed = (xSpeed * (0.5 / slip));
};
xSpeed = (xSpeed - ((walkAccel / 2) * slip));
if (xSpeed < (-(walkSpeed) * isDuck())){
xSpeed = (-(walkSpeed) * isDuck());
};
if (facing){
turn();
};
} else {
if (((Keys.keyIsDown[Keys.rightKey]) && (!(Keys.keyIsDown[Keys.leftKey])))){
if (xSpeed < 0){
xSpeed = (xSpeed * (0.5 / slip));
};
xSpeed = (xSpeed + ((walkAccel / 2) * slip));
if (xSpeed > (walkSpeed * isDuck())){
xSpeed = (walkSpeed * isDuck());
};
if (!facing){
turn();
};
} else {
if (xSpeed != 0){
if (slip != 1){
slip = (slip / 2);
};
if (xSpeed > 0){
xSpeed = (xSpeed - (walkAccel * slip));
};
if (xSpeed < 0){
xSpeed = (xSpeed + (walkAccel * slip));
};
if ((((xSpeed < (walkAccel * slip))) && ((xSpeed > (-(walkAccel) * slip))))){
xSpeed = 0;
};
if (slip != 1){
slip = (slip * 2);
};
};
};
};
if (((((((Keys.keyIsDown[Keys.jumpKey]) && (jump))) && (onGround))) && (!(magic)))){
if (((Keys.keyIsDown[Keys.downKey]) && (droppable()))){
drop = true;
} else {
onGround = false;
jump = false;
ySpeed = -(jumpSpeed);
if (armor.special == 5){
ySpeed = (ySpeed - 3);
};
};
animate("jump");
effect2();
heat = 0;
} else {
if (((((((((((Keys.keyIsDown[Keys.downKey]) && (Keys.keyIsDown[Keys.attackKey]))) && (!(attacking)))) && (onGround))) && (attack))) && (!(magic)))){
animate("jab");
attack = false;
attacking = true;
} else {
if (Keys.keyIsDown[Keys.downKey]){
ducking = true;
} else {
if (((((((((Keys.keyIsDown[Keys.attackKey]) && (!(attacking)))) && (onGround))) && (attack))) && (!(magic)))){
if (Keys.keyIsDown[Keys.upKey]){
animate("slash4");
} else {
animate(("slash" + combo));
combo++;
if (combo > 3){
combo = 1;
};
};
attack = false;
attacking = true;
comboFall = 15;
} else {
ducking = false;
};
};
};
};
};
if (!dead){
xSpeed = Math.round(xSpeed);
if (!onGround){
if (ySpeed < 0){
if (Keys.keyIsDown[Keys.jumpKey]){
ySpeed = (ySpeed + (gravity * 0.8));
} else {
ySpeed = (ySpeed + (gravity * 2));
};
} else {
ySpeed = (ySpeed + gravity);
};
if (ySpeed > fallSpeed){
ySpeed = fallSpeed;
};
};
Camera.move(0, ySpeed);
m = 0;
if (((((((hitLand(-12)) && (!(hitLand(0))))) || (((hitPlatform(-12)) && (!(hitPlatform(0))))))) && (onGround))){
m = -1;
while (((!(hitLand(m))) && (!(hitPlatform(m))))) {
m--;
};
Camera.move(0, -(m));
};
if (((((((((hitLand(m)) || (hitPlatform(m)))) && (!(hitPlatform(((m + ySpeed) + 5)))))) && ((ySpeed >= -1)))) && (!(drop)))){
if (((((((!(attacking)) && (!(interacting)))) && (!(magic)))) && (!(dead)))){
noTurn = false;
if (ducking){
if ((((((xSpeed == 0)) || (!((slip == 1))))) && ((Keys.keyIsDown[Keys.leftKey] == Keys.keyIsDown[Keys.rightKey])))){
animate("duck");
} else {
animate("crawl");
};
} else {
if ((((((xSpeed == 0)) || (!((slip == 1))))) && ((Keys.keyIsDown[Keys.leftKey] == Keys.keyIsDown[Keys.rightKey])))){
animate("stand");
} else {
animate("walk");
};
};
};
if (!onGround){
attacking = false;
};
ySpeed = 0;
onGround = true;
bounce = 1;
n = -1;
while (((hitLand((n + m))) || (hitPlatform((n + m))))) {
n++;
};
Camera.move(0, (-(n) + 1));
} else {
if (!hitPlatform(m)){
drop = false;
};
onGround = false;
if (((((((Keys.keyIsDown[Keys.attackKey]) && (attack))) && (!(attacking)))) && (!(magic)))){
comboFall = 0;
if (Keys.keyIsDown[Keys.upKey]){
animate("spin2");
} else {
animate("spin");
};
attack = false;
attacking = true;
} else {
if (((((!(attacking)) && (!(magic)))) && (!((animation == "jump"))))){
animate("fall");
heat = 0;
};
};
};
noHit = true;
w = xSpeed;
while (w != 0) {
for each (pl in Game.level.landforms) {
if (((pl.hitbox) && (((pl.hitbox.hitTestPoint(((x + w) + fatness), ((y - 5) - n), true)) || (pl.hitbox.hitTestPoint(((x + w) - fatness), ((y - 5) - n), true)))))){
if (w > 0){
xSpeed = (w - 1);
} else {
xSpeed = (w + 1);
};
noHit = false;
};
};
if (((Game.level.land.hitTestPoint(((x + w) + fatness), ((y - 5) - n), true)) || (Game.level.land.hitTestPoint(((x + w) - fatness), ((y - 5) - n), true)))){
if (w > 0){
xSpeed = (w - 1);
} else {
xSpeed = (w + 1);
};
noHit = false;
};
if (w > 0){
w--;
} else {
w++;
};
if (noHit){
break;
};
};
Camera.move(xSpeed, 0);
nx = (nx - Camera.tx);
ny = (ny - Camera.ty);
SFX.countSound = 0;
i = 0;
for each (mc in [headPoint, headPoint2, feetPoint, feetPoint2, bodyPoint, bodyPoint2]) {
hitPoints[i].x = mc.x;
hitPoints[i].y = mc.y;
i++;
};
};
Game.hud.update();
}
function frame133(){
animate("duck");
attacking = false;
}
function frame141(){
endAttack();
}
function frame142(){
attackPower = 1.3;
knockBack = 0.4;
SFX.sound("attack2", "p");
}
function frame144(){
noTurn = true;
}
function frame149(){
endAttack();
}
}
}//package
Section 435
//Pot (Pot)
package {
public class Pot extends Foe {
public function Pot(){
super();
addFrameScript(0, frame1, 3, frame4, 15, frame16);
HP = 10;
monster = ((Math.random() * 3) + 1);
EXP = 0;
dropRate = 3;
contactDamage = false;
projectile = true;
}
function frame16(){
kill();
}
function frame4(){
gotoAndStop(animation);
}
function frame1(){
init();
stop();
}
}
}//package
Section 436
//Rock (Rock)
package {
import flash.utils.*;
public class Rock extends Foe {
public var lifeTime:int;// = 120
public var spin:Number;// = 0
public var bounce:Boolean;// = true
public function Rock(type:int){
lifeTime = 120;
spin = 0;
bounce = true;
super();
addFrameScript(0, frame1, 4, frame5, 14, frame15, 25, frame26);
startAnim = "intro";
EXP = 0;
HP = 120;
recoilType = 0;
attack = (attack * 13);
dropRate = 0;
monster = type;
soundHit = "rock";
soundDie = "rock2";
landFoe = false;
dynamicFoe = true;
noTurn = true;
spin = ((Math.random() * 12) - 6);
displace = 10;
projectile = true;
}
override public function behave(){
if (((((bounce) && ((ySpeed > 5)))) && (hitLand()))){
ySpeed = (ySpeed * -0.7);
xSpeed = (xSpeed * 0.5);
bounce = false;
SFX.sound("rock");
};
ySpeed = (ySpeed + 1);
rotation = (rotation + (spin * 2));
lifeTime--;
hitFoes();
if (lifeTime == 0){
soundDie = "";
die();
};
}
function frame15(){
gotoAndStop("idle2");
}
function frame26(){
kill();
}
function frame1(){
init();
stop();
}
function frame5(){
animate("idle");
}
public function hitFoes(){
for each (f in Game.level.foes) {
if (((((((((((((((((f) && (!((f == this))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == ClayDark))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == SpriteRock))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == Rock))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == BossGolem))))) && (!((getDefinitionByName(getQualifiedClassName(f)) == MonolithIce))))) && (f.hitbox))) && (f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))))){
f.hit(40, true);
if (!dead){
die();
};
};
};
}
}
}//package
Section 437
//sandlandformbig (sandlandformbig)
package {
public dynamic class sandlandformbig extends Landform {
public function sandlandformbig(){
super();
}
}
}//package
Section 438
//SandLandformSmall (SandLandformSmall)
package {
public dynamic class SandLandformSmall extends Landform {
public function SandLandformSmall(){
super();
}
}
}//package
Section 439
//sandplatformbig (sandplatformbig)
package {
public dynamic class sandplatformbig extends Platform {
public function sandplatformbig(){
super();
}
}
}//package
Section 440
//SandPlatformSmall (SandPlatformSmall)
package {
public dynamic class SandPlatformSmall extends Platform {
public function SandPlatformSmall(){
super();
}
}
}//package
Section 441
//SaveData (SaveData)
package {
import flash.net.*;
public class SaveData {
public static var levelsUnlocked:int;
public static var firstPlay:Boolean = false;
public static var spentMoney:int;
public static var armor:Equip;
public static var hat:Equip;
public static var weapon:Equip;
public static var playerLevel:int;
public static var menuChoice:Array = [0, "p1", 6, 4];
public static var selectedLevel:int;
public static var spellPrompt:Boolean = false;
public static var HPups:int;
public static var menuState:int = 0;
public static var MPups:int;
public static var spellData:Array;
public static var equipData:Array;
public static var equipPrompt:Boolean = false;
public static var playerEXP:int;
public function SaveData(){
super();
}
public static function initEquips(){
trace("Init equip data");
equipData = [true, false, false, false, false, true, false, false, false, false, true, false, false, false, false];
hat = Equips.pirateHat;
armor = Equips.pirateArmor;
weapon = Equips.cutlass;
}
public static function loadGame(){
var so:SharedObject;
var medals:Array;
var i:int;
trace("LOADING GAME");
so = SharedObject.getLocal("EBFAdventureStory");
if (so.data.HPups != undefined){
HPups = so.data.HPups;
MPups = so.data.MPups;
playerLevel = so.data.playerLevel;
playerEXP = so.data.playerEXP;
hat = Equips.equips[so.data.hat];
armor = Equips.equips[so.data.armor];
weapon = Equips.equips[so.data.weapon];
equipData = so.data.equipData;
spellData = so.data.spellData;
levelsUnlocked = so.data.levelsUnlocked;
selectedLevel = so.data.selectedLevel;
Level.levelNo = so.data.levelNo;
spentMoney = so.data.spentMoney;
Options.difficulty = so.data.difficulty;
Options.music = so.data.sound;
Options.sound = so.data.sound;
Options.background = so.data.background;
Options.quality = so.data.quality;
Options.aim = so.data.aim;
Keys.jumpKey = so.data.jumpKey;
Keys.attackKey = so.data.attackKey;
Keys.magicKey = so.data.magicKey;
Keys.hot1Key = so.data.hot1Key;
Keys.hot2Key = so.data.hot2Key;
Keys.hot3Key = so.data.hot3Key;
Keys.upKey = so.data.upKey;
Keys.leftKey = so.data.leftKey;
Keys.rightKey = so.data.rightKey;
Keys.downKey = so.data.downKey;
Keys.interactKey = Keys.upKey;
medals = so.data.medals;
i = 0;
while (i < Medals.medals.length) {
Medals.medals[i].unlocked = medals[i];
i++;
};
if (so.data.hot1 != -1){
Game.hot1 = Spells.spells[so.data.hot1];
};
if (so.data.hot2 != -1){
Game.hot2 = Spells.spells[so.data.hot2];
};
if (so.data.hot3 != -1){
Game.hot3 = Spells.spells[so.data.hot3];
};
LevelState.totalTimes = so.data.times;
LevelState.totalCoins = so.data.coins;
LevelState.totalChests = so.data.chests;
LevelState.totalFoes = so.data.foes;
LevelState.chestCoins = so.data.chestCoins;
LevelState.ranks = so.data.ranks;
LevelState.perfects = so.data.perfects;
} else {
init();
firstPlay = true;
};
trace("load complete");
}
public static function saveGame(){
var so:SharedObject;
var medals:Array;
var i:int;
trace("SAVING GAME");
so = SharedObject.getLocal("EBFAdventureStory");
so.data.HPups = HPups;
so.data.MPups = MPups;
so.data.playerLevel = playerLevel;
so.data.playerEXP = playerEXP;
so.data.hat = Equips.equips.indexOf(hat);
so.data.armor = Equips.equips.indexOf(armor);
so.data.weapon = Equips.equips.indexOf(weapon);
so.data.equipData = equipData;
so.data.spellData = spellData;
so.data.levelsUnlocked = levelsUnlocked;
so.data.selectedLevel = selectedLevel;
so.data.levelNo = Level.levelNo;
so.data.spentMoney = spentMoney;
so.data.difficulty = Options.difficulty;
so.data.sound = Options.music;
so.data.sound = Options.sound;
so.data.background = Options.background;
so.data.quality = Options.quality;
so.data.aim = Options.aim;
so.data.jumpKey = Keys.jumpKey;
so.data.attackKey = Keys.attackKey;
so.data.magicKey = Keys.magicKey;
so.data.hot1Key = Keys.hot1Key;
so.data.hot2Key = Keys.hot2Key;
so.data.hot3Key = Keys.hot3Key;
so.data.upKey = Keys.upKey;
so.data.leftKey = Keys.leftKey;
so.data.rightKey = Keys.rightKey;
so.data.downKey = Keys.downKey;
if (Game.hot1){
so.data.hot1 = Spells.spells.indexOf(Game.hot1);
} else {
so.data.hot1 = -1;
};
if (Game.hot2){
so.data.hot2 = Spells.spells.indexOf(Game.hot2);
} else {
so.data.hot2 = -1;
};
if (Game.hot3){
so.data.hot3 = Spells.spells.indexOf(Game.hot3);
} else {
so.data.hot3 = -1;
};
medals = [];
i = 0;
while (i < Medals.medals.length) {
medals[i] = Medals.medals[i].unlocked;
i++;
};
so.data.medals = medals;
so.data.times = LevelState.totalTimes;
so.data.coins = LevelState.totalCoins;
so.data.chests = LevelState.totalChests;
so.data.foes = LevelState.totalFoes;
so.data.chestCoins = LevelState.chestCoins;
so.data.ranks = LevelState.ranks;
so.data.perfects = LevelState.perfects;
so.flush();
trace("save complete");
}
public static function init(){
initEquips();
initExp();
initProgress();
}
public static function initProgress(){
trace("Init level progress");
HPups = 0;
MPups = 0;
spellData = [0, 0, 0, 0, 1, 0];
Game.hot1 = null;
Game.hot2 = Spells.fire;
Game.hot3 = null;
levelsUnlocked = 1;
selectedLevel = 1;
Level.levelNo = 1;
spentMoney = 0;
LevelState.init();
}
public static function initExp(){
trace("Init player experience");
playerLevel = 0;
playerEXP = 0;
}
}
}//package
Section 442
//SeaBomb (SeaBomb)
package {
public class SeaBomb extends Foe {
private var lifeTime:int;// = 120
public function SeaBomb(sp:Number=0, sp2:Number=0){
lifeTime = 120;
super();
addFrameScript(0, frame1, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 32, frame33);
xSpeed = sp;
ySpeed = sp2;
EXP = 0;
HP = 70;
recoilType = 2;
attack = (attack * 7);
dropRate = 0.1;
soundHit = "metal";
soundDie = "explode";
monster = 1;
landFoe = true;
displace = 25;
noTurn = true;
rotation = (Math.random() * 360);
projectile = true;
}
override public function behave(){
if (dynamicFoe){
lifeTime--;
} else {
lifeTime = 100;
};
xSpeed = (xSpeed * 0.96);
if (lifeTime == 0){
die();
};
rotation = (rotation + (xSpeed * 2));
gravity();
if (onGround){
xSpeed = (xSpeed * 0.8);
};
hitFoes();
}
function frame23(){
hitFoes();
}
function frame22(){
hitFoes();
}
function frame21(){
hitFoes();
}
function frame1(){
init();
stop();
}
function frame20(){
rotation = 0;
attack = (attack * 2.7);
hitFoes();
}
function frame33(){
kill();
}
function frame19(){
gotoAndStop("idle2");
}
public function hitFoes(){
for each (f in Game.level.foes) {
if ((((((((((lifeTime < 115)) && (f))) && (!((f == this))))) && (f.hitbox))) && (f.hitbox.hitTestPoint((x + parent.x), (y + parent.y))))){
if (((f.hit(100, true)) && (!(dead)))){
die();
};
};
};
}
}
}//package
Section 443
//SFX (SFX)
package {
import flash.display.*;
public class SFX extends MovieClip {
public static var sounds:MovieClip;
static var countSound:int = 0;
static var prevSound:String = "";
public function SFX(){
super();
}
public static function sound(s:String, t:String=""){
countSound++;
if ((((((countSound < 4)) || ((t == "m")))) && (Options.sound))){
sounds.gotoAndStop(s);
sounds.gotoAndStop(1);
};
}
public static function init(r:MovieClip){
sounds = new Sounds();
r.addChild(sounds);
trace("created SFX on root");
}
}
}//package
Section 444
//Sky (Sky)
package {
import flash.display.*;
public dynamic class Sky extends MovieClip {
public function Sky(){
super();
}
}
}//package
Section 445
//Slime (Slime)
package {
public class Slime extends Foe {
public var accel:Number;// = 0.2
public function Slime(){
accel = 0.2;
super();
addFrameScript(0, frame1, 26, frame27, 27, frame28, 38, frame39, 50, frame51);
EXP = 3;
HP = 40;
recoilType = 1;
attack = (attack * 3);
dropRate = 0.5;
soundHit = "slime";
soundDie = "hit2";
maxSpeed = 4;
monster = ((Math.random() * 5) + 1);
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
ready = false;
startAnim = "intro";
noTurn = true;
}
override public function behave(){
if (!ready){
animate("intro");
};
if (((aggro) || (seePlayer()))){
if (!ready){
ready = true;
animate("idle");
noTurn = false;
};
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx * 0.2));
} else {
contact = false;
xSpeed = (xSpeed * 0.97);
};
limitSpeed();
gravity();
if (((((((onGround) && ((Math.random() < 0.02)))) && (ready))) && (seePlayer()))){
jump(15);
};
}
function frame1(){
init();
stop();
}
function frame27(){
gotoAndStop("intro");
}
function frame39(){
gotoAndStop(animation);
}
function frame28(){
ready = true;
}
function frame51(){
kill();
}
}
}//package
Section 446
//SlimeBig (SlimeBig)
package {
public class SlimeBig extends Foe {
public var accel:Number;// = 0.2
public var wait:int;
public function SlimeBig(){
accel = 0.2;
super();
addFrameScript(0, frame1, 39, frame40, 68, frame69, 69, frame70, 70, frame71, 71, frame72, 72, frame73, 73, frame74, 74, frame75, 75, frame76, 76, frame77, 77, frame78, 78, frame79, 93, frame94, 94, frame95, 95, frame96, 106, frame107);
EXP = 60;
HP = 450;
recoilType = 0;
attack = (attack * 8);
dropRate = 1;
soundHit = "snow";
soundDie = "hit2";
maxSpeed = 0;
}
override public function behave(){
}
function frame1(){
init();
stop();
wait = 0;
}
function frame40(){
if (seePlayer()){
animate("stomp");
} else {
gotoAndStop(animation);
};
}
function frame70(){
root.y = -16;
}
function frame75(){
root.y = 3;
}
function frame77(){
root.y = 1;
}
function frame69(){
SFX.sound("pound");
bounceFoes(((Math.random() * 21) + 12));
root.y = 20;
if (((Game.player.onGround) && (seePlayer()))){
Game.player.hit((attack * 1));
};
}
function frame76(){
root.y = -2;
}
function frame78(){
root.y = -1;
}
function frame74(){
root.y = -4;
}
function frame71(){
root.y = 10;
}
function frame72(){
root.y = -7;
}
function frame73(){
root.y = 5;
}
function frame79(){
root.y = 0;
}
function frame94(){
animate("idle");
}
function frame95(){
monster = 7;
root.y = 0;
}
function frame96(){
root.y = 0;
}
function frame107(){
kill();
}
public function bounceFoes(b:int){
for each (f in Game.level.foes) {
if (((((((f) && (f.onGround))) && (!(f.boss)))) && (sightbox.hitTestPoint((f.x + parent.x), (f.y + parent.y), true)))){
f.jump((18 + (Math.random() * 12)));
};
};
}
}
}//package
Section 447
//SlimeSnow (SlimeSnow)
package {
public class SlimeSnow extends Foe {
public var accel:Number;// = 0.2
public function SlimeSnow(){
accel = 0.2;
super();
addFrameScript(0, frame1, 26, frame27, 27, frame28, 38, frame39, 50, frame51);
EXP = 10;
HP = 80;
recoilType = 1;
attack = (attack * 7);
dropRate = 0.3;
soundHit = "snow";
soundDie = "hit2";
maxSpeed = 5;
monster = ((Math.random() * 5) + 6);
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
ready = false;
startAnim = "intro";
noTurn = true;
}
override public function behave(){
if (!ready){
animate("intro");
};
if (((aggro) || (seePlayer()))){
if (!ready){
ready = true;
animate("idle");
noTurn = false;
};
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - ((rx * 0.3) * slip));
} else {
contact = false;
xSpeed = (xSpeed * (0.92 + (0.03 * slip)));
};
limitSpeed();
gravity();
if (((((((onGround) && ((Math.random() < 0.02)))) && (ready))) && (seePlayer()))){
jump((12 + (Math.random() * 6)));
};
}
function frame1(){
init();
stop();
}
function frame27(){
gotoAndStop("intro");
}
function frame39(){
gotoAndStop(animation);
}
function frame28(){
ready = true;
}
function frame51(){
kill();
}
}
}//package
Section 448
//SnowLandformhalfbig (SnowLandformhalfbig)
package {
public dynamic class SnowLandformhalfbig extends Landform {
public function SnowLandformhalfbig(){
super();
}
}
}//package
Section 449
//SnowLandformMedium (SnowLandformMedium)
package {
public dynamic class SnowLandformMedium extends Landform {
public function SnowLandformMedium(){
super();
}
}
}//package
Section 450
//snowlandformsmall (snowlandformsmall)
package {
public dynamic class snowlandformsmall extends Landform {
public function snowlandformsmall(){
super();
}
}
}//package
Section 451
//snowplatformbig (snowplatformbig)
package {
public dynamic class snowplatformbig extends Platform {
public function snowplatformbig(){
super();
}
}
}//package
Section 452
//snowplatformbigcopy (snowplatformbigcopy)
package {
public dynamic class snowplatformbigcopy extends Landform {
public function snowplatformbigcopy(){
super();
}
}
}//package
Section 453
//SnowPlatformMedium (SnowPlatformMedium)
package {
public dynamic class SnowPlatformMedium extends Platform {
public function SnowPlatformMedium(){
super();
}
}
}//package
Section 454
//snowplatformsmall (snowplatformsmall)
package {
public dynamic class snowplatformsmall extends Platform {
public function snowplatformsmall(){
super();
}
}
}//package
Section 455
//Sounds (Sounds)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Sounds extends MovieClip {
public function Sounds(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 456
//Spell (Spell)
package {
public class Spell {
public var MP:Array;
public var power:Array;
public var name:String;// = "Ice"
public var cost:Array;
public var effect:String;// = ""
public var chance:Array;
public var graphic:String;// = "ice"
public var ID:int;// = 0
public var time:Array;
public function Spell(name:String, MP:Array, power:Array, cost:Array, time:Array, effect:String, graphic:String, ID:int){
name = "Ice";
ID = 0;
MP = [5, 10, 20];
power = [2, 3, 4];
chance = [0.8, 0.9, 1];
cost = [60, 120, 180];
time = [90, 90, 90];
effect = "";
graphic = "ice";
super();
this.name = name;
this.MP = MP;
this.power = power;
this.cost = cost;
this.time = time;
this.effect = effect;
this.graphic = graphic;
this.ID = ID;
}
public function getLevel(){
return (SaveData.spellData[ID]);
}
}
}//package
Section 457
//SpellMC (SpellMC)
package {
import flash.display.*;
public class SpellMC extends MovieClip {
public var i:int;
public var spell:Spell;
public function SpellMC(spell:Spell){
super();
addFrameScript(1, frame2, 29, frame30, 31, frame32, 59, frame60, 62, frame63, 92, frame93, 95, frame96, 112, frame113, 114, frame115, 132, frame133, 134, frame135, 151, frame152, 160, frame161, 176, frame177, 180, frame181, 199, frame200, 202, frame203, 221, frame222, 223, frame224, 253, frame254, 0x0100, frame257, 282, frame283, 284, frame285, 314, frame315, 316, frame317, 336, frame337, 339, frame340, 360, frame361, 366, frame367, 388, frame389, 508, frame509, 527, frame528, 529, frame530, 550, frame551, 552, frame553, 574, frame575, 576, frame577, 595, frame596, 597, frame598, 620, frame621, 622, frame623, 643, frame644);
this.spell = spell;
}
function frame152(){
kill();
}
function frame551(){
kill();
}
function frame553(){
SFX.sound("heal", "p");
Game.player.heal(1.6, this);
}
function frame317(){
SFX.sound("seiken", "p");
this.scaleX = (this.scaleX * 0.8);
this.scaleY = (this.scaleY * 0.8);
}
function frame285(){
this.scaleX = (this.scaleX * 0.9);
this.scaleY = (this.scaleY * 0.9);
SFX.sound("poison", "p");
SFX.sound("poison2", "p");
}
function frame200(){
kill();
}
function frame315(){
kill();
}
function frame161(){
this.scaleX = (this.scaleX * 0.68);
this.scaleY = (this.scaleY * 0.68);
SFX.sound("thunder", "p");
}
function frame283(){
kill();
}
function frame177(){
kill();
}
function frame577(){
SFX.sound("temper", "p");
Game.player.temper(1.2, 450);
}
function frame181(){
this.scaleX = (this.scaleX * 0.8);
this.scaleY = (this.scaleY * 0.8);
SFX.sound("thunder", "p");
}
function frame93(){
kill();
}
function frame623(){
SFX.sound("temper", "p");
Game.player.temper(1.3, 900);
}
public function kill(){
stop();
Game.spell = null;
parent.removeChild(this);
}
function frame340(){
SFX.sound("seiken", "p");
this.scaleX = (this.scaleX * 0.9);
this.scaleY = (this.scaleY * 0.9);
}
function frame224(){
this.scaleX = (this.scaleX * 0.85);
this.scaleY = (this.scaleY * 0.85);
SFX.sound("poison", "p");
}
function frame96(){
this.scaleX = (this.scaleX * 0.85);
this.scaleY = (this.scaleY * 0.85);
SFX.sound("fire2", "p");
trace("cast fire");
}
function frame575(){
kill();
}
function frame337(){
kill();
}
function frame2(){
this.scaleX = (this.scaleX * 0.85);
this.scaleY = (this.scaleY * 0.85);
SFX.sound("ice2", "p");
}
function frame30(){
kill();
}
function frame113(){
kill();
}
function frame115(){
this.scaleX = (this.scaleX * 0.8);
this.scaleY = (this.scaleY * 0.8);
SFX.sound("fire2", "p");
}
function frame596(){
kill();
}
function frame598(){
SFX.sound("temper", "p");
Game.player.temper(1.25, 600);
}
function frame361(){
kill();
}
function frame367(){
SFX.sound("seiken", "p");
this.scaleX = (this.scaleX * 0.9);
this.scaleY = (this.scaleY * 0.9);
}
function frame644(){
kill();
}
function frame203(){
this.scaleX = (this.scaleX * 0.7);
this.scaleY = (this.scaleY * 0.7);
SFX.sound("thunder", "p");
}
function frame528(){
kill();
}
function frame509(){
SFX.sound("heal", "p");
Game.player.heal(1, this);
}
function frame32(){
this.scaleX = (this.scaleX * 0.8);
this.scaleY = (this.scaleY * 0.8);
SFX.sound("ice2", "p");
trace("cast ice");
}
public function hitPoint(p:MovieClip){
for (i in parent.foes) {
if (((parent.foes[i].hitbox) && (parent.foes[i].hitbox.hitTestPoint(((x + (p.x * scaleX)) + parent.x), ((y + (p.y * scaleY)) + parent.y), true)))){
if (parent.foes[i].hit((Game.player.baseMagic * Game.selectedSpell.power[(Game.selectedSpell.getLevel() - 1)]))){
if (parent.foes[i]){
parent.foes[i].setStatus(Game.selectedSpell.effect, Game.selectedSpell.time[(Game.selectedSpell.getLevel() - 1)]);
};
};
};
};
}
function frame530(){
SFX.sound("heal", "p");
Game.player.heal(1.3, this);
}
function frame135(){
this.scaleX = (this.scaleX * 0.7);
this.scaleY = (this.scaleY * 0.7);
SFX.sound("fire2", "p");
}
function frame257(){
this.scaleX = (this.scaleX * 0.9);
this.scaleY = (this.scaleY * 0.9);
SFX.sound("poison2", "p");
}
function frame133(){
kill();
}
function frame621(){
kill();
}
function frame254(){
kill();
}
function frame222(){
kill();
}
function frame60(){
kill();
}
function frame63(){
this.scaleX = (this.scaleX * 0.7);
this.scaleY = (this.scaleY * 0.7);
SFX.sound("ice2", "p");
trace("cast ice");
}
function frame389(){
kill();
}
}
}//package
Section 458
//Spells (Spells)
package {
public class Spells {
public static var thunder:Spell = new Spell("Thunder", [12, 25, 50], [4, 4.4, 4.8], [60, 120, 180], [60, 60, 60], "stun", "thunder", 5);
public static var heal:Spell = new Spell("Heal", [0, 0, 0], [0, 0, 0], [80, 150, 200], [0, 0, 0], "", "heal", 0);
public static var ice:Spell = new Spell("Ice", [10, 20, 40], [1, 1.1, 1.2], [60, 120, 180], [120, 120, 120], "freeze", "ice", 3);
public static var spells:Array = [heal, slash, seiken, ice, fire, thunder];
public static var seiken:Spell = new Spell("Seiken", [10, 20, 40], [2.7, 2.95, 3.2], [60, 120, 180], [0, 0, 0], "", "seiken", 2);
public static var fire:Spell = new Spell("Fire", [12, 25, 50], [2.8, 3, 3.2], [60, 120, 180], [450, 450, 450], "burn", "fire", 4);
public static var slash:Spell = new Spell("Temper", [0, 0, 0], [0, 0, 0], [60, 130, 200], [0, 0, 0], "", "temper", 1);
public function Spells(){
super();
}
}
}//package
Section 459
//Spikeball (Spikeball)
package {
public class Spikeball extends Foe {
public var cut:Boolean;// = false
public var rec:int;// = 0
public var accel:Number;// = 0.5
public var wait:int;// = 0
public var ball:Spikeball;
public function Spikeball(rec:int=0){
accel = 0.5;
wait = 0;
rec = 0;
cut = false;
super();
addFrameScript(0, frame1, 10, frame11, 19, frame20);
this.rec = rec;
EXP = 0;
HP = 60;
recoilType = 1;
attack = (attack * 10);
dropRate = 0.1;
soundHit = "bat";
soundDie = "hit2";
maxSpeed = 8;
monster = 1;
maxSpeed = (maxSpeed * (0.8 + (Math.random() / 2)));
landFoe = false;
ready = false;
dynamicFoe = true;
projectile = true;
}
override public function behave(){
var rx:Number;
var ry:Number;
var rt:Number;
if (((!(father)) || (father.dead))){
if (!cut){
cut = true;
ySpeed = (-8 - (Math.random() * 8));
} else {
if (ball){
ball.father = null;
};
};
ySpeed++;
if (y > 450){
die();
};
} else {
if (((ball) && (parent.contains(ball)))){
parent.setChildIndex(ball, (parent.getChildIndex(this) - 1));
};
rx = (father.x - x);
ry = (father.y - y);
rt = (Math.abs(rx) + Math.abs(ry));
if (rt == 0){
rt = 1;
};
rx = (rx / rt);
ry = (ry / rt);
ySpeed = (ySpeed + (ry * 2));
xSpeed = (xSpeed + (rx * 2));
xSpeed = (xSpeed * 0.9);
ySpeed = (ySpeed * 0.9);
if (xSpeed > maxSpeed){
xSpeed = (xSpeed - 2);
};
if (ySpeed > maxSpeed){
ySpeed = (ySpeed - 2);
};
if (xSpeed < -(maxSpeed)){
xSpeed = (xSpeed + 2);
};
if (ySpeed < -(maxSpeed)){
ySpeed = (ySpeed + 2);
};
};
}
function frame11(){
gotoAndStop(animation);
}
function frame1(){
init();
init2();
stop();
}
function frame20(){
kill();
}
public function init2(){
maxSpeed = (father.maxSpeed * 0.94);
HP = father.HP;
if (rec > 0){
ball = new Spikeball((rec - 1));
parent.addChildAt(ball, (parent.getChildIndex(this) - 1));
ball.x = this.x;
ball.y = this.y;
ball.father = this;
};
}
}
}//package
Section 460
//SpriteFire (SpriteFire)
package {
public class SpriteFire extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function SpriteFire(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 24, frame25, 28, frame29, 41, frame42, 56, frame57, 59, frame60, 70, frame71);
EXP = 55;
HP = 190;
maxSpeed = 5;
recoilType = 1;
attack = (attack * 9);
dropRate = 0.5;
ready = true;
edgeFall = false;
monster = 3;
soundHit = "rock";
soundDie = "hit2";
}
public function shoot(){
shot = new FireAttack();
parent.addChild(shot);
shot.x = this.x;
shot.y = (this.y - 25);
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
}
override public function behave(){
if (((((((seePlayer()) && (ready))) || (aggro))) && (!((animation == "attack1"))))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx / 2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
}
function frame29(){
noTurn = true;
}
function frame1(){
init();
stop();
}
function frame25(){
if (((seePlayer()) && (onGround))){
animate("attack1");
} else {
gotoAndStop(animation);
};
}
function frame42(){
shoot();
}
function frame57(){
noTurn = false;
}
function frame60(){
animate("idle");
}
function frame71(){
kill();
}
}
}//package
Section 461
//SpriteIce (SpriteIce)
package {
public class SpriteIce extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function SpriteIce(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 24, frame25, 25, frame26, 50, frame51, 73, frame74, 82, frame83, 91, frame92, 102, frame103);
EXP = 27;
HP = 180;
maxSpeed = 5;
recoilType = 1;
attack = (attack * 9);
dropRate = 0.5;
ready = true;
edgeFall = false;
}
override public function behave(){
if (((((((seePlayer()) && (ready))) || (aggro))) && (!((animation == "attack1"))))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx / 2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
}
function frame26(){
recoilType = -1;
}
function frame1(){
init();
stop();
}
function frame25(){
if (((seePlayer()) && (onGround))){
animate("attack1");
} else {
gotoAndStop(animation);
};
}
function frame51(){
animate("hide");
}
function frame74(){
animate("attack2");
}
function frame83(){
recoilType = 1;
}
function frame92(){
animate("idle");
}
function frame103(){
kill();
}
}
}//package
Section 462
//SpriteRock (SpriteRock)
package {
public class SpriteRock extends Foe {
public var accel:Number;// = 0.5
public var wait:int;// = 0
public function SpriteRock(){
accel = 0.5;
wait = 0;
super();
addFrameScript(0, frame1, 24, frame25, 25, frame26, 36, frame37, 50, frame51, 77, frame78, 81, frame82, 86, frame87, 95, frame96, 106, frame107);
EXP = 65;
HP = 150;
maxSpeed = 5;
recoilType = 1;
attack = (attack * 12);
dropRate = 0.5;
ready = true;
edgeFall = false;
monster = 2;
soundHit = "rock";
soundDie = "rock2";
}
override public function behave(){
if (((((((seePlayer()) && (ready))) || (aggro))) && (!((animation == "attack1"))))){
contact = true;
rx = ((x - player.x) + parent.x);
if (rx == 0){
rx = 1;
};
rt = Math.abs(rx);
rx = (rx / rt);
xSpeed = (xSpeed - (rx / 2));
} else {
contact = false;
xSpeed = (xSpeed * 0.8);
};
limitSpeed();
gravity();
}
function frame26(){
recoilType = -1;
}
function frame1(){
init();
stop();
}
function frame25(){
if (((seePlayer()) && (onGround))){
animate("attack1");
} else {
gotoAndStop(animation);
};
}
function frame37(){
rock();
}
function frame51(){
animate("hide");
}
function frame78(){
animate("attack2");
}
function frame87(){
recoilType = 1;
}
function frame82(){
rock();
}
function frame96(){
animate("idle");
}
function frame107(){
kill();
}
public function rock(){
shot = new Rock(1);
parent.addChild(shot);
shot.y = this.y;
shot.x = this.x;
shot.ySpeed = (-10 - (Math.random() * 8));
if (facing){
shot.xSpeed = ((Math.random() * 6) + 1);
} else {
shot.xSpeed = ((-(Math.random()) * 6) - 1);
};
shot.scaleX = 0.8;
shot.scaleY = 0.8;
SFX.sound("rock");
}
}
}//package
Section 463
//stoneplatformmedium2 (stoneplatformmedium2)
package {
public dynamic class stoneplatformmedium2 extends Platform {
public function stoneplatformmedium2(){
super();
}
}
}//package
Section 464
//StonePlatformSmall (StonePlatformSmall)
package {
public dynamic class StonePlatformSmall extends Platform {
public function StonePlatformSmall(){
super();
}
}
}//package
Section 465
//Symbol216 (Symbol216)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Symbol216 extends Platform {
public function Symbol216(){
super();
addFrameScript(0, frame1);
}
function frame1(){
slippery = true;
}
}
}//package
Section 466
//Symbol271 (Symbol271)
package {
public dynamic class Symbol271 extends Platform {
public function Symbol271(){
super();
}
}
}//package
Section 467
//Target (Target)
package {
public class Target extends Foe {
public function Target(){
super();
addFrameScript(0, frame1, 3, frame4, 21, frame22);
if (Game.levelNo != 1){
HP = 999999;
};
EXP = 2;
dropRate = 0.3;
contactDamage = false;
deathType = 1;
}
function frame4(){
gotoAndStop(animation);
}
function frame22(){
kill();
}
function frame1(){
init();
stop();
}
}
}//package
Section 468
//Tentacle (Tentacle)
package {
public class Tentacle extends Foe {
public var wait:int;
public function Tentacle(){
super();
addFrameScript(0, frame1, 2, frame3, 5, frame6, 6, frame7, 57, frame58, 59, frame60, 66, frame67);
EXP = 0;
attack = (attack * 8);
landFoe = true;
immortal = true;
noTurn = true;
edgeFall = false;
soundDie = "none";
soundHit = "none";
projectile = true;
}
override public function behave(){
}
function frame6(){
x = (x + ((Math.random() * 600) - 300));
}
function frame7(){
if (((!(seePlayer())) || (!(parent.beholder.tentacles)))){
gotoAndPlay("idle");
};
}
function frame3(){
if (parent.beholder.dead){
die();
} else {
if (Math.random() < 0.5){
gotoAndStop(5);
};
};
}
function frame1(){
init();
stop();
wait = 0;
}
function frame58(){
animate("idle");
gotoAndStop("idle");
}
function frame67(){
kill();
}
function frame60(){
contactDamage = false;
}
}
}//package
Section 469
//Transition (Transition)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
public dynamic class Transition extends MovieClip {
public function Transition(){
super();
addFrameScript(0, frame1, 1, frame2, 33, frame34, 36, frame37);
}
function frame1(){
stop();
parent.transitioning = false;
}
function frame2(){
parent.transitioning = true;
}
function frame37(){
if (Game.player){
Game.player.interacting = false;
};
}
function frame34(){
Game.hud.displayLevelNo();
}
}
}//package
Section 470
//Tree (Tree)
package {
public class Tree extends Foe {
public var wait:int;
public function Tree(){
super();
addFrameScript(0, frame1, 14, frame15, 27, frame28, 41, frame42, 50, frame51, 55, frame56, 66, frame67);
EXP = 6;
HP = 80;
recoilType = 0;
attack = (attack * 5);
dropRate = 0.6;
soundHit = "tree";
soundDie = "tree";
}
public function shoot(){
shot = new TreeBubbles();
parent.addChild(shot);
shot.x = this.x;
shot.y = this.y;
shot.scaleX = this.scaleX;
shot.scaleY = this.scaleY;
SFX.sound("tree2", "f");
}
function frame15(){
if (seePlayer()){
contact = true;
wait++;
};
if (wait == 5){
wait = 0;
animate("attack");
} else {
gotoAndStop(animation);
};
}
function frame1(){
init();
stop();
wait = 0;
}
function frame42(){
shoot();
}
function frame28(){
noTurn = true;
}
function frame51(){
noTurn = false;
}
function frame56(){
animate("idle");
}
function frame67(){
kill();
}
}
}//package
Section 471
//TreeBubbles (TreeBubbles)
package {
public class TreeBubbles extends Foe {
public function TreeBubbles(){
super();
addFrameScript(0, frame1, 21, frame22);
attack = (attack * 6);
dynamicFoe = true;
attacking = true;
projectile = true;
}
function frame22(){
kill();
}
function frame1(){
init();
stop();
}
}
}//package
Section 472
//WoodenPlatformMedium (WoodenPlatformMedium)
package {
public dynamic class WoodenPlatformMedium extends Platform {
public function WoodenPlatformMedium(){
super();
}
}
}//package
Section 473
//WoodenPlatformSmall (WoodenPlatformSmall)
package {
public dynamic class WoodenPlatformSmall extends Platform {
public function WoodenPlatformSmall(){
super();
}
}
}//package
Section 474
//WoodenPlatformTiny (WoodenPlatformTiny)
package {
public dynamic class WoodenPlatformTiny extends Platform {
public function WoodenPlatformTiny(){
super();
}
}
}//package