Frame 1
loadbar_width = _root.loadBar_mc._width;
_root.loadBar_mc._width = 1;
Frame 2
play();
Frame 3
if (getBytesLoaded() == getBytesTotal()) {
gotoAndStop (20);
} else {
_root.loadBar_mc._width = loadbar_width * (getBytesLoaded() / getBytesTotal());
prevFrame();
play();
}
Frame 20
game.G_GameBoard.main(this);
stop();
Symbol 19 MovieClip [pie_mc] Frame 1
stop();
Symbol 49 MovieClip [arrow_mc] Frame 1
stop();
Symbol 49 MovieClip [arrow_mc] Frame 2
play();
Symbol 93 MovieClip [crocco_mc] Frame 1
stop();
Symbol 175 MovieClip [golly_mc] Frame 1
stop();
Symbol 255 MovieClip [dolly_mc] Frame 1
stop();
Symbol 282 MovieClip [prickles_mc] Frame 1
stop();
Symbol 289 MovieClip [pie_splat] Frame 1
stop();
Symbol 289 MovieClip [pie_splat] Frame 16
stop();
Symbol 289 MovieClip [pie_splat] Frame 35
stop();
Symbol 324 MovieClip Frame 1
stop();
Symbol 20480 MovieClip [__Packages.standard.gameobject.ID_Object] Frame 0
class standard.gameobject.ID_Object
{
var _id;
function ID_Object () {
var _local2 = standard.container.Database.Instance();
_id = _local2.GetNewObjectID();
_local2.Store(this);
}
function GetID(Void) {
return(_id);
}
function toString(Void) {
return(("ID_Object(" + _id) + ")");
}
var Initialize = standard.gameobject.ID_Object;
}
Symbol 20481 MovieClip [__Packages.standard.gameobject.GameObject] Frame 0
class standard.gameobject.GameObject extends standard.gameobject.ID_Object
{
var _fsm, _id;
function GameObject (Void) {
super();
}
function SetStateMachine(s) {
_fsm = s;
}
function GetStateMachine(Void) {
return(_fsm);
}
function Cleanup(Void) {
}
static function MakeMsgFunc(sending_fsm, msg_type, delay, data) {
if (delay == null) {
delay = 0;
}
var _local2 = function (more_data) {
if (more_data) {
sending_fsm.SendDelayedMsgToMe(delay, msg_type, 1, more_data);
} else {
sending_fsm.SendDelayedMsgToMe(delay, msg_type, 1, data);
}
};
return(_local2);
}
function SendMsg(name, receiver, data) {
_fsm.SendMsg(name, receiver, data);
}
function SendDelayedMsg(delay, name, receiver, data) {
_fsm.SendDelayedMsg(delay, name, receiver, data);
}
function SendDelayedMsgToMe(delay, name, scope, data) {
return(_fsm.SendDelayedMsgToMe(delay, name, scope, data));
}
function CancelDelayedMsg(msg) {
return(_fsm.CancelDelayedMsg(msg));
}
function SetState(newState) {
_fsm.SetState(newState);
}
function toString(Void) {
return(("GameObject(" + _id) + ")");
}
var Initialize = standard.gameobject.GameObject;
}
Symbol 20482 MovieClip [__Packages.standard.GameBoard] Frame 0
class standard.GameBoard extends standard.gameobject.GameObject
{
var _mc, _time, _database, _msgroute, _engine, _fsm;
function GameBoard (mc) {
super();
standard.debug.Tracer.myTrace("new GameBoard()", "standard.GameBoard::GameBoard", "build/as/standard/GameBoard.as", 23);
_mc = mc;
_time = standard.Time.Instance();
_database = standard.container.Database.Instance();
_msgroute = standard.message.MsgRoute.Instance();
}
function Get_MC(Void) {
return(_mc);
}
function StartEngine(Void) {
standard.debug.Tracer.myTrace(this + ".StartEngine(Void)", "standard.GameBoard::StartEngine", "build/as/standard/GameBoard.as", 40);
_engine = _mc.createEmptyMovieClip("engineMC", 11);
_engine.parent = this;
_engine.onEnterFrame = function () {
this.parent.Update();
_global.updateAfterEvent();
};
}
function StopEngine(Void) {
_engine.onEnterFrame = null;
}
function Update() {
_time.MarkTimeThisTick();
_global.curFrame = _time.GetCurrentFrame();
if (!_global.PAUSED) {
_msgroute.DeliverDelayedMessages();
_fsm.Update();
}
}
function toString(Void) {
return("GameBoard()");
}
var Initialize = standard.GameBoard;
}
Symbol 20483 MovieClip [__Packages.game.G_GameBoard] Frame 0
class game.G_GameBoard extends standard.GameBoard
{
var _keyed_db, SetStateMachine;
function G_GameBoard (mc) {
super(mc);
_global.sfx = new standard.audio.SFX_Player();
_keyed_db = standard.container.Keyed_Database.Instance();
}
function Initialize(Void) {
standard.debug.Tracer.myTrace(this + ".Initialize(Void)", "game.G_GameBoard::Initialize", "build/as/game/G_GameBoard.as", 23);
var _local3 = new standard.StateMachine_NEW(this);
AddStates(_local3);
SetStateMachine(_local3);
_local3.Start();
LoadExternalData();
}
function LoadExternalData(Void) {
}
function DataLoaded(Void) {
}
function AddStates(fsm) {
}
function GetSoundList(Void) {
var _local3 = [];
return(_local3);
}
function UpdateFSM(Void) {
var _local3 = _keyed_db.GetDynamicIterator(2, 1);
_local3.First();
for ( ; !_local3.IsDone() ; _local3.Next()) {
_local3.CurrentItem().Update();
}
}
static function StartDebugger(Void) {
System.security.loadPolicyFile("xmlsocket://192.168.0.1:8007");
_global.socket = new standard.deferred.XMLSocket_Deferred();
var _local3 = _global.socket.connect("192.168.0.1", "8007");
_global.tracer = new standard.debug.Tracer(_global.socket);
_local3.addCallback(null, StartGame);
}
static function StartGame(Void) {
var _local3 = new game.FSM_GameBoard(_root);
}
static function main() {
_root.stop();
StartGame();
}
function toString(Void) {
return("GameBoard()");
}
}
Symbol 20484 MovieClip [__Packages.game.FSM_GameBoard] Frame 0
class game.FSM_GameBoard extends game.G_GameBoard
{
var _AddStateCleanupHook, _RunStateCleanupHooks, Initialize, Get_MC, StartEngine, _fsm, _music_enabled, _cur_music, _mc, _music_button, _music_counter, _interval_hashes, _platform_tables, SendDelayedMsgToMe, SetState, _player_avatar, _option_difficulty, _option_gametype, _option_rounds, _levels, _trackerMC, _total_rankings, _map_index, _pie_counter, _platforms, NextSplat, _pathfinding_counter, _blackboard, _keyed_db, _scoreboard, _timer, GetID, SendMsg;
function FSM_GameBoard (mc) {
super(mc);
_global.keystack = new standard.events.KeyStack();
var _local4 = [];
_AddStateCleanupHook = standard.Hook.MakeAddHookFunc(_local4);
_RunStateCleanupHooks = standard.Hook.MakeRunHooksFunc(_local4);
Initialize();
}
function Update(Void) {
super.Update();
}
function LoadExternalData() {
standard.debug.Tracer.myTrace(this + ".LoadExternalData()", "game.FSM_GameBoard::LoadExternalData", "build/as/game/FSM_GameBoard.as", 68);
var _local2 = _global.sfx.LoadSounds(GetSoundList(), Get_MC().createEmptyMovieClip("sound_library_mc", 22));
_local2.addCallback(this, SoundsLoaded);
}
function SoundsLoaded(Void) {
standard.debug.Tracer.myTrace(this + ".SoundsLoaded(Void)", "game.FSM_GameBoard::SoundsLoaded", "build/as/game/FSM_GameBoard.as", 75);
DataLoaded();
}
function DataLoaded(Void) {
standard.debug.Tracer.myTrace(this + ".DataLoaded(Void)", "game.FSM_GameBoard::DataLoaded", "build/as/game/FSM_GameBoard.as", 79);
StartEngine();
}
function AddStates(fsm) {
fsm.AddState("Global", null, Global_OnMessage, null, null);
fsm.AddState("Initialize", Initialize_OnEnter, Initialize_OnMessage, null, null);
fsm.AddState("Titlecard", Titlecard_OnEnter, Titlecard_OnMessage, null, null);
fsm.AddState("Instructions", Instructions_OnEnter, Instructions_OnMessage, null, Instructions_OnExit);
fsm.AddState("CharacterSelect", CharacterSelect_OnEnter, CharacterSelect_OnMessage, null, null);
fsm.AddState("Options", Options_OnEnter, Options_OnMessage, null, null);
fsm.AddState("Init_New_Game", Init_New_Game_OnEnter, null, null, null);
fsm.AddState("Pre_Init_Level", Pre_Init_Level_OnEnter, null, Pre_Init_Level_OnUpdate, null);
fsm.AddState("Init_Level", Init_Level_OnEnter, null, Init_Level_OnUpdate, Init_Level_OnExit);
fsm.AddState("Pre_Level", Pre_Level_OnEnter, Pre_Level_OnMessage, null, null);
fsm.AddState("Play_Level", Play_Level_OnEnter, Play_Level_OnMessage, Play_Level_OnUpdate, Play_Level_OnExit);
fsm.AddState("Quit", Quit_OnEnter, LevelEnd_OnMessage, null, LevelEnd_OnExit);
fsm.AddState("Timed_LevelEnd", Timed_LevelEnd_OnEnter, LevelEnd_OnMessage, null, LevelEnd_OnExit);
fsm.AddState("Eliminated_Lose", Eliminated_Lose_OnEnter, LevelEnd_OnMessage, null, LevelEnd_OnExit);
fsm.AddState("Eliminated_Win", Eliminated_Win_OnEnter, LevelEnd_OnMessage, null, LevelEnd_OnExit);
fsm.AddState("GameOver", GameOver_OnEnter, GameOver_OnMessage, null, GameOver_OnEnter);
}
function GetSoundList(Void) {
standard.debug.Tracer.myTrace("GetSoundList(Void)", "game.FSM_GameBoard::GetSoundList", "build/as/game/FSM_GameBoard.as", 166);
var _local3 = [{tags:[1], copies:1, path:"Foot_Conc_SneakerJump1.wav", external:false}, {tags:[1], copies:1, path:"Foot_Conc_SneakerJump2.wav", external:false}, {tags:[1], copies:1, path:"Foot_Conc_SneakerJump3.wav", external:false}, {tags:[1], copies:1, path:"Foot_Conc_SneakerJump4.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand1.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand2.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand3.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand4.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand5.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand6.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand7.wav", external:false}, {tags:[16], copies:1, path:"Foot_Conc_SneakerLand8.wav", external:false}, {tags:[4], copies:1, path:"Hit_SlimeSplat1.wav", external:false}, {tags:[4], copies:1, path:"Hit_SlimeSplat2.wav", external:false}, {tags:[4], copies:1, path:"Hit_SlimeSplat8.wav", external:false}, {tags:[8], copies:1, path:"Swish_ArmSwing02.wav", external:false}, {tags:[8], copies:1, path:"Swish_ArmSwing03.wav", external:false}, {tags:[8], copies:1, path:"Swish_ArmSwing10.wav", external:false}, {id:"gulp", copies:1, path:"gulp.wav", external:false}, {id:"click1", copies:1, path:"Menu_Click06.wav", external:false}, {id:"click2", copies:1, path:"Switch_LightOn.wav", external:false}, {id:"click3", copies:1, path:"Menu_Click24.wav", external:false}, {id:"timer_slow", copies:1, path:"single-tick-tock.wav", external:false}, {id:"timer_fast", copies:1, path:"fast-tick-tock.wav", external:false}, {id:"sting1", copies:1, path:"cartoon-accent-bonks-zip.wav", external:false}, {id:"sting2", copies:1, path:"cartoon-accent-bonk-horn.wav", external:false}, {id:"sting3", copies:1, path:"cartoon-accent-bong-squawk.wav", external:false}, {id:"sting4", copies:1, path:"cartoon-accent-bong-boing.wav", external:false}, {id:"menu_music", copies:1, path:"reanimated_menu_lite.wav", external:false}, {id:"music1", copies:1, path:"reanimated_01.wav", external:false}, {id:"music2", copies:1, path:"reanimated_03.wav", external:false}, {id:"music3", copies:1, path:"reanimated_06.wav", external:false}];
return(_local3);
}
function AddButtonToState(mc, msg) {
var _local4 = new standard.widget.MC_Button(mc);
_local4.AddMouseDownEvent(MakeMsgFunc(_fsm, msg));
_local4.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click1"));
_local4.AddMouseDownEvent(MakeMCFrameFunc(mc, "down", false));
_local4.AddRollOverEvent(MakeMCFrameFunc(mc, "over", false));
_local4.AddRollOutEvent(MakeMCFrameFunc(mc, "up", false));
_local4.Enable(true);
_AddStateCleanupHook(standard.Hook.MakeHook(_local4, _local4.Cleanup));
}
function ToggleMusic(Void) {
standard.debug.Tracer.myTrace(this + ".ToggleMusic(Void)", "game.FSM_GameBoard::ToggleMusic", "build/as/game/FSM_GameBoard.as", 220);
standard.debug.Tracer.myTrace("_music_enabled: " + _music_enabled, "game.FSM_GameBoard::ToggleMusic", "build/as/game/FSM_GameBoard.as", 221);
if (_music_enabled) {
_music_enabled = false;
if (_cur_music != null) {
_global.sfx.StopSound(_cur_music);
_cur_music = null;
}
var _local3 = MakeMCFrameFunc(_mc.button_soundMC, "off_over", false);
var _local4 = MakeMCFrameFunc(_mc.button_soundMC, "off_up", false);
_music_button.AddRollOverEvent(_local3, true);
_music_button.AddRollOutEvent(_local4, true);
_mc.button_soundMC.gotoAndStop("off_up");
} else {
_music_enabled = true;
_cur_music = "music" + _music_counter.Next();
standard.debug.Tracer.myTrace("_cur_music: " + _cur_music, "game.FSM_GameBoard::ToggleMusic", "build/as/game/FSM_GameBoard.as", 239);
_global.sfx.PlaySound(_cur_music, 0, 5000);
var _local5 = MakeMCFrameFunc(_mc.button_soundMC, "on_over", false);
var _local6 = MakeMCFrameFunc(_mc.button_soundMC, "on_up", false);
_music_button.AddRollOverEvent(_local5, true);
_music_button.AddRollOutEvent(_local6, true);
_mc.button_soundMC.gotoAndStop("on_up");
}
}
static function MakeMsgFunc(sending_fsm, msg_type, delay, data) {
standard.debug.Tracer.myTrace((((((("MakeMsgFunc(sending_fsm:StateMachine_NEW,msg_type:Number,delay:Number,data:Object) : " + sending_fsm) + ", ") + msg_type) + ", ") + delay) + ", ") + data, "game.FSM_GameBoard::MakeMsgFunc", "build/as/game/FSM_GameBoard.as", 251);
if (delay == null) {
delay = 0;
}
var _local2 = function () {
sending_fsm.SendDelayedMsgToMe(delay, msg_type, 1, data);
};
return(_local2);
}
static function MakeMCFrameFunc(mc, label, bPlay) {
if (bPlay) {
var _local3 = function () {
mc.gotoAndPlay(label);
};
} else {
var _local3 = function () {
mc.gotoAndStop(label);
};
}
return(_local3);
}
static function MakeCircularNextFunc(a) {
var index = 0;
var N = a.length;
var _local2 = function () {
var _local2 = a[index];
index++;
if (index == N) {
index = 0;
}
return(_local2);
};
return(_local2);
}
static function MakeCounter(start, size) {
var _local4 = {};
_local4.first = start;
_local4.last = (start + size) - 1;
_local4.current = start;
_local4.Reset = function () {
this.current = this.first;
};
_local4.Next = function () {
var _local2 = this.current;
if (this.current == this.last) {
this.current = this.first;
} else {
this.current++;
}
return(_local2);
};
return(_local4);
}
function Global_OnMessage(msg) {
switch (msg.GetMsgName()) {
case 29 :
ToggleMusic();
return(true);
case 30 :
var _local3 = msg.GetData();
_global.sfx.PlaySound(_local3.snd);
return(true);
}
return(false);
}
function Initialize_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Initialize_OnEnter(Void)", "game.FSM_GameBoard::Initialize_OnEnter", "build/as/game/FSM_GameBoard.as", 324);
_interval_hashes = {};
_platform_tables = {};
_music_enabled = true;
_music_counter = MakeCounter(1, 3);
SendDelayedMsgToMe(1, 3);
}
function Initialize_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Initialize_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::Initialize_OnMessage", "build/as/game/FSM_GameBoard.as", 332);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Titlecard");
return(true);
}
return(false);
}
function Titlecard_OnEnter(Void) {
_mc.gotoAndStop("titlecard");
if (_music_enabled) {
_cur_music = "menu_music";
_global.sfx.PlaySound(_cur_music, 0, 5000);
}
AddButtonToState(_mc.button_playMC, 3);
_AddStateCleanupHook(standard.Hook.MakeHook(this, _AddStateCleanupHook, null, true));
}
function Titlecard_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Titlecard_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::Titlecard_OnMessage", "build/as/game/FSM_GameBoard.as", 354);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Instructions");
return(true);
}
return(false);
}
function Titlecard_OnExit(Void) {
_RunStateCleanupHooks();
}
function Instructions_OnEnter(Void) {
_mc.gotoAndStop("instructions");
AddButtonToState(_mc.instructionsMC.button_nextMC, 3);
_AddStateCleanupHook(standard.Hook.MakeHook(this, _AddStateCleanupHook, null, true));
}
function Instructions_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Instructions_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::Instructions_OnMessage", "build/as/game/FSM_GameBoard.as", 373);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("CharacterSelect");
return(true);
}
return(false);
}
function Instructions_OnExit(Void) {
_RunStateCleanupHooks();
}
static function MakeMCFrameFunc2(mc, label, bPlay, state) {
if (bPlay) {
var _local3 = function () {
mc.gotoAndPlay(label);
state.label = label;
};
} else {
var _local3 = function () {
mc.gotoAndStop(label);
state.label = label;
};
}
return(_local3);
}
static function MakeMCFrameFunc3(mc, state, bPlay) {
if (bPlay) {
var _local3 = function () {
mc.gotoAndPlay(state.label);
};
} else {
var _local3 = function () {
mc.gotoAndStop(state.label);
};
}
return(_local3);
}
function CharacterSelect_OnEnter(Void) {
_mc.gotoAndStop("select");
_player_avatar = null;
var _local5 = new standard.widget.Radio_Buttons();
_local5.AddSelectHook(standard.Hook.MakeHook(this, Select_Avatar));
var _local3 = _mc.selectMC.panel01MC;
var _local4 = new standard.widget.MC_Button(_local3);
_local4.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click2"));
var _local6 = {label:"up"};
_local4.AddRollOverEvent(MakeMCFrameFunc(_local3, "over", true));
_local4.AddRollOutEvent(MakeMCFrameFunc3(_local3, _local6, false));
_local5.AddButton(_local4, MakeMCFrameFunc(_local3, "down", false), MakeMCFrameFunc2(_local3, "off", false, _local6), 1);
_local3 = _mc.selectMC.panel02MC;
_local4 = new standard.widget.MC_Button(_local3);
_local4.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click2"));
var _local7 = {label:"up"};
_local4.AddRollOverEvent(MakeMCFrameFunc(_local3, "over", true));
_local4.AddRollOutEvent(MakeMCFrameFunc3(_local3, _local7, false));
_local5.AddButton(_local4, MakeMCFrameFunc(_local3, "down", false), MakeMCFrameFunc2(_local3, "off", false, _local7), 2);
_local3 = _mc.selectMC.panel03MC;
_local4 = new standard.widget.MC_Button(_local3);
_local4.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click2"));
var _local8 = {label:"up"};
_local4.AddRollOverEvent(MakeMCFrameFunc(_local3, "over", true));
_local4.AddRollOutEvent(MakeMCFrameFunc3(_local3, _local8, false));
_local5.AddButton(_local4, MakeMCFrameFunc(_local3, "down", false), MakeMCFrameFunc2(_local3, "off", false, _local8), 3);
_local3 = _mc.selectMC.panel04MC;
_local4 = new standard.widget.MC_Button(_local3);
_local4.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click2"));
var _local9 = {label:"up"};
_local4.AddRollOverEvent(MakeMCFrameFunc(_local3, "over", true));
_local4.AddRollOutEvent(MakeMCFrameFunc3(_local3, _local9, false));
_local5.AddButton(_local4, MakeMCFrameFunc(_local3, "down", false), MakeMCFrameFunc2(_local3, "off", false, _local9), 0);
_AddStateCleanupHook(standard.Hook.MakeHook(_local5, _local5.Cleanup));
AddButtonToState(_mc.selectMC.button_nextMC, 3);
AddButtonToState(_mc.selectMC.button_backMC, 4);
_AddStateCleanupHook(standard.Hook.MakeHook(this, _AddStateCleanupHook, null, true));
}
function Select_Avatar(avatar_index) {
standard.debug.Tracer.myTrace((this + ".Select_Avatar(avatar_index:Number) : ") + avatar_index, "game.FSM_GameBoard::Select_Avatar", "build/as/game/FSM_GameBoard.as", 473);
_player_avatar = avatar_index;
}
function CharacterSelect_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".CharacterSelect_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::CharacterSelect_OnMessage", "build/as/game/FSM_GameBoard.as", 477);
switch (msg.GetMsgName()) {
case 3 :
if (_player_avatar == null) {
_mc.selectMC.mustSelectMC.gotoAndPlay("show");
} else {
SetState("Options");
}
return(true);
case 4 :
SetState("Instructions");
return(true);
}
return(false);
}
function CharacterSelect_OnExit(Void) {
_RunStateCleanupHooks();
}
function Options_OnEnter(Void) {
_mc.gotoAndStop("options");
AddButtonToState(_mc.optionsMC.button_playMC, 3);
AddButtonToState(_mc.optionsMC.button_backMC, 4);
var _local6 = standard.Hook.MakeHook;
var _local5 = new standard.widget.Radio_Buttons();
_local5.AddSelectHook(standard.Hook.MakeHook(this, Select_Difficulty));
var _local4 = _mc.optionsMC.difficulty1MC;
var _local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 1);
_local4 = _mc.optionsMC.difficulty2MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 2);
_local5.SelectButton(_local3);
_local4 = _mc.optionsMC.difficulty3MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 3);
_AddStateCleanupHook(_local6(_local5, _local5.Cleanup));
_local5 = new standard.widget.Radio_Buttons();
_local5.AddSelectHook(standard.Hook.MakeHook(this, Select_GameType));
_local4 = _mc.optionsMC.gametype1MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 4);
_local5.SelectButton(_local3);
_local4 = _mc.optionsMC.gametype2MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 5);
_AddStateCleanupHook(_local6(_local5, _local5.Cleanup));
_local5 = new standard.widget.Radio_Buttons();
_local5.AddSelectHook(standard.Hook.MakeHook(this, Select_Rounds));
_local4 = _mc.optionsMC.rounds1MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 1);
_local4 = _mc.optionsMC.rounds2MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 3);
_local5.SelectButton(_local3);
_local4 = _mc.optionsMC.rounds3MC;
_local3 = new standard.widget.MC_Button(_local4);
_local3.AddMouseDownEvent(_local6(_global.sfx, _global.sfx.PlaySound, "click3"));
_local5.AddButton(_local3, MakeMCFrameFunc(_local4, "on", false), MakeMCFrameFunc(_local4, "off", false), 5);
_AddStateCleanupHook(_local6(_local5, _local5.Cleanup));
_AddStateCleanupHook(_local6(this, _AddStateCleanupHook, null, true));
}
function Select_Difficulty(index) {
_option_difficulty = index;
}
function Select_GameType(index) {
_option_gametype = index;
}
function Select_Rounds(index) {
_option_rounds = index;
_levels = [];
var _local3 = [0, 1, 2, 3, 4];
while ((index--) > 0) {
_levels.push(_local3.splice(Math.floor(Math.random() * _local3.length), 1)[0]);
}
standard.debug.Tracer.myTrace("levels___", "game.FSM_GameBoard::Select_Rounds", "build/as/game/FSM_GameBoard.as", 598);
var _local4 = 0;
for ( ; _local4 < _levels.length ; _local4++) {
standard.debug.Tracer.myTrace("\t" + _levels[_local4], "game.FSM_GameBoard::Select_Rounds", "build/as/game/FSM_GameBoard.as", 600);
}
}
function Options_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Options_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::Options_OnMessage", "build/as/game/FSM_GameBoard.as", 603);
switch (msg.GetMsgName()) {
case 3 :
SetState("Init_New_Game");
return(true);
case 4 :
SetState("CharacterSelect");
return(true);
}
return(false);
}
function Options_OnExit(Void) {
_RunStateCleanupHooks();
}
function Init_New_Game_OnEnter(Void) {
var _local3 = new Date();
var _local4 = _local3.getTime();
standard.debug.Tracer.myTrace("unique_id: " + _local4, "game.FSM_GameBoard::Init_New_Game_OnEnter", "build/as/game/FSM_GameBoard.as", 623);
_trackerMC = _mc.createEmptyMovieClip("tracker_mc", 10000);
_trackerMC._visible = false;
_trackerMC.loadMovie("" + _local4);
_total_rankings = new Array(4);
_total_rankings[1] = 0;
_total_rankings[2] = 0;
_total_rankings[3] = 0;
_total_rankings[0] = 0;
SetState("Pre_Init_Level");
}
function Pre_Init_Level_OnEnter(Void) {
_mc.gotoAndStop("initializing");
}
function Pre_Init_Level_OnUpdate(Void) {
SetState("Init_Level");
return(true);
}
function Init_Level_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Init_Level_OnEnter(Void)", "game.FSM_GameBoard::Init_Level_OnEnter", "build/as/game/FSM_GameBoard.as", 647);
var _local3 = 10;
_map_index = _levels.pop();
standard.debug.Tracer.myTrace("_map_index: " + _map_index, "game.FSM_GameBoard::Init_Level_OnEnter", "build/as/game/FSM_GameBoard.as", 651);
_pie_counter = MakeCounter(0, 20);
if (_interval_hashes[_map_index] == null) {
_platforms = GetPlatforms(_map_index);
var _local4 = game.Jump_Interval.GetAllPlatformIntervals(_platforms, _local3);
_local4 = game.Jump_Interval.FilterPlatformIntervals(_local4);
_platform_tables[_map_index] = game.Jump_Interval.CreatePlatformTable(_local4);
_interval_hashes[_map_index] = _local4;
} else {
SetState("Pre_Level");
}
}
function Init_Level_OnUpdate(Void) {
var _local3 = 10;
if (_platforms.length > 0) {
var _local4 = _platforms.pop();
standard.debug.Tracer.myTrace("next_platform: " + _local4.name, "game.FSM_GameBoard::Init_Level_OnUpdate", "build/as/game/FSM_GameBoard.as", 670);
game.Jump_Interval.AppendMoveToData(_interval_hashes[_map_index][_local4.name], _local3);
} else {
SetState("Pre_Level");
}
return(true);
}
function Init_Level_OnExit(Void) {
}
function GetRandomPlatformX(platform) {
var _local3 = platform.x1;
var _local4 = platform.x2;
var _local5 = _local4 - _local3;
if (_local5 > 10) {
_local3 = _local3 + 10;
_local4 = _local4 - 10;
_local5 = _local5 - 20;
}
var _local6 = _local3 + Math.floor(Math.random() * _local5);
return(_local6);
}
function Pre_Level_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Pre_Level_OnEnter(Void)", "game.FSM_GameBoard::Pre_Level_OnEnter", "build/as/game/FSM_GameBoard.as", 696);
_mc.gotoAndStop("game");
_mc.background_mc.gotoAndStop(_map_index + 1);
_mc.getReadyMC.gotoAndPlay("show");
_global.keystack.Initialize();
var _local3 = [];
var _local4 = 0;
for ( ; _local4 < 15 ; _local4++) {
_local3.push(_mc.background_mc.avatarMC.attachMovie("pie_splat", "splat" + _local4, 150 + _local4));
}
NextSplat = MakeCircularNextFunc(_local3);
_pathfinding_counter = MakeCounter(0, 4);
_blackboard = {avatar:_pathfinding_counter.Next()};
var _local5 = GetPlatforms(_map_index);
var _local6 = _local5.concat();
var _local7 = _local6.splice(Math.floor(Math.random() * _local6.length), 1)[0];
var _local8 = _local6.splice(Math.floor(Math.random() * _local6.length), 1)[0];
var _local9 = _local6.splice(Math.floor(Math.random() * _local6.length), 1)[0];
var _local10 = _local6.splice(Math.floor(Math.random() * _local6.length), 1)[0];
var _local11 = _player_avatar == 1;
var _local12 = _player_avatar == 2;
var _local13 = _player_avatar == 3;
var _local14 = _player_avatar == 0;
Init_Avatar(1, GetRandomPlatformX(_local7), _local7.y, _local11);
Init_Avatar(2, GetRandomPlatformX(_local8), _local8.y, _local12);
Init_Avatar(3, GetRandomPlatformX(_local9), _local9.y, _local13);
Init_Avatar(0, GetRandomPlatformX(_local10), _local10.y, _local14);
var _local15 = _keyed_db.GetDynamicIterator(2, 32);
_local15.First();
for ( ; !_local15.IsDone() ; _local15.Next()) {
var _local16 = _local15.CurrentItem();
_local16.SetMap(_local5);
_local16.SetIntervalHash(_interval_hashes[_map_index]);
_local16.SetPlatformTable(_platform_tables[_map_index]);
if (_local16.GetAvatarIndex() == _player_avatar) {
_local16._mc.arrowMC.gotoAndPlay("show");
}
}
if (_music_enabled) {
if (_cur_music != null) {
_global.sfx.StopSound(_cur_music);
}
_cur_music = "music" + _music_counter.Next();
standard.debug.Tracer.myTrace("_cur_music: " + _cur_music, "game.FSM_GameBoard::Pre_Level_OnEnter", "build/as/game/FSM_GameBoard.as", 745);
_global.sfx.PlaySound(_cur_music, 0, 5000);
}
_music_button = new standard.widget.MC_Button(_mc.button_soundMC);
_music_button.AddMouseDownEvent(MakeMsgFunc(_fsm, 29), true);
_music_button.AddMouseDownEvent(standard.Hook.MakeHook(_global.sfx, _global.sfx.PlaySound, "click1"));
_music_button.Enable(true);
_AddStateCleanupHook(standard.Hook.MakeHook(_music_button, _music_button.Cleanup));
_AddStateCleanupHook(standard.Hook.MakeHook(this, _AddStateCleanupHook, null, true));
if (_music_enabled) {
_mc.button_soundMC.gotoAndStop("on_up");
_music_button.AddRollOverEvent(MakeMCFrameFunc(_mc.button_soundMC, "on_over", false), true);
_music_button.AddRollOutEvent(MakeMCFrameFunc(_mc.button_soundMC, "on_up", false), true);
} else {
_mc.button_soundMC.gotoAndStop("off_up");
_music_button.AddRollOverEvent(MakeMCFrameFunc(_mc.button_soundMC, "off_over", false), true);
_music_button.AddRollOutEvent(MakeMCFrameFunc(_mc.button_soundMC, "off_up", false), true);
}
_scoreboard = new game.Scoreboard(_mc.scoreboardMC);
_timer = new game.G_Timer();
_timer.SetMC(_mc.timerMC);
if (_option_gametype == 4) {
_scoreboard.Init_TimedGame();
_timer.Show();
_timer.SetTimeLimit(60000);
_timer.ShowTime(0);
_timer.AddTimeupFunc(standard.Timer.MakeTimerMsgFunc(_timer.GetStateMachine(), GetID(), 22));
_timer.AddTimerTickFunc(standard.Timer.MakeTimerMsgFunc(_timer.GetStateMachine(), GetID(), 23), 1000);
_keyed_db.Add(_timer.GetStateMachine(), 16, 1);
} else {
_scoreboard.Init_EliminationGame();
_timer.Hide();
}
SendDelayedMsgToMe(45, 3);
}
function Pre_Level_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Pre_Level_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::Pre_Level_OnMessage", "build/as/game/FSM_GameBoard.as", 789);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Play_Level");
return(true);
}
return(false);
}
function Play_Level_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Play_Level_OnEnter(Void)", "game.FSM_GameBoard::Play_Level_OnEnter", "build/as/game/FSM_GameBoard.as", 800);
var _local3 = _keyed_db.GetDynamicIterator(2, 32);
_local3.First();
for ( ; !_local3.IsDone() ; _local3.Next()) {
var _local4 = _local3.CurrentItem();
SendMsg(3, _local4.GetID());
}
if (_option_gametype == 4) {
SendMsg(24, _timer.GetID());
}
}
function GetAttributes(character, difficulty, isPlayer) {
switch (character) {
case 0 :
var _local5 = 10;
var _local6 = 30;
break;
case 1 :
_local5 = 10;
_local6 = 20;
break;
case 2 :
_local5 = 8;
_local6 = 16;
break;
case 3 :
_local5 = 16;
_local6 = 18;
}
if (!isPlayer) {
switch (difficulty) {
case 1 :
_local5 = _local5 * 4;
var _local7 = 24;
var _local8 = 48;
var _local9 = 0.2;
_local6 = _local6 / 2;
break;
case 2 :
_local5 = _local5 * 3;
if (character == 0) {
_local9 = 0.6;
_local7 = 12;
_local8 = 24;
} else {
_local9 = 0.4;
_local7 = 16;
_local8 = 32;
}
break;
case 3 :
_local5 = _local5 * 2;
_local7 = 0;
_local8 = 4;
_local9 = 1;
}
}
var _local10 = {reload_delay:_local5, pie_speed:_local6, pause_min:_local7, pause_max:_local8, evade_probability:_local9};
return(_local10);
}
function Init_Avatar(character, x, y, playerControlled) {
var _local10 = GetAttributes(character, _option_difficulty, playerControlled);
switch (character) {
case 0 :
var _local6 = 10;
var _local7 = "crocco_mc";
var _local8 = 20;
var _local9 = 74;
break;
case 1 :
_local6 = 10;
_local7 = "golly_mc";
_local8 = 20;
_local9 = 53;
break;
case 2 :
_local6 = 10;
_local7 = "dolly_mc";
_local8 = 20;
_local9 = 53;
break;
case 3 :
_local6 = 10;
_local7 = "prickles_mc";
_local8 = 20;
_local9 = 37;
}
if (playerControlled) {
var _local11 = new game.Hero2(x, y, _local6, character, _local10.reload_delay, _local10.pie_speed);
var _local14 = 105;
_local11.SetKeys(90, 40, 37, 39, 88);
} else {
var _local11 = new game.Enemy(x, y, _local6, character, _local10.reload_delay, _local10.pie_speed, _local10.pause_min, _local10.pause_max, _local10.evade_probability);
var _local14 = 100 + character;
}
var _local12 = _mc.background_mc.avatarMC.attachMovie(_local7, "avatar_mc" + character, _local14);
var _local13 = new standard.graphics.MC_Mixin(_local11, _local12);
_keyed_db.Add(_local11.GetStateMachine(), 8, 1);
_keyed_db.Add(_local11, 512, 2, 32);
_local11.Set_Dimensions(_local8, _local9);
_local11.Draw();
_local11.SetBlackboard(_blackboard);
var _local17 = [];
var _local18 = 0;
for ( ; _local18 < 3 ; _local18++) {
var _local15 = new game.Projectile(0, 0, 5);
var _local16 = _pie_counter.Next();
_local12 = _mc.background_mc.avatarMC.attachMovie("pie_mc", "pie" + _local16, 110 + _local16);
_local13 = new standard.graphics.MC_Mixin(_local15, _local12);
_local15.Hide();
_keyed_db.Add(_local15.GetStateMachine(), 8, 1);
_keyed_db.Add(_local15, 512, 4, 256);
_local15.Set_Dimensions(12, 15);
_local15.SetOwnerID(_local11.GetID());
_local15.SetAvatarID(character);
_local17.push(_local15);
}
_local11.AddAmmo(_local17);
}
function GetPlatforms(index) {
standard.debug.Tracer.myTrace((this + ".GetPlatforms(index:Number) : ") + index, "game.FSM_GameBoard::GetPlatforms", "build/as/game/FSM_GameBoard.as", 964);
switch (index) {
case 0 :
var _local3 = [{name:"ground", x1:10, x2:590, y:370, canDrop:false}, {name:"bench 1", x1:123, x2:142, y:346, canDrop:true}, {name:"bench 2", x1:212, x2:234, y:346, canDrop:true}, {name:"bench 3", x1:356, x2:375, y:346, canDrop:true}, {name:"bench 4", x1:446, x2:468, y:347, canDrop:true}, {name:"table 1", x1:140, x2:214, y:322, canDrop:true}, {name:"table 2", x1:374, x2:448, y:322, canDrop:true}, {name:"fence", x1:10, x2:590, y:262, canDrop:true}, {name:"roof", x1:263, x2:590, y:172, canDrop:true}, {name:"birdhouse", x1:133, x2:173, y:118, canDrop:true}];
break;
case 1 :
_local3 = [{name:"light1", x1:107, x2:201, y:172, canDrop:true}, {name:"light2", x1:263, x2:357, y:172, canDrop:true}, {name:"light3", x1:419, x2:513, y:172, canDrop:true}, {name:"chair1", x1:54, x2:86, y:302, canDrop:true}, {name:"whiteboard", x1:116, x2:243, y:262, canDrop:true}, {name:"table", x1:276, x2:567, y:322, canDrop:true}, {name:"chair2", x1:432, x2:470, y:302, canDrop:true}, {name:"ground", x1:10, x2:590, y:370, canDrop:false}];
break;
case 2 :
_local3 = [{name:"picture6", x1:510, x2:542, y:118, canDrop:true}, {name:"picture5", x1:435, x2:467, y:118, canDrop:true}, {name:"picture4", x1:360, x2:392, y:118, canDrop:true}, {name:"picture3", x1:285, x2:317, y:118, canDrop:true}, {name:"picture2", x1:210, x2:242, y:118, canDrop:true}, {name:"picture1", x1:135, x2:167, y:118, canDrop:true}, {name:"speaker", x1:78, x2:106, y:172, canDrop:true}, {name:"map", x1:300, x2:409, y:226, canDrop:true}, {name:"cabinet", x1:30, x2:93, x2:93, y:262, canDrop:true}, {name:"aquarium", x1:489, x2:558, y:290, canDrop:true}, {name:"blackboard", x1:252, x2:456, y:322, canDrop:true}, {name:"desk", x1:108, x2:229, y:322, canDrop:true}, {name:"ground", x1:10, x2:590, y:370, canDrop:false}];
break;
case 3 :
_local3 = [{name:"photo2", x1:478, x2:520, y:118, canDrop:true}, {name:"photo1", x1:393, x2:435, y:118, canDrop:true}, {name:"light1", x1:147, x2:163, y:172, canDrop:true}, {name:"light2", x1:287, x2:303, y:172, canDrop:true}, {name:"cabinet", x1:323, x2:586, y:226, canDrop:true}, {name:"lamp", x1:30, x2:56, y:262, canDrop:true}, {name:"fireplace", x1:153, x2:298, y:289, canDrop:true}, {name:"sofa", x1:95, x2:133, y:334, canDrop:true}, {name:"ground", x1:10, x2:590, y:370, canDrop:false}];
break;
case 4 :
_local3 = [{name:"RightLight", x1:515, x2:579, y:172, canDrop:true}, {name:"Leftlight", x1:208, x2:272, y:172, canDrop:true}, {name:"top", x1:387, x2:494, y:226, canDrop:true}, {name:"swingtop", x1:51, x2:197, y:226, canDrop:true}, {name:"middle", x1:338, x2:388, y:262, canDrop:true}, {name:"low", x1:305, x2:337, y:322, canDrop:true}, {name:"swing", x1:80, x2:167, y:322, canDrop:true}, {name:"ground", x1:10, x2:590, x2:590, y:370, canDrop:false}];
}
_local3.sortOn("y", Array.NUMERIC);
return(_local3);
}
function Play_Level_OnMessage(msg) {
switch (msg.GetMsgName()) {
case 27 :
SetState("Quit");
break;
case 20 :
if (_option_gametype == 4) {
SetState("Timed_LevelEnd");
} else {
SetState("Eliminated_Win");
}
break;
case 23 :
var _local3 = msg.GetData();
var _local4 = 60000 - _local3.time;
if (_local4 <= 5000) {
_global.sfx.PlaySound("timer_fast");
} else if (_local4 <= 10000) {
_global.sfx.PlaySound("timer_slow");
}
return(true);
case 22 :
standard.debug.Tracer.myTrace("TIMESUP!", "game.FSM_GameBoard::Play_Level_OnMessage", "build/as/game/FSM_GameBoard.as", 1354);
SetState("Timed_LevelEnd");
return(true);
}
return(false);
}
function Play_Level_OnUpdate(Void) {
_global.keystack.DoubleCheck();
_blackboard.avatar = _pathfinding_counter.Next();
if (_blackboard.avatar == _player_avatar) {
_blackboard.avatar = _pathfinding_counter.Next();
}
var _local3 = _keyed_db.GetDynamicIterator(8, 1);
_local3.First();
for ( ; !_local3.IsDone() ; _local3.Next()) {
_local3.CurrentItem().Update_FSM();
}
var _local4 = _keyed_db.GetDynamicIterator(2, 32);
var _local5 = _keyed_db.GetDynamicIterator(2, 256);
_local5.First();
for ( ; !_local5.IsDone() ; _local5.Next()) {
var _local6 = _local5.CurrentItem();
if (!_local6.IsStuck()) {
_local4.First();
for ( ; !_local4.IsDone() ; _local4.Next()) {
var _local7 = _local4.CurrentItem();
var _local8 = CollisionTest(_local6, _local7);
if (!_global.isNaN(_local8)) {
standard.debug.Tracer.myTrace((("(X) Collision: " + _local6) + " : ") + _local7, "game.FSM_GameBoard::Play_Level_OnUpdate", "build/as/game/FSM_GameBoard.as", 1382);
var _local9 = _local6.Get_VX();
if (_local7.CanEatPie(_local6.GetBounds(), _local9)) {
standard.debug.Tracer.myTrace("EATS PIE!!!", "game.FSM_GameBoard::Play_Level_OnUpdate", "build/as/game/FSM_GameBoard.as", 1387);
SendMsg(17, _local6.GetID());
SendMsg(28, _local7.GetID());
} else {
SendMsg(17, _local7.GetID(), {dir:_local9});
if (_option_gametype == 4) {
var _local10 = _local6.GetAvatarID();
_scoreboard.UpdateScore(1, _local10);
_scoreboard.UpdateScore(-1, _local7.GetAvatarIndex());
} else {
var _local11 = _scoreboard.UpdateScore(-1, _local7.GetAvatarIndex());
if (_local11 == 0) {
SendMsg(26, _local7.GetID());
var _local12 = _keyed_db.Count(2, 32);
_total_rankings[_local7.GetAvatarIndex()] = _total_rankings[_local7.GetAvatarIndex()] + _local12;
}
}
var _local13 = ((_local6.Get_VX() > 0) ? (-_local7.Get_Half_Width()) : (_local7.Get_Half_Width()));
var _local14 = _local6.Get_Y() - (_local7.Get_Y() + (_local7.Get_VY() * _local8));
SendMsg(4, _local6.GetID(), {avatar:_local7, dx:_local13, dy:_local14});
var _local15 = NextSplat();
_local15._x = _local7.Get_X() + _local13;
_local15._y = _local7.Get_Y() + _local14;
if (_local9 > 0) {
_local15.gotoAndPlay("right");
} else {
_local15.gotoAndPlay("left");
}
}
}
}
}
}
var _local16 = _keyed_db.GetDynamicIterator(512, 2);
_local16.First();
for ( ; !_local16.IsDone() ; _local16.Next()) {
_local16.CurrentItem().Update();
}
if (_option_gametype == 5) {
if (_scoreboard.GetScore(_player_avatar) <= 0) {
SetState("Eliminated_Lose");
} else if (_keyed_db.Count(2, 32) == 1) {
SetState("Eliminated_Win");
}
}
return(true);
}
function CollisionTest(pieObject, avatarObject) {
var _local4 = pieObject.GetBounds();
var _local5 = avatarObject.GetBounds();
if (_local4.intersects(_local5)) {
standard.debug.Tracer.myTrace("pie_bounds: " + _local4, "game.FSM_GameBoard::CollisionTest", "build/as/game/FSM_GameBoard.as", 1452);
standard.debug.Tracer.myTrace("avatar_bounds: " + _local5, "game.FSM_GameBoard::CollisionTest", "build/as/game/FSM_GameBoard.as", 1453);
var _local6 = pieObject.Get_VX();
var _local7 = pieObject.Get_VY();
var _local8 = avatarObject.Get_VX();
var _local9 = avatarObject.Get_VY();
var _local10 = _local6 - _local8;
var _local11 = _local7 - _local9;
var _local12 = pieObject.Get_X();
var _local13 = pieObject.Get_Y();
var _local14 = pieObject.Get_Width();
var _local15 = pieObject.Get_Height();
var _local16 = avatarObject.GetStaticBounds();
var _local17 = new standard.geometry.Rect(_local16.x1 - _local14, _local16.y1 - _local15, _local16.x2, _local16.y2);
var _local18 = _local17.x1 - _local12;
var _local19 = _local17.x2 - _local12;
var _local20 = ((Math.abs(_local18) < Math.abs(_local19)) ? (_local18) : (_local19));
var _local21 = _local20 / _local10;
var _local22 = _local13 + (_local11 * _local21);
if ((_local21 < 1) && ((_local22 >= _local17.y1) && (_local22 <= _local17.y2))) {
return(_local21);
}
return(_global.NaN);
}
return(_global.NaN);
}
function Play_Level_OnExit(Void) {
if (_option_gametype == 4) {
SendMsg(25, _timer.GetID());
}
}
function Quit_OnEnter(Void) {
_mc.youQuitMC.gotoAndPlay("show");
_levels = [];
SendDelayedMsgToMe(48, 3);
}
function Timed_LevelEnd_OnEnter(Void) {
var _local3 = 1;
var _local4 = 0;
var _local5 = 0;
var _local6 = _scoreboard.GetScore(_player_avatar);
standard.debug.Tracer.myTrace("our_score: " + _local6, "game.FSM_GameBoard::Timed_LevelEnd_OnEnter", "build/as/game/FSM_GameBoard.as", 1517);
var _local7 = 0;
for ( ; _local7 < 4 ; _local7++) {
if (_local7 != _player_avatar) {
var _local8 = _scoreboard.GetScore(_local7);
if (_local8 > _local6) {
_local4++;
} else if (_local8 == _local6) {
_local5++;
}
}
}
if (_local4 > 0) {
_local3 = _local4 + 1;
}
if (_local5 > 0) {
_mc.resultMC.gotoAndPlay("result2");
} else {
_mc.resultMC.gotoAndPlay("result1");
}
_mc.resultMC.rankMC.gotoAndStop(_local3);
SendDelayedMsgToMe(11, 30, null, {snd:"sting" + _local3});
standard.debug.Tracer.myTrace("Results___", "game.FSM_GameBoard::Timed_LevelEnd_OnEnter", "build/as/game/FSM_GameBoard.as", 1541);
var _local9 = _scoreboard.GetRanking_Timed();
var _local10 = 0;
for ( ; _local10 < _local9.length ; _local10++) {
standard.debug.Tracer.myTrace((((("\tid: " + _local9[_local10].id) + ",score: ") + _local9[_local10].score) + ", rank: ") + _local9[_local10].rank, "game.FSM_GameBoard::Timed_LevelEnd_OnEnter", "build/as/game/FSM_GameBoard.as", 1544);
_total_rankings[_local9[_local10].id] = _total_rankings[_local9[_local10].id] + _local9[_local10].rank;
}
_timer.ShowTime(60000);
SendDelayedMsgToMe(75, 3);
}
function LevelEnd_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
if (_levels.length > 0) {
SetState("Pre_Init_Level");
} else {
SetState("GameOver");
}
return(true);
}
return(false);
}
function LevelEnd_OnExit(Void) {
var _local3 = _keyed_db.GetDynamicIterator(32);
_local3.First();
for ( ; !_local3.IsDone() ; _local3.Next()) {
_local3.CurrentItem().Cleanup();
}
var _local4 = _keyed_db.GetDynamicIterator(256);
_local4.First();
for ( ; !_local4.IsDone() ; _local4.Next()) {
_local4.CurrentItem().Cleanup();
}
var _local5 = 0;
for ( ; _local5 < 15 ; _local5++) {
var _local6 = NextSplat();
_local6.removeMovieClip();
}
standard.debug.Tracer.myTrace("Database dump", "game.FSM_GameBoard::LevelEnd_OnExit", "build/as/game/FSM_GameBoard.as", 1577);
_keyed_db.Dump();
_RunStateCleanupHooks();
}
function Eliminated_Lose_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Eliminated_Lose_OnEnter(Void)", "game.FSM_GameBoard::Eliminated_Lose_OnEnter", "build/as/game/FSM_GameBoard.as", 1584);
_mc.resultMC.gotoAndPlay("result3");
var _local3 = _keyed_db.Count(2, 32);
standard.debug.Tracer.myTrace("playersLeft: " + _local3, "game.FSM_GameBoard::Eliminated_Lose_OnEnter", "build/as/game/FSM_GameBoard.as", 1589);
var _local4 = _local3 + 1;
_mc.resultMC.rankMC.gotoAndStop(_local4);
SendDelayedMsgToMe(11, 30, null, {snd:"sting" + _local4});
var _local5 = _keyed_db.GetDynamicIterator(32, 2);
_local5.First();
for ( ; !_local5.IsDone() ; _local5.Next()) {
var _local6 = _local5.CurrentItem();
_local3--;
standard.debug.Tracer.myTrace("setting remaining player's score to " + _local3, "game.FSM_GameBoard::Eliminated_Lose_OnEnter", "build/as/game/FSM_GameBoard.as", 1599);
_total_rankings[_local6.GetAvatarIndex()] = _total_rankings[_local6.GetAvatarIndex()] + _local3;
}
SendDelayedMsgToMe(75, 3);
}
function Eliminated_Win_OnEnter(Void) {
_mc.resultMC.gotoAndPlay("result4");
var _local3 = 1;
SendDelayedMsgToMe(11, 30, null, {snd:"sting" + _local3});
SendDelayedMsgToMe(75, 3);
}
function GetFinalResults(rankAr) {
standard.debug.Tracer.myTrace((this + ".GetFinalResults(rankAr:Array) : ") + rankAr, "game.FSM_GameBoard::GetFinalResults", "build/as/game/FSM_GameBoard.as", 1615);
var _local3 = [];
var _local4 = 0;
for ( ; _local4 < rankAr.length ; _local4++) {
standard.debug.Tracer.myTrace((("\tid: " + _local4) + ", score: ") + rankAr[_local4], "game.FSM_GameBoard::GetFinalResults", "build/as/game/FSM_GameBoard.as", 1621);
var _local5 = _local4;
var _local6 = rankAr[_local4];
if (_local5 == _player_avatar) {
_local6 = _local6 - 0.5;
}
_local3.push({id:_local4, score:rankAr[_local4]});
}
_local3.sortOn("score", Array.NUMERIC | Array.ASCENDING);
var _local7 = _local3.length;
while (_local7--) {
if (_local3[_local7].id == _player_avatar) {
_local3[_local7].score = _local3[_local7].score + 0.5;
break;
}
}
return(_local3);
}
function GameOver_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".GameOver_OnEnter(Void)", "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1640);
_mc.gotoAndStop("end");
var _local3 = _player_avatar == 1;
var _local4 = _player_avatar == 2;
var _local5 = _player_avatar == 3;
var _local6 = _player_avatar == 0;
var _local7 = GetFinalResults(_total_rankings);
var _local8 = new Array(4);
var _local9 = new Array(4);
var _local10 = 0;
var _local11 = 999;
var _local12 = 0;
var _local13 = 0;
for ( ; _local13 < _local7.length ; _local13++) {
var _local14 = _local7[_local13];
var _local15 = _local14.score;
var _local16 = _local14.id;
standard.debug.Tracer.myTrace("id: " + _local16, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1657);
standard.debug.Tracer.myTrace("score: " + _local15, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1658);
if (_local15 > _local11) {
_local10 = _local10 + (_local12 + 1);
_local12 = 0;
} else if (_local15 == _local11) {
_local12++;
}
standard.debug.Tracer.myTrace("rankIndex: " + _local10, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1666);
_local11 = _local15;
_local8[_local16] = _local10;
_local9[_local16] = _local13;
}
var _local17 = _local8[1];
standard.debug.Tracer.myTrace("gollyRank: " + _local17, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1672);
var _local18 = _local8[2];
standard.debug.Tracer.myTrace("dollyRank: " + _local18, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1674);
var _local19 = _local8[3];
standard.debug.Tracer.myTrace("pricklesRank: " + _local19, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1676);
var _local20 = _local8[0];
standard.debug.Tracer.myTrace("croccoRank: " + _local20, "game.FSM_GameBoard::GameOver_OnEnter", "build/as/game/FSM_GameBoard.as", 1678);
var _local21 = ["first", "second", "third", "fourth"];
var _local22 = (_local3 ? (_local21[_local17] + "you") : (_local21[_local17]));
var _local23 = (_local4 ? (_local21[_local18] + "you") : (_local21[_local18]));
var _local24 = (_local5 ? (_local21[_local19] + "you") : (_local21[_local19]));
var _local25 = (_local6 ? (_local21[_local20] + "you") : (_local21[_local20]));
var _local26 = _mc.endMC;
_local26.end_gollyMC._x = _golly_char_pos[_local9[1]].x;
_local26.end_gollyMC._y = _golly_char_pos[_local9[1]].y;
_local26.nameGollyMC._x = _golly_name_pos[_local9[1]].x;
_local26.nameGollyMC._y = _golly_name_pos[_local9[1]].y;
_local26.end_dollyMC._x = _dolly_char_pos[_local9[2]].x;
_local26.end_dollyMC._y = _dolly_char_pos[_local9[2]].y;
_local26.nameDollyMC._x = _dolly_name_pos[_local9[2]].x;
_local26.nameDollyMC._y = _dolly_name_pos[_local9[2]].y;
_local26.end_pricklesMC._x = _prickles_char_pos[_local9[3]].x;
_local26.end_pricklesMC._y = _prickles_char_pos[_local9[3]].y;
_local26.namePrickleMC._x = _prickles_name_pos[_local9[3]].x;
_local26.namePrickleMC._y = _prickles_name_pos[_local9[3]].y;
_local26.end_croccoMC._x = _crocco_char_pos[_local9[0]].x;
_local26.end_croccoMC._y = _crocco_char_pos[_local9[0]].y;
_local26.nameCroccoMC._x = _crocco_name_pos[_local9[0]].x;
_local26.nameCroccoMC._y = _crocco_name_pos[_local9[0]].y;
_local26.end_gollyMC.gotoAndStop(_local22);
_local26.end_dollyMC.gotoAndStop(_local23);
_local26.end_pricklesMC.gotoAndStop(_local24);
_local26.end_croccoMC.gotoAndStop(_local25);
_local26.nameGollyMC.gotoAndStop((_local3 ? "on" : "off"));
_local26.nameDollyMC.gotoAndStop((_local4 ? "on" : "off"));
_local26.namePrickleMC.gotoAndStop((_local5 ? "on" : "off"));
_local26.nameCroccoMC.gotoAndStop((_local6 ? "on" : "off"));
AddButtonToState(_local26.button_againMC, 3);
_AddStateCleanupHook(standard.Hook.MakeHook(this, _AddStateCleanupHook, null, true));
if (_music_enabled) {
if (_cur_music != null) {
_global.sfx.StopSound(_cur_music);
}
_cur_music = "menu_music";
_global.sfx.PlaySound(_cur_music, 0, 5000);
}
}
function GameOver_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".GameOver_OnMessage(msg:Msg_Object) : ") + msg, "game.FSM_GameBoard::GameOver_OnMessage", "build/as/game/FSM_GameBoard.as", 1720);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("CharacterSelect");
return(true);
}
return(false);
}
function GameOver_OnExit(Void) {
_RunStateCleanupHooks();
}
function toString(Void) {
return("FSM_GameBoard()");
}
var _golly_char_pos = [{x:78, y:47}, {x:176, y:47}, {x:274, y:47}, {x:372, y:47}];
var _golly_name_pos = [{x:103, y:283}, {x:201, y:283}, {x:299, y:283}, {x:397, y:283}];
var _dolly_char_pos = [{x:78, y:47}, {x:176, y:47}, {x:274, y:47}, {x:372, y:47}];
var _dolly_name_pos = [{x:103, y:283}, {x:201, y:283}, {x:299, y:283}, {x:397, y:283}];
var _prickles_char_pos = [{x:78, y:47}, {x:176, y:47}, {x:274, y:47}, {x:372, y:47}];
var _prickles_name_pos = [{x:90, y:283}, {x:188, y:283}, {x:286, y:283}, {x:384, y:283}];
var _crocco_char_pos = [{x:76, y:47}, {x:174, y:47}, {x:272, y:47}, {x:370, y:47}];
var _crocco_name_pos = [{x:95, y:286}, {x:193, y:286}, {x:291, y:286}, {x:389, y:286}];
}
Symbol 20485 MovieClip [__Packages.standard.gameobject.Static_GameObject] Frame 0
class standard.gameobject.Static_GameObject extends standard.gameobject.GameObject
{
var _height, _width, _half_width, _half_height, _x, _y;
function Static_GameObject (x, y) {
super();
_height = (_width = (_half_width = (_half_height = 0)));
if (x == null) {
_x = 0;
} else {
_x = x;
}
if (y == null) {
_y = 0;
} else {
_y = y;
}
}
function Cleanup(Void) {
super.Cleanup();
}
function Create_MC(Void) {
standard.debug.Tracer.myTrace((((("*** ERROR ***: " + "This function is deprecated") + ": ") + "/home/astro/projects/client/cn/reanimated/app/src/as/standard/gameobject/Static_GameObject.as") + ":") + 46, "standard.gameobject.Static_GameObject::Create_MC", "build/as/standard/gameobject/Static_GameObject.as", 48);
}
function Get_MC(Void) {
standard.debug.Tracer.myTrace((((("*** ERROR ***: " + "This function is deprecated") + ": ") + "/home/astro/projects/client/cn/reanimated/app/src/as/standard/gameobject/Static_GameObject.as") + ":") + 50, "standard.gameobject.Static_GameObject::Get_MC", "build/as/standard/gameobject/Static_GameObject.as", 52);
}
function Show(Void) {
standard.debug.Tracer.myTrace((((("*** ERROR ***: " + "This function is deprecated") + ": ") + "/home/astro/projects/client/cn/reanimated/app/src/as/standard/gameobject/Static_GameObject.as") + ":") + 54, "standard.gameobject.Static_GameObject::Show", "build/as/standard/gameobject/Static_GameObject.as", 56);
}
function Hide(Void) {
standard.debug.Tracer.myTrace((((("*** ERROR ***: " + "This function is deprecated") + ": ") + "/home/astro/projects/client/cn/reanimated/app/src/as/standard/gameobject/Static_GameObject.as") + ":") + 58, "standard.gameobject.Static_GameObject::Hide", "build/as/standard/gameobject/Static_GameObject.as", 60);
}
function Draw(Void) {
standard.debug.Tracer.myTrace((((("*** ERROR ***: " + "This function is deprecated") + ": ") + "/home/astro/projects/client/cn/reanimated/app/src/as/standard/gameobject/Static_GameObject.as") + ":") + 62, "standard.gameobject.Static_GameObject::Draw", "build/as/standard/gameobject/Static_GameObject.as", 64);
}
function SetWidth(w) {
_width = w;
_half_width = w / 2;
}
function SetHeight(h) {
_height = h;
_half_height = h / 2;
}
function Set_Dimensions(w, h) {
_width = w;
_half_width = w / 2;
_height = h;
_half_height = h / 2;
}
function GetBounds(Void) {
return(new standard.geometry.Rect(_x, _y, _x + _width, _y + _height));
}
function Get_X(Void) {
return(_x);
}
function Get_Y(Void) {
return(_y);
}
function Get_CX(Void) {
return(_x + _half_width);
}
function Get_CY(Void) {
return(_y + _half_height);
}
function Get_XMax(Void) {
return(_x + _width);
}
function Get_YMax(Void) {
return(_y + _height);
}
function Get_Width(Void) {
return(_width);
}
function Get_Half_Width(Void) {
return(_half_width);
}
function Get_Height(Void) {
return(_height);
}
function Get_Half_Height(Void) {
return(_half_height);
}
function MoveTo(x, y) {
standard.debug.Tracer.myTrace((((this + ".MoveTo(x:Number, y:Number) : ") + x) + ", ") + y, "standard.gameobject.Static_GameObject::MoveTo", "build/as/standard/gameobject/Static_GameObject.as", 138);
_x = x;
_y = y;
}
function MoveBy(x, y) {
_x = _x + x;
_y = _y + y;
}
function UpdatePosition(Void) {
standard.debug.Tracer.myTrace("WARNING: This function is deprecated. Use Draw() instead.", "standard.gameobject.Static_GameObject::UpdatePosition", "build/as/standard/gameobject/Static_GameObject.as", 156);
standard.debug.Tracer.myTrace(("\t" + this) + ".UpdatePosition(Void)", "standard.gameobject.Static_GameObject::UpdatePosition", "build/as/standard/gameobject/Static_GameObject.as", 157);
Draw();
}
function Set_Position(x, y) {
standard.debug.Tracer.myTrace("WARNING: This function is deprecated. Use MoveTo() instead.", "standard.gameobject.Static_GameObject::Set_Position", "build/as/standard/gameobject/Static_GameObject.as", 164);
standard.debug.Tracer.myTrace((((this + ".Set_Position(x:Number,y:Number) : ") + x) + ",") + y, "standard.gameobject.Static_GameObject::Set_Position", "build/as/standard/gameobject/Static_GameObject.as", 165);
MoveTo(x, y);
}
function toString(Void) {
return("Static_GameObject()");
}
var Initialize = standard.gameobject.Static_GameObject;
}
Symbol 20486 MovieClip [__Packages.standard.gameobject.Moving_GameObject] Frame 0
class standard.gameobject.Moving_GameObject extends standard.gameobject.Static_GameObject
{
var _vel, MoveBy, _x, _y, _width, _height, Draw;
function Moving_GameObject (x, y) {
super(x, y);
_vel = {x:0, y:0};
}
function SetVel(x, y) {
if (x != null) {
_vel.x = x;
}
if (y != null) {
_vel.y = y;
}
}
function AdjustVel(x, y) {
if (x != null) {
_vel.x = _vel.x + x;
}
if (y != null) {
_vel.y = _vel.y + y;
}
}
function Get_VX(Void) {
return(_vel.x);
}
function Get_VY(Void) {
return(_vel.y);
}
function UpdatePosition(Void) {
MoveBy(_vel.x, _vel.y);
}
function GetBounds(Void) {
return(new standard.geometry.Rect(_x, _y, _x + _width, _y + _height));
}
function Update(Void) {
UpdatePosition();
Draw();
}
function toString(Void) {
return("Moving_GameObject()");
}
var Initialize = standard.gameobject.Moving_GameObject;
}
Symbol 20487 MovieClip [__Packages.game.G_Moving_GameObject] Frame 0
class game.G_Moving_GameObject extends standard.gameobject.Moving_GameObject
{
var _radius, Add_Cleanup_Hook, Run_Cleanup_Hooks, _ax, _ay, _vx, _vy, _px, _py, _initialized, _keyed_db, _sprite_controller, SetStateMachine, _mc, _vel, _x, _y;
function G_Moving_GameObject (x, y, r) {
super(x, y);
_radius = r;
var _local6 = [];
Add_Cleanup_Hook = standard.Hook.MakeAddHookFunc(_local6);
Run_Cleanup_Hooks = standard.Hook.MakeRunHooksFunc(_local6);
_ax = 0;
_ay = 0;
_vx = new game.Value(0, null);
_vy = new game.Value(0, null);
_px = new game.Value(x, null);
_py = new game.Value(y, null);
if (_initialized == null) {
_initialized = true;
_keyed_db = standard.container.Keyed_Database.Instance();
_sprite_controller = new standard.SpriteController();
var _local7 = new standard.StateMachine_Mixin(this);
AddStates(this);
SetStateMachine(this);
}
}
function Cleanup() {
standard.debug.Tracer.myTrace(this + ".Cleanup()", "game.G_Moving_GameObject::Cleanup", "build/as/game/G_Moving_GameObject.as", 63);
super.Cleanup();
_keyed_db.Remove(this);
Run_Cleanup_Hooks();
}
function Get_X(Void) {
return(_px.GetVal());
}
function Get_Y(Void) {
return(_py.GetVal());
}
function Get_VX(Void) {
return(_vx.GetVal());
}
function Get_VY(Void) {
return(_vy.GetVal());
}
function SetAnimationKey(oKey) {
_sprite_controller.SetKey(oKey);
}
function PlayAnimation(sName) {
_mc.gotoAndStop(_sprite_controller.PlayAnimation(sName));
}
function UpdateAnimation(Void) {
var _local3 = _sprite_controller.Update();
_mc.gotoAndStop(_local3);
}
static function MakeMsgFunc(sending_fsm, msg_type, delay, data) {
if (delay == null) {
delay = 0;
}
var _local2 = function () {
sending_fsm.SendDelayedMsgToMe(delay, msg_type, 1, data);
};
return(_local2);
}
function Get_Radius(Void) {
return(_radius);
}
function AddStates(fsm) {
}
function UpdateVelocity(Void) {
_vel.x = _vx.AdjustVal(_ax);
_vel.y = _vy.AdjustVal(_ay);
}
function UpdatePosition(Void) {
var _local3 = _vx.GetVal();
_x = _px.AdjustVal(_local3);
var _local4 = _vy.GetVal();
_y = _py.AdjustVal(_local4);
}
function toString(Void) {
return("G_Moving_GameObject()");
}
var Initialize = game.G_Moving_GameObject;
}
Symbol 20488 MovieClip [__Packages.game.Avatar] Frame 0
class game.Avatar extends game.G_Moving_GameObject
{
var _state_flags, _duck_delay, _avatar_index, _reload_delay, _pie_speed, _animation_frames, _throw_height, _duck_height, _mouth_min, _mouth_max, _mc_mixin_cleanup, _ammo, _y, _blackboard, _cur_platform, _vx, _vy, _map, _sprite_controller, _last_animation_state, _mc, _height, _half_width, _x, _ax, _px, _jump_steps, _py, _ay, _unduck_msg, SendDelayedMsgToMe, SendMsg, CancelDelayedMsg, SetVel, SetState, UpdateVelocity, _keyed_db;
function Avatar (x, y, r, avatar_index, reload_delay, pie_speed) {
super(x, y, r);
_state_flags = 0;
_duck_delay = 10;
_avatar_index = avatar_index;
_reload_delay = reload_delay;
_pie_speed = pie_speed;
_animation_frames = GetFrames(avatar_index);
switch (_avatar_index) {
case 1 :
_throw_height = -34;
_duck_height = 18;
break;
case 2 :
_throw_height = -34;
_duck_height = 18;
break;
case 3 :
_throw_height = -34;
_duck_height = 18;
break;
case 0 :
_throw_height = -34;
_duck_height = 56;
_mouth_min = -37;
_mouth_max = -18;
}
}
function Cleanup(Void) {
standard.debug.Tracer.myTrace(this + ".Cleanup(Void)", "game.Avatar::Cleanup", "build/as/game/Avatar.as", 92);
super.Cleanup();
_mc_mixin_cleanup();
}
function AddAmmo(ammo) {
_ammo = ammo;
}
function GetAvatarIndex(Void) {
return(_avatar_index);
}
function CanEatPie(pie_bounds, pie_vx) {
if (_avatar_index == 0) {
if (_state_flags & 64) {
var _local4 = _state_flags & 1;
if (((pie_vx > 0) && (_local4)) || ((pie_vx < 0) && (!_local4))) {
if ((pie_bounds.y1 >= (_y + _mouth_min)) && (pie_bounds.y2 <= (_y + _mouth_max))) {
standard.debug.Tracer.myTrace("Can eat pie.", "game.Avatar::CanEatPie", "build/as/game/Avatar.as", 122);
return(true);
}
standard.debug.Tracer.myTrace("\tDoesn't fit in our mouth.", "game.Avatar::CanEatPie", "build/as/game/Avatar.as", 126);
standard.debug.Tracer.myTrace("mouth_min: " + (_y + _mouth_min), "game.Avatar::CanEatPie", "build/as/game/Avatar.as", 127);
standard.debug.Tracer.myTrace("mouth_max: " + (_y + _mouth_max), "game.Avatar::CanEatPie", "build/as/game/Avatar.as", 128);
} else {
standard.debug.Tracer.myTrace("\tFacing wrong way.", "game.Avatar::CanEatPie", "build/as/game/Avatar.as", 132);
}
}
}
return(false);
}
function ShouldEatPie(pie_bounds, pie_vx) {
if (_avatar_index == 0) {
var _local4 = _state_flags & 1;
if (((pie_vx > 0) && (_local4)) || ((pie_vx < 0) && (!_local4))) {
if ((pie_bounds.y1 >= (_y + _mouth_min)) && (pie_bounds.y2 <= (_y + _mouth_max))) {
standard.debug.Tracer.myTrace("Can eat pie.", "game.Avatar::ShouldEatPie", "build/as/game/Avatar.as", 153);
return(true);
}
standard.debug.Tracer.myTrace("\tDoesn't fit in our mouth.", "game.Avatar::ShouldEatPie", "build/as/game/Avatar.as", 157);
standard.debug.Tracer.myTrace("mouth_min: " + (_y + _mouth_min), "game.Avatar::ShouldEatPie", "build/as/game/Avatar.as", 158);
standard.debug.Tracer.myTrace("mouth_max: " + (_y + _mouth_max), "game.Avatar::ShouldEatPie", "build/as/game/Avatar.as", 159);
} else {
standard.debug.Tracer.myTrace("\tFacing wrong way.", "game.Avatar::ShouldEatPie", "build/as/game/Avatar.as", 163);
}
}
return(false);
}
function SetBlackboard(bb) {
_blackboard = bb;
}
function GetCurrentPlatform(Void) {
return(_cur_platform);
}
function FindCurrentPlatform(bounds) {
var _local3 = bounds.y2;
var _local4 = bounds.x1;
var _local5 = bounds.x2;
var _local8 = _vx.GetVal();
var _local9 = _vy.GetVal();
var _local10 = _map;
var _local12 = 0;
for ( ; _local12 < _local10.length ; _local12++) {
var _local13 = _local10[_local12];
var _local6 = _local4;
var _local7 = _local5;
if (_local13.y >= _local3) {
var _local14 = _local13.y - _local3;
if ((_local9 > 0) && ((_local14 <= _local9) && (_local8 != 0))) {
var _local15 = _local8;
_local6 = _local6 + _local15;
_local7 = _local7 + _local15;
}
if ((_local13.x1 <= _local7) && (_local13.x2 >= _local6)) {
var _local11 = _local13;
break;
}
}
}
return(_local11);
}
function FindMoveToInterval(interval, vx, x) {
var _local5 = interval.move_data[vx];
var _local6 = _local5.length;
if (_local6 > 0) {
var _local7 = null;
while (_local6--) {
var _local8 = _local5[_local6];
if ((x >= _local8.x1) && (x <= _local8.x2)) {
_local7 = _local8;
break;
}
}
return(_local7);
}
return(null);
}
function GetPathToInterval(interval, vx, x) {
var _local5 = [];
var _local6 = 0;
var _local7 = x;
var _local8 = FindMoveToInterval(interval, vx, x);
if (_local8 != null) {
var _local9 = _local8.steps;
while (_local9--) {
_local6 = _local8.ax;
vx = vx + _local6;
if (vx > 8) {
vx = 8;
} else if (vx < -8) {
vx = -8;
}
x = x + vx;
_local8 = FindMoveToInterval(interval, vx, x);
_local5.push({ax:_local6, vx:vx, x:x - _local7});
}
}
_local5.reverse();
return(_local5);
}
function SetMap(map) {
standard.debug.Tracer.myTrace((this + ".SetMap(map:Array) : ") + map, "game.Avatar::SetMap", "build/as/game/Avatar.as", 316);
_map = map;
_cur_platform = FindCurrentPlatform(GetStaticBounds());
}
function GetFrames(avatar_index) {
standard.debug.Tracer.myTrace((this + ".GetFrames(avatar_index:Number) : ") + avatar_index, "game.Avatar::GetFrames", "build/as/game/Avatar.as", 325);
switch (avatar_index) {
case 3 :
var _local3 = {idle_right:{loop:true, start:1, end:32}, idle_left:{loop:true, start:33, end:64}, idle_throw_right:{loop:false, start:65, end:75}, idle_throw_left:{loop:false, start:79, end:89}, run_right:{loop:true, start:90, end:101}, run_left:{loop:true, start:102, end:113}, run_throw_right:{loop:false, start:114, end:125}, run_throw_left:{loop:false, start:126, end:137}, jump_right:{loop:false, start:138, end:149}, jump_left:{loop:false, start:150, end:161}, jump_throw_right:{loop:false, start:162, end:176}, jump_throw_left:{loop:false, start:177, end:191}, duck_right:{loop:false, start:192, end:201}, duck_left:{loop:false, start:202, end:211}};
break;
case 0 :
_local3 = {idle_right:{loop:true, start:1, end:32}, idle_left:{loop:true, start:33, end:64}, idle_throw_right:{loop:false, start:65, end:76}, idle_throw_left:{loop:false, start:85, end:96}, run_right:{loop:true, start:105, end:120}, run_left:{loop:true, start:121, end:135}, run_throw_right:{loop:false, start:136, end:147}, run_throw_left:{loop:false, start:151, end:162}, jump_right:{loop:false, start:166, end:173}, jump_left:{loop:false, start:174, end:181}, jump_throw_right:{loop:false, start:182, end:193}, jump_throw_left:{loop:false, start:197, end:208}, duck_right:{loop:false, start:212, end:221}, duck_left:{loop:false, start:222, end:231}, chew_right:{loop:false, start:232, end:243}, chew_left:{loop:false, start:244, end:255}};
break;
case 1 :
case 2 :
_local3 = {idle_right:{loop:true, start:1, end:32}, idle_left:{loop:true, start:33, end:64}, idle_throw_right:{loop:false, start:65, end:76}, idle_throw_left:{loop:false, start:85, end:96}, run_right:{loop:true, start:105, end:116}, run_left:{loop:true, start:117, end:128}, run_throw_right:{loop:false, start:129, end:140}, run_throw_left:{loop:false, start:141, end:152}, jump_right:{loop:false, start:153, end:160}, jump_left:{loop:false, start:161, end:168}, jump_throw_right:{loop:false, start:169, end:180}, jump_throw_left:{loop:false, start:181, end:192}, duck_right:{loop:false, start:196, end:205}, duck_left:{loop:false, start:206, end:215}};
}
return(_local3);
}
function PlayAnimation2(Void) {
var _local3 = "";
if (_state_flags & 64) {
_local3 = _local3 + "duck";
} else if (_state_flags & (8 | 16)) {
_local3 = _local3 + "jump";
} else if (_state_flags & 32768) {
_local3 = _local3 + "chew";
} else if (_state_flags & 2) {
_local3 = _local3 + "run";
} else {
_local3 = _local3 + "idle";
}
if (_state_flags & 32) {
_local3 = _local3 + "_throw";
}
if (_state_flags & 1) {
_local3 = _local3 + "_left";
} else {
_local3 = _local3 + "_right";
}
var _local4 = _sprite_controller.GetCurrentAnimation();
if (_local3 != _local4) {
if ((_last_animation_state & 32) && (_state_flags & 32)) {
var _local5 = _animation_frames[_local4].start;
var _local6 = _sprite_controller.GetCurrentFrame();
var _local7 = (_local6 - _local5) + 1;
_mc.gotoAndStop(_sprite_controller.PlayAnimation(_local3, false, _local7));
} else {
_mc.gotoAndStop(_sprite_controller.PlayAnimation(_local3));
}
_last_animation_state = _state_flags;
} else {
_mc.gotoAndStop(_sprite_controller.Update());
}
}
function GetBounds(Void) {
switch (_avatar_index) {
case 0 :
case 1 :
case 2 :
case 3 :
if (_state_flags & 64) {
var _local3 = _duck_height;
} else {
var _local3 = _height;
}
}
var _local4 = _vx.GetVal();
if (_local4 > 0) {
return(new standard.geometry.Rect(_x - _half_width, _y - _local3, (_x + _half_width) + _local4, _y));
}
return(new standard.geometry.Rect((_x - _half_width) + _local4, _y - _local3, _x + _half_width, _y));
}
function GetStaticBounds(Void) {
switch (_avatar_index) {
case 0 :
case 1 :
case 2 :
case 3 :
if (_state_flags & 64) {
var _local3 = _duck_height;
} else {
var _local3 = _height;
}
}
return(new standard.geometry.Rect(_x - _half_width, _y - _local3, _x + _half_width, _y));
}
function FaceLeft(Void) {
_state_flags = _state_flags | 1;
}
function FaceRight(Void) {
_state_flags = _state_flags | 1;
_state_flags = _state_flags ^ 1;
}
function Move(Void) {
_state_flags = _state_flags | 2;
_state_flags = _state_flags | 4;
_state_flags = _state_flags ^ 4;
if (_state_flags & 1) {
_ax = -1;
_vx.SetGoal(-8);
} else {
_ax = 1;
_vx.SetGoal(8);
}
}
function Brake(Void) {
_state_flags = _state_flags | 4;
_vx.SetGoal(0);
if (_state_flags & (8 | 16)) {
_ax = 0;
} else if (_vx.GetVal() > 0) {
_ax = -1;
} else {
_ax = 1;
}
}
function Stop(Void) {
var _local3 = _vx.GetVal();
_vx.SetVal(0);
if (((_local3 > 0) && (_state_flags & 1)) || ((_local3 < 0) && (!(_state_flags & 1)))) {
Move();
} else {
_state_flags = _state_flags | 2;
_state_flags = _state_flags ^ 2;
_state_flags = _state_flags | 4;
_state_flags = _state_flags ^ 4;
_ax = 0;
_vx.SetGoal();
_px.SetGoal();
}
}
function Jump(Void) {
_jump_steps = 0;
_state_flags = _state_flags | 8;
var _local3 = _vx.GetVal();
if ((_local3 == 8) || (_local3 == -8)) {
var _local4 = _vy.SetVal(-14);
} else {
var _local5 = _vy.SetVal(-12);
}
if (_state_flags & 4) {
_ax = 0;
}
_py.SetGoal(null);
_global.sfx.PlayKeyedSound(1);
}
function Fall(Void) {
_state_flags = _state_flags | 8;
_state_flags = _state_flags ^ 8;
_state_flags = _state_flags | 16;
if (_state_flags & 4) {
_ax = 0;
}
_ay = 2;
_vy.SetGoal(18);
_py.AddGoalHook(standard.Hook.MakeHook(this, Land), true);
}
function Land(Void) {
_state_flags = _state_flags | 16;
_state_flags = _state_flags ^ 16;
_ay = 0;
_vy.SetGoal(null);
var _local3 = _vy.SetVal(0);
_py.SetGoal(null);
_py.AddGoalHook(null, true);
if (_state_flags & 2048) {
Duck();
} else if (!(_state_flags & (256 | 512))) {
Brake();
}
_global.sfx.PlayKeyedSound(16);
}
function Duck(Void) {
_state_flags = _state_flags | 64;
Brake();
_unduck_msg = SendDelayedMsgToMe(_duck_delay, 16);
}
function Unduck(Void) {
_state_flags = _state_flags | 64;
_state_flags = _state_flags ^ 64;
if (_state_flags & (256 | 512)) {
Move();
}
}
function DropDown(Void) {
if (_cur_platform.canDrop) {
_y++;
Fall();
Unduck();
}
}
function Throw(Void) {
if (_ammo.length > 0) {
_state_flags = _state_flags | (32 | 8192);
_sprite_controller.AddAnimationCompleteHook(standard.Hook.MakeHook(this, Unthrow), true);
SendDelayedMsgToMe(5, 18);
_global.sfx.PlayKeyedSound(8);
}
}
function GetLaunchData(Void) {
var _local3 = {x:null, y:_y + _throw_height, vx:null, vy:0};
if (_state_flags & 1) {
var _local4 = -_pie_speed;
_local3.vx = _local4;
_local3.x = ((_x - _half_width) + _local4) - 12;
} else {
var _local5 = _pie_speed;
_local3.vx = _local5;
_local3.x = (_x + _half_width) + _local5;
}
return(_local3);
}
function Launch(Void) {
var _local3 = _ammo.pop();
var _local4 = GetLaunchData();
SendMsg(18, _local3.GetID(), _local4);
SendDelayedMsgToMe(_reload_delay, 19);
}
function Unthrow(Void) {
_state_flags = _state_flags | 32;
_state_flags = _state_flags ^ 32;
_sprite_controller.AddAnimationCompleteHook(null, true);
if ((_state_flags & 2048) && (!(_state_flags & (8 | 16)))) {
Duck();
}
}
function Pickup(obj) {
_ammo.push(obj);
}
function Reload(Void) {
_state_flags = _state_flags | 8192;
_state_flags = _state_flags ^ 8192;
}
function UpdatePositionGoalX(Void) {
var _local3 = _vx.GetVal();
if (_local3 > 0) {
var _local4 = 590 - _half_width;
} else if (_local3 < 0) {
var _local4 = 10 + _half_width;
} else {
var _local4 = null;
}
_px.SetGoal(_local4);
}
function UpdatePositionGoalY(Void) {
if (_vy.GetVal() >= 0) {
_py.SetGoal(_cur_platform.y);
}
}
function Chew(Void) {
CancelDelayedMsg(_unduck_msg);
_state_flags = _state_flags | 64;
_state_flags = _state_flags ^ 64;
_state_flags = _state_flags | 32768;
_sprite_controller.AddAnimationCompleteHook(standard.Hook.MakeHook(this, Unchew), true);
_global.sfx.PlaySound("gulp");
}
function Unchew(Void) {
_state_flags = _state_flags | 32768;
_state_flags = _state_flags ^ 32768;
_sprite_controller.AddAnimationCompleteHook(null, true);
if (_state_flags & (256 | 512)) {
Move();
}
}
function Unhit(Void) {
_state_flags = _state_flags | 16384;
_state_flags = _state_flags ^ 16384;
}
function Global_OnMessage(msg) {
return(false);
}
function Initialize_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Initialize_OnEnter(Void)", "game.Avatar::Initialize_OnEnter", "build/as/game/Avatar.as", 810);
_ax = 0;
_ay = 0;
SetVel(0, 0);
_px.AddGoalHook(standard.Hook.MakeHook(this, Stop), true);
}
function Initialize_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Initialize_OnMessage(msg:Msg_Object) : ") + msg, "game.Avatar::Initialize_OnMessage", "build/as/game/Avatar.as", 820);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Move");
return(true);
}
return(false);
}
function Move_OnEnter(Void) {
}
function Move_OnMessage(msg) {
switch (msg.GetMsgName()) {
case 9 :
_state_flags = _state_flags | 256;
FaceLeft();
if (!(_state_flags & (64 | 32768))) {
Move();
}
return(true);
case 10 :
_state_flags = _state_flags | 256;
_state_flags = _state_flags ^ 256;
if (_state_flags & 512) {
if (_state_flags & 1) {
FaceRight();
Move();
}
} else if (!(_state_flags & (64 | 32768))) {
Brake();
}
return(true);
case 11 :
_state_flags = _state_flags | 512;
FaceRight();
if (!(_state_flags & (64 | 32768))) {
Move();
}
return(true);
case 12 :
_state_flags = _state_flags | 512;
_state_flags = _state_flags ^ 512;
if (_state_flags & 256) {
if (!(_state_flags & 1)) {
FaceLeft();
Move();
}
} else if (!(_state_flags & (64 | 32768))) {
Brake();
}
return(true);
case 5 :
_state_flags = _state_flags | 1024;
if (_state_flags & 2048) {
DropDown();
} else if (!(_state_flags & (((8 | 16) | 64) | 32768))) {
Jump();
}
return(true);
case 6 :
_state_flags = _state_flags | 1024;
_state_flags = _state_flags ^ 1024;
if (_state_flags & 8) {
Fall();
}
return(true);
case 7 :
_state_flags = _state_flags | 2048;
if (!(_state_flags & (((8 | 16) | 32) | 32768))) {
Duck();
}
return(true);
case 8 :
_state_flags = _state_flags | 2048;
_state_flags = _state_flags ^ 2048;
if (_state_flags & 64) {
CancelDelayedMsg(_unduck_msg);
Unduck();
}
return(true);
case 16 :
if (_state_flags & 64) {
Unduck();
}
return(true);
case 13 :
_state_flags = _state_flags | 4096;
if (!(_state_flags & ((8192 | 64) | 32768))) {
Throw();
}
return(true);
case 14 :
_state_flags = _state_flags | 4096;
_state_flags = _state_flags ^ 4096;
return(true);
case 15 :
var _local3 = msg.GetData();
Pickup(_local3.item);
return(true);
case 19 :
Reload();
return(true);
case 18 :
Launch();
return(true);
case 17 :
return(true);
case 21 :
Unhit();
return(true);
case 26 :
SetState("Dead");
return(true);
case 28 :
Chew();
return(true);
}
return(false);
}
function Move_OnUpdate(Void) {
var _local3 = _vx.GetVal();
if ((_local3 == 0) && ((_state_flags & 2) && (!(_state_flags & (256 | 512))))) {
Stop();
}
if (_state_flags & 8) {
_jump_steps++;
if (_jump_steps > 5) {
Fall();
}
}
UpdateVelocity();
var _local4 = _cur_platform;
_cur_platform = FindCurrentPlatform(GetStaticBounds());
if ((!(_state_flags & (8 | 16))) && (_cur_platform != _local4)) {
Fall();
}
UpdatePositionGoalX();
UpdatePositionGoalY();
PlayAnimation2();
return(true);
}
function Dead_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Dead_OnEnter(Void)", "game.Avatar::Dead_OnEnter", "build/as/game/Avatar.as", 1017);
_keyed_db.Change(this, 2, 4);
SendDelayedMsgToMe(12, 3);
}
function Dead_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
Cleanup();
return(true);
}
return(false);
}
function Dead_OnUpdate(Void) {
return(true);
}
function toString(Void) {
return("Avatar()");
}
var Initialize = game.Avatar;
static var _approach_table = [[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0]]];
}
Symbol 20489 MovieClip [__Packages.game.Hero2] Frame 0
class game.Hero2 extends game.Avatar
{
var _hero_initialized, GetFrames, SetAnimationKey, Start, _fsm, AddState, Global_OnMessage, Initialize_OnEnter, Initialize_OnMessage, Move_OnEnter, Move_OnMessage, Move_OnUpdate, Dead_OnEnter, Dead_OnMessage, Dead_OnUpdate, _id;
function Hero2 (x, y, r, avatar_index, reload_delay, pie_speed) {
super(x, y, r, avatar_index, reload_delay, pie_speed);
if (_hero_initialized == null) {
_hero_initialized = true;
var _local9 = GetFrames(avatar_index);
SetAnimationKey(_local9);
}
Start();
}
function SetKeys(up, down, left, right, special) {
_global.keystack.AddKeyEvents(up, game.G_Moving_GameObject.MakeMsgFunc(_fsm, 5), game.G_Moving_GameObject.MakeMsgFunc(_fsm, 6));
_global.keystack.AddKeyEvents(down, game.G_Moving_GameObject.MakeMsgFunc(_fsm, 7), game.G_Moving_GameObject.MakeMsgFunc(_fsm, 8));
_global.keystack.AddKeyEvents(left, game.G_Moving_GameObject.MakeMsgFunc(_fsm, 9), game.G_Moving_GameObject.MakeMsgFunc(_fsm, 10));
_global.keystack.AddKeyEvents(right, game.G_Moving_GameObject.MakeMsgFunc(_fsm, 11), game.G_Moving_GameObject.MakeMsgFunc(_fsm, 12));
_global.keystack.AddKeyEvents(special, game.G_Moving_GameObject.MakeMsgFunc(_fsm, 13), game.G_Moving_GameObject.MakeMsgFunc(_fsm, 14));
}
function AddStates(Void) {
AddState("Global", null, Global_OnMessage, null, null);
AddState("Initialize", Initialize_OnEnter, Initialize_OnMessage, null, null);
AddState("Move", Move_OnEnter, Move_OnMessage, Move_OnUpdate, null);
AddState("Dead", Dead_OnEnter, Dead_OnMessage, Dead_OnUpdate, null);
}
function toString(Void) {
return(("Hero2(" + _id) + ")");
}
var Initialize = game.Hero2;
}
Symbol 20490 MovieClip [__Packages.standard.Timer] Frame 0
class standard.Timer extends standard.gameobject.GameObject
{
var _keyed_db, SetStateMachine, Start, AddState, _time_limit, _timeup_func, _tick_func, _tick_interval, _mc, _fsm, SetState, _last_tick;
function Timer () {
super();
_keyed_db = standard.container.Keyed_Database.Instance();
var _local3 = new standard.StateMachine_Mixin(this);
AddStates(this);
SetStateMachine(this);
Start();
}
function AddStates(Void) {
AddState("Global", null, null, null, null);
AddState("Initialize", Initialize_OnEnter, null, null, null);
AddState("Paused", Paused_OnEnter, Paused_OnMessage, null, Paused_OnExit);
AddState("Running", Running_OnEnter, Running_OnMessage, Running_OnUpdate, Running_OnExit);
AddState("Expired", Expired_OnEnter, Expired_OnMessage, Expired_OnUpdate, Expired_OnExit);
}
function SetTimeLimit(t) {
standard.debug.Tracer.myTrace((this + ".SetTimeLimit(t:Number) : ") + t, "standard.Timer::SetTimeLimit", "build/as/standard/Timer.as", 71);
_time_limit = t;
}
function AddTimeupFunc(f) {
standard.debug.Tracer.myTrace((this + ".AddTimeupFunc(f:Function) : ") + f, "standard.Timer::AddTimeupFunc", "build/as/standard/Timer.as", 78);
_timeup_func = f;
}
function AddTimerTickFunc(f, i) {
standard.debug.Tracer.myTrace((((this + ".AddTimerTickFunc(f:Function,i:Number) : ") + f) + ", ") + i, "standard.Timer::AddTimerTickFunc", "build/as/standard/Timer.as", 85);
_tick_func = f;
_tick_interval = i;
}
function SetMC(mc) {
standard.debug.Tracer.myTrace((this + ".SetMC(mc:MovieClip) : ") + mc, "standard.Timer::SetMC", "build/as/standard/Timer.as", 93);
_mc = mc;
}
static function MakeTimerMsgFunc(sending_fsm, receiver_id, msg_type) {
var _local2 = function (t) {
sending_fsm.SendMsg(msg_type, receiver_id, {time:t});
};
return(_local2);
}
function Activate(Void) {
_keyed_db.Change(_fsm, 16, 8);
}
function Deactivate(Void) {
_keyed_db.Change(_fsm, 8, 16);
}
function Initialize_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Initialize_OnEnter(Void)", "standard.Timer::Initialize_OnEnter", "build/as/standard/Timer.as", 126);
_fsm.SetState("Paused");
}
function Paused_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Paused_OnEnter(Void)", "standard.Timer::Paused_OnEnter", "build/as/standard/Timer.as", 135);
}
function Paused_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Paused_OnMessage(msg:Msg_Object) : ") + msg, "standard.Timer::Paused_OnMessage", "build/as/standard/Timer.as", 141);
if (!(msg.GetMsgName() === 24)) {
} else {
SetState("Running");
return(true);
}
return(false);
}
function Paused_OnExit(Void) {
}
function Running_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Running_OnEnter(Void)", "standard.Timer::Running_OnEnter", "build/as/standard/Timer.as", 160);
ShowTime(0);
_last_tick = 0;
Activate();
}
function Running_OnMessage(msg) {
switch (msg.GetMsgName()) {
case 25 :
SetState("Paused");
return(true);
case 23 :
var _local3 = msg.GetData().time;
ShowTime(_local3);
return(true);
}
return(false);
}
function Running_OnUpdate(Void) {
var _local3 = _fsm.GetTimeInState();
ShowTime(_local3);
var _local4 = _local3 - _last_tick;
if (_local4 >= _tick_interval) {
_last_tick = _local3;
_tick_func(_local3);
}
if (_local3 >= _time_limit) {
standard.debug.Tracer.myTrace("*** timesup ***", "standard.Timer::Running_OnUpdate", "build/as/standard/Timer.as", 202);
SetState("Expired");
}
return(true);
}
function Running_OnExit(Void) {
Deactivate();
}
function ShowTime(t) {
}
function Expired_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Expired_OnEnter(Void)", "standard.Timer::Expired_OnEnter", "build/as/standard/Timer.as", 229);
Activate();
standard.debug.Tracer.myTrace("timesup: calling timeup_func", "standard.Timer::Expired_OnEnter", "build/as/standard/Timer.as", 233);
_timeup_func(_time_limit);
}
function Expired_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Expired_OnMessage(msg:Msg_Object) : ") + msg, "standard.Timer::Expired_OnMessage", "build/as/standard/Timer.as", 239);
if (!(msg.GetMsgName() === 25)) {
} else {
SetState("Paused");
return(true);
}
return(false);
}
function Expired_OnUpdate(Void) {
return(true);
}
function Expired_OnExit(Void) {
Deactivate();
}
function toString(Void) {
return("Timer()");
}
}
Symbol 20491 MovieClip [__Packages.game.G_Timer] Frame 0
class game.G_Timer extends standard.Timer
{
var _mc, _time_limit;
function G_Timer () {
super();
}
function Hide(Void) {
_mc._visible = false;
}
function Show(Void) {
_mc._visible = true;
}
function ShowTime(t) {
var _local3 = t / _time_limit;
var _local4 = -6 + (_local3 * (233 - -6));
_mc.watchMC._x = _local4;
}
function toString(Void) {
return("G_Timer()");
}
}
Symbol 20492 MovieClip [__Packages.standard.deferred.Deferred] Frame 0
class standard.deferred.Deferred
{
var called, paused, timeoutCall, callbacks, result;
function Deferred () {
called = false;
paused = 0;
timeoutCall = null;
callbacks = [];
}
function passthru(arg) {
return(arg);
}
function addCallbacks(callbackObj, callback, errbackObj, errback, callbackArgs, errbackArgs) {
var _local8 = [[callbackObj, callback, callbackArgs], [errbackObj, errback || (passthru), errbackArgs]];
callbacks.push(_local8);
if (called) {
_runCallbacks();
}
return(this);
}
function addCallback(callbackObj, callback, args) {
return(addCallbacks(callbackObj, callback, null, null, args));
}
function addErrback(errbackObj, errback, args) {
return(addCallbacks(null, passthru, errbackObj, errback, null, args));
}
function addBoth(callbackObj, callback, args) {
return(addCallbacks(callbackObj, callback, callbackObj, callback, args, args));
}
function callback(result) {
_startRunCallbacks(result);
}
function errback(fail) {
if (!(fail instanceof standard.deferred.Failure)) {
fail = new standard.deferred.Failure(fail);
}
_startRunCallbacks(fail);
}
function pause() {
paused++;
}
function unpause(self) {
paused--;
if (paused > 0) {
return(undefined);
}
if (called) {
_runCallbacks();
}
}
function _continue(new_result) {
result = new_result;
unpause();
}
function _startRunCallbacks(new_result) {
if (called) {
}
called = true;
result = new_result;
if (timeoutCall) {
timeoutCall.cancel();
delete timeoutCall;
}
_runCallbacks();
}
function _runCallbacks() {
if (paused == 0) {
var _local2 = callbacks;
callbacks = [];
while (_local2.length > 0) {
var _local6 = _local2.shift();
if (result instanceof standard.deferred.Failure) {
var _local3 = _local6[1][0];
var _local4 = _local6[1][1];
var _local5 = _local6[1][2];
} else {
var _local3 = _local6[0][0];
var _local4 = _local6[0][1];
var _local5 = _local6[0][2];
}
if (_local5 == null) {
var _local5 = [];
}
try {
_local5.unshift(result);
result = _local4.apply(_local3, _local5);
if (result instanceof standard.deferred.Deferred) {
callbacks = _local2;
pause();
result.addBoth(_continue);
}
} catch(_local) {
var e = ( /* Error999 */
);
result = new standard.deferred.Failure();
}
}
}
}
function toString(Void) {
return("Deferred()");
}
function testCB(result, a1, a2, a3) {
standard.debug.Tracer.myTrace((((((((this + ".testCB(result,a1,a2,a3) : ") + result) + ",") + a1) + ",") + a2) + ",") + a3, "standard.deferred.Deferred::testCB", "build/as/standard/deferred/Deferred.as", 248);
return(44);
}
function testCB2(a1) {
standard.debug.Tracer.myTrace((this + ".testCB(a1) : ") + a1, "standard.deferred.Deferred::testCB2", "build/as/standard/deferred/Deferred.as", 255);
}
static function test() {
standard.debug.Tracer.myTrace("Deferred main()", "standard.deferred.Deferred::test", "build/as/standard/deferred/Deferred.as", 260);
var _local2 = new standard.deferred.Deferred();
standard.debug.Tracer.myTrace("d: " + _local2, "standard.deferred.Deferred::test", "build/as/standard/deferred/Deferred.as", 263);
}
}
Symbol 20493 MovieClip [__Packages.standard.Memo] Frame 0
class standard.Memo
{
function Memo () {
}
static function Memoize(obj, func) {
var hash = {};
var _local2 = function () {
var _local2 = arguments.join(",");
var _local3 = hash[_local2];
if (_local3 != null) {
return(_local3);
}
_local3 = func.apply(obj, arguments);
hash[_local2] = _local3;
return(_local3);
};
return(_local2);
}
function toString(Void) {
return("Memo()");
}
}
Symbol 20494 MovieClip [__Packages.game.Value] Frame 0
class game.Value
{
var _cur, _goal, AddGoalHook, RunGoalHooks;
function Value (val, goal) {
_cur = val;
_goal = goal;
var _local4 = [];
AddGoalHook = standard.Hook.MakeAddHookFunc(_local4);
RunGoalHooks = standard.Hook.MakeRunHooksFunc(_local4);
}
function Initialize(Void) {
_cur = null;
_goal = null;
}
function SetGoal(val) {
_goal = val;
}
function GetGoal(Void) {
return(_goal);
}
function SetVal(val) {
if ((_goal != null) && (_cur != null)) {
var _local3 = _goal - _cur;
var _local4 = _goal - val;
if ((_local3 * _local4) <= 0) {
_cur = _goal;
RunGoalHooks();
} else {
_cur = val;
}
} else {
_cur = val;
}
return(_cur);
}
function AdjustVal(val) {
return(SetVal(_cur + val));
}
function GetVal(Void) {
return(_cur);
}
function toString(Void) {
return("Value()");
}
}
Symbol 20495 MovieClip [__Packages.standard.collection.Priority_Queue] Frame 0
class standard.collection.Priority_Queue
{
function Priority_Queue () {
}
static function Heapify(A, i, heap_size, prop) {
var _local9 = false;
while (!_local9) {
var _local6 = (i << 1) + 1;
var _local7 = (i << 1) + 2;
if ((_local6 < heap_size) && (A[_local6][prop] < A[i][prop])) {
var _local8 = _local6;
} else {
var _local8 = i;
}
if ((_local7 < heap_size) && (A[_local7][prop] < A[_local8][prop])) {
var _local8 = _local7;
}
if (_local8 != i) {
var _local10 = A[i];
A[i] = A[_local8];
A[_local8] = _local10;
i = _local8;
} else {
_local9 = true;
}
}
}
static function Build_Heap(A, prop) {
var _local4 = A.length >> 1;
while (_local4--) {
Heapify(A, _local4, A.length, prop);
}
}
static function Heapsort(A, prop) {
Build_Heap(A, prop);
var _local4 = A.length;
var _local5 = A.length;
while (_local4-- , _local4) {
var _local6 = A[_local4];
A[_local4] = A[0];
A[0] = _local6;
_local5--;
Heapify(A, 0, _local5, prop);
}
}
static function Extract_Min(A, prop) {
var _local4 = A[0];
A[0] = A[A.length - 1];
A.pop();
Heapify(A, 0, A.length, prop);
return(_local4);
}
static function Insert(A, key, prop) {
var _local5 = A.length;
var _local6 = key[prop];
while (_local5 > 0) {
var _local7 = (_local5 - 1) >> 1;
if (A[_local7][prop] > _local6) {
A[_local5] = A[_local7];
_local5 = _local7;
} else {
break;
}
}
A[_local5] = key;
}
static function UpdateNode(A, key, prop) {
var _local5 = key[prop];
var _local6 = null;
var _local7 = A.length;
while (_local7--) {
if (A[_local7] == key) {
_local6 = _local7;
break;
}
}
if (_local6 != null) {
Heapify(A, _local6, A.length, prop);
while (_local6 > 0) {
var _local8 = (_local6 - 1) >> 1;
if (A[_local8][prop] > _local5) {
A[_local6] = A[_local8];
_local6 = _local8;
} else {
break;
}
}
A[_local6] = key;
return(true);
}
standard.debug.Tracer.myTrace("NOT FOUND!!!", "standard.collection.Priority_Queue::UpdateNode", "build/as/standard/collection/Priority_Queue.as", 283);
return(false);
}
function toString() {
return("Priority_Queue()");
}
}
Symbol 20496 MovieClip [__Packages.standard.pathfinding.A_star] Frame 0
class standard.pathfinding.A_star
{
function A_star () {
}
static function GetNode(nodelist, node_id, node_location) {
var _local5 = nodelist[node_id];
if (_local5 != null) {
return(_local5);
}
_local5 = {};
_local5.id = node_id;
_local5.location = node_location;
_local5.onOpen = false;
_local5.onClosed = false;
nodelist[node_id] = _local5;
return(_local5);
}
static function GetNode2(nodelist, node_id, node_location) {
var _local5 = {};
_local5.id = node_id;
_local5.location = node_location;
_local5.onOpen = false;
_local5.onClosed = false;
nodelist[node_id] = _local5;
return(_local5);
}
static function FindPath(start, agent, GetPathInProgress, SavePathInProgress, GetNodeID, GetNodeHeuristic, GoalTest, CostFromNodeToNode, GetConnectingNodes, TimeoutSearch) {
var _local12 = GetPathInProgress.call(agent);
if (_local12 == null) {
var _local13 = {};
_local13.id = GetNodeID.call(agent, start);
_local13.onOpen = true;
_local13.onClosed = false;
_local13.parent = 0;
_local13.cost = 0;
_local13.location = start;
_local13.total = GetNodeHeuristic.call(agent, start);
_local12 = {};
_local12.openlist = [];
_local12.nodelist = {};
_local12.startnode = _local13;
Insert(_local12.openlist, _local13, "total");
} else {
var _local13 = _local12.startnode;
}
while (_local12.openlist.length > 0) {
var _local14 = Extract_Min(_local12.openlist, "total");
var _local15 = GoalTest.call(agent, _local14.location);
if (_local15) {
var _local16 = [];
var _local17 = _local14;
_local16.push(_local14.location);
while ((_local17.parent != 0) && (_local17.id != _local13.id)) {
_local16.push(_local17.parent.location);
_local17 = _local17.parent;
}
return(_local16);
}
var _local18 = GetConnectingNodes.call(agent, _local14.location);
var _local19 = _local18.length;
while (_local19--) {
var _local20 = _local18[_local19];
var _local21 = {};
_local21.location = _local20;
var _local22 = GetNodeID.call(agent, _local21.location);
if ((_local14.parent == 0) || (_local14.parent.id != _local22)) {
_local21.parent = _local14;
_local21.cost = _local14.cost + CostFromNodeToNode.call(agent, _local14.location, _local21.location);
_local21.total = _local21.cost + GetNodeHeuristic.call(agent, _local21.location);
var _local23 = GetNode(_local12.nodelist, _local22, _local21.location);
if ((!(_local23.onOpen || (_local23.onClosed))) || (_local21.total < _local23.total)) {
_local23.onClosed = false;
_local23.parent = _local21.parent;
_local23.cost = _local21.cost;
_local23.total = _local21.total;
_local23.location = _local21.location;
if (_local23.onOpen) {
UpdateNode(_local12.openlist, _local23, "total");
} else {
Insert(_local12.openlist, _local23, "total");
_local23.onOpen = true;
}
}
}
}
_local14.onClosed = true;
_local14.onOpen = false;
if (TimeoutSearch.call(agent)) {
SavePathInProgress.call(agent, _local12);
return(-1);
}
}
return(false);
}
static function FindPath2(start, agent, GetPathInProgress, SavePathInProgress, GetNodeID, GetNodeHeuristic, GoalTest, CostFromNodeToNode, GetConnectingNodes, TimeoutSearch) {
var _local12 = GetPathInProgress.call(agent);
if (_local12 == null) {
var _local13 = {};
_local13.id = GetNodeID.call(agent, start);
_local13.onOpen = true;
_local13.onClosed = false;
_local13.parent = 0;
_local13.cost = 0;
_local13.location = start;
_local13.total = GetNodeHeuristic.call(agent, start);
_local12 = {};
_local12.openlist = [];
_local12.nodelist = {};
_local12.startnode = _local13;
Insert(_local12.openlist, _local13, "total");
} else {
var _local13 = _local12.startnode;
}
while (_local12.openlist.length > 0) {
var _local14 = Extract_Min(_local12.openlist, "total");
var _local15 = GoalTest.call(agent, _local14.location);
if (_local15) {
var _local16 = [];
var _local17 = _local14;
_local16.push(_local14.location);
while ((_local17.parent != 0) && (_local17.id != _local13.id)) {
_local16.push(_local17.parent.location);
_local17 = _local17.parent;
}
return(_local16);
}
var _local18 = GetConnectingNodes.call(agent, _local14.location);
var _local19 = _local18.length;
while (_local19--) {
var _local20 = _local18[_local19];
var _local21 = {};
_local21.location = _local20;
var _local22 = GetNodeID.call(agent, _local21.location);
if ((_local14.parent == 0) || (_local14.parent.id != _local22)) {
_local21.parent = _local14;
_local21.cost = _local14.cost + CostFromNodeToNode.call(agent, _local14.location, _local21.location);
_local21.total = _local21.cost + GetNodeHeuristic.call(agent, _local21.location);
var _local23 = GetNode(_local12.nodelist, _local22, _local21.location);
if ((!(_local23.onOpen || (_local23.onClosed))) || (_local21.total < _local23.total)) {
_local23.onClosed = false;
_local23.parent = _local21.parent;
_local23.cost = _local21.cost;
_local23.total = _local21.total;
_local23.location = _local21.location;
if (_local23.onOpen) {
UpdateNode(_local12.openlist, _local23, "total");
} else {
Insert(_local12.openlist, _local23, "total");
_local23.onOpen = true;
}
}
}
}
_local14.onClosed = true;
_local14.onOpen = false;
if (TimeoutSearch.call(agent)) {
SavePathInProgress.call(agent, _local12);
return(-1);
}
}
return(false);
}
function toString() {
return("A_star()");
}
static var Insert = standard.collection.Priority_Queue.Insert;
static var Extract_Min = standard.collection.Priority_Queue.Extract_Min;
static var UpdateNode = standard.collection.Priority_Queue.UpdateNode;
}
Symbol 20497 MovieClip [__Packages.standard.debug.Tracer] Frame 0
class standard.debug.Tracer
{
function Tracer () {
}
static function myTrace(msg) {
_global.socket.send((("<|" + _global.curFrame) + "|>") + msg);
}
}
Symbol 20498 MovieClip [__Packages.game.Platform_Guide] Frame 0
class game.Platform_Guide extends game.Avatar
{
var Start, FindCurrentPlatform, _mc, _platform_interval_hash, AddState, Global_OnMessage, Initialize_OnEnter, Initialize_OnMessage, Move_OnEnter, Move_OnMessage, Dead_OnEnter, Dead_OnUpdate, _id;
function Platform_Guide (x, y, r) {
super(x, y, r);
Mouse.addListener(this);
Start();
}
function onMouseMove(Void) {
var _local3 = new standard.geometry.Rect(_root._xmouse, _root._ymouse, _root._xmouse, _root._ymouse);
var _local4 = FindCurrentPlatform(_local3);
_mc._x = 0;
_mc._y = 0;
_mc.clear();
_mc.moveTo(_local3.x1, _local3.y1);
_mc.lineStyle(1, 16711680, 100);
_mc.lineTo(_local3.x1, _local4.y);
var _local5 = -12;
var _local6 = standard.Math_Utils.SumSeries;
var _local7 = (_local5 * 5) - _local6(-_local5, 2);
_mc.lineStyle(1, 15793935, 100);
_mc.moveTo(0, _local4.y + _local7);
_mc.lineTo(600, _local4.y + _local7);
var _local8 = 10;
var _local9 = 1;
var _local10 = -8;
var _local11 = 16;
var _local12 = 0;
var _local13 = 2;
var _local14 = _platform_interval_hash[_local4.name];
var _local15 = _local14.length;
if (_local15 > 0) {
while (_local15--) {
var _local16 = _local14[_local15];
if ((_local16.type == _local13) && ((_local16.from_ax == _local9) && ((_local16.from_vx == _local10) && ((_local16.x_steps == _local11) && (_local16.y_steps == _local12))))) {
var _local17 = _local16.from_p.y;
var _local18 = _local16.to_p.y;
_mc.lineStyle(1, 65280, 100);
_mc.moveTo(_local16.from_x1, _local17);
_mc.lineTo(_local16.from_x2, _local17);
_mc.lineStyle(1, 65280, 100);
_mc.moveTo(_local16.from_x1, _local17);
_mc.lineTo(_local16.from_x1, _local17 - _local8);
_mc.moveTo(_local16.from_x2, _local17);
_mc.lineTo(_local16.from_x2, _local17 - _local8);
_mc.lineStyle(1, 16711680, 100);
_mc.moveTo(_local16.to_x1, _local18);
_mc.lineTo(_local16.to_x2, _local18);
_mc.lineStyle(1, 16711680, 100);
_mc.moveTo(_local16.to_x1, _local18);
_mc.lineTo(_local16.to_x1, _local18 - _local8);
_mc.moveTo(_local16.to_x2, _local18);
_mc.lineTo(_local16.to_x2, _local18 - _local8);
}
}
}
}
function AddStates(Void) {
AddState("Global", null, Global_OnMessage, null, null);
AddState("Initialize", Initialize_OnEnter, Initialize_OnMessage, null, null);
AddState("Move", Move_OnEnter, Move_OnMessage, Move_OnUpdate, null);
AddState("Dead", Dead_OnEnter, null, Dead_OnUpdate, null);
}
function Move_OnUpdate(Void) {
return(true);
}
function toString(Void) {
return(("Platform_Guide(" + _id) + ")");
}
}
Symbol 20499 MovieClip [__Packages.standard.deferred.XMLSocket_Deferred] Frame 0
class standard.deferred.XMLSocket_Deferred extends XMLSocket
{
var _deferred;
function XMLSocket_Deferred () {
super();
}
function connect(sPath, sPort) {
standard.debug.Tracer.myTrace((((this + ".connect(sPath, sPort) : ") + sPath) + ",") + sPort, "standard.deferred.XMLSocket_Deferred::connect", "build/as/standard/deferred/XMLSocket_Deferred.as", 17);
super.connect(sPath, sPort);
_deferred = new standard.deferred.Deferred();
return(_deferred);
}
function onConnect(success) {
standard.debug.Tracer.myTrace((this + ".onConnect(success:Boolean) : ") + success, "standard.deferred.XMLSocket_Deferred::onConnect", "build/as/standard/deferred/XMLSocket_Deferred.as", 28);
if (success) {
standard.debug.Tracer.myTrace("Connection succeeded!", "standard.deferred.XMLSocket_Deferred::onConnect", "build/as/standard/deferred/XMLSocket_Deferred.as", 33);
} else {
standard.debug.Tracer.myTrace("Connection failed!", "standard.deferred.XMLSocket_Deferred::onConnect", "build/as/standard/deferred/XMLSocket_Deferred.as", 35);
}
_deferred.callback(this);
}
function toString(Void) {
return("XMLSocket_Deferred()");
}
}
Symbol 20500 MovieClip [__Packages.standard.container.Keyed_Container] Frame 0
class standard.container.Keyed_Container
{
var _categories;
function Keyed_Container () {
_categories = {};
}
function GetCombinedKey(key1, key2, key3) {
if (key2) {
if (key3) {
return((key1 | key2) | key3);
}
return(key1 | key2);
}
return(key1);
}
function Add(item, key1, key2, key3) {
if (key1) {
AddItemToCategory(item, key1);
if (key2) {
AddItemToCategory(item, key2);
AddItemToCategory(item, key1 | key2);
if (key3) {
AddItemToCategory(item, key3);
AddItemToCategory(item, key1 | key3);
AddItemToCategory(item, key2 | key3);
AddItemToCategory(item, (key1 | key2) | key3);
}
}
}
}
function AddItemToCategory(item, key) {
}
function toString(Void) {
return("Keyed_Container()");
}
var Initialize = standard.container.Keyed_Container;
static var UNIVERSAL_KEY = (1 << 30) - 1;
}
Symbol 20501 MovieClip [__Packages.standard.container.Keyed_Database] Frame 0
class standard.container.Keyed_Database extends standard.container.Keyed_Container
{
var _lookups, GetCombinedKey, _categories;
function Keyed_Database (Void) {
super();
_lookups = {};
}
static function Instance(Void) {
if (_instance == 0) {
_instance = new standard.container.Keyed_Database();
}
return(_instance);
}
function IsEmpty(key1, key2, key3) {
var _local5 = _categories[GetCombinedKey(key1, key2, key3)];
return(_local5 == null);
}
function Count(key1, key2, key3) {
var _local5 = 0;
var _local6 = GetStaticIterator(key1, key2, key3);
_local6.First();
for ( ; !_local6.IsDone() ; _local6.Next()) {
_local6.CurrentItem();
_local5++;
}
return(_local5);
}
function AddItemToCategory(item, key) {
var _local4 = {category:key, item:item, prev:null, next:null, next_sibling:null, prev_sibling:null};
if (_categories[key] == null) {
_categories[key] = _local4;
_local4.next = _local4;
_local4.prev = _local4;
} else {
var _local5 = _categories[key];
_local4.prev = _local5.prev;
_local4.next = _local5;
_local5.prev.next = _local4;
_local5.prev = _local4;
}
var _local6 = item.GetID();
if (_lookups[_local6] == null) {
_lookups[_local6] = _local4;
} else {
_local4.next_sibling = _lookups[_local6];
_lookups[_local6].prev_sibling = _local4;
_lookups[_local6] = _local4;
}
}
function Change(item, from_key, to_key) {
Remove(item, from_key);
var _local5 = item.GetID();
if (!HasCategory(_local5, to_key)) {
var _local6 = _lookups[_local5];
while (_local6 != null) {
AddItemToCategory(item, to_key | _local6.category);
_local6 = _local6.next_sibling;
}
AddItemToCategory(item, to_key);
}
}
function HasCategory(id, key) {
var _local4 = _lookups[id];
while (_local4 != null) {
if (_local4.category & key) {
return(true);
}
_local4 = _local4.next_sibling;
}
return(false);
}
function GetStaticIterator(key1, key2, key3) {
var _local5 = _categories[GetCombinedKey(key1, key2, key3)];
var _local6 = {first:_local5, last:_local5.prev, done:false, current:_local5};
_local6.First = function () {
this.current = this.first;
if (this.current == null) {
this.done = true;
}
};
_local6.Next = function () {
this.current = this.current.next;
};
_local6.IsDone = function () {
return(this.done);
};
_local6.CurrentItem = function () {
this.done = (this.current == this.last) || (this.current == this.first.prev);
return(this.current.item);
};
return(_local6);
}
function GetDynamicIterator(key1, key2, key3) {
var _local5 = _categories[GetCombinedKey(key1, key2, key3)];
var _local6 = {first:_local5, current:_local5, done:false};
_local6.First = function () {
this.done = false;
this.current = this.first;
if (this.current == null) {
this.done = true;
}
};
_local6.Next = function () {
this.current = this.current.next;
};
_local6.IsDone = function () {
return(this.done);
};
_local6.CurrentItem = function () {
this.done = this.current == this.first.prev;
return(this.current.item);
};
return(_local6);
}
function Remove(item, key) {
if (key == null) {
key = standard.container.Keyed_Container.UNIVERSAL_KEY;
}
var _local4 = item.GetID();
var _local5 = _lookups[_local4];
while (_local5 != null) {
if (_local5.category & key) {
if (_local5.next == _local5) {
_categories[_local5.category] = null;
} else {
if (_categories[_local5.category] == _local5) {
_categories[_local5.category] = _local5.next;
}
_local5.next.prev = _local5.prev;
_local5.prev.next = _local5.next;
}
if (_lookups[_local4].next_sibling == null) {
_lookups[_local4] = null;
} else if (_lookups[_local4] == _local5) {
_lookups[_local4] = _local5.next_sibling;
_local5.next_sibling.prev_sibling = null;
} else {
if (_local5.next_sibling != null) {
_local5.next_sibling.prev_sibling = _local5.prev_sibling;
}
_local5.prev_sibling.next_sibling = _local5.next_sibling;
}
}
_local5 = _local5.next_sibling;
}
}
function Dump(Void) {
for (var key in _categories) {
var _local3 = Number(key);
standard.debug.Tracer.myTrace("key: " + _local3.toString(2), "standard.container.Keyed_Database::Dump", "build/as/standard/container/Keyed_Database.as", 354);
var _local4 = GetStaticIterator(_local3);
_local4.First();
for ( ; !_local4.IsDone() ; _local4.Next()) {
standard.debug.Tracer.myTrace("\t" + _local4.CurrentItem(), "standard.container.Keyed_Database::Dump", "build/as/standard/container/Keyed_Database.as", 357);
}
}
}
function toString() {
return("Keyed_Database()");
}
static function test() {
var _local2 = Instance();
var _local3 = new standard.gameobject.ID_Object();
var _local4 = new standard.gameobject.ID_Object();
var _local5 = new standard.gameobject.ID_Object();
var _local6 = new standard.gameobject.ID_Object();
var _local7 = new standard.gameobject.ID_Object();
var _local8 = 1;
var _local9 = 2;
var _local10 = 4;
var _local11 = 8;
var _local12 = 16;
_local2.Add(_local3, _local8, _local9, _local11);
_local2.Add(_local3, _local10, _local11);
standard.debug.Tracer.myTrace("+++++++", "standard.container.Keyed_Database::test", "build/as/standard/container/Keyed_Database.as", 410);
_local2.Dump();
}
var Initialize = standard.container.Keyed_Database;
static var _instance = 0;
}
Symbol 20502 MovieClip [__Packages.game.Jump_Interval] Frame 0
class game.Jump_Interval
{
var from_x1, from_x2, from_ax, from_vx, from_p, to_x1, to_x2, to_vx, to_p, x_steps, y_steps, cur_vy, time, type;
function Jump_Interval (from_x1, from_x2, from_ax, from_vx, from_p, to_x1, to_x2, to_vx, to_p, x_steps, y_steps, cur_vy, time, type) {
this.from_x1 = from_x1;
this.from_x2 = from_x2;
this.from_ax = from_ax;
this.from_vx = from_vx;
this.from_p = from_p;
this.to_x1 = to_x1;
this.to_x2 = to_x2;
this.to_vx = to_vx;
this.to_p = to_p;
this.x_steps = x_steps;
this.y_steps = y_steps;
this.cur_vy = cur_vy;
this.time = time;
this.type = type;
}
function Clone(Void) {
return(new game.Jump_Interval(from_x1, from_x2, from_ax, from_vx, from_p, to_x1, to_x2, to_vx, to_p, x_steps, y_steps, cur_vy, time, type));
}
static function SubtractInterval(a, b) {
var _local4 = [];
if ((b.x2 < a.x1) || (b.x1 > a.x2)) {
_local4.push(a);
} else if ((b.x1 <= a.x1) && (b.x2 >= a.x2)) {
} else {
if ((b.x1 <= a.x2) && (b.x1 > a.x1)) {
var _local5 = {x1:a.x1, x2:b.x1 - 1};
_local4.push(_local5);
}
if ((b.x2 >= a.x1) && (b.x2 < a.x2)) {
var _local6 = {x1:b.x2 + 1, x2:a.x2};
_local4.push(_local6);
}
}
return(_local4);
}
static function SubtractIntervals(a, other_intervals) {
var _local4 = [a];
var _local5 = other_intervals.length;
var _local6 = 0;
for ( ; _local6 < _local5 ; _local6++) {
var _local7 = other_intervals[_local6];
var _local8 = [];
var _local9 = 0;
for ( ; _local9 < _local4.length ; _local9++) {
var _local10 = _local4[_local9];
_local8 = _local8.concat(SubtractInterval(_local10, _local7));
}
_local4 = _local8;
}
return(_local4);
}
static function Find_T_at_Y(dy, ay, vy, max_vy, y_steps) {
var _local7 = standard.Math_Utils.SumSeries;
var _local8 = (vy * y_steps) - _local7((-vy) - ay, ay);
var _local9 = _local8 + _local7(max_vy, ay);
var _local10 = (-vy) / ay;
var _local11 = max_vy / ay;
if (dy < _local8) {
var _local12 = _global.NaN;
} else if (dy <= _local9) {
var _local13 = ay / 2;
var _local14 = dy - _local8;
var _local12 = ((-_local13) + Math.sqrt((_local13 * _local13) - ((4 * _local13) * (-_local14)))) / ay;
_local12 = _local12 + (y_steps + _local10);
_local12 = Math.ceil(_local12);
} else {
var _local15 = dy - _local9;
var _local12 = _local15 / max_vy;
_local12 = _local12 + ((y_steps + _local10) + _local11);
_local12 = Math.ceil(_local12);
}
return(_local12);
}
static function Find_X_at_T(t, ax, vx, x_steps) {
var _local6 = standard.Math_Utils.SumSeries2;
if (ax == 0) {
var _local7 = 0;
} else if (t <= x_steps) {
var _local8 = vx + (t * ax);
var _local7 = _local6(vx, _local8, ax) - vx;
} else {
var _local9 = t - x_steps;
var _local10 = vx + (ax * x_steps);
var _local11 = _local6(vx, _local10, ax) - vx;
var _local7 = _local11 + (_local10 * _local9);
}
return(_local7);
}
static function GetPlatformIntervals(type, from_p, to_p, half_width, interval_hash, ax, cur_vx, max_vx, x_steps, ay, cur_vy, max_vy, y_steps) {
var _local15 = [];
var _local16 = to_p.y - from_p.y;
if (type == 2) {
_local16--;
}
var _local17 = Find_T_at_Y(_local16, ay, cur_vy, max_vy, y_steps);
if (!_global.isNaN(_local17)) {
var _local18 = Find_X_at_T(_local17, ax, cur_vx, x_steps);
if (!_global.isNaN(_local18)) {
var _local19 = from_p.x1 - half_width;
var _local20 = from_p.x2 + half_width;
var _local21 = to_p.x1 - half_width;
var _local22 = to_p.x2 + half_width;
if (_local19 < 10) {
_local19 = 10;
}
if (_local20 > 590) {
_local20 = 590;
}
if (_local21 < 10) {
_local21 = 10;
}
if (_local22 > 590) {
_local22 = 590;
}
var _local23 = cur_vx + (x_steps * ax);
var _local24 = _local19;
var _local25 = _local24 + _local18;
if (_local25 < _local21) {
var _local26 = _local21 - _local25;
var _local27 = _local20 - _local19;
if (_local26 <= _local27) {
_local25 = _local25 + _local26;
_local24 = _local24 + _local26;
} else {
_local25 = _global.NaN;
_local24 = _global.NaN;
}
} else if (_local25 > _local22) {
_local25 = _global.NaN;
_local24 = _global.NaN;
}
if (!_global.isNaN(_local25)) {
var _local28 = _local22 - _local25;
var _local29 = _local20 - _local24;
if (_local28 < _local29) {
var _local30 = _local24 + _local28;
} else {
var _local30 = _local24 + _local29;
}
var _local31 = interval_hash[from_p.name];
var _local32 = [];
var _local33 = _local31.length;
var _local34 = 0;
for ( ; _local34 < _local33 ; _local34++) {
var _local35 = _local31[_local34];
if ((_local35.type == type) && ((_local35.from_vx == cur_vx) && ((_local35.y_steps == y_steps) && ((_local35.x_steps == x_steps) && (_local35.cur_vy == cur_vy))))) {
var _local36 = {x1:_local35.from_x1, x2:_local35.from_x2};
_local32.push(_local36);
}
}
_local15 = SubtractIntervals({x1:_local24, x2:_local30}, _local32);
var _local37 = [];
var _local38 = 0;
for ( ; _local38 < _local15.length ; _local38++) {
var _local39 = _local15[_local38];
var _local40 = new game.Jump_Interval(_local39.x1, _local39.x2, ax, cur_vx, from_p, _local39.x1 + _local18, _local39.x2 + _local18, _local23, to_p, x_steps, y_steps, cur_vy, _local17, type);
_local37.push(_local40);
}
_local15 = _local37;
}
}
}
return(_local15);
}
static function AddIntervalToHash(interval_hash, interval) {
var _local4 = interval.from_p.name;
if (interval_hash[_local4] == null) {
interval_hash[_local4] = [];
}
interval_hash[_local4].push(interval);
return(interval_hash);
}
static function GetAllPlatformIntervals(map, half_width) {
var _local4 = {};
var _local7 = 2;
var _local9 = 18;
var _local10 = [0, 2];
var _local12 = 0;
for ( ; _local12 < _local10.length ; _local12++) {
var _local11 = _local10[_local12];
var _local13 = -1;
for ( ; _local13 <= 1 ; _local13++) {
var _local14 = ((_local13 < 0) ? -8 : 8);
if (_local13 == 0) {
var _local15 = 0;
var _local16 = 0;
} else {
var _local15 = -8;
var _local16 = 8;
}
var _local17 = _local15;
for ( ; _local17 <= _local16 ; _local17 = _local17 + 4) {
if (_local11 == 0) {
if ((_local17 == 8) || (_local17 == -8)) {
var _local8 = -14;
} else {
var _local8 = -12;
}
} else {
var _local8 = 0;
}
if ((_local13 == 0) || ((_local13 * _local17) <= 0)) {
var _local18 = 0;
} else {
var _local18 = (_local14 - _local17) / _local13;
}
var _local19 = _local18;
for ( ; _local19 <= _local18 ; _local19++) {
if (_local11 == 0) {
var _local20 = 1;
var _local21 = 5;
} else {
var _local20 = 0;
var _local21 = 0;
}
var _local22 = _local20;
for ( ; _local22 <= _local21 ; _local22 = _local22 + 2) {
var _local23 = 0;
for ( ; _local23 < map.length ; _local23++) {
var _local24 = 0;
for ( ; _local24 < map.length ; _local24++) {
var _local5 = map[_local23];
var _local6 = map[_local24];
for ( ; (_local11 == 2) && (_local5 == _local6) ; _local24++) {
}
var _local25 = GetPlatformIntervals(_local11, _local5, _local6, half_width, _local4, _local13, _local17, _local14, _local19, _local7, _local8, _local9, _local22);
var _local26 = 0;
for ( ; _local26 < _local25.length ; _local26++) {
_local4 = AddIntervalToHash(_local4, _local25[_local26]);
}
}
}
}
}
}
}
}
return(_local4);
}
static function FilterPlatformIntervals(interval_hash) {
var _local3 = standard.Math_Utils.SumSeries;
var _local4 = 0;
var _local5 = 0;
for (var from_p_name in interval_hash) {
var _local6 = interval_hash[from_p_name];
var _local7 = _local6.length;
while (_local7--) {
_local4++;
var _local8 = _local6[_local7];
if (_local8.to_p.name == _local8.from_p.name) {
standard.debug.Tracer.myTrace(_local6[_local7] + " *DELETED* (same platform)", "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 520);
_local6.splice(_local7, 1);
_local5++;
continue;
}
var _local9 = _local8.to_vx;
var _local10 = ((_local9 > 0) ? (_local3(_local9 - 1, 1)) : (_local3(_local9 + 1, -1)));
if (((_local9 > 0) && ((_local8.to_x1 + _local10) > _local8.to_p.x2)) || ((_local9 < 0) && ((_local8.to_x2 + _local10) < _local8.to_p.x1))) {
standard.debug.Tracer.myTrace(_local6[_local7] + " *DELETED* (can't stop)", "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 534);
_local6.splice(_local7, 1);
_local5++;
continue;
}
var _local11 = false;
var _local12 = _local6.length;
while (_local12--) {
var _local13 = _local6[_local12];
if ((_local13.from_vx == _local8.from_vx) && ((_local13.to_vx == _local8.to_vx) && ((_local13.x_steps == _local8.x_steps) && ((_local13.from_p.name == _local8.from_p.name) && ((_local13.to_p.name == _local8.to_p.name) && ((_local13.from_x1 <= _local8.from_x1) && ((_local13.from_x2 >= _local8.from_x2) && ((_local13.to_x1 <= _local8.to_x1) && ((_local13.to_x2 >= _local8.to_x2) && (_local13.y_steps != _local8.y_steps)))))))))) {
_local11 = true;
break;
}
}
if (_local11) {
standard.debug.Tracer.myTrace(_local6[_local7] + " *DELETED* (Not needed.)", "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 571);
_local6.splice(_local7, 1);
_local5++;
continue;
}
if (_local8.x_steps > _local8.time) {
_local8.x_steps = _local8.time;
}
standard.debug.Tracer.myTrace(_local6[_local7], "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 584);
}
}
standard.debug.Tracer.myTrace("===================================", "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 589);
standard.debug.Tracer.myTrace("Final list:", "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 590);
for (var key in interval_hash) {
var _local14 = interval_hash[key];
var _local15 = _local14.length;
while (_local15--) {
standard.debug.Tracer.myTrace(_local14[_local15], "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 597);
}
}
standard.debug.Tracer.myTrace("Total number of intervals: " + _local4, "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 600);
standard.debug.Tracer.myTrace("Total after deletion: " + (_local4 - _local5), "game.Jump_Interval::FilterPlatformIntervals", "build/as/game/Jump_Interval.as", 601);
return(interval_hash);
}
static function CreatePlatformTable(interval_hash) {
var _local3 = {};
var _local4 = [];
for (var key in interval_hash) {
var _local5 = interval_hash[key];
var _local6 = _local5.length;
_local4.push(key);
var _local7 = 0;
while (_local6--) {
_local7++;
var _local8 = _local5[_local6];
var _local9 = _local8.from_p.name;
var _local10 = _local8.to_p.name;
if (_local3[_local9] == null) {
_local3[_local9] = {};
}
if ((_local3[_local9][_local10] == null) || (_local3[_local9][_local10] > _local8.time)) {
_local3[_local9][_local10] = _local8.time;
}
}
standard.debug.Tracer.myTrace((("Intervals from " + key) + ": ") + _local7, "game.Jump_Interval::CreatePlatformTable", "build/as/game/Jump_Interval.as", 640);
}
standard.debug.Tracer.myTrace("-- Platform Table ----------", "game.Jump_Interval::CreatePlatformTable", "build/as/game/Jump_Interval.as", 647);
for (var from_p_name in _local3) {
var _local11 = _local3[from_p_name];
for (var to_p_name in _local11) {
standard.debug.Tracer.myTrace((((("From " + from_p_name) + " to ") + to_p_name) + " = ") + _local11[to_p_name], "game.Jump_Interval::CreatePlatformTable", "build/as/game/Jump_Interval.as", 651);
}
}
return(_local3);
}
static function AppendMoveToData(from_intervals, half_width) {
var _local4 = standard.Math_Utils.SumSeries;
var _local18 = 8;
var _local5 = from_intervals.length;
var _local7 = from_intervals[0].from_p.x1 - half_width;
var _local8 = from_intervals[0].from_p.x2 + half_width;
while (_local5--) {
var _local6 = from_intervals[_local5];
_local6.move_data = {};
var _local16 = [];
var _local21 = {x1:_local6.from_x1, x2:_local6.from_x2, vx:_local6.from_vx, ax:0, steps:0, dx:0};
var _local22 = _local4(Math.abs(_local6.from_vx), 1);
_local16.push(_local21);
InsertMoveData(_local6.move_data, _local21, _local6.from_vx, 0);
while (_local16.length > 0) {
var _local17 = _local16.shift();
var _local23 = _local17.vx;
var _local24 = _local17.dx;
var _local15 = _local17.steps + 1;
var _local9 = _local17.x1 - _local23;
var _local10 = _local17.x2 - _local23;
if ((_local9 <= _local8) && (_local10 >= _local7)) {
if (_local9 < _local7) {
_local9 = _local7;
}
if (_local10 > _local8) {
_local10 = _local8;
}
if (_local23 > (-_local18)) {
var _local14 = _local23 - 1;
var _local13 = 1;
} else {
var _local14 = -_local18;
var _local13 = -1;
}
var _local25 = _local22 + _local4(Math.abs(_local14) - 1, 1);
if (Math.abs(_local24) < _local25) {
var _local19 = _local6.move_data[_local14];
var _local20 = SubtractIntervals({x1:_local9, x2:_local10}, _local19);
var _local26 = 0;
for ( ; _local26 < _local20.length ; _local26++) {
var _local27 = _local20[_local26];
_local27.ax = _local13;
_local27.vx = _local14;
_local27.steps = _local15;
_local27.dx = _local24 + _local23;
_local16.push(_local27);
InsertMoveData(_local6.move_data, _local27, _local14, _local15);
}
}
if (_local23 < _local18) {
var _local12 = _local23 + 1;
var _local11 = -1;
} else {
var _local12 = _local18;
var _local11 = 1;
}
var _local28 = _local22 + _local4(Math.abs(_local12) - 1, 1);
if (Math.abs(_local24) < _local28) {
var _local19 = _local6.move_data[_local12];
var _local20 = SubtractIntervals({x1:_local9, x2:_local10}, _local19);
var _local29 = 0;
for ( ; _local29 < _local20.length ; _local29++) {
var _local30 = _local20[_local29];
_local30.ax = _local11;
_local30.vx = _local12;
_local30.steps = _local15;
_local30.dx = _local24 + _local23;
_local16.push(_local30);
InsertMoveData(_local6.move_data, _local30, _local12, _local15);
}
}
}
}
}
}
static function InsertMoveData(move_data, ni, vx, new_steps) {
if (move_data[vx] == null) {
move_data[vx] = [ni];
} else {
var _local6 = move_data[vx];
var _local7 = 0;
var _local8 = _local6.length;
var _local9 = ni.x1;
while ((_local7 < _local8) && (_local9 > _local6[_local7].x2)) {
_local7++;
}
var _local10 = _local6[_local7];
var _local11 = _local6[_local7 - 1];
if ((_local10.steps == new_steps) && ((_local10.ax == ni.ax) && ((_local10.dx == ni.dx) && (_local10.x1 == (ni.x2 + 1))))) {
_local10.x1 = ni.x1;
} else if ((_local11.steps == new_steps) && ((_local11.ax == ni.ax) && ((_local11.dx == ni.dx) && (_local11.x2 == (ni.x1 - 1))))) {
_local11.x2 = ni.x2;
} else {
_local6.splice(_local7, 0, ni);
}
}
}
function toString(Void) {
return((((((((((((((((((((((((("Jump_Interval<" + type) + "> t=") + time) + "| ") + from_p.name) + "[") + from_x1) + ",") + from_x2) + "]@vx=") + from_vx) + " to ") + to_p.name) + "[") + to_x1) + ",") + to_x2) + "]@vx=") + to_vx) + " | x_steps=") + x_steps) + ", y_steps=") + y_steps) + ", dx=") + (to_x1 - from_x1));
}
}
Symbol 20503 MovieClip [__Packages.game.Enemy] Frame 0
class game.Enemy extends game.Avatar
{
var GetFrames, SetAnimationKey, _evade_probability, _pause_min_time, _pause_max_time, SumSeries_Memo, FindMoveToPath_Memo, FindSeq_FromStopToVX_Memo, FindSeq_FromVXToStop_Memo, _plan, _left_func, _left_off_func, _right_func, _right_off_func, _up_func, _up_off_func, _down_func, _down_off_func, _change_state_func, Start, _platform_interval_hash, _platform_table, _state_flags, SendDelayedMsgToMe, Get_VX, Get_VY, Get_CX, GetStaticBounds, _keyed_db, _duck_height, _y, ShouldEatPie, _duck_delay, _cur_platform, _map, _x, GetLaunchData, _half_width, _height, FindCurrentPlatform, _goal, _goal_time, _vx, _path_in_progress, _path_start_time, GetPathToInterval, FindMoveToInterval, _moveTo_goal, _id, SetState, _avatar_index, _blackboard, AddState, Global_OnMessage, Initialize_OnEnter, Dead_OnEnter, Dead_OnMessage, Dead_OnUpdate;
function Enemy (x, y, r, avatar_index, reload_delay, pie_speed, pause_min, pause_max, evade_probability) {
super(x, y, r, avatar_index, reload_delay, pie_speed);
var _local12 = GetFrames(avatar_index);
SetAnimationKey(_local12);
_evade_probability = evade_probability;
_pause_min_time = pause_min;
_pause_max_time = pause_max;
SumSeries_Memo = standard.Memo.Memoize(null, standard.Math_Utils.SumSeries);
FindMoveToPath_Memo = standard.Memo.Memoize(this, FindMoveToPath);
FindSeq_FromStopToVX_Memo = standard.Memo.Memoize(this, FindSeq_FromStopToVX);
FindSeq_FromVXToStop_Memo = standard.Memo.Memoize(this, FindSeq_FromVXToStop);
_plan = [];
Mouse.addListener(this);
_left_func = game.G_Moving_GameObject.MakeMsgFunc(this, 9);
_left_off_func = game.G_Moving_GameObject.MakeMsgFunc(this, 10);
_right_func = game.G_Moving_GameObject.MakeMsgFunc(this, 11);
_right_off_func = game.G_Moving_GameObject.MakeMsgFunc(this, 12);
_up_func = game.G_Moving_GameObject.MakeMsgFunc(this, 5);
_up_off_func = game.G_Moving_GameObject.MakeMsgFunc(this, 6);
_down_func = game.G_Moving_GameObject.MakeMsgFunc(this, 7);
_down_off_func = game.G_Moving_GameObject.MakeMsgFunc(this, 8);
_change_state_func = game.G_Moving_GameObject.MakeMsgFunc(this, 3);
Start();
}
function SetIntervalHash(hash) {
_platform_interval_hash = hash;
}
function SetPlatformTable(table) {
_platform_table = table;
}
function onMouseDown(Void) {
standard.debug.Tracer.myTrace(this + ".onMouseDown(Void)", "game.Enemy::onMouseDown", "build/as/game/Enemy.as", 101);
SetGoal(_root._xmouse, _root._ymouse);
}
function UpdateAI(Void) {
if ((!(_state_flags & 8192)) && (SeesEnemy())) {
SendDelayedMsgToMe(0, 13);
SendDelayedMsgToMe(5, 14);
} else if (!(_state_flags & (((8 | 16) | 64) | 32768))) {
if (Math.random() < _evade_probability) {
var _local3 = GetDangerousPies();
if (_local3.length > 0) {
AvoidPies(_local3);
}
}
}
}
function GetDangerousPies(Void) {
var _local3 = [];
var _local4 = Get_VX();
var _local5 = Get_VY();
var _local6 = Get_CX();
var _local7 = GetStaticBounds();
var _local8 = _keyed_db.GetDynamicIterator(2, 256);
_local8.First();
for ( ; !_local8.IsDone() ; _local8.Next()) {
var _local9 = _local8.CurrentItem();
for ( ; _local9.IsStuck() ; _local8.Next()) {
}
var _local10 = _local9.GetBounds();
for ( ; (_local10.y2 < _local7.y1) || (_local10.y1 > _local7.y2) ; _local8.Next()) {
}
var _local11 = _local9.Get_VX();
var _local12 = 0;
var _local13 = _local9.Get_CX();
var _local14 = _local13 - _local6;
for ( ; (_local11 * _local14) > 0 ; _local8.Next()) {
}
for ( ; Math.abs(_local14) > 100 ; _local8.Next()) {
}
var _local15 = CollisionTest(_local9.Get_X(), _local9.Get_Y(), _local11, _local12, _local4, _local5, _local7);
if (!_global.isNaN(_local15)) {
_local3.push({time:_local15, pie:_local9});
}
}
return(_local3);
}
function CollisionTest(pie_x, pie_y, pie_vx, pie_vy, avatar_vx, avatar_vy, avatar_static_bounds) {
var _local9 = pie_vx - avatar_vx;
var _local10 = pie_vy - avatar_vy;
var _local11 = new standard.geometry.Rect(avatar_static_bounds.x1 - 12, avatar_static_bounds.y1 - 15, avatar_static_bounds.x2, avatar_static_bounds.y2);
var _local12 = _local11.x1 - pie_x;
var _local13 = _local11.x2 - pie_x;
var _local14 = ((Math.abs(_local12) < Math.abs(_local13)) ? (_local12) : (_local13));
var _local15 = _local14 / _local9;
var _local16 = pie_y + (_local10 * _local15);
if ((_local16 >= _local11.y1) && (_local16 <= _local11.y2)) {
return(_local15);
}
return(_global.NaN);
}
function AvoidPies(pieAr) {
pieAr.sortOn("time", Array.NUMERIC);
var _local3 = pieAr[0];
var _local4 = _local3.time;
_local4 = Math.ceil(_local4);
var _local5 = _local3.pie;
_plan = [];
if (_state_flags & 256) {
_plan.push({t:0, msg:"left_off", func:_left_off_func});
}
if (_state_flags & 512) {
_plan.push({t:0, msg:"right_off", func:_right_off_func});
}
var _local6 = _local5.GetBounds();
var _local7 = _y - _duck_height;
if ((_local6.y2 < _local7) || (ShouldEatPie(_local6, _local5.Get_VX()))) {
_plan.push({t:0, msg:"down", func:_down_func});
_plan.push({t:_duck_delay, msg:"down_off", func:_down_off_func});
} else {
_plan.push({t:0, msg:"up", func:_up_func});
_plan.push({t:Math.floor(_local4 / 2), msg:"up_off", func:_up_off_func});
}
}
function GetPlan(Void) {
var _local3 = _platform_table[_cur_platform.name];
var _local4 = [_cur_platform.name];
for (var key in _local3) {
_local4.push(key);
}
var _local5 = Math.floor(Math.random() * _local4.length);
var _local6 = _local4[_local5];
var _local7 = GetPlatformByName(_local6);
var _local8 = _local7.x1 + Math.floor(Math.random() * (_local7.x2 - _local7.x1));
SetGoal(_local8, _local7.y);
}
function GetPlatformByName(p_name) {
var _local3 = _map.length;
while ((_local3--) > 0) {
if (_map[_local3].name == p_name) {
return(_map[_local3]);
}
}
return(null);
}
function FaceCenter(Void) {
var _local3 = 10 + ((590 - 10) / 2);
if (_state_flags & 1) {
if (_x < _local3) {
SendDelayedMsgToMe(0, 11);
SendDelayedMsgToMe(1, 12);
}
} else if (_x > _local3) {
SendDelayedMsgToMe(0, 9);
SendDelayedMsgToMe(1, 10);
}
}
function SeesEnemy(Void) {
var _local3 = GetLaunchData();
var _local4 = _local3.x;
var _local5 = _local3.y;
var _local6 = _local3.vx;
var _local7 = _local3.vy;
var _local8 = _keyed_db.GetDynamicIterator(2, 32);
_local8.First();
for ( ; !_local8.IsDone() ; _local8.Next()) {
var _local9 = _local8.CurrentItem();
if (_local9 != this) {
if (_local9.GetCurrentPlatform().y >= _local5) {
var _local10 = _local9.Get_VY();
var _local11 = _local9.Get_VX();
var _local12 = _local9.GetStaticBounds();
var _local13 = CollisionTest(_local4, _local5, _local6, _local7, _local11, _local10, _local12);
if ((!_global.isNaN(_local13)) && (_local13 >= 0)) {
return(true);
}
}
}
}
return(false);
}
function SetGoal(x, y) {
standard.debug.Tracer.myTrace((((this + ".SetGoal(x:Number,y:Number) : ") + x) + ", ") + y, "game.Enemy::SetGoal", "build/as/game/Enemy.as", 359);
standard.debug.Tracer.myTrace((("cur location: " + _x) + ",") + _y, "game.Enemy::SetGoal", "build/as/game/Enemy.as", 360);
var _local4 = new standard.geometry.Rect(x - _half_width, y - _height, x + _half_width, y);
var _local5 = FindCurrentPlatform(_local4);
_goal = {x:x, y:_local5.y, vx:0, p:_local5};
if (_local5 != null) {
_plan = GetPlanToGoal();
}
}
function GetPlanToGoal(Void) {
standard.debug.Tracer.myTrace(this + ".GetPlanToGoal(Void)", "game.Enemy::GetPlanToGoal", "build/as/game/Enemy.as", 386);
_goal_time = 0;
var _local3 = new standard.geometry.Rect(_x - _half_width, _y - _height, _x + _half_width, _y);
var _local4 = FindCurrentPlatform(_local3);
var _local5 = {t:0, dx:0, x:_x, y:_y, vx:_vx.GetVal(), p:_local4, move_path:[]};
_path_in_progress = null;
_path_start_time = getTimer();
var _local6 = standard.pathfinding.A_star.FindPath2(_local5, this, GetPathInProgress, SavePathInProgress, GetNodeID, GetNodeHeuristic, GoalTest, CostFromNodeToNode, GetConnectingNodes, TimeoutSearch);
if ((_local6 != false) && (_local6 != -1)) {
return(ProcessPath(_local6));
}
if (_local6 == false) {
standard.debug.Tracer.myTrace("PATH IS FALSE", "game.Enemy::GetPlanToGoal", "build/as/game/Enemy.as", 424);
}
return([]);
}
function ResumePathfinding(Void) {
_path_start_time = getTimer();
var _local3 = standard.pathfinding.A_star.FindPath2(null, this, GetPathInProgress, SavePathInProgress, GetNodeID, GetNodeHeuristic, GoalTest, CostFromNodeToNode, GetConnectingNodes, TimeoutSearch);
if (_local3 == false) {
standard.debug.Tracer.myTrace("path is false", "game.Enemy::ResumePathfinding", "build/as/game/Enemy.as", 446);
_path_in_progress = null;
} else if (_local3 != -1) {
_path_in_progress = null;
_plan = ProcessPath(_local3);
}
}
function ProcessPath(path) {
var _local4 = [];
var _local5 = 0;
var _local6 = 0;
var _local7 = 0;
var _local8 = {msg:"none"};
var _local3 = path.length;
if (_local3 > 0) {
while (_local3--) {
var _local9 = path[_local3];
var _local10 = _local9.move_path;
if (_local10 == null) {
_local10 = GetPathToInterval(_local9.jump_path, _local9.old_vx, _local9.oldx);
}
var _local11 = _local10.length;
if (_local11 > 0) {
while (_local11--) {
var _local12 = _local10[_local11];
var _local13 = null;
var _local14 = _local12.ax < _local6;
var _local15 = _local12.ax > _local6;
var _local16 = {t:_local5, msg:"right", func:_right_func};
var _local17 = {t:_local5, msg:"left", func:_left_func};
var _local18 = {t:_local5, msg:"right_off", func:_right_off_func};
var _local19 = {t:_local5, msg:"left_off", func:_left_off_func};
switch (_local8.msg) {
case "none" :
if (_local14) {
_local13 = _local17;
} else if (_local15) {
_local13 = _local16;
}
break;
case "right" :
if (_local14) {
_local13 = _local18;
}
break;
case "left" :
if (_local15) {
_local13 = _local19;
}
break;
case "right_off" :
if (_local12.vx < 0) {
_local13 = _local17;
} else if (_local12.vx >= _local7) {
_local13 = _local16;
}
break;
case "left_off" :
if (_local12.vx > 0) {
_local13 = _local16;
} else {
if (_local12.vx > _local7) {
break;
}
_local13 = _local17;
}
}
_local6 = _local12.ax;
_local7 = _local12.vx;
if (_local13 != null) {
_local4.push(_local13);
_local8 = _local13;
}
_local5++;
}
}
var _local20 = _local9.jump_path;
if (_local20 != null) {
var _local21 = _local20.time;
var _local22 = _local20.x_steps;
var _local23 = _local20.y_steps;
var _local24 = _local20.from_ax;
var _local25 = _local20.from_vx;
if (_local20.type == 2) {
_local4.push({t:_local5, msg:"down", func:_down_func});
_local4.push({t:_local5, msg:"up", func:_up_func});
_local4.push({t:_local5 + 1, msg:"down_off", func:_down_off_func});
_local4.push({t:_local5 + 1, msg:"up_off", func:_up_off_func});
} else {
_local4.push({t:_local5, msg:"up", func:_up_func});
_local4.push({t:_local5 + _local23, msg:"up_off", func:_up_off_func});
}
if (_local22 != 0) {
if (_local22 > 0) {
if (_local24 > 0) {
if (_local8.msg == "left") {
_local4.push({t:_local5, msg:"left_off", func:_left_off_func});
}
if (_local8.msg != "right") {
_local4.push({t:_local5, msg:"right", func:_right_func});
}
_local8 = {t:_local5 + _local22, msg:"right_off", func:_right_off_func};
_local4.push(_local8);
_local6 = 1;
} else {
if (_local8.msg == "right") {
_local4.push({t:_local5, msg:"right_off", func:_right_off_func});
}
if (_local8.msg != "left") {
_local4.push({t:_local5, msg:"left", func:_left_func});
}
_local8 = {t:_local5 + _local22, msg:"left_off", func:_left_off_func};
_local4.push(_local8);
_local6 = -1;
}
}
} else if (_local8.msg == "right") {
_local8 = {t:_local5, msg:"right_off", func:_right_off_func};
_local4.push(_local8);
} else if (_local8.msg == "left") {
_local8 = {t:_local5 + _local22, msg:"left_off", func:_left_off_func};
_local4.push(_local8);
}
_local7 = _local20.to_vx;
_local5 = _local5 + _local21;
}
}
}
standard.debug.Tracer.myTrace("Stop at: " + _local5, "game.Enemy::ProcessPath", "build/as/game/Enemy.as", 619);
_local4.push({t:_local5, msg:"change_state", func:_change_state_func});
_local4.sortOn("t", Array.NUMERIC);
var _local26 = _local4.length;
for ( ; _local26 > 0 ; _local26--) {
_local4[_local26].t = _local4[_local26].t - _local4[_local26 - 1].t;
}
_local4[0].t = 0;
return(_local4);
}
function ExecutePlan(Void) {
var _local3 = _plan[0];
_goal_time++;
while (_goal_time >= _local3.t) {
_plan.shift();
_local3.func();
_goal_time = 0;
if (_plan.length > 0) {
_local3 = _plan[0];
} else {
break;
}
}
}
function SavePathInProgress(path) {
_path_in_progress = path;
}
function GetPathInProgress(Void) {
return(_path_in_progress);
}
function GetNodeID(node) {
var _local3 = ((node.x * 100000) + (node.y * 100)) + node.vx;
return(_local3);
}
function GetConnectingNodes(from_node) {
var _local3 = [];
var _local4 = from_node.x;
var _local5 = from_node.y;
var _local6 = 0;
var _local7 = from_node.vx;
var _local8 = 8;
var _local9 = from_node.p;
var _local11 = (_local9.x1 - _half_width) - _local4;
var _local12 = (_local9.x2 + _half_width) - _local4;
if (_goal.p.name == _local9.name) {
var _local13 = _goal.x - _local4;
var _local14 = FindStepsToGoal2(_local13, _local13, _local7, 0, _local8, _local11, _local12);
if (_local14) {
var _local10 = _local14.dx;
var _local15 = {};
_local15.t = _local14.steps;
_local15.dx = _local10;
_local15.oldx = _local4;
_local15.x = _local4 + _local10;
_local15.y = _local5;
_local15.vx = 0;
_local15.p = _local9;
_local15.move_path = _local14.path;
_local15.jump_path = null;
_local3.push(_local15);
} else {
standard.debug.Tracer.myTrace("COULD NOT FIND A PATH TO THE GOAL!", "game.Enemy::GetConnectingNodes", "build/as/game/Enemy.as", 712);
}
} else {
var _local16 = _platform_interval_hash[_local9.name];
var _local17 = _local16.length;
if (_local17 > 0) {
while (_local17--) {
var _local18 = _local16[_local17];
if (_local18.to_p.name == _goal.p.name) {
var _local19 = FindMoveToInterval(_local18, _local7, _local4);
var _local20 = _local19.steps;
if (_local20 != null) {
var _local21 = _local18.to_x1 - _local18.from_x1;
var _local22 = _local18.to_p.y - _local9.y;
var _local10 = _local19.dx + _local21;
var _local23 = {t:_local20 + _local18.time, dx:_local10, old_vx:_local7, oldx:_local4, x:_local4 + _local10, y:_local5 + _local22, vx:_local18.to_vx, p:_local18.to_p, jump_path:_local18};
_local3.push(_local23);
}
}
}
}
}
return(_local3);
}
function CostFromNodeToNode(node1, node2) {
return(node2.t);
}
function GetNodeHeuristic(node) {
var _local3 = _platform_table[node.p.name][_goal.p.name];
if (_local3 == null) {
var _local4 = Math.abs(_goal.x - node.x);
var _local5 = Math.abs(_goal.y - node.y);
_local4 = _local4 / 8;
_local5 = _local5 / 18;
_local3 = Math.ceil(((_local4 > _local5) ? (_local4) : (_local5)));
}
return(_local3);
}
function GoalTest(node) {
return((node.x == _goal.x) && ((node.y == _goal.y) && (node.vx == _goal.vx)));
}
function TimeoutSearch(Void) {
return((getTimer() - _path_start_time) > 10);
}
function FindMoveToPath(dx1, dx2, ax0, vx0, vx1, max_vx, min_dx, max_dx) {
if (min_dx == null) {
min_dx = -1000;
}
if (max_dx == null) {
max_dx = 1000;
}
var _local10 = {};
_local10.ax = 0;
_local10.vx = vx0;
_local10.x = 0;
_moveTo_goal = {};
_moveTo_goal.x1 = dx1;
_moveTo_goal.x2 = dx2;
_moveTo_goal.vx = vx1;
_moveTo_goal.max_vx = max_vx;
_moveTo_goal.min_dx = min_dx;
_moveTo_goal.max_dx = max_dx;
var _local11 = standard.pathfinding.A_star.FindPath(_local10, this, MoveTo_GetPathInProgress, MoveTo_SavePathInProgress, MoveTo_GetNodeID, MoveTo_GetNodeHeuristic, MoveTo_GoalTest, MoveTo_CostFromNodeToNode, MoveTo_GetConnectingNodes, MoveTo_TimeoutSearch);
if (_local11 != null) {
_local11.pop();
}
return(_local11);
}
function MoveTo_SavePathInProgress(path) {
}
function MoveTo_GetPathInProgress(Void) {
return(null);
}
function MoveTo_GetNodeID(node) {
var _local3 = (((node.x + 300) * 1000) + ((node.vx + 8) * 10)) + (node.ax + 1);
return(_local3);
}
function MoveTo_CostFromNodeToNode(node1, node2) {
return(1);
}
function MoveTo_GoalTest(node) {
var _local3 = (node.vx == _moveTo_goal.vx) && ((node.x >= _moveTo_goal.x1) && (node.x <= _moveTo_goal.x2));
return(_local3);
}
function MoveTo_GetConnectingNodes(from_node) {
var _local3 = [];
var _local4 = from_node.x;
var _local5 = from_node.vx + 1;
var _local6 = from_node.vx - 1;
var _local7 = _moveTo_goal.max_vx;
if (_local5 > _local7) {
_local5 = _local7;
}
if (_local6 < (-_local7)) {
_local6 = -_local7;
}
var _local8 = _local4 + _local5;
var _local9 = _local4 + _local6;
if ((_local8 <= _moveTo_goal.max_dx) && (_local8 >= _moveTo_goal.min_dx)) {
var _local10 = {ax:1, vx:_local5, x:_local8};
_local3.push(_local10);
}
if ((_local9 >= _moveTo_goal.min_dx) && (_local9 <= _moveTo_goal.max_dx)) {
var _local11 = {ax:-1, vx:_local6, x:_local9};
_local3.push(_local11);
}
return(_local3);
}
function MoveTo_TimeoutSearch(Void) {
return(false);
}
function toString(Void) {
return(("Enemy(" + _id) + ")");
}
function BadApproach(dx1, dx2, vx0, vx1) {
var _local6 = Math.abs(dx1);
var _local7 = Math.abs(dx2);
var _local8 = true;
if ((_local6 >= 43) || (_local7 >= 43)) {
_local8 = false;
} else {
if (_local6 < _local7) {
var _local9 = _local6;
var _local10 = _local7;
} else {
var _local9 = _local7;
var _local10 = _local6;
}
var _local11 = _local9;
for ( ; _local11 <= _local10 ; _local11++) {
if (game.Avatar._approach_table[Math.abs(vx1)][Math.abs(vx0)][_local11] == 1) {
_local8 = false;
}
}
}
return(_local8);
}
function FindSteps_FromDXToStop(vx) {
if (vx > 0) {
var _local3 = SumSeries_Memo(vx - 1, 1);
} else {
var _local3 = SumSeries_Memo(vx + 1, -1);
}
return(_local3);
}
function FindSteps_FromStopToDX(vx) {
if (vx > 0) {
var _local3 = SumSeries_Memo(vx, 1);
} else {
var _local3 = SumSeries_Memo(vx, -1);
}
return(_local3);
}
function FindSeq_FromStopToVX(vx) {
standard.debug.Tracer.myTrace((this + ".FindSeq_FromStopToVX(vx:Number) : ") + vx, "game.Enemy::FindSeq_FromStopToVX", "build/as/game/Enemy.as", 960);
var _local3 = [];
if (vx > 0) {
var _local4 = vx;
while ((_local4--) > 0) {
_local3.push({ax:1, vx:_local4 + 1});
}
} else {
var _local5 = vx;
while ((_local5++) < 0) {
_local3.push({ax:-1, vx:_local5 - 1});
}
}
return(_local3);
}
function FindSeq_FromVXToStop(vx) {
standard.debug.Tracer.myTrace((this + ".FindSeq_FromVXToStop(vx:Number) : ") + vx, "game.Enemy::FindSeq_FromVXToStop", "build/as/game/Enemy.as", 975);
var _local3 = [];
if (vx > 0) {
var _local4 = vx;
var _local5 = 0;
while ((_local5++) < _local4) {
_local3.push({ax:-1, vx:_local5 - 1});
}
} else {
var _local6 = vx;
var _local7 = 0;
while ((_local7--) > _local6) {
_local3.push({ax:1, vx:_local7 + 1});
}
}
return(_local3);
}
function FindStepsToGoal(dx1, dx2, vx0, vx1, max_vx, min_dx, max_dx) {
if ((vx0 == 0) && (vx1 == 0)) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 1;
} else {
var _local9 = 0;
}
} else if (vx0 == 0) {
if (vx1 > 0) {
if (dx2 >= 0) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 2;
} else {
var _local9 = 0;
}
} else {
var _local9 = 1;
}
} else if (dx1 <= 0) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 2;
} else {
var _local9 = 0;
}
} else {
var _local9 = 1;
}
} else if (vx1 == 0) {
if (vx0 > 0) {
if (dx2 >= 0) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 2;
} else {
var _local9 = 0;
}
} else {
var _local9 = 1;
}
} else if (dx1 <= 0) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 2;
} else {
var _local9 = 0;
}
} else {
var _local9 = 1;
}
} else if ((vx0 * vx1) > 0) {
if (((vx0 > 0) && (dx2 >= 0)) || ((vx0 < 0) && (dx1 <= 0))) {
if (BadApproach(dx1, dx2, vx0, vx1)) {
var _local9 = 2;
} else {
var _local9 = 0;
}
} else {
var _local9 = 2;
}
} else {
var _local9 = 1;
}
var _local11 = 0;
var _local12 = 0;
switch (_local9) {
case 0 :
var _local10 = FindMoveToPath_Memo(dx1, dx2, 0, vx0, vx1, max_vx);
if (_local10 == false) {
standard.debug.Tracer.myTrace("Path not found.", "game.Enemy::FindStepsToGoal", "build/as/game/Enemy.as", 1102);
return(false);
}
_local11 = _local11 + _local10.length;
if (_local10.length > 0) {
_local12 = _local12 + _local10[0].x;
}
break;
case 1 :
var _local13 = FindSteps_FromStopToDX(vx1);
var _local14 = dx1 - _local13;
var _local15 = dx2 - _local13;
if ((_local15 < min_dx) || (_local14 > max_dx)) {
return(false);
}
var _local16 = FindSteps_FromDXToStop(vx0);
if (((_local14 * vx0) < 0) || (BadApproach(_local14, _local15, vx0, 0))) {
dx1 = dx1 - _local16;
dx2 = dx2 - _local16;
if ((dx2 < min_dx) || (dx1 > max_dx)) {
return(false);
}
_local11 = _local11 + Math.abs(vx0);
_local12 = _local12 + _local16;
_local10 = FindSeq_FromVXToStop_Memo(vx0);
var _local17 = FindStepsToGoal(dx1, dx2, 0, vx1, max_vx, min_dx, max_dx);
if (!_local17) {
return(false);
}
_local11 = _local11 + _local17.steps;
_local12 = _local12 + _local17.dx;
_local10 = _local17.path.concat(_local10);
} else {
var _local18 = FindStepsToGoal(_local14, _local15, vx0, 0, max_vx, min_dx, max_dx);
if (!_local18) {
return(false);
}
_local11 = _local11 + _local18.steps;
_local12 = _local12 + _local18.dx;
_local10 = _local18.path;
_local11 = _local11 + Math.abs(vx1);
_local12 = _local12 + _local13;
_local10 = FindSeq_FromStopToVX_Memo(vx1).concat(_local10);
}
break;
case 2 :
_local11 = _local11 + Math.abs(vx0);
_local12 = _local12 + FindSteps_FromDXToStop(vx0);
if ((_local12 < min_dx) || (_local12 > max_dx)) {
return(false);
}
_local10 = FindSeq_FromVXToStop_Memo(vx0);
dx1 = dx1 - _local12;
dx2 = dx2 - _local12;
var _local19 = ((vx1 > 0) ? (SumSeries_Memo(vx1, 1)) : (SumSeries_Memo(vx1, -1)));
var _local20 = dx1 - _local19;
var _local21 = dx2 - _local19;
if ((_local21 < min_dx) || (_local20 > max_dx)) {
return(false);
}
var _local22 = FindStepsToGoal(_local20, _local21, 0, 0, max_vx, min_dx, max_dx);
if (!_local22) {
return(false);
}
_local11 = _local11 + _local22.steps;
_local12 = _local12 + _local22.dx;
_local10 = _local22.path.concat(_local10);
_local11 = _local11 + Math.abs(vx1);
_local12 = _local12 + _local19;
_local10 = FindSeq_FromStopToVX_Memo(vx1).concat(_local10);
}
return({steps:_local11, dx:_local12, path:_local10});
}
function FindStepsToGoal2(dx1, dx2, vx0, vx1, max_vx, min_dx, max_dx) {
var _local9 = FindStepsToGoal(dx1, dx2, vx0, vx1, max_vx, min_dx, max_dx);
if (_local9) {
var _local10 = _local9.path;
var _local11 = _local10.length;
var _local12 = 0;
while (_local11--) {
var _local13 = _local10[_local11];
_local12 = _local12 + _local13.vx;
_local13.x = _local12;
}
}
return(_local9);
}
function MoveTo_GetNodeHeuristic(node) {
var _local3 = node.vx;
var _local4 = node.x;
var _local6 = Math.abs(_moveTo_goal.x1 - _local4);
var _local7 = Math.abs(_moveTo_goal.x2 - _local4);
if (BadApproach(_local6, _local7, Math.abs(_local3), Math.abs(_moveTo_goal.vx))) {
var _local5 = 1000;
} else {
var _local5 = ((_local6 < _local7) ? (_local6) : (_local7));
}
return(_local5);
}
function Initialize_OnMessage(msg) {
standard.debug.Tracer.myTrace((this + ".Initialize_OnMessage(msg:Msg_Object) : ") + msg, "game.Enemy::Initialize_OnMessage", "build/as/game/Enemy.as", 1251);
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Initial_Pause");
return(true);
}
return(false);
}
function Initial_Pause_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Initial_Pause_OnEnter(Void)", "game.Enemy::Initial_Pause_OnEnter", "build/as/game/Enemy.as", 1262);
if (!(_state_flags & 32)) {
FaceCenter();
}
var _local3 = _pause_min_time + Math.floor(Math.random() * (_pause_max_time - _pause_min_time));
SendDelayedMsgToMe(_local3, 3);
}
function Initial_Pause_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Move");
return(true);
}
return(Move_OnMessage(msg));
}
function Pause_OnEnter(Void) {
if (!(_state_flags & 32)) {
FaceCenter();
}
var _local3 = _pause_min_time + Math.floor(Math.random() * (_pause_max_time - _pause_min_time));
SendDelayedMsgToMe(_local3, 3);
}
function Pause_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Move");
return(true);
}
return(Move_OnMessage(msg));
}
function Pause_OnUpdate(Void) {
UpdateAI();
if (_plan.length > 0) {
} else if (_blackboard.avatar == _avatar_index) {
standard.debug.Tracer.myTrace(this + "::: Our turn to update pathfinding!!!", "game.Enemy::Pause_OnUpdate", "build/as/game/Enemy.as", 1302);
if (_path_in_progress != null) {
ResumePathfinding();
} else {
GetPlan();
}
}
super.Move_OnUpdate();
return(true);
}
function Move_OnEnter(Void) {
}
function Move_OnUpdate(Void) {
UpdateAI();
if (_plan.length > 0) {
ExecutePlan();
} else if (_blackboard.avatar == _avatar_index) {
standard.debug.Tracer.myTrace(this + "::: Our turn to update pathfinding!!!", "game.Enemy::Move_OnUpdate", "build/as/game/Enemy.as", 1328);
if (_path_in_progress != null) {
ResumePathfinding();
} else {
GetPlan();
}
}
super.Move_OnUpdate();
return(true);
}
function Move_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Pause");
return(true);
}
return(super.Move_OnMessage(msg));
}
function AddStates(Void) {
AddState("Global", null, Global_OnMessage, null, null);
AddState("Initialize", Initialize_OnEnter, Initialize_OnMessage, null, null);
AddState("Initial_Pause", Initial_Pause_OnEnter, Initial_Pause_OnMessage, null, null);
AddState("Pause", Pause_OnEnter, Pause_OnMessage, Pause_OnUpdate, null);
AddState("Move", Move_OnEnter, Move_OnMessage, Move_OnUpdate, null);
AddState("Dead", Dead_OnEnter, Dead_OnMessage, Dead_OnUpdate, null);
}
}
Symbol 20504 MovieClip [__Packages.standard.deferred.Failure] Frame 0
class standard.deferred.Failure
{
var _msg;
function Failure (sMsg) {
_msg = sMsg;
}
function GetMsg(Void) {
return(_msg);
}
function toString(Void) {
return(("Failure(" + _msg) + ")");
}
}
Symbol 20505 MovieClip [__Packages.game.Scoreboard] Frame 0
class game.Scoreboard
{
var _mc, _scorecards, _scores;
function Scoreboard (mc) {
_mc = mc;
_scorecards = {};
_scorecards[1] = _mc.score01MC;
_scorecards[2] = _mc.score02MC;
_scorecards[3] = _mc.score03MC;
_scorecards[0] = _mc.score04MC;
}
function Init_TimedGame(Void) {
_scores = {};
_scores[1] = 0;
_scores[2] = 0;
_scores[3] = 0;
_scores[0] = 0;
ResetScoreboard();
}
function Init_EliminationGame(Void) {
_scores = {};
_scores[1] = 3;
_scores[2] = 3;
_scores[3] = 3;
_scores[0] = 3;
ResetScoreboard();
}
function ResetScoreboard(Void) {
for (var key in _scorecards) {
var _local3 = _scorecards[key];
_local3.gotoAndStop(1);
_local3.scoreMC.gotoAndStop("1digit");
_local3.scoreMC.minusMC.gotoAndStop("off");
_local3.scoreMC.digit1MC.gotoAndStop(_scores[key] + 1);
}
}
function UpdateScore(score_delta, avatar_id) {
standard.debug.Tracer.myTrace((((this + ".UpdateScore(score_delta:Number,avatar_id:Number) : ") + score_delta) + ", ") + avatar_id, "game.Scoreboard::UpdateScore", "build/as/game/Scoreboard.as", 58);
var _local4 = _scores[avatar_id] + score_delta;
var _local5 = _scorecards[avatar_id];
_scores[avatar_id] = _local4;
if (_local4 < 0) {
_local5.scoreMC.minusMC.gotoAndStop("on");
} else {
_local5.scoreMC.minusMC.gotoAndStop("off");
}
var _local6 = NumberToDigits(Math.abs(_local4), 2);
if (Math.abs(_local4) < 10) {
_local5.scoreMC.gotoAndStop("1digit");
_local5.scoreMC.digit1MC.gotoAndStop(_local6[0]);
} else {
_local5.scoreMC.gotoAndStop("2digit");
_local5.scoreMC.digit1MC.gotoAndStop(_local6[0]);
_local5.scoreMC.digit2MC.gotoAndStop(_local6[1]);
}
UpdateLeader();
return(_local4);
}
function GetRanking_Timed(Void) {
standard.debug.Tracer.myTrace(this + ".GetRanking_Timed(Void)", "game.Scoreboard::GetRanking_Timed", "build/as/game/Scoreboard.as", 93);
var _local3 = [];
var _local4 = 0;
for ( ; _local4 < 4 ; _local4++) {
_local3.push({score:GetScore(_local4), id:_local4});
}
_local3.sortOn("score", Array.NUMERIC | Array.DESCENDING);
var _local5 = 0;
var _local6 = -999;
var _local7 = 0;
for ( ; _local7 < _local3.length ; _local7++) {
var _local8 = _local3[_local7];
var _local9 = _local8.score;
if (_local9 < _local6) {
_local5++;
}
standard.debug.Tracer.myTrace("rankIndex: " + _local5, "game.Scoreboard::GetRanking_Timed", "build/as/game/Scoreboard.as", 118);
_local6 = _local9;
_local8.rank = _local5;
}
return(_local3);
}
function UpdateLeader(Void) {
var _local3 = -100;
var _local4 = 0;
for (var key in _scores) {
var _local5 = _scores[key];
if (_local5 > _local3) {
_local3 = _local5;
_local4++;
} else if (_local5 < _local3) {
_local4++;
}
}
for (var key in _scores) {
if (_local4 > 1) {
if (_scores[key] == _local3) {
_scorecards[key].gotoAndStop(2);
} else {
_scorecards[key].gotoAndStop(1);
}
} else {
_scorecards[key].gotoAndStop(1);
}
}
}
function GetScore(avatar_id) {
return(_scores[avatar_id]);
}
static function NumberToDigits(val, padding) {
if (padding == null) {
padding = 0;
}
var _local4 = val.toString().split("");
var _local5 = _local4.length;
while (_local5--) {
_local4[_local5] = Number(_local4[_local5]) + 1;
}
_local4.reverse();
while (_local4.length < padding) {
_local4.push(1);
}
return(_local4);
}
function toString(Void) {
return("Scoreboard()");
}
}
Symbol 20506 MovieClip [__Packages.standard.widget.Widget] Frame 0
class standard.widget.Widget extends standard.gameobject.Static_GameObject
{
var _width, _height, _mc, _id, _x, _y;
function Widget (x, y) {
super(x, y);
standard.debug.Tracer.myTrace((("new Widget(x:Number,y:Number) : " + x) + ", ") + y, "standard.widget.Widget::Widget", "build/as/standard/widget/Widget.as", 18);
_width = 40;
_height = 20;
}
function Cleanup(Void) {
super.Cleanup();
_mc.removeMovieClip();
}
function Create_MC(parentMC, iDepth) {
if (iDepth == null) {
iDepth = parentMC.getNextHighestDepth();
}
_mc = parentMC.createEmptyMovieClip("Widget" + _id, iDepth);
return(_mc);
}
function Get_MC(Void) {
return(_mc);
}
function Show(Void) {
_mc._visible = true;
}
function Hide(Void) {
_mc._visible = false;
}
function Draw(Void) {
_mc._x = _x;
_mc._y = _y;
}
function toString(Void) {
return("Widget()");
}
var Initialize = standard.widget.Widget;
}
Symbol 20507 MovieClip [__Packages.standard.container.Keyed_Sound_Player] Frame 0
class standard.container.Keyed_Sound_Player extends standard.container.Keyed_Container
{
var _time, _id, AddUpdateHook, RemoveUpdateHook, RunUpdateHooks, _categories, GetCombinedKey;
function Keyed_Sound_Player () {
super();
_time = standard.Time.Instance();
_id = standard.container.Database.Instance().GetNewObjectID();
var _local3 = [];
AddUpdateHook = standard.Hook.MakeAddHookFunc(_local3);
RemoveUpdateHook = standard.Hook.MakeRemoveHookFunc(_local3);
RunUpdateHooks = standard.Hook.MakeRunHooksFunc(_local3);
}
function GetID(Void) {
return(_id);
}
static function Instance(Void) {
if (_instance == 0) {
_instance = new standard.container.Keyed_Sound_Player();
}
return(_instance);
}
function Process_Message(msg) {
standard.debug.Tracer.myTrace((this + ".Process_Message(msg:Msg_Object) : ") + msg, "standard.container.Keyed_Sound_Player::Process_Message", "build/as/standard/container/Keyed_Sound_Player.as", 51);
var _local3 = msg.GetData();
if (_local3.id != null) {
PlaySound(_local3.id, _local3.offset, _local3.loops);
} else {
PlayKeyedSound(_local3.key1, _local3.key2, _local3.key3, _local3.offset, _local3.loops);
}
}
function AddItemToCategory(item, key) {
var _local4 = _categories[key];
if (_local4 == null) {
_categories[key] = item;
} else if (_local4 instanceof standard.audio.Sound_Unit) {
var _local5 = new standard.audio.Sound_Set();
_local5.AddSound(_local4);
_local5.AddSound(item);
_categories[key] = _local5;
} else {
_local4.AddSound(item);
}
}
function GetSound(key1, key2, key3) {
if (key1 instanceof String) {
var _local5 = _categories[key1].GetSound();
return(_local5);
}
var _local6 = _categories[GetCombinedKey(key1, key2, key3)];
if (_local6 != null) {
return(_local6.GetSound());
}
return(null);
}
function PlayKeyedSound(key1, key2, key3, offset, loops, vol) {
if (offset == null) {
offset = 0;
}
if (loops == null) {
loops = 1;
}
var _local8 = GetSound(key1, key2, key3);
if (vol != null) {
_local8.setVolume(vol);
} else {
_local8.setVolume(100);
}
if (_local8 != null) {
_local8.start(offset, loops);
}
}
function PlaySound(sID, offset, loops, vol) {
if (offset == null) {
offset = 0;
}
if (loops == null) {
loops = 1;
}
var _local6 = GetSound(sID);
if (vol != null) {
_local6.setVolume(vol);
} else {
_local6.setVolume(100);
}
if (_local6 != null) {
_local6.start(offset, loops);
}
}
function StopSound(sID) {
var _local3 = GetSound(sID);
if (_local3 != null) {
_local3.stop();
}
}
function FadeSound(sID, end_vol, fadeFunc, duration) {
standard.debug.Tracer.myTrace((((((((this + ".FadeSound(sID:String,end_vol:Number,fadeFunc:Function,duration:Number) : ") + sID) + ", ") + end_vol) + ", ") + fadeFunc) + ", ") + duration, "standard.container.Keyed_Sound_Player::FadeSound", "build/as/standard/container/Keyed_Sound_Player.as", 185);
var _local6 = GetSound(sID);
if (_local6 != null) {
var _local7 = MakeFadeUpdateFunc(_local6, _time, _time.GetCurTime(), fadeFunc(_local6.getVolume(), end_vol, duration), null, RemoveUpdateHook);
AddUpdateHook(_local7);
}
}
function Update(Void) {
RunUpdateHooks();
}
static function MakeLinearFadeFunc(start_vol, end_vol, duration) {
standard.debug.Tracer.myTrace((((("MakeLinearFadeFunc(start_vol:Number, end_vol:Number, duration:Number) : " + start_vol) + ", ") + end_vol) + ", ") + duration, "standard.container.Keyed_Sound_Player::MakeLinearFadeFunc", "build/as/standard/container/Keyed_Sound_Player.as", 208);
var units = ((end_vol - start_vol) / duration);
var _local4 = function (t) {
standard.debug.Tracer.myTrace("t: " + t, "standard.container.Keyed_Sound_Player::MakeLinearFadeFunc", "build/as/standard/container/Keyed_Sound_Player.as", 213);
return(start_vol + (t * units));
};
return(_local4);
}
static function MakeFadeUpdateFunc(snd, t, start_time, fadeFunc, fadeCompleteFunc, rem_func) {
var _local3 = function (Void) {
var _local3 = t.GetCurTime();
var _local4 = fadeFunc(_local3 - start_time);
if (_local4 > 0) {
standard.debug.Tracer.myTrace("vol: " + _local4, "standard.container.Keyed_Sound_Player::MakeFadeUpdateFunc", "build/as/standard/container/Keyed_Sound_Player.as", 231);
snd.setVolume(_local4);
} else {
snd.setVolume(0);
snd.stop();
rem_func(arguments.callee);
}
};
return(_local3);
}
static function MakeFadeCompleteFunc() {
var _local2 = function () {
};
return(_local2);
}
function toString(Void) {
return("Keyed_Sound_Player()");
}
var Initialize = standard.container.Keyed_Sound_Player;
static var _instance = 0;
}
Symbol 20508 MovieClip [__Packages.standard.audio.SFX_Player] Frame 0
class standard.audio.SFX_Player extends standard.container.Keyed_Sound_Player
{
function SFX_Player () {
super();
standard.debug.Tracer.myTrace("new SFX_Player()", "standard.audio.SFX_Player::SFX_Player", "build/as/standard/audio/SFX_Player.as", 14);
}
function LoadSounds(snd_ar, snd_mc) {
standard.debug.Tracer.myTrace((((this + ".LoadSounds(snd_ar:Array,snd_mc:MovieClip) : ") + snd_ar) + ", ") + snd_mc, "standard.audio.SFX_Player::LoadSounds", "build/as/standard/audio/SFX_Player.as", 19);
var _local4 = new standard.loader.AudioLoader();
_local4.SetMC(snd_mc);
_local4.SetCallBackFunc(MakeLoadCallbackFunc(this));
var _local5 = _local4.Load(snd_ar);
return(_local5);
}
function MakeLoadCallbackFunc(ksp) {
var _local2 = function (snd, snd_data) {
standard.debug.Tracer.myTrace((("sound loaded: " + snd) + ",") + snd_data, "standard.audio.SFX_Player::MakeLoadCallbackFunc", "build/as/standard/audio/SFX_Player.as", 38);
if (snd_data.id != null) {
ksp.Add.apply(ksp, [snd].concat(snd_data.id));
}
if (snd_data.tags != null) {
ksp.Add.apply(ksp, [snd].concat(snd_data.tags));
}
};
return(_local2);
}
function toString(Void) {
return("SFX_Player()");
}
var Initialize = standard.audio.SFX_Player;
}
Symbol 20509 MovieClip [__Packages.standard.widget.Simple_Button] Frame 0
class standard.widget.Simple_Button extends standard.widget.Widget
{
var AddEnableHook, RunEnableHooks, AddDisableHook, RunDisableHooks, _mouseDownEvent_ar, _mouseUpEvent_ar, _mouseOverEvent_ar, _mouseOutEvent_ar, _mouseMove_ar, AddMouseDownEvent, AddMouseUpEvent, AddMouseMoveEvent, AddRollOverEvent, AddRollOutEvent, OnMouseDown, OnMouseUp, OnMouseMove, OnMouseOver, OnMouseOut, _enabled, _mc, _x, _y, _width, _height;
function Simple_Button (Void) {
super();
var _local4 = standard.Hook.MakeAddHookFunc;
var _local5 = standard.Hook.MakeRunHooksFunc;
var _local6 = [];
var _local7 = [];
AddEnableHook = _local4(_local6);
RunEnableHooks = _local5(_local6);
AddDisableHook = _local4(_local7);
RunDisableHooks = _local5(_local7);
_mouseDownEvent_ar = [];
_mouseUpEvent_ar = [];
_mouseOverEvent_ar = [];
_mouseOutEvent_ar = [];
_mouseMove_ar = [];
AddMouseDownEvent = _local4(_mouseDownEvent_ar);
AddMouseUpEvent = _local4(_mouseUpEvent_ar);
AddMouseMoveEvent = _local4(_mouseMove_ar);
AddRollOverEvent = _local4(_mouseOverEvent_ar);
AddRollOutEvent = _local4(_mouseOutEvent_ar);
OnMouseDown = _local5(_mouseDownEvent_ar);
OnMouseUp = _local5(_mouseUpEvent_ar);
OnMouseMove = _local5(_mouseMove_ar);
OnMouseOver = _local5(_mouseOverEvent_ar);
OnMouseOut = _local5(_mouseOutEvent_ar);
_enabled = true;
Enable(false);
}
function Enable(b) {
if (b) {
if (!_enabled) {
_enabled = true;
if (_mouseDownEvent_ar.length > 0) {
_mc.onPress = OnMouseDown;
}
if (_mouseUpEvent_ar.length > 0) {
_mc.onRelease = OnMouseUp;
_mc.onReleaseOutside = OnMouseUp;
}
if (_mouseMove_ar.length > 0) {
_mc.onMouseMove = OnMouseMove;
}
if (_mouseOverEvent_ar.length > 0) {
_mc.onRollOver = OnMouseOver;
}
if (_mouseOutEvent_ar.length > 0) {
_mc.onRollOut = OnMouseOut;
}
RunEnableHooks();
}
} else if (_enabled) {
_enabled = false;
delete _mc.onRelease;
delete _mc.onPress;
delete _mc.onReleaseOutside;
delete _mc.onRollOver;
delete _mc.onRollOut;
RunDisableHooks();
}
}
function IsEnabled(Void) {
return(_enabled);
}
function Draw(f_c, f_a, l_t, l_c, l_a) {
_mc._x = _x;
_mc._y = _y;
_mc.clear();
_mc.beginFill(f_c, f_a);
_mc.lineStyle(l_t, l_c, l_a);
_mc.moveTo(0, 0);
_mc.lineTo(_width, 0);
_mc.lineTo(_width, _height);
_mc.lineTo(0, _height);
_mc.lineTo(0, 0);
_mc.endFill();
}
function toString(Void) {
return("Simple_Button()");
}
var Initialize = standard.widget.Simple_Button;
static var COUNT = 0;
}
Symbol 20510 MovieClip [__Packages.standard.widget.Radio_Buttons] Frame 0
class standard.widget.Radio_Buttons
{
var _buttons, AddSelectHook, RunSelectHooks, _value;
function Radio_Buttons () {
_buttons = [];
var _local2 = [];
AddSelectHook = standard.Hook.MakeAddHookFunc(_local2);
RunSelectHooks = standard.Hook.MakeRunHooksFunc(_local2);
}
function Cleanup(Void) {
while (_buttons.length > 0) {
var _local3 = _buttons.pop();
_local3.button.Cleanup();
}
}
function AddButton(b, activateFunc, deactivateFunc, value) {
_buttons.push({button:b, activateFunc:activateFunc, deactivateFunc:deactivateFunc, value:value});
b.AddMouseDownEvent(standard.Hook.MakeHook(this, SelectButton, b));
b.Enable(true);
}
function SelectButton(b) {
var _local3 = _buttons.length;
while (_local3--) {
var _local4 = _buttons[_local3];
if (b == _local4.button) {
_local4.activateFunc();
_local4.button.Enable(false);
SetValue(_local4.value);
} else {
_local4.deactivateFunc();
_local4.button.Enable(true);
}
}
standard.debug.Tracer.myTrace("value: " + GetValue(), "standard.widget.Radio_Buttons::SelectButton", "build/as/standard/widget/Radio_Buttons.as", 61);
}
function SetValue(value) {
_value = value;
RunSelectHooks(_value);
}
function GetValue(Void) {
return(_value);
}
function toString(Void) {
return("Radio_Buttons()");
}
}
Symbol 20511 MovieClip [__Packages.standard.loader.AudioLoader] Frame 0
class standard.loader.AudioLoader
{
var _num_sounds, _callback_func, _mc, _deferred, _error_callback;
function AudioLoader (Void) {
_num_sounds = 0;
}
function SetCallBackFunc(f) {
_callback_func = f;
}
function SetMC(mc) {
_mc = mc;
}
function Load(sndArray) {
_deferred = new standard.deferred.Deferred();
LoadNext(null, sndArray, 0);
return(_deferred);
}
function LoadNext(deferred_result, sndArray, index) {
_num_sounds++;
var _local5 = sndArray[index];
var _local6 = _mc.createEmptyMovieClip("snd" + _num_sounds, _num_sounds);
var _local7 = new standard.audio.Sound_Unit(_local6);
if (_local5.external) {
var _local9 = new Date();
var _local8 = _local7.loadSound((_local5.path + "?") + _local9.valueOf(), false);
} else {
var _local8 = _local7.attachSound(_local5.path);
}
_callback_func(_local7, _local5);
if ((_local5.copies != null) && (_local5.copies > 1)) {
_local5.copies--;
_local8.addCallback(this, LoadNext, [sndArray, index]);
if (!_local5.external) {
LoadNext(null, sndArray, index);
}
} else if (index < (sndArray.length - 1)) {
_local8.addCallback(this, LoadNext, [sndArray, index + 1]);
if (!_local5.external) {
LoadNext(null, sndArray, index + 1);
}
} else {
_local8.addCallback(this, LoadComplete);
if (!_local5.external) {
LoadComplete();
}
}
_local8.addErrback(this, _error_callback, ["Error loading sound file: " + _local5.path]);
}
function SetErrorCallback(f) {
_error_callback = f;
}
function LoadComplete() {
_deferred.callback();
}
function toString(Void) {
return("AudioLoader()");
}
static var _instance = 0;
}
Symbol 20512 MovieClip [__Packages.standard.deferred.Sound_Deferred] Frame 0
class standard.deferred.Sound_Deferred extends Sound
{
var _deferred;
function Sound_Deferred (target) {
super(target);
}
function loadSound(url, isStreaming) {
_deferred = new standard.deferred.Deferred();
super.loadSound(url, isStreaming);
return(_deferred);
}
function attachSound(linkageID) {
_deferred = new standard.deferred.Deferred();
super.attachSound(linkageID);
return(_deferred);
}
function onLoad(success) {
if (success) {
_deferred.callback(this);
} else {
_deferred.errback();
}
}
function toString(Void) {
return("Sound_Deferred()");
}
}
Symbol 20513 MovieClip [__Packages.standard.Math_Utils] Frame 0
class standard.Math_Utils
{
function Math_Utils () {
}
static function MIN(x, y) {
return(((x <= y) ? (x) : (y)));
}
static function MAX(x, y) {
return(((x >= y) ? (x) : (y)));
}
static function SumSeries(last, step) {
var _local4 = (((last * last) / step) + last) / 2;
return(_local4);
}
static function SumSeries2(first, last, step) {
var _local5 = (last - first) / step;
var _local6 = ((step * ((_local5 * _local5) + _local5)) / 2) + ((_local5 + 1) * first);
return(_local6);
}
static function test() {
standard.debug.Tracer.myTrace("sum: " + SumSeries(-8, -1), "standard.Math_Utils::test", "build/as/standard/Math_Utils.as", 34);
}
function toString(Void) {
return("Math_Utils()");
}
}
Symbol 20514 MovieClip [__Packages.standard.audio.Sound_Set] Frame 0
class standard.audio.Sound_Set
{
var _id, _sound_units, _last_start, _sound_count, _sounds_playing;
function Sound_Set () {
_id = COUNT++;
_sound_units = [];
_last_start = 0;
_sound_count = 0;
_sounds_playing = 0;
}
function AddSound(s) {
_sound_count++;
s.AddSoundStartHook(standard.Hook.MakeHook(this, OnSoundStart));
s.AddSoundCompleteHook(standard.Hook.MakeHook(this, OnSoundComplete));
_sound_units.push(s);
}
function OnSoundStart() {
_sounds_playing++;
}
function OnSoundComplete() {
_sounds_playing--;
}
function Functor(obj, func) {
var _local2 = function () {
func.call(obj);
};
return(_local2);
}
function GetSound(Void) {
return(_sound_units[random(_sound_count)]);
}
function GetLastStart(Void) {
return(_last_start);
}
function IsPlaying(Void) {
return(_sounds_playing > 0);
}
function toString(Void) {
return(("Sound_Set(" + _id) + ")");
}
static var COUNT = 0;
}
Symbol 20515 MovieClip [__Packages.standard.StateMachine_Mixin] Frame 0
class standard.StateMachine_Mixin
{
var _currentState, _nextState, _states, _stateChange, _state_key, _ccMessagesToGameObject, _timeOnEnter, _time, _msgroute, GetID;
function StateMachine_Mixin (obj) {
obj._states = [];
obj._state_key = {};
obj._time = standard.Time.Instance();
obj._msgroute = standard.message.MsgRoute.Instance();
obj._currentState = 1;
obj._stateChange = false;
obj._nextState = -1;
obj._timeOnEnter = 0;
obj._ccMessagesToGameObject = 0;
obj.__proto__.Start = Start;
obj.__proto__.AddState = AddState;
obj.__proto__.SetCCReceiver = SetCCReceiver;
obj.__proto__.GetCCReceiver = GetCCReceiver;
obj.__proto__.GetState = GetState;
obj.__proto__.GetTimeInState = GetTimeInState;
obj.__proto__.Update_FSM = Update;
obj.__proto__.ProcessStateChange = ProcessStateChange;
obj.__proto__.Process_Message = Process_Message;
obj.__proto__.Process_Update = Process_Update;
obj.__proto__.SetState = SetState;
obj.__proto__.SendMsg = SendMsg;
obj.__proto__.SendDelayedMsg = SendDelayedMsg;
obj.__proto__.SendDelayedMsgToMe = SendDelayedMsgToMe;
obj.__proto__.CancelDelayedMsg = CancelDelayedMsg;
}
function Start(Void) {
standard.debug.Tracer.myTrace(this + ".Start(Void)", "standard.StateMachine_Mixin::Start", "build/as/standard/StateMachine_Mixin.as", 60);
_currentState = 1;
_nextState = -1;
_states[_currentState][0].call(this);
if (_stateChange) {
ProcessStateChange();
}
}
function AddState(key, onEnter, onMsg, onUpdate, onExit) {
var _local7 = standard.StateMachine_Mixin;
if (_state_key[key] != null) {
_states[_state_key[key]] = [_local7.MakeEventFunc(onEnter), _local7.MakeBooleanEventFunc(onMsg), _local7.MakeBooleanEventFunc(onUpdate), _local7.MakeEventFunc(onExit)];
} else {
_state_key[key] = _states.length;
_states.push([_local7.MakeEventFunc(onEnter), _local7.MakeBooleanEventFunc(onMsg), _local7.MakeBooleanEventFunc(onUpdate), _local7.MakeEventFunc(onExit)]);
}
}
static function MakeEventFunc(func) {
if (func == null) {
return(null);
}
return(func);
}
static function MakeBooleanEventFunc(func) {
if (func == null) {
return(FalseFunc);
}
return(func);
}
static function FalseFunc(Void) {
return(false);
}
function SetCCReceiver(id) {
_ccMessagesToGameObject = id;
}
function GetCCReceiver(Void) {
return(_ccMessagesToGameObject);
}
function ClearCCReceiver(Void) {
_ccMessagesToGameObject = 0;
}
function GetState(key) {
if (key == null) {
return(_currentState);
}
return(_state_key[key]);
}
function GetTimeInState(Void) {
return(_time.GetCurTime() - _timeOnEnter);
}
function Update(Void) {
Process_Update();
}
function ProcessStateChange(Void) {
var _local3 = 10;
while (_stateChange && ((_local3--) >= 0)) {
_stateChange = false;
_states[_currentState][3].call(this);
_currentState = _nextState;
_timeOnEnter = _time.GetCurTime();
_states[_currentState][0].call(this);
}
}
function Process_Update(Void) {
if (_states[_currentState][2].call(this) == false) {
_states[0][2].call(this);
}
if (_stateChange) {
ProcessStateChange();
}
}
function Process_Message(msg) {
if (GetCCReceiver() > 0) {
SendMsg(msg.GetMsgName(), GetCCReceiver());
}
if (_states[_currentState][1].call(this, msg) == false) {
_states[0][1].call(this, msg);
}
if (_stateChange) {
ProcessStateChange();
}
}
function SetState(key) {
_stateChange = true;
_nextState = _state_key[key];
}
function SendMsg(name, receiver, data) {
_msgroute.SendMsg(0, name, receiver, GetID(), 0, data);
}
function SendDelayedMsg(delay, name, receiver, data) {
_msgroute.SendMsg(delay, name, receiver, GetID(), 0, data);
}
function SendDelayedMsgToMe(delay, name, scope, data) {
if (scope == 1) {
var _local6 = _msgroute.SendMsg(delay, name, GetID(), GetID(), _currentState, data);
} else {
var _local6 = _msgroute.SendMsg(delay, name, GetID(), GetID(), 0, data);
}
return(_local6);
}
function CancelDelayedMsg(msg) {
return(_msgroute.CancelDelayedMsg(msg));
}
function toString(Void) {
return("StateMachine_Mixin()");
}
var Initialize = standard.StateMachine_Mixin;
}
Symbol 20516 MovieClip [__Packages.standard.Hook] Frame 0
class standard.Hook
{
function Hook () {
}
static function MakeAddHookFunc(a) {
var _local2 = function (new_func, bOverwrite) {
if (bOverwrite == true) {
a.length = 0;
}
if (new_func != null) {
a.unshift(new_func);
}
};
return(_local2);
}
static function MakeRemoveHookFunc(a) {
var _local2 = function (func) {
standard.debug.Tracer.myTrace("remove hook func: " + func, "standard.Hook::MakeRemoveHookFunc", "build/as/standard/Hook.as", 40);
var _local3 = a.length;
while (_local3--) {
if (a[_local3] == func) {
standard.debug.Tracer.myTrace(("Found hook at " + _local3) + ". Removing", "standard.Hook::MakeRemoveHookFunc", "build/as/standard/Hook.as", 45);
a.splice(_local3, 1);
break;
}
}
};
return(_local2);
}
static function MakeRunHooksFunc(a) {
var _local2 = function () {
var _local2 = a.length;
if (_local2) {
while (_local2--) {
a[_local2].apply(null, arguments);
}
}
};
return(_local2);
}
static function MakeHook(obj, func) {
var initial_args = arguments;
initial_args.shift();
initial_args.shift();
var _local2 = function () {
func.apply(obj, initial_args.concat(arguments));
};
return(_local2);
}
function toString(Void) {
return("Hook()");
}
}
Symbol 20517 MovieClip [__Packages.standard.events.KeyStack] Frame 0
class standard.events.KeyStack
{
var _key_down_add_hash, _key_down_run_hash, _key_down2_add_hash, _key_down2_run_hash, _key_up_add_hash, _key_up_run_hash, _key_active_hash, _debugOn;
function KeyStack () {
Key.addListener(this);
}
function Initialize(Void) {
_key_down_add_hash = {};
_key_down_run_hash = {};
_key_down2_add_hash = {};
_key_down2_run_hash = {};
_key_up_add_hash = {};
_key_up_run_hash = {};
_key_active_hash = {};
}
function AddKeyEvents(iKey, downFunc, upFunc, down2Func) {
standard.debug.Tracer.myTrace((((((((this + ".AddKeyEvents(iKey:Number,downFunc:Function,upFunc:Function,down2Func:Function) : ") + iKey) + ", ") + downFunc) + ", ") + upFunc) + ", ") + down2Func, "standard.events.KeyStack::AddKeyEvents", "build/as/standard/events/KeyStack.as", 40);
if (_key_active_hash[iKey] == null) {
_key_active_hash[iKey] = false;
RegisterKey(iKey, _key_down_add_hash, _key_down_run_hash);
RegisterKey(iKey, _key_up_add_hash, _key_up_run_hash);
}
_key_down_add_hash[iKey](downFunc);
_key_up_add_hash[iKey](upFunc);
}
function RegisterKey(iKey, addHash, runHash) {
var _local5 = [];
var _local6 = standard.Hook.MakeAddHookFunc(_local5);
var _local7 = standard.Hook.MakeRunHooksFunc(_local5);
addHash[iKey] = _local6;
runHash[iKey] = _local7;
}
function onKeyDown(Void) {
var _local3 = Key.getCode();
PressKey(_local3);
}
function PressKey(iKey) {
if (_key_active_hash[iKey] == false) {
_key_active_hash[iKey] = true;
_key_down_run_hash[iKey]();
}
}
function onKeyUp(Void) {
var _local3 = Key.getCode();
ReleaseKey(_local3);
}
function ReleaseKey(iKey) {
if (_key_active_hash[iKey]) {
_key_active_hash[iKey] = false;
_key_up_run_hash[iKey]();
}
}
function DoubleCheck(Void) {
for (var _local3 in _key_active_hash) {
var _local4 = Number(_local3);
if (_key_active_hash[_local4]) {
if (!Key.isDown(_local4)) {
standard.debug.Tracer.myTrace("DOUBLE CHECK: " + _local4, "standard.events.KeyStack::DoubleCheck", "build/as/standard/events/KeyStack.as", 121);
ReleaseKey(_local4);
}
}
}
}
function ShowDebug(Void) {
_debugOn = true;
}
function HideDebug(Void) {
_debugOn = false;
}
function UpdateDebug(Void) {
}
function toString(Void) {
return("KeyStack()");
}
}
Symbol 20518 MovieClip [__Packages.standard.container.Database] Frame 0
class standard.container.Database
{
var _list, _nextFreeID;
function Database () {
_list = {};
_nextFreeID = 1;
}
static function Instance(Void) {
if (_instance == 0) {
_instance = new standard.container.Database();
}
return(_instance);
}
function Store(item) {
_list[item.GetID()] = item;
}
function Remove(id) {
delete _list[id];
}
function Find(id) {
return(_list[id]);
}
function Flush(Void) {
for (var i in _list) {
Remove(_list[i]);
}
}
function GetNewObjectID(Void) {
return(_nextFreeID++);
}
function PrintAll(Void) {
standard.debug.Tracer.myTrace("==== DATABASE ====", "standard.container.Database::PrintAll", "build/as/standard/container/Database.as", 46);
standard.debug.Tracer.myTrace("ID's given out: " + _nextFreeID, "standard.container.Database::PrintAll", "build/as/standard/container/Database.as", 47);
standard.debug.Tracer.myTrace("contents", "standard.container.Database::PrintAll", "build/as/standard/container/Database.as", 48);
standard.debug.Tracer.myTrace("--------", "standard.container.Database::PrintAll", "build/as/standard/container/Database.as", 49);
for (var val in _list) {
standard.debug.Tracer.myTrace("| " + _list[val], "standard.container.Database::PrintAll", "build/as/standard/container/Database.as", 51);
}
}
function toString(Void) {
return("Database()");
}
static var _instance = 0;
}
Symbol 20519 MovieClip [__Packages.standard.graphics.MC_Mixin] Frame 0
class standard.graphics.MC_Mixin
{
var _mc, _x, _y;
function MC_Mixin (obj, mc) {
obj._mc = mc;
obj.Draw = Draw;
obj.Show = Show;
obj.Hide = Hide;
obj._mc_mixin_last_frame = -1;
obj._mc_mixin_cleanup = Cleanup;
}
function Cleanup(Void) {
standard.debug.Tracer.myTrace(this + ".Cleanup(Void)<mc>", "standard.graphics.MC_Mixin::Cleanup", "build/as/standard/graphics/MC_Mixin.as", 33);
_mc.removeMovieClip();
}
function Show(Void) {
_mc._visible = true;
}
function Hide(Void) {
_mc._visible = false;
}
function Draw(Void) {
_mc._x = _x;
_mc._y = _y;
}
function toString(Void) {
return("MC_Mixin()");
}
}
Symbol 20520 MovieClip [__Packages.standard.audio.Sound_Unit] Frame 0
class standard.audio.Sound_Unit extends standard.deferred.Sound_Deferred
{
var _time, _isPlaying, _last_start, AddSoundStartHook, RunSoundStartHooks, AddSoundCompleteHook, RunSoundCompleteHooks, _name;
function Sound_Unit (target) {
super(target);
_time = standard.Time.Instance();
_isPlaying = false;
_last_start = 0;
var _local4 = [];
AddSoundStartHook = standard.Hook.MakeAddHookFunc(_local4);
RunSoundStartHooks = standard.Hook.MakeRunHooksFunc(_local4);
var _local5 = [];
AddSoundCompleteHook = standard.Hook.MakeAddHookFunc(_local5);
RunSoundCompleteHooks = standard.Hook.MakeRunHooksFunc(_local5);
}
function loadSound(url, isStreaming) {
_name = url;
return(super.loadSound(url, isStreaming));
}
function attachSound(linkageID) {
_name = linkageID;
return(super.attachSound(linkageID));
}
function GetSound(Void) {
return(this);
}
function start(secondOffset, loops) {
_last_start = _time.GetCurTime();
_isPlaying = true;
super.start(secondOffset, loops);
RunSoundStartHooks();
return(_last_start);
}
function onSoundComplete(Void) {
_isPlaying = false;
RunSoundCompleteHooks();
}
function GetLastStart(Void) {
return(_last_start);
}
function IsPlaying(Void) {
return(_isPlaying);
}
function toString(Void) {
return(("Sound_Unit(" + _name) + ")");
}
}
Symbol 20521 MovieClip [__Packages.standard.geometry.Rect] Frame 0
class standard.geometry.Rect
{
var x1, y1, x2, y2;
function Rect (ix1, iy1, ix2, iy2) {
x1 = ix1;
y1 = iy1;
x2 = ix2;
y2 = iy2;
}
function intersects(r) {
if (x2 < r.x1) {
return(false);
}
if (r.x2 < x1) {
return(false);
}
if (y2 < r.y1) {
return(false);
}
if (r.y2 < y1) {
return(false);
}
return(true);
}
function toString(Void) {
return(((((((("Rect(" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + ")");
}
}
Symbol 20522 MovieClip [__Packages.standard.widget.MC_Button] Frame 0
class standard.widget.MC_Button extends standard.widget.Simple_Button
{
var _mc;
function MC_Button (mc) {
super();
_mc = mc;
}
function toString(Void) {
return("MC_Button()");
}
var Initialize = standard.widget.MC_Button;
static var COUNT = 0;
}
Symbol 20523 MovieClip [__Packages.standard.SpriteController] Frame 0
class standard.SpriteController
{
var _animation_complete, AddAnimationCompleteHook, RunAnimationCompleteHooks, _animation_key, _curFrame, _curAnimation, _animation_loops;
function SpriteController (oKey) {
_animation_complete = false;
if (oKey != null) {
SetKey(oKey);
}
var _local3 = [];
AddAnimationCompleteHook = standard.Hook.MakeAddHookFunc(_local3);
RunAnimationCompleteHooks = standard.Hook.MakeRunHooksFunc(_local3);
}
function SetKey(oKey) {
_animation_key = oKey;
}
function AnimationComplete() {
return(_animation_complete);
}
function GetCurrentFrame() {
return(_curFrame);
}
function GetCurrentAnimation(Void) {
return(_curAnimation);
}
function PlayAnimation(sName, bLoop, deltaFrame) {
if (deltaFrame == null) {
deltaFrame = 0;
}
_animation_complete = false;
_curAnimation = sName;
if (bLoop != null) {
_animation_loops = bLoop;
} else {
_animation_loops = _animation_key[sName].loop;
}
_curFrame = _animation_key[sName].start + deltaFrame;
if (_curFrame > _animation_key[sName].end) {
_curFrame = _animation_key[sName].end;
}
return(_curFrame);
}
function Update(Void) {
if (_curFrame < _animation_key[_curAnimation].end) {
_curFrame++;
} else {
_animation_complete = true;
RunAnimationCompleteHooks();
if (_animation_loops) {
_curFrame = _animation_key[_curAnimation].start;
}
}
return(_curFrame);
}
function toString(Void) {
return("SpriteController()");
}
}
Symbol 20524 MovieClip [__Packages.standard.StateMachine_NEW] Frame 0
class standard.StateMachine_NEW extends standard.gameobject.ID_Object
{
var _states, _state_key, _time, _msgroute, _owner, _currentState, _stateChange, _nextState, _timeOnEnter, _ccMessagesToGameObject, _id;
function StateMachine_NEW (obj) {
super();
_states = [];
_state_key = {};
_time = standard.Time.Instance();
_msgroute = standard.message.MsgRoute.Instance();
_owner = obj;
_currentState = 1;
_stateChange = false;
_nextState = -1;
_timeOnEnter = 0;
_ccMessagesToGameObject = 0;
}
function Start(Void) {
standard.debug.Tracer.myTrace(this + ".Start(Void)", "standard.StateMachine_NEW::Start", "build/as/standard/StateMachine_NEW.as", 55);
_currentState = 1;
_nextState = -1;
_states[_currentState][0]();
if (_stateChange) {
ProcessStateChange();
}
}
function AddState(name, onEnter, onMsg, onUpdate, onExit) {
if (_state_key[name] != null) {
_states[_state_key[name]] = [MakeEventFunc(_owner, onEnter), MakeEventFunc(_owner, onMsg), MakeEventFunc(_owner, onUpdate), MakeEventFunc(_owner, onExit)];
} else {
_state_key[name] = _states.length;
_states.push([MakeEventFunc(_owner, onEnter), MakeEventFunc(_owner, onMsg), MakeEventFunc(_owner, onUpdate), MakeEventFunc(_owner, onExit)]);
}
}
function MakeEventFunc(obj, func) {
if (func == null) {
var _local2 = function () {
return(false);
};
} else {
var _local2 = function () {
return(func.apply(obj, arguments));
};
}
return(_local2);
}
function SetCCReceiver(id) {
_ccMessagesToGameObject = id;
}
function GetCCReceiver(Void) {
return(_ccMessagesToGameObject);
}
function ClearCCReceiver(Void) {
_ccMessagesToGameObject = 0;
}
function GetState(name) {
if (name == null) {
return(_currentState);
}
return(_state_key[name]);
}
function GetTimeInState(Void) {
return(_time.GetCurTime() - _timeOnEnter);
}
function Update(Void) {
Process_Update();
}
function ProcessStateChange(Void) {
var _local3 = 10;
while (_stateChange && ((_local3--) >= 0)) {
_stateChange = false;
_states[_currentState][3]();
_currentState = _nextState;
_timeOnEnter = _time.GetCurTime();
_states[_currentState][0]();
}
}
function Process_Update(Void) {
if (_states[_currentState][2]() == false) {
_states[0][2]();
}
if (_stateChange) {
ProcessStateChange();
}
}
function Process_Message(msg) {
if (GetCCReceiver() > 0) {
SendMsg(msg.GetMsgName(), GetCCReceiver());
}
if (_states[_currentState][1](msg) == false) {
_states[0][1](msg);
}
if (_stateChange) {
ProcessStateChange();
}
}
function SetState(newState) {
standard.debug.Tracer.myTrace((this + ".SetState(newState:String) : ") + newState, "standard.StateMachine_NEW::SetState", "build/as/standard/StateMachine_NEW.as", 172);
_stateChange = true;
_nextState = _state_key[newState];
}
function SendMsg(name, receiver, data) {
_msgroute.SendMsg(0, name, receiver, _owner.GetID(), 0, data);
}
function SendDelayedMsg(delay, name, receiver, data) {
_msgroute.SendMsg(delay, name, receiver, _owner.GetID(), 0, data);
}
function SendDelayedMsgToMe(delay, name, scope, data) {
if (scope == 1) {
var _local6 = _msgroute.SendMsg(delay, name, _owner.GetID(), _owner.GetID(), _currentState, data);
} else {
var _local6 = _msgroute.SendMsg(delay, name, _owner.GetID(), _owner.GetID(), 0, data);
}
return(_local6);
}
function toString(Void) {
return(((("StateMachine_NEW(" + _id) + ",") + _owner) + ")");
}
var Initialize = standard.StateMachine_NEW;
}
Symbol 20525 MovieClip [__Packages.standard.message.Msg_Object] Frame 0
class standard.message.Msg_Object
{
var _deliveryTime, _name, _sender, _receiver, _state, _data, _delivered;
function Msg_Object (deliveryTime, name, sender, receiver, state, data) {
_deliveryTime = deliveryTime;
_name = name;
_sender = sender;
_receiver = receiver;
_state = state;
_data = data;
_delivered = false;
}
function Serialize(Void) {
return("");
}
function GetMsgName(Void) {
return(_name);
}
function SetMsgName(name) {
_name = name;
}
function GetSender(Void) {
return(_sender);
}
function SetSender(sender) {
_sender = sender;
}
function GetReceiver(Void) {
return(_receiver);
}
function SetReceiver(receiver) {
_receiver = receiver;
}
function GetMsgState(Void) {
return(_state);
}
function SetMsgState(state) {
_state = state;
}
function GetData(Void) {
return(_data);
}
function GetDeliveryTime(Void) {
return(_deliveryTime);
}
function SetDeliveryTime(time) {
_deliveryTime = time;
}
function IsDelivered(Void) {
return(_delivered);
}
function SetDelivered(value) {
_delivered = value;
}
function toString(Void) {
return(((((((((("Msg_Object(" + _name) + ",") + _sender) + ",") + _receiver) + ",") + _state) + ",") + _deliveryTime) + ")");
}
}
Symbol 20526 MovieClip [__Packages.standard.message.MsgRoute] Frame 0
class standard.message.MsgRoute
{
var _time, _database, _delayedMessages;
function MsgRoute (Void) {
_time = standard.Time.Instance();
_database = standard.container.Database.Instance();
_delayedMessages = [];
}
static function Instance(Void) {
if (_instance == 0) {
_instance = new standard.message.MsgRoute();
}
return(_instance);
}
function SendMsg(delay, name, receiver, sender, state, data) {
if (delay <= 0) {
var _local8 = new standard.message.Msg_Object(_time.GetCurrentFrame(), name, sender, receiver, state, data);
RouteMsg(_local8);
} else {
var _local9 = delay + _time.GetCurrentFrame();
var _local8 = new standard.message.Msg_Object(_local9, name, sender, receiver, state, data);
var _local10 = 0;
while ((_local10 < _delayedMessages.length) && (_local9 >= _delayedMessages[_local10].GetDeliveryTime())) {
_local10++;
}
_delayedMessages.splice(_local10, 0, _local8);
}
return(_local8);
}
function CancelDelayedMsg(msg) {
var _local3 = _delayedMessages.length;
var _local4 = false;
if (_local3 > 0) {
while (_local3--) {
if (_delayedMessages[_local3] == msg) {
_local4 = true;
_delayedMessages.splice(_local3, 1);
}
}
}
return(_local4);
}
function DeliverDelayedMessages(Void) {
var _local4 = _time.GetCurrentFrame();
while ((_delayedMessages.length > 0) && (_delayedMessages[0].GetDeliveryTime() <= _local4)) {
var _local3 = _delayedMessages.shift();
RouteMsg(_local3);
}
}
function RouteMsg(msg) {
var _local3 = _database.Find(msg.GetReceiver());
if (_local3 != 0) {
if (_local3.GetStateMachine() == null) {
msg.SetDelivered(true);
_local3.Process_Message(msg);
} else if ((msg.GetMsgState() == 0) || (msg.GetMsgState() == _local3.GetStateMachine().GetState())) {
msg.SetDelivered(true);
_local3.GetStateMachine().Process_Message(msg);
}
}
}
function Flush(Void) {
while (_delayedMessages.length > 0) {
_delayedMessages.pop();
}
}
function FlushAllFrom(id) {
var _local3 = [];
var _local4 = 0;
for ( ; _local4 < _delayedMessages.length ; _local4++) {
if (_delayedMessages[_local4].GetSender() != id) {
_local3.push(_delayedMessages[_local4]);
}
}
_delayedMessages = _local3;
}
function toString(Void) {
return("MsgRoute()");
}
static var _instance = 0;
}
Symbol 20527 MovieClip [__Packages.game.Projectile] Frame 0
class game.Projectile extends game.G_Moving_GameObject
{
var _px, SetState, SetAnimationKey, Start, AddState, _mc_mixin_cleanup, _owner_id, _avatar_id, _vx, _x, _y, _width, _height, _py, PlayAnimation, Draw, _stuck_avatar, _stuck_dx, _stuck_dy, UpdatePosition, _keyed_db, Show, UpdateVelocity, UpdateAnimation, SendDelayedMsgToMe, Hide, SendMsg, _id;
function Projectile (x, y, r) {
super(x, y, r);
_px.AddGoalHook(standard.Hook.MakeHook(this, SetState, "Dead"), true);
var _local6 = GetFrames();
SetAnimationKey(_local6);
Start();
}
function AddStates() {
AddState("Global", null, null, null, null);
AddState("Initialize", Initialize_OnEnter, null, null, null);
AddState("Ready", null, Ready_OnMessage, null, null);
AddState("Move", Move_OnEnter, Move_OnMessage, Move_OnUpdate, Move_OnExit);
AddState("Stuck", Stuck_OnEnter, Stuck_OnMessage, Stuck_OnUpdate, Stuck_OnExit);
AddState("Dead", Dead_OnEnter, Dead_OnMessage, null, Dead_OnExit);
}
function Cleanup(Void) {
super.Cleanup();
_mc_mixin_cleanup();
}
function GetFrames(Void) {
var _local3 = {idle_right:{loop:true, start:1, end:16}, idle_left:{loop:true, start:17, end:32}, splat_right:{loop:false, start:33, end:44}, splat_left:{loop:false, start:45, end:57}};
return(_local3);
}
function SetOwnerID(id) {
_owner_id = id;
}
function SetAvatarID(id) {
_avatar_id = id;
}
function GetAvatarID(Void) {
return(_avatar_id);
}
function GetBounds(Void) {
var _local3 = _vx.GetVal();
if (_local3 > 0) {
return(new standard.geometry.Rect(_x, _y, (_x + _width) + _local3, _y + _height));
}
return(new standard.geometry.Rect(_x + _local3, _y, _x + _width, _y + _height));
}
function Launch(x, y, vx, vy) {
standard.debug.Tracer.myTrace((((((((this + ".Launch(x:Number,y:Number,vx:Number,vy:Number) : ") + x) + ", ") + y) + ", ") + vx) + ", ") + vy, "game.Projectile::Launch", "build/as/game/Projectile.as", 118);
_px.Initialize();
_py.Initialize();
_vx.SetVal(vx);
_x = _px.SetVal(x);
_y = _py.SetVal(y);
if (vx < 0) {
_px.SetGoal(10);
PlayAnimation("idle_left");
} else {
_px.SetGoal(590);
PlayAnimation("idle_right");
}
if ((x < 10) || (x > 590)) {
SetState("Dead");
} else {
SetState("Move");
}
Draw();
}
function IsStuck(Void) {
return(_stuck_avatar != null);
}
function Update(Void) {
if (IsStuck()) {
var _local3 = _stuck_avatar.Get_X();
var _local4 = _stuck_avatar.Get_Y();
_x = _px.SetVal(_local3 + _stuck_dx);
_y = _py.SetVal(_local4 + _stuck_dy);
} else {
UpdatePosition();
}
Draw();
}
function Global_OnMessage(msg) {
if (!(msg.GetMsgName() === 17)) {
} else {
SetState("Dead");
return(true);
}
return(false);
}
function Initialize_OnEnter(Void) {
SetState("Ready");
}
function Ready_OnMessage(msg) {
if (!(msg.GetMsgName() === 18)) {
} else {
var _local3 = msg.GetData();
Launch(_local3.x, _local3.y, _local3.vx, _local3.vy);
return(true);
}
return(false);
}
function Move_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Move_OnEnter(Void)", "game.Projectile::Move_OnEnter", "build/as/game/Projectile.as", 207);
_keyed_db.Change(this, 4, 2);
_stuck_avatar = null;
Show();
}
function Move_OnMessage(msg) {
switch (msg.GetMsgName()) {
case 17 :
SetState("Dead");
return(true);
case 4 :
var _local3 = msg.GetData();
_stuck_avatar = _local3.avatar;
_stuck_dx = _local3.dx;
_stuck_dy = _local3.dy;
SetState("Stuck");
return(true);
}
return(false);
}
function Move_OnUpdate(Void) {
UpdateVelocity();
UpdateAnimation();
return(true);
}
function Move_OnExit(Void) {
}
function Stuck_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Stuck_OnEnter(Void)", "game.Projectile::Stuck_OnEnter", "build/as/game/Projectile.as", 251);
_global.sfx.PlayKeyedSound(4, 0, 0, 0, 1, 60);
if (_vx.GetVal() < 0) {
PlayAnimation("splat_left");
} else {
PlayAnimation("splat_right");
}
_vx.SetVal(0);
SendDelayedMsgToMe(12, 3);
}
function Stuck_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Dead");
return(true);
}
return(false);
}
function Stuck_OnUpdate(Void) {
UpdateAnimation();
return(true);
}
function Stuck_OnExit(Void) {
_stuck_avatar = null;
}
function Dead_OnEnter(Void) {
standard.debug.Tracer.myTrace(this + ".Dead_OnEnter(Void)", "game.Projectile::Dead_OnEnter", "build/as/game/Projectile.as", 292);
_keyed_db.Change(this, 2, 4);
SetState("Initialize");
}
function Dead_OnMessage(msg) {
if (!(msg.GetMsgName() === 3)) {
} else {
SetState("Initialize");
return(true);
}
return(false);
}
function Dead_OnExit(Void) {
Hide();
SendMsg(15, _owner_id, {item:this});
}
function toString(Void) {
return(("Projectile(" + _id) + ")");
}
var Initialize = game.Projectile;
}
Symbol 20528 MovieClip [__Packages.standard.Time] Frame 0
class standard.Time
{
var AddMarkHook, RunMarkHooks, _actualTime, _gameTime, _timeLastTick, _gameSpeed, _startTime, _curFrame;
function Time (Void) {
var _local3 = [];
AddMarkHook = standard.Hook.MakeAddHookFunc(_local3);
RunMarkHooks = standard.Hook.MakeRunHooksFunc(_local3);
_actualTime = 0;
_gameTime = 0;
_timeLastTick = 0.001;
_gameSpeed = 1;
_startTime = getTimer() * 1;
_curFrame = 0;
}
static function Instance(Void) {
if (_instance == 0) {
_instance = new standard.Time();
}
return(_instance);
}
function MarkTimeThisTick(Void) {
var _local3 = getTimer() - _startTime;
var _local4 = _local3 - _actualTime;
_actualTime = _local3;
var _local5 = _local4 * _gameSpeed;
_gameTime = _gameTime + _local5;
_timeLastTick = _local5;
_curFrame++;
RunMarkHooks(_gameTime);
}
function GetCurrentFrame(Void) {
return(_curFrame);
}
function GetElapsedTime(Void) {
return(_timeLastTick);
}
function GetCurTime(Void) {
return(_gameTime);
}
function SetGameSpeed(value) {
_gameSpeed = value;
if (_gameSpeed < 0) {
_gameSpeed = 0;
} else if (_gameSpeed > 100) {
_gameSpeed = 100;
}
}
function GetGameSpeed(Void) {
return(_gameSpeed);
}
function toString(Void) {
return("Time()");
}
static var _instance = 0;
}
Symbol 361 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 6
stop();
Symbol 361 MovieClip Frame 11
stop();
Symbol 380 MovieClip Frame 1
stop();
Symbol 380 MovieClip Frame 10
stop();
Symbol 380 MovieClip Frame 11
stop();
Symbol 380 MovieClip Frame 16
stop();
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 10
stop();
Symbol 392 MovieClip Frame 11
stop();
Symbol 392 MovieClip Frame 16
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 10
stop();
Symbol 399 MovieClip Frame 11
stop();
Symbol 399 MovieClip Frame 16
stop();
Symbol 407 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 10
stop();
Symbol 407 MovieClip Frame 11
stop();
Symbol 407 MovieClip Frame 16
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 2
play();
Symbol 431 MovieClip Frame 1
stop();
Symbol 431 MovieClip Frame 6
stop();
Symbol 431 MovieClip Frame 11
stop();
Symbol 446 MovieClip Frame 1
stop();
stop();
Symbol 446 MovieClip Frame 6
stop();
Symbol 450 MovieClip Frame 1
stop();
Symbol 450 MovieClip Frame 6
stop();
Symbol 450 MovieClip Frame 11
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 1
stop();
Symbol 507 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 1
stop();
Symbol 544 MovieClip Frame 1
stop();
Symbol 544 MovieClip Frame 6
stop();
Symbol 544 MovieClip Frame 11
stop();
Symbol 544 MovieClip Frame 16
stop();
Symbol 547 MovieClip Frame 1
stop();
Symbol 547 MovieClip Frame 2
play();
Symbol 552 MovieClip Frame 1
stop();
Symbol 563 MovieClip Frame 1
stop();
Symbol 563 MovieClip Frame 2
play();
Symbol 563 MovieClip Frame 76
stop();
Symbol 563 MovieClip Frame 96
play();
Symbol 563 MovieClip Frame 170
stop();
Symbol 563 MovieClip Frame 200
play();
Symbol 563 MovieClip Frame 274
stop();
Symbol 563 MovieClip Frame 303
play();
Symbol 563 MovieClip Frame 377
stop();
Symbol 563 MovieClip Frame 406
play();
Symbol 563 MovieClip Frame 480
stop();
Symbol 566 MovieClip Frame 1
stop();
Symbol 566 MovieClip Frame 2
play();
Symbol 566 MovieClip Frame 40
stop();
Symbol 574 MovieClip Frame 2
gotoAndPlay(random(8));
Symbol 575 MovieClip Frame 2
gotoAndPlay(random(16));
Symbol 576 MovieClip Frame 2
gotoAndPlay(random(8));
Symbol 600 MovieClip Frame 1
stop();
Symbol 600 MovieClip Frame 6
stop();
Symbol 600 MovieClip Frame 11
stop();
Symbol 600 MovieClip Frame 16
stop();
Symbol 600 MovieClip Frame 21
stop();
Symbol 600 MovieClip Frame 26
stop();
Symbol 600 MovieClip Frame 31
stop();
Symbol 600 MovieClip Frame 36
stop();
Symbol 605 MovieClip Frame 1
stop();
Symbol 605 MovieClip Frame 6
stop();
Symbol 605 MovieClip Frame 11
stop();
Symbol 605 MovieClip Frame 16
stop();
Symbol 605 MovieClip Frame 21
stop();
Symbol 605 MovieClip Frame 26
stop();
Symbol 605 MovieClip Frame 31
stop();
Symbol 605 MovieClip Frame 36
stop();
Symbol 610 MovieClip Frame 1
stop();
Symbol 610 MovieClip Frame 6
stop();
Symbol 610 MovieClip Frame 11
stop();
Symbol 610 MovieClip Frame 16
stop();
Symbol 610 MovieClip Frame 21
stop();
Symbol 610 MovieClip Frame 26
stop();
Symbol 610 MovieClip Frame 31
stop();
Symbol 610 MovieClip Frame 36
stop();
Symbol 615 MovieClip Frame 1
stop();
Symbol 615 MovieClip Frame 6
stop();
Symbol 615 MovieClip Frame 11
stop();
Symbol 615 MovieClip Frame 16
stop();
Symbol 615 MovieClip Frame 21
stop();
Symbol 615 MovieClip Frame 26
stop();
Symbol 615 MovieClip Frame 31
stop();
Symbol 615 MovieClip Frame 36
stop();
Symbol 622 MovieClip Frame 1
stop();
Symbol 622 MovieClip Frame 6
stop();
Symbol 622 MovieClip Frame 11
stop();
Symbol 625 MovieClip Frame 1
stop();
Symbol 625 MovieClip Frame 6
stop();
Symbol 627 MovieClip Frame 1
stop();
Symbol 627 MovieClip Frame 6
stop();
Symbol 629 MovieClip Frame 1
stop();
Symbol 629 MovieClip Frame 6
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 6
stop();