Frame 1
function getPoints(_callbackFunction, _functionScope) {
}
function awardPoints(_points, _callbackFunction, _functionScope) {
}
Stage.showMenu = false;
_focusrect = false;
_global.rootScore = this;
Frame 2
stop();
Instance of Symbol 14 MovieClip in Frame 2
onClipEvent (enterFrame) {
var l_nPc = (_root.getBytesLoaded() / _root.getBytesTotal());
var l_sPc = Math.floor(l_nPc * 100);
if (mcLoad._currentframe < l_sPc) {
mcLoad.nextFrame();
} else {
this.mcLoad.stop();
}
if (mcLoad._currentframe == mcLoad._totalframes) {
_parent.gotoAndPlay("performanceTest");
}
}
Frame 10
sarbakan.utils.PerformanceWatcher.start(35);
Instance of Symbol 14 MovieClip in Frame 10
onClipEvent (load) {
mcLoad.gotoAndStop(mcLoad._totalframes);
}
Frame 45
_global.PerformanceTestResult = sarbakan.utils.PerformanceWatcher.fps;
sarbakan.utils.PerformanceWatcher.stop();
Frame 46
stop();
Symbol 3 MovieClip [_pause] Frame 1
new sarbakan.visual.PauseManager(this);
Symbol 22 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
Symbol 138 MovieClip Frame 1
_visible = false;
Symbol 177 MovieClip Frame 24
gotoAndPlay ("loop");
Symbol 184 MovieClip Frame 6
stopOnLastFrame();
Symbol 546 MovieClip Frame 4
oOwner.onStepSound();
Symbol 546 MovieClip Frame 8
oOwner.onStepSound();
Symbol 546 MovieClip Frame 12
oOwner.onStepSound();
Symbol 577 MovieClip Frame 9
stopOnLastFrame();
Symbol 816 MovieClip Frame 7
oOwner.onStepSound();
Symbol 823 MovieClip Frame 9
stopOnLastFrame();
Symbol 826 MovieClip Frame 9
stopOnLastFrame();
Symbol 1002 MovieClip [exit] Frame 1
_visible = false;
Symbol 1203 MovieClip Frame 1
stop();
Symbol 1621 MovieClip [__Packages.sarbakan.visual.PauseManager] Frame 0
class sarbakan.visual.PauseManager
{
static var oPausableList, bPaused;
function PauseManager (_mc) {
if (!oPausableList) {
reset();
}
register(_mc._parent);
_mc._visible = false;
_mc.swapDepths(999999);
_mc.removeMovieClip();
bPaused = false;
}
static function register(_mc) {
oPausableList[_mc] = _mc;
_mc.onUnload = function () {
sarbakan.visual.PauseManager.remove(this);
};
}
static function remove(_mc) {
delete oPausableList[_mc];
}
static function reset() {
oPausableList = {};
}
static function pause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].stop();
}
bPaused = true;
}
static function unpause() {
for (var _local1 in oPausableList) {
oPausableList[_local1].play();
}
bPaused = false;
}
}
Symbol 1622 MovieClip [__Packages.sarbakan.utils.PerformanceWatcher] Frame 0
class sarbakan.utils.PerformanceWatcher
{
static var nMovieFPS, bActive, oEnterFrameListener, nCurrentFPS, mcDebug, nUpdateCount, nLastGetTimer;
function PerformanceWatcher () {
}
static function start(_nMovieFPS) {
nMovieFPS = _nMovieFPS;
if (!bActive) {
bActive = true;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(sarbakan.utils.PerformanceWatcher, update);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
}
nCurrentFPS = nMovieFPS;
reset();
}
static function stop() {
if (bActive) {
bActive = false;
MovieClip.removeListener(oEnterFrameListener);
stopDebug();
}
}
static function addListener(_listener, _nMinFPS, _bDelete) {
aListeners.push({listener:_listener, nMinFPS:_nMinFPS, bDelete:_bDelete});
}
static function removeListener(_listener) {
for (var _local2 in aListeners) {
if (aListeners[_local2].listener == _listener) {
aListeners.splice(_local2, 1);
}
}
}
static function get fps() {
return(nCurrentFPS);
}
static function startDebug(_mcTimeline) {
mcDebug = _mcTimeline.createEmptyMovieClip("PerformanceWatcherDebug", DEBUG_DEPTH);
mcDebug._x = (Stage.width - DEBUG_RIGHT_MARGIN) - 50;
mcDebug._y = DEBUG_TOP_MARGIN;
mcDebug.createTextField("field", 2, 0, 0, 50, 50);
var _local1 = new TextFormat();
_local1.font = DEBUG_FONT;
_local1.size = DEBUG_FONT_SIZE;
_local1.color = DEBUG_FONT_COLOR;
_local1.align = "right";
mcDebug.field.setNewTextFormat(_local1);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 50, 50);
var _local2 = new TextFormat();
_local2.font = DEBUG_FONT;
_local2.size = DEBUG_FONT_SIZE;
_local2.color = DEBUG_FONT_SHADOW_COLOR;
_local2.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local2);
mcDebug.fieldShadow.selectable = false;
}
static function stopDebug() {
if (mcDebug != undefined) {
mcDebug.removeMovieClip();
}
}
static function update() {
if ((++nUpdateCount) == nMovieFPS) {
computeFrameRate();
updateDebug();
notifyListeners();
}
}
static function reset() {
nUpdateCount = 0;
nLastGetTimer = getTimer();
}
static function computeFrameRate() {
var _local1 = getTimer() - nLastGetTimer;
var _local2 = _local1 / 1000;
nCurrentFPS = Math.round(nMovieFPS / _local2);
reset();
}
static function notifyListeners() {
var _local1 = new Array();
for (var _local2 in aListeners) {
if (aListeners[_local2].nMinFPS >= nCurrentFPS) {
aListeners[_local2].listener(nCurrentFPS);
if (aListeners[_local2].bDelete) {
_local1.push(aListeners[_local2].listener);
}
}
}
for (var _local2 in _local1) {
removeListener(_local1[_local2]);
}
}
static function updateDebug() {
if (mcDebug != undefined) {
mcDebug.field.text = nCurrentFPS + " fps";
mcDebug.fieldShadow.text = nCurrentFPS + " fps";
}
}
static var DEBUG_DEPTH = 123456;
static var DEBUG_RIGHT_MARGIN = 0;
static var DEBUG_TOP_MARGIN = 0;
static var DEBUG_FONT = "Verdana";
static var DEBUG_FONT_SIZE = 10;
static var DEBUG_FONT_COLOR = 16777215;
static var DEBUG_FONT_SHADOW_COLOR = 0;
static var aListeners = new Array();
}
Symbol 1623 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
}
Symbol 1624 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1625 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1626 MovieClip [__Packages.Controller] Frame 0
class Controller
{
var mcBase, oTransition, oPackaging, oDifficultyStatus, oSideScroller, oPopup, oHUD, nDifficultyLevel, nMusicIntensityLevel, oMusicMain, oMusicChannel2, oMusicChannel3, oMusicChannelEnemmy1, oMusicChannelEnemmy2, oMusicAmbiance, oMusicPackaging, oMusicEnnemy;
function Controller (_mcBase) {
_global.C = this;
mcBase = _mcBase;
mcBase.stop();
mcBase.onEnterFrame = sarbakan.utils.Delegate.create(this, update);
sarbakan.sound.SoundManager.init(mcBase);
oTransition = new sarbakan.packaging.TransitionManager(mcBase.mcTransition);
oPackaging = new Packaging(mcBase.mcPackaging);
oDifficultyStatus = SharedObject.getLocal("av_elemental");
}
function update() {
oSideScroller.update();
oPopup.update();
oHUD.update();
}
function initGame(_nDifficulty) {
mcBase.gotoAndStop("game");
nDifficultyLevel = _nDifficulty;
nMusicIntensityLevel = 1;
oPopup = new Popup(mcBase.mcPopup);
oSideScroller = new SideScroller(mcBase.mcGame);
oSideScroller.init();
oHUD = new HUD(mcBase.mcHUD);
}
function destroyGame() {
oSideScroller.destroy();
delete oSideScroller;
mcBase.gotoAndStop("reset");
mcBase.gotoAndStop("packaging");
}
function isInGame() {
return(oSideScroller != undefined);
}
function transitionTo(_sTransitionID, _fListener) {
var _local2 = {middleListener:_fListener, inID:"in" + _sTransitionID, outID:"out" + _sTransitionID};
oTransition.startTransition(_local2);
}
function unlockMasterMode() {
oDifficultyStatus.data.unlocked = true;
oDifficultyStatus.flush();
}
function isMasterUnlocked() {
return(oDifficultyStatus.data.unlocked);
}
function winGame() {
oPackaging.goto("win", "Normal");
}
function loseGame() {
pause();
stopMusic();
oPackaging.goto("lose", "Normal");
}
function pause() {
oSideScroller.oView.pause();
}
function unpause() {
oSideScroller.oView.unpause();
}
function initGameMusic() {
if (oMusicMain.duration == undefined) {
stopMusic();
oMusicMain = sarbakan.sound.SoundManager.play("music_main", GameData.VOLUME_MUSIC_MAIN, 99999, true);
oMusicChannel2 = sarbakan.sound.SoundManager.play("music_channel2", 0, 9999999, true);
oMusicChannel3 = sarbakan.sound.SoundManager.play("music_channel3", 0, 9999999, true);
oMusicChannelEnemmy1 = sarbakan.sound.SoundManager.play("music_ennemy1", 0, 9999999, true);
oMusicChannelEnemmy2 = sarbakan.sound.SoundManager.play("music_ennemy2", 0, 9999999, true);
oMusicAmbiance = sarbakan.sound.SoundManager.play("ambiance", GameData.VOLUME_AMBIANCE, 9999999, true);
}
if (nMusicIntensityLevel > 1) {
var _local3 = nMusicIntensityLevel;
nMusicIntensityLevel = 1;
var _local2 = 1;
while (_local2 < _local3) {
musicIncreaseIntensity();
_local2++;
}
}
}
function initPackagingMusic() {
if (oMusicPackaging.duration == undefined) {
stopMusic();
oMusicPackaging = sarbakan.sound.SoundManager.play("musicPackaging", GameData.VOLUME_MUSIC_MAIN, 99999, true);
}
}
function musicIncreaseIntensity() {
var _local3 = [];
var _local2 = 2;
while (_local2 <= 3) {
if (this["oMusicChannel" + _local2].getVolume() == 0) {
_local3.push(_local2);
}
_local2++;
}
if (_local3.length > 0) {
nMusicIntensityLevel++;
var _local4 = _local3[0];
this["oMusicChannel" + _local4].setVolume(GameData["VOLUME_MUSIC_CHANNEL" + _local4]);
}
}
function musicDecreaseIntensity() {
var _local3 = [];
var _local2 = 2;
while (_local2 <= 3) {
if (this["oMusicChannel" + _local2].getVolume() != 0) {
_local3.push(_local2);
}
_local2++;
}
if (_local3.length > 0) {
nMusicIntensityLevel--;
var _local4 = _local3[0];
sarbakan.sound.SoundManager.fade(this["oMusicChannel" + _local4], sarbakan.sound.SoundManager.FADE_VOLUME, 0, 4);
}
}
function musicEnnemyStart() {
if (oMusicEnnemy == undefined) {
var _local2 = sarbakan.utils.MoreMath.random(1, 2);
oMusicEnnemy = this["oMusicChannelEnemmy" + _local2];
oMusicEnnemy.setVolume(GameData["VOLUME_MUSIC_CHANNEL_ENNEMY" + _local2]);
}
}
function musicEnnemyStop() {
sarbakan.sound.SoundManager.fade(oMusicEnnemy, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 4);
delete oMusicEnnemy;
}
function stopMusic() {
sarbakan.sound.SoundManager.stop(oMusicPackaging);
sarbakan.sound.SoundManager.stop(oMusicMain);
sarbakan.sound.SoundManager.stop(oMusicChannel2);
sarbakan.sound.SoundManager.stop(oMusicChannel3);
sarbakan.sound.SoundManager.stop(oMusicChannelEnemmy1);
sarbakan.sound.SoundManager.stop(oMusicChannelEnemmy2);
sarbakan.sound.SoundManager.stop(oMusicAmbiance);
}
}
Symbol 1627 MovieClip [__Packages.sarbakan.structure.Sequence] Frame 0
class sarbakan.structure.Sequence
{
function Sequence () {
}
function init() {
}
function update() {
}
function destroy() {
}
}
Symbol 1628 MovieClip [__Packages.sarbakan.visual.element.BaseElement] Frame 0
class sarbakan.visual.element.BaseElement
{
static var nNextID;
var id, oAttachProperties, oOwner, mc, sLinkage, nAttachDepth;
function BaseElement (_sID) {
id = _sID;
oAttachProperties = {};
}
function init() {
}
function setOwner(_oOwner) {
oOwner = _oOwner;
}
function setMC(_mc) {
mc = _mc;
if (mc.onElementCreated) {
mc.onElementCreated(this);
delete mc.onElementCreated;
}
}
function getMC() {
return(mc);
}
function setLinkage(_sLinkage) {
sLinkage = _sLinkage;
}
function attachMC(_mc) {
if (nAttachDepth == undefined) {
nAttachDepth = oOwner.getNextDepth();
oOwner.reserveDepth(nAttachDepth);
}
setMC(oOwner.mc.attachMovie(sLinkage, id, nAttachDepth, oAttachProperties));
}
function detachMC() {
oAttachProperties = {_x:mc._x, _y:mc._y, _xscale:mc._xscale, _yscale:mc._yscale, _height:mc._height, _width:mc._width, _rotation:mc._rotation, _alpha:mc._alpha, _visible:mc._visible};
mc.removeMovieClip();
setMC(undefined);
}
function removeReferenceMC() {
mc.swapDepths(16383);
detachMC();
}
function toString() {
return(("[Element " + id) + "]");
}
static function resetID() {
nNextID = undefined;
}
static function getNextID() {
if (!nNextID) {
nNextID = 0;
}
return(nNextID++);
}
}
Symbol 1629 MovieClip [__Packages.sarbakan.visual.layer.Layer] Frame 0
class sarbakan.visual.layer.Layer
{
var mc, oDynamicElements, oStaticElements, oCollisionMaps, oActivationManager, nHighestDepth, aReservedDepth, nOriginalX, nOriginalY, nStageWHalf, nStageHHalf;
function Layer (_mc, _oActivationManager) {
mc = _mc;
oDynamicElements = {};
oStaticElements = [];
oCollisionMaps = {};
oActivationManager = _oActivationManager;
nHighestDepth = 0;
aReservedDepth = [];
nOriginalX = _mc._x;
nOriginalY = _mc._y;
}
function init(_nStageW, _nStageH) {
nStageWHalf = _nStageW / 2;
nStageHHalf = _nStageH / 2;
oActivationManager.init(_nStageW, _nStageH);
}
function addDynamicElement(_oElement) {
oDynamicElements[_oElement.id] = _oElement;
_oElement.setOwner(this);
_oElement.init();
if (oDynamicElements[_oElement.id] != undefined) {
if (!_oElement.bAlwaysActive) {
var _local3 = _oElement.getGlobalPos(_oElement.mc);
oActivationManager.addDynamicElement(_oElement, _local3.x, _local3.y, _oElement.mc._width, _oElement.mc._height);
} else {
oActivationManager.addAlwaysActiveElement(_oElement);
}
_oElement.disable();
updateActivation(true);
}
}
function changeDynamicElementID(_oElement, _sNewID) {
delete oDynamicElements[_oElement.id];
_oElement.id = _sNewID;
oDynamicElements[_oElement.id] = _oElement;
}
function removeDynamicElement(_oElement) {
if (_oElement.bAlwaysActive) {
oActivationManager.removeAlwaysActiveElement(_oElement);
} else {
oActivationManager.removeDynamicElement(_oElement);
}
delete oDynamicElements[_oElement.id];
}
function addStaticElement(_oElement) {
_oElement.setOwner(this);
_oElement.init();
oActivationManager.addStaticElement(_oElement, _oElement.mc._x, _oElement.mc._y, _oElement.mc._width, _oElement.mc._height);
_oElement.disable();
updateActivation(true);
oStaticElements.push(_oElement);
}
function getDisplacementX() {
return(nOriginalX - mc._x);
}
function getDisplacementY() {
return(nOriginalY - mc._y);
}
function addCollisionMap(_oCollisionMap) {
oCollisionMaps[_oCollisionMap.id] = _oCollisionMap;
}
function getCollisionMap(_sCollisionMapID) {
return(oCollisionMaps[_sCollisionMapID]);
}
function reserveDepth(_nDepth) {
if (_nDepth > nHighestDepth) {
nHighestDepth = _nDepth;
}
aReservedDepth[_nDepth] = true;
}
function isDepthReserved(_nDepth) {
return(aReservedDepth[_nDepth] == true);
}
function getNextDepth() {
return(++nHighestDepth);
}
function update() {
updateActivation(false);
var _local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].update();
}
}
function reset() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].reset();
}
updateActivation(true);
}
function pause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].pause();
}
}
function unpause() {
var _local2;
_local2 = oActivationManager.getActiveElements();
for (var _local3 in _local2) {
_local2[_local3].unpause();
}
}
function destroy() {
for (var _local2 in oDynamicElements) {
oDynamicElements[_local2].remove();
}
for (var _local2 in oStaticElements) {
oStaticElements[_local2].removeMovieClip();
}
for (var _local2 in oCollisionMaps) {
oCollisionMaps[_local2].remove();
}
mc._x = nOriginalX;
mc._y = nOriginalY;
}
function updateActivation(_bForceUpdate) {
oActivationManager.updateActivation((mc._x - nStageWHalf) * -1, (mc._y - nStageHHalf) * -1, _bForceUpdate);
}
}
Symbol 1630 MovieClip [__Packages.sarbakan.visual.activation.ActivationManager] Frame 0
class sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight;
function ActivationManager () {
}
function init(_nZoneWidth, _nZoneHeight) {
nZoneWidth = _nZoneWidth;
nZoneHeight = _nZoneHeight;
}
function addDynamicElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
}
function updateDynamicElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
removeDynamicElement(_oElement);
addDynamicElement(_oElement, _nX, _nY, _nWidth, _nHeight);
}
function addAlwaysActiveElement(_oElement) {
}
function removeAlwaysActiveElement(_oElement) {
}
function removeDynamicElement(_oElement) {
}
function addStaticElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
}
function removeStaticElement(_oElement) {
}
function updateActivation(_nX, _nY) {
}
function getActiveElements() {
return([]);
}
}
Symbol 1631 MovieClip [__Packages.sarbakan.visual.element.StaticElement] Frame 0
class sarbakan.visual.element.StaticElement extends sarbakan.visual.element.BaseElement
{
var attachMC, detachMC, mc;
function StaticElement (_sID) {
super(_sID);
}
function enable() {
if (!isActive()) {
attachMC();
}
}
function disable() {
if (isActive()) {
detachMC();
}
}
function isActive() {
return(mc != undefined);
}
}
Symbol 1632 MovieClip [__Packages.sarbakan.visual.layer.CollisionMap] Frame 0
class sarbakan.visual.layer.CollisionMap
{
static var nDepth;
var id, oLayer, mc, nColor;
function CollisionMap (_sID, _oLayer, _nColor) {
if (!nDepth) {
nDepth = BASE_DEPTH;
}
id = _sID;
oLayer = _oLayer;
mc = oLayer.mc.createEmptyMovieClip(id, nDepth++);
mc._visible = false;
if (!_nColor) {
nColor = 16711935 /* 0xFF00FF */;
} else {
nColor = _nColor;
}
}
function show(_nAlpha) {
mc._visible = true;
if (_nAlpha) {
mc._alpha = _nAlpha;
} else {
mc._alpha = 100;
}
}
function hide() {
mc._visible = false;
mc._alpha = 100;
}
function drawRect(_nX, _nY, _nWidth, _nHeight) {
mc.moveTo(_nX, _nY);
mc.beginFill(nColor);
mc.lineTo(_nX + _nWidth, _nY);
mc.lineTo(_nX + _nWidth, _nY + _nHeight);
mc.lineTo(_nX, _nY + _nHeight);
mc.lineTo(_nX, _nY);
}
function setNewSource(_mcSource) {
remove();
mc = _mcSource;
mc._visible = false;
}
function attachMC(_sLinkage, _nX, _nY, _sName) {
if (!_sName) {
_sName = String(mc.getNextHighestDepth());
}
return(mc.attachMovie(_sLinkage, _sName, mc.getNextHighestDepth(), {_x:_nX, _y:_nY}));
}
function remove() {
mc.removeMovieClip();
}
function getMC() {
return(mc);
}
static var BASE_DEPTH = 64000;
}
Symbol 1633 MovieClip [__Packages.sarbakan.visual.element.DynamicElement] Frame 0
class sarbakan.visual.element.DynamicElement extends sarbakan.visual.element.BaseElement
{
var nSpeedX, nSpeedXLast, nSpeedY, nSpeedYLast, bAlwaysActive, bStaticMovieClip, bAnimStopped, bKeepStateOnEnable, mc, sState, sNextState, detachMC, bNoPause, oOwner, oAttachProperties;
function DynamicElement (_sID) {
super(_sID);
nSpeedX = 0;
nSpeedXLast = 0;
nSpeedY = 0;
nSpeedYLast = 0;
bAlwaysActive = false;
bStaticMovieClip = false;
bAnimStopped = false;
bKeepStateOnEnable = false;
enablePause();
}
function update() {
updateState();
updateMove();
}
function elementOnScreen() {
var _local2 = {x:0, y:0};
_local2 = {x:mc._x, y:mc._y};
mc._parent.localToGlobal(_local2);
var _local4 = _local2.x;
var _local3 = _local2.y;
var _local6 = _local4 + mc.state._width;
var _local5 = _local3 + mc.state._height;
return((((_local4 >= 0) && (_local4 <= 600)) && ((_local3 >= 0) && (_local3 <= 300))) || (((_local6 >= 0) && (_local6 <= 600)) && ((_local5 >= 0) && (_local5 <= 300))));
}
function enable() {
if (!isActive()) {
attachMC();
if (bKeepStateOnEnable && (sState != undefined)) {
setState(sState);
} else if (sNextState) {
setState(sNextState);
} else {
setState(DEFAULT_STATE);
}
updateState();
onEnable();
}
}
function disable() {
if (isActive()) {
detachMC();
onDisable();
}
}
function isActive() {
return(mc != undefined);
}
function pause() {
mc.state.stop();
}
function unpause() {
if (!bAnimStopped) {
mc.state.play();
}
}
function disablePause() {
bNoPause = true;
bAnimStopped = true;
}
function enablePause() {
bNoPause = false;
}
function stopOnLastFrame() {
mc.state.stop();
bAnimStopped = true;
}
function remove() {
disable();
if (!bStaticMovieClip) {
mc.removeMovieClip();
}
oOwner.removeDynamicElement(this);
}
function reset() {
}
function setMC(_mc) {
super.setMC(_mc);
if (sState) {
sNextState = sState;
} else {
sNextState = DEFAULT_STATE;
}
if (isActive()) {
updateState();
}
}
function attachMC() {
super.attachMC();
setState(DEFAULT_STATE);
}
function getElement(_sElementID) {
return(oOwner.oDynamicElements[_sElementID]);
}
function setState(_sState) {
sNextState = _sState;
}
function getState() {
return(sState);
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
function stateCurrentFrame() {
return(mc.state._currentframe);
}
function stateIsNot() {
var _local3 = false;
for (var _local4 in arguments) {
if (arguments[_local4] == sState) {
_local3 = true;
break;
}
}
return(!_local3);
}
function getCoord() {
var _local2 = {};
if (mc != undefined) {
_local2.x = mc._x;
_local2.y = mc._y;
} else {
_local2.x = oAttachProperties._x;
_local2.y = oAttachProperties._y;
}
return(_local2);
}
function setCoord(_oPos) {
mc._x = _oPos.x;
mc._y = _oPos.y;
}
function teleportTo(_nX, _nY) {
if (isActive()) {
mc._x = _nX;
mc._y = _nY;
updatePosInActivation();
} else {
oAttachProperties._x = _nX;
oAttachProperties._y = _nY;
attachMC();
updatePosInActivation();
detachMC();
}
oOwner.updateActivation(true);
}
function getGlobalPos(_mc) {
var _local1 = new Object();
_local1.x = 0;
_local1.y = 0;
_local1.x = _mc._x;
_local1.y = _mc._y;
_mc._parent.localToGlobal(_local1);
return(_local1);
}
function collideWithMap(_sCollisionMapID) {
var _local3;
if (typeof(arguments[1]) == "movieclip") {
_local3 = getGlobalPos(arguments[1]);
} else if (typeof(arguments[1]) == "object") {
_local3 = arguments[1];
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oCollisionMaps[_sCollisionMapID].mc.hitTest(_local3.x, _local3.y, true));
}
function collideWithElement(_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = getGlobalPos(arguments[1]);
} else {
_local3 = getGlobalPos(mc);
}
return(oOwner.oDynamicElements[_sElementID].mc.hitTest(_local3.x, _local3.y, false));
}
function collideWithElementBox(_sElementID) {
var _local3;
if (arguments[1]) {
_local3 = arguments[1];
} else {
_local3 = mc;
}
return(oOwner.oDynamicElements[_sElementID].mc.hitTest(_local3));
}
function onEnable() {
}
function onDisable() {
}
function updateState() {
if (sNextState != undefined) {
sState = sNextState;
sNextState = undefined;
mc.gotoAndStop(sState);
if (!bNoPause) {
bAnimStopped = false;
}
mc.state.oOwner = this;
mc.state.stopOnLastFrame = sarbakan.utils.Delegate.create(this, stopOnLastFrame);
}
this[sState]();
}
function updateMove() {
mc._x = nSpeedX + mc._x;
mc._y = nSpeedY + mc._y;
if ((!bAlwaysActive) && ((nSpeedX != 0) || (nSpeedY != 0))) {
updatePosInActivation();
}
}
function updatePosInActivation() {
var _local2 = getGlobalPos(mc);
_local2.x = _local2.x + oOwner.getDisplacementX();
_local2.y = _local2.y + oOwner.getDisplacementY();
oOwner.oActivationManager.updateDynamicElement(this, _local2.x, _local2.y, mc._width, mc._height);
}
var DEFAULT_STATE = "idle";
}
Symbol 1634 MovieClip [__Packages.sarbakan.utils.Delegate] Frame 0
class sarbakan.utils.Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local4 = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(_local4.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1635 MovieClip [__Packages.Popup] Frame 0
class Popup extends sarbakan.visual.element.DynamicElement
{
var setMC, oKey, nCurrentType, nCurrentCharacter, sText, fEndListener, bStayOpen, getState, stateFinished, bCanClose, mc, stateStarting, setState;
function Popup (_mc) {
super("popup");
setMC(_mc);
oKey = sarbakan.input.KeyManager.getInstance();
oKey.addKeyListener(32, "CLOSE");
}
function showDialog(_nCharacter, _sText, _fEndListener, _bStayOpen) {
nCurrentType = TYPE_DIALOG;
nCurrentCharacter = _nCharacter;
sText = _sText;
fEndListener = _fEndListener;
bStayOpen = _bStayOpen;
showPopup();
}
function showInstruction(_sText, _fEndListener, _bStayOpen) {
nCurrentType = TYPE_INSTRUCTION;
sText = _sText;
fEndListener = _fEndListener;
bStayOpen = _bStayOpen;
showPopup();
}
function isActive() {
return((getState() == "dialogAppear") || (getState() == "instructionAppear"));
}
function popupAppear() {
if (stateFinished()) {
showPopupType();
}
}
function dialogAppear() {
contentAppear();
}
function instructionAppear() {
contentAppear();
}
function contentAppear() {
setContent();
if (stateFinished()) {
bCanClose = true;
mc.state.stop();
}
if (bCanClose) {
if (oKey.CLOSE) {
closePopup();
}
}
}
function dialogDisappear() {
contentDisappear();
}
function instructionDisappear() {
contentDisappear();
}
function contentDisappear() {
if (stateStarting()) {
setContent();
}
if (stateFinished()) {
if (bStayOpen) {
notify();
mc.state.stop();
} else {
setState("popupDisappear");
}
}
}
function popupDisappear() {
if (stateFinished()) {
notify();
setState("idle");
}
}
function showPopup() {
bCanClose = false;
if (getState() == "idle") {
setState("popupAppear");
} else {
showPopupType();
}
}
function showPopupType() {
if (nCurrentType == TYPE_DIALOG) {
setState("dialogAppear");
} else {
setState("instructionAppear");
}
}
function closePopup() {
if (nCurrentType == TYPE_DIALOG) {
setState("dialogDisappear");
} else {
setState("instructionDisappear");
}
}
function setContent() {
mc.state.mcContent.txtText.text = sText;
if (nCurrentType == TYPE_DIALOG) {
mc.state.mcContent.mcCharacter.gotoAndStop(Number(nCurrentCharacter) + 1);
}
}
function notify() {
if (fEndListener != undefined) {
fEndListener();
delete fEndListener;
}
}
static var TYPE_DIALOG = 1;
static var TYPE_INSTRUCTION = 2;
}
Symbol 1636 MovieClip [__Packages.sarbakan.input.KeyManager] Frame 0
class sarbakan.input.KeyManager
{
static var oInstance;
var oKeyList;
function KeyManager () {
oKeyList = new Object();
}
static function getInstance() {
if (!oInstance) {
oInstance = new sarbakan.input.KeyManager();
}
initEnterFrame();
return(oInstance);
}
function addKeyListener(_nKeyCode, _sKeyName) {
oKeyList[_sKeyName] = new Object();
oKeyList[_sKeyName].nKeyCode = _nKeyCode;
this[_sKeyName] = false;
}
function onEnterFrame() {
setKey();
}
function setKey() {
var _local2;
for (_local2 in oKeyList) {
if (Key.isDown(oKeyList[_local2].nKeyCode)) {
this[_local2] = true;
} else {
this[_local2] = false;
}
}
}
static function initEnterFrame() {
mx.transitions.OnEnterFrameBeacon.init();
MovieClip.removeListener(oInstance);
MovieClip.addListener(oInstance);
}
}
Symbol 1637 MovieClip [__Packages.HUD] Frame 0
class HUD
{
var mc, nScore, nScoreDisplayed, nProgressLimit, nProgressCount, nProgressUpdateCount;
function HUD (_mc) {
mc = _mc;
nScore = 0;
nScoreDisplayed = 0;
}
function update() {
if (sarbakan.visual.PauseManager.bPaused != true) {
updateProgress();
updateScore();
updateEnergy();
}
}
function init() {
initEnergy();
updateEnergy();
initProgress();
updateProgress();
updateCharacters();
updateToken();
mc.btMenu.onRelease = sarbakan.utils.Delegate.create(this, onButtonMenu);
}
function addScore(_nScore) {
nScore = nScore + _nScore;
}
function onButtonMenu() {
_global.C.oPackaging.clickSound();
_global.C.pause();
_global.C.oPackaging.goto("menu");
}
function initEnergy() {
var _local4 = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].energyMax;
var _local3 = 1;
while (_local3 <= 6) {
if (_local3 > _local4) {
mc.mcLife["mcLife" + _local3]._visible = false;
} else {
mc.mcLife["mcLife" + _local3]._visible = true;
}
_local3++;
}
}
function updateEnergy() {
var _local4 = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].energyMax;
if (_local4 != undefined) {
var _local3 = 1;
while (_local3 <= _local4) {
if (_local3 > elements.characters.BaseCharacter.nEnergy) {
mc.mcLife["mcLife" + _local3].gotoAndStop("empty");
} else {
mc.mcLife["mcLife" + _local3].gotoAndStop("full");
}
_local3++;
}
}
}
function initProgress() {
nProgressLimit = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].time * 60;
nProgressCount = 0;
nProgressUpdateCount = GameData.FRAME_RATE;
}
function updateProgress() {
if ((++nProgressUpdateCount) >= GameData.FRAME_RATE) {
nProgressUpdateCount = 0;
if ((++nProgressCount) == nProgressLimit) {
_global.C.loseGame();
} else {
mc.mcProgress.gotoAndStop(Math.ceil((nProgressCount / nProgressLimit) * 100));
}
}
}
function updateCharacters() {
var _local2 = elements.characters.BaseCharacter.getControlledCharacter();
mc.mcCharCurrent.gotoAndStop(_local2.id);
mc.mcCharPrev.gotoAndStop(_local2.CHARACTER_PREV);
mc.mcCharNext.gotoAndStop(_local2.CHARACTER_NEXT);
}
function updateToken() {
if (elements.characters.BaseCharacter.nToken == undefined) {
mc.txtToken.text = 0;
} else {
mc.txtToken.text = elements.characters.BaseCharacter.nToken;
}
}
function updateScore() {
if (nScoreDisplayed < nScore) {
nScoreDisplayed = nScoreDisplayed + 50;
if (nScoreDisplayed > nScore) {
nScoreDisplayed = nScore;
}
}
mc.txtScore.text = nScoreDisplayed;
}
}
Symbol 1638 MovieClip [__Packages.GameData] Frame 0
class GameData
{
function GameData () {
}
static var FRAME_RATE = 35;
static var FRAME_PERFORMANCE_THRESHOLD = 12;
static var SCREEN_WIDTH = 600;
static var SCREEN_HEIGHT = 300;
static var DIFFICULTY_NORMAL = 0;
static var DIFFICULTY_HARD = 1;
static var DIFFICULTY_MASTER = 2;
static var DIFFICULTY_SETTINGS = [{time:40, energyMax:6, guard_delayAttack:40, guard_energyMax:2, guard_chanceAttack:0.4, score_multiplier:1}, {time:35, energyMax:5, guard_delayAttack:25, guard_energyMax:3, guard_chanceAttack:0.3, score_multiplier:1.2}, {time:30, energyMax:4, guard_delayAttack:15, guard_energyMax:4, guard_chanceAttack:0.2, score_multiplier:1.5}];
static var CONTINUE_TIME_VALUE = 10;
static var ELEMENT_AANG = 0;
static var ELEMENT_KATARA = 1;
static var ELEMENT_TOPH = 2;
static var ELEMENT_FIREGUARD = 3;
static var ELEMENT_SPAWNPOINT = 4;
static var ELEMENT_SWITCH = 5;
static var ELEMENT_DOOR = 6;
static var ELEMENT_CRACKEDWALL = 7;
static var ELEMENT_FIRE = 8;
static var ELEMENT_FIREBALL = 9;
static var ELEMENT_FLOOR_DYNAMIC = 10;
static var ELEMENT_BONUS_TOKEN = 11;
static var ELEMENT_BONUS_LIFE = 12;
static var ELEMENT_EXIT = 13;
static var ELEMENT_DECORATION = 14;
static var CHARACTERS = ["aang", "katara", "toph"];
static var DEFAULT_CHARACTER = ELEMENT_AANG;
static var CAMERA_BASE_SPEED = 15;
static var CAMERA_SPEED_ADJUST_STEP = 75;
static var CAMERA_CORRECTION_X = 250;
static var CAMERA_CORRECTION_Y = 200;
static var SCORE_ENNEMY = 125;
static var SCORE_ENNEMY_ALL = 1000;
static var SCORE_TOKEN = 300;
static var SCORE_TOKEN_ALL = 500;
static var SCORE_HEART = 50;
static var SCORE_GENERIC = 10;
static var SCORE_GENERIC_ALL = 1000;
static var SCORE_COMPLETE = 10000;
static var SCORE_TIME_REMAINING = 20;
static var SCORE_SPEED_BONUS = 1000;
static var SCORE_SPEED_BONUS_LIGHTNING = 5000;
static var SCORE_SPEED_BONUS_MASTER = 15000;
static var SCORE_ENERGY_REMAINING = 100;
static var SCORE_ENERGY_FULL = 5000;
static var BONUS_TIME_MASTER = 25;
static var BONUS_TIME_LIGHTNING = 30;
static var BONUS_TIME = 35;
static var VOLUME_MUSIC_PACKAGING = 40;
static var VOLUME_MUSIC_MAIN = 40;
static var VOLUME_MUSIC_CHANNEL2 = 55;
static var VOLUME_MUSIC_CHANNEL3 = 55;
static var VOLUME_MUSIC_CHANNEL_ENNEMY1 = 55;
static var VOLUME_MUSIC_CHANNEL_ENNEMY2 = 55;
static var VOLUME_TOPH_HITGROUND = 100;
static var VOLUME_AANG_JUMP = 80;
static var VOLUME_AANG_RUN = 100;
static var VOLUME_KATARA_WHIP = 50;
static var VOLUME_STEP = 100;
static var VOLUME_JUMP = 100;
static var VOLUME_LAND = 100;
static var VOLUME_SWITCH = 100;
static var VOLUME_LEVER = 100;
static var VOLUME_CRUMBLE = 100;
static var VOLUME_DOOR = 100;
static var VOLUME_FIREGUARD_HIT = 100;
static var VOLUME_FIREBALL = 60;
static var VOLUME_FIREBALL_HIT = 60;
static var VOLUME_FIRE_SPAWN = 100;
static var VOLUME_FIRE_EXTINGUISH = 100;
static var VOLUME_FIRE_HURT = 100;
static var VOLUME_BONUS_LIFE = 100;
static var VOLUME_BONUS_TOKEN = 100;
static var VOLUME_SPAWN = 100;
static var VOLUME_SPAWN_HIT = 100;
static var VOLUME_MAGIC = 100;
static var VOLUME_EXIT = 100;
static var VOLUME_AMBIANCE = 100;
static var VOLUME_BUTTON = 75;
static var DIALOGS = {TUTO_A:"Where am I?", TUTO_B:"Aang! I'm so glad you're okay! We've been captured by Fire Benders while we were sleeping. There must be something I can do to help you out...", TUTO_C:"I think you need to activate the switch. Why not use your whip?", TUTO_D:"Thanks Katara.", TUTO_E:"I heard Toph yell out just a while ago. You must free her!", TUTO_F:"Maybe I could reach this switch by jumping...", TUTO_G:"Aang! Katara! We need to escape, quick! I overheard a guard saying that this boat is heading towards the Fire Lord's lands! There's no time to waste!", TUTO_H:"I think I see a wall made of stone...\u2026Toph, is there something you could do to free Katara?", TUTO_I:"I owe you one Toph! If we ever stumble upon a Fire Guard, he'll have a taste of my whip!", TUTO_J:"Let's get going!", HINT_SWITCH_MULTIPLE:"It's strange, this switch doesn't seem to activate anything. Maybe we should trigger them all...", HINT_SWITCH_FIRE:"Stepping on switches might help Toph and Aang cross this perilous section.", HINT_SWITCH_PLATFORM:"What is this? It seems that the switches make some platforms appear and disappear.", HINT_SWITCH_SWITCH:"Oh I get it! Stepping on switches makes other switches appear.", EXIT_LEVER:"This switch is different... Maybe it unlocks the exit leading to the deck!", EXIT_REACHED_A:"There, I've reached the exit! But I can't leave without ##MISSING_CHARACTER1## and ##MISSING_CHARACTER2##.", EXIT_REACHED_B:"##INCOMING_CHARACTER## I'm glad you made it, but let's not rejoice now. ##MISSING_CHARACTER## is still in danger!", EXIT_REACHED_C:"We made it!"};
static var INSTRUCTIONS = {TUTO_A:"Move to the left, using the arrow keys.", TUTO_B:"Press \"x\" to switch to Katara.", TUTO_C:"Press \"spacebar\" to use the water whip.", TUTO_E:"Press \"z\" or to switch to Aang.", TUTO_F:"Press \"up arrow\" to jump. Press \"spacebar\" to jump higher and step on the switch.", TUTO_H:"Press \"z\" to switch to Toph.\nStomp ground with \"spacebar\" to break the stone walls."};
}
Symbol 1639 MovieClip [__Packages.sarbakan.visual.element.basicElement.Character] Frame 0
class sarbakan.visual.element.basicElement.Character extends sarbakan.visual.element.DynamicElement
{
var sFloorColliderID, sWallColliderID, sCeilingColliderID, sFrontColliderName, sBackColliderName, sBottomColliderName, sTopColliderName, nMoveSpeedX, nAirSpeedX, bNoFlip, nDirection, mc, setState, nSpeedX, nSpeedY, stateStarting, stateFinished, getGlobalPos, collideWithMap;
function Character (_sID) {
super(_sID);
sFloorColliderID = "floor";
sWallColliderID = "wall";
sCeilingColliderID = "ceiling";
sFrontColliderName = "front";
sBackColliderName = "back";
sBottomColliderName = "bottom";
sTopColliderName = "top";
nMoveSpeedX = SPEED_RUN;
nAirSpeedX = SPEED_AIR_MOVEX;
bNoFlip = false;
}
function setDirection(_nDirection) {
if ((_nDirection >= -1) && (_nDirection <= 1)) {
nDirection = _nDirection;
if (bNoFlip != true) {
mc._xscale = Math.abs(mc._xscale) * nDirection;
}
}
}
function getDirection() {
return(nDirection);
}
function initIdle() {
setState("idle");
}
function idle() {
nSpeedX = 0;
nSpeedY = 0;
checkFall();
}
function run() {
nSpeedX = nMoveSpeedX * nDirection;
nSpeedY = 0;
checkFall();
setPositionOutFloor();
checkWall();
}
function fall() {
if (stateStarting()) {
nSpeedY = 1;
}
if (stateFinished()) {
mc.state.stop();
}
nSpeedY = nSpeedY + (nSpeedY * GRAVITY);
if (nSpeedY > SPEED_FALL) {
nSpeedY = SPEED_FALL;
}
if (isOnGround()) {
setPositionOutFloor();
setState("land");
} else if (nSpeedX != 0) {
nSpeedX = nDirection * nAirSpeedX;
}
checkWall();
}
function land() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
initIdle();
setPositionOutFloor();
}
}
function jump() {
if (stateStarting()) {
nAirSpeedX = SPEED_AIR_MOVEX;
nSpeedY = JUMP_FORCE;
} else {
nSpeedY = nSpeedY - (nSpeedY * GRAVITY);
if (nSpeedX != 0) {
nSpeedX = nDirection * nAirSpeedX;
}
if (nSpeedY > -1) {
setState("fall");
}
}
checkWall();
if (nSpeedY <= -1) {
checkCeiling();
}
}
function jumpStart() {
if (stateFinished()) {
setState("jump");
}
}
function onEnable() {
setDirection(nDirection);
}
function checkFall() {
var _local2 = mc._y;
while (!isOnGround()) {
mc._y = mc._y + ADJUST_FLOOR;
if ((mc._y - _local2) > DISTANCE_FALL) {
setState("fall");
break;
}
nSpeedY = mc._y - _local2;
}
if (mc._y != _local2) {
mc._y = _local2;
return(false);
}
return(true);
}
function checkWall() {
if (isHittingWall()) {
setPositionOutWall();
}
}
function checkCeiling() {
if (isHittingCeiling()) {
nSpeedY = 0;
setState("fall");
}
}
function isOnGround() {
var _local2 = getGlobalPos(mc[sBottomColliderName]);
return(collideWithMap(sFloorColliderID, {x:_local2.x + nSpeedX, y:_local2.y + nSpeedY}));
}
function isHittingWall() {
var _local2;
_local2 = getGlobalPos(mc[sFrontColliderName]);
if (collideWithMap(sWallColliderID, {x:_local2.x + nSpeedX, y:_local2.y + nSpeedY})) {
return(-1);
}
if (sBackColliderName) {
_local2 = getGlobalPos(mc[sBackColliderName]);
if (collideWithMap(sWallColliderID, {x:_local2.x + nSpeedX, y:_local2.y + nSpeedY})) {
return(1);
}
}
}
function isHittingCeiling() {
var _local3 = false;
if (sTopColliderName) {
var _local2;
_local2 = getGlobalPos(mc[sTopColliderName]);
if (collideWithMap(sCeilingColliderID, {x:_local2.x + nSpeedX, y:_local2.y + nSpeedY})) {
_local3 = true;
}
}
return(_local3);
}
function setPositionOutFloor() {
while (isOnGround()) {
nSpeedY--;
}
}
function setPositionInFloor() {
while (!isOnGround()) {
nSpeedY++;
}
}
function setPositionOutWall() {
var _local2;
var _local3 = 0;
while (_local2 = isHittingWall() && (_local3 < 10) , _local2) {
_local2 = isHittingWall();
nSpeedX = nSpeedX + (_local2 * (mc._xscale / Math.abs(mc._xscale)));
_local3++;
}
}
var ADJUST_FLOOR = 1;
var DISTANCE_FALL = 8;
var JUMP_FORCE = -20;
var GRAVITY = 0.2;
var SPEED_RUN = 3;
var SPEED_FALL = 10;
var SPEED_AIR_MOVEX = 3;
}
Symbol 1640 MovieClip [__Packages.elements.characters.BaseCharacter] Frame 0
class elements.characters.BaseCharacter extends sarbakan.visual.element.basicElement.Character
{
static var oKey, ENERGY_FULL, nEnergy, nToken, oControlledCharacter, bLockedControl;
var setMC, setLinkage, sCeilingColliderID, sBackColliderName, oSeenBy, nLastStepID, removeReferenceMC, attachMC, oOriginalSpawnX, mc, oOriginalSpawnY, isActive, oAttachProperties, oSpawnPoint, teleportTo, setState, setDirection, nSpeedX, nSpeedY, stateFinished, stateStarting, FRAME_SWITCH_TRIGGER, stateCurrentFrame, FRAME_LEVER_TRIGGER, nSwitchDelayCount, CHARACTER_NEXT, CHARACTER_PREV, nAirSpeedX, nDirection, SPEED_RUN, oOwner, getGlobalPos, collideWithMap, sWallColliderID;
function BaseCharacter (_sID, _sLinkage, _mc) {
super(_sID);
setMC(_mc);
setLinkage(_sLinkage);
if (!oKey) {
setupKeys();
}
ENERGY_FULL = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].energyMax;
sCeilingColliderID = "wall";
delete sBackColliderName;
oSeenBy = {};
nLastStepID = 1;
nEnergy = ENERGY_FULL;
nToken = 0;
}
function init() {
removeReferenceMC();
attachMC();
oOriginalSpawnX = mc._x;
oOriginalSpawnY = mc._y;
}
static function setControlledCharacter(_oCharacter) {
oControlledCharacter = _oCharacter;
}
static function getControlledCharacter() {
return(oControlledCharacter);
}
static function getControlledCharacterID() {
for (var _local1 in GameData.CHARACTERS) {
if (GameData.CHARACTERS[_local1] == oControlledCharacter.id) {
return(_local1);
}
}
}
static function lockControl() {
bLockedControl = true;
if (oControlledCharacter.getState() == "run") {
oControlledCharacter.setState("idle");
}
sarbakan.utils.ActionSequencer.onActionDone("lockControl");
sarbakan.utils.ActionSequencer.onActionDone("tuto_lockControl");
}
static function unlockControl() {
if (_global.C.oPopup.isActive() == false) {
bLockedControl = false;
}
sarbakan.utils.ActionSequencer.onActionDone("unlockControl");
sarbakan.utils.ActionSequencer.onActionDone("tuto_unlockControl");
}
function getCoord() {
var _local2 = {};
if (isActive()) {
_local2.x = mc._x - GameData.CAMERA_CORRECTION_X;
_local2.y = mc._y - GameData.CAMERA_CORRECTION_Y;
} else {
_local2.x = oAttachProperties._x - GameData.CAMERA_CORRECTION_X;
_local2.y = oAttachProperties._y - GameData.CAMERA_CORRECTION_Y;
}
return(_local2);
}
function addSeeingFireGuard(_oFireGuard) {
oSeenBy[_oFireGuard.id] = _oFireGuard;
}
function removeSeeingFireGuard(_oFireGuard) {
delete oSeenBy[_oFireGuard.id];
}
function setSpawnPoint(_oSpawnPoint) {
oSpawnPoint = _oSpawnPoint;
}
function updateOffscreenDeath() {
if (!isActive()) {
for (var _local2 in oSeenBy) {
break;
}
if (_local2 != undefined) {
if (Math.random() < CHANCE_KILLED_OFFSCREEN) {
oSeenBy = {};
var _local3 = getRespawnPoint();
teleportTo(_local3.x, _local3.y);
setState("respawn");
}
}
}
}
static function loseEnergy() {
nEnergy--;
_global.C.oHUD.updateEnergy();
}
static function gainEnergy() {
nEnergy++;
if (nEnergy > ENERGY_FULL) {
nEnergy = ENERGY_FULL;
}
_global.C.oHUD.updateEnergy();
}
static function gainToken() {
nToken++;
_global.C.oHUD.updateToken();
}
function idle() {
super.idle();
var _local3 = false;
if (isControlledCharacter()) {
if (oKey.LEFT) {
setDirection(-1);
setState("run");
_local3 = true;
} else if (oKey.RIGHT) {
setDirection(1);
setState("run");
_local3 = true;
}
if (oKey.JUMP) {
initJump();
_local3 = true;
}
if (!_local3) {
checkSwitchControl();
}
}
}
function run() {
super.run();
if (isControlledCharacter()) {
if (oKey.LEFT) {
setDirection(-1);
} else if (oKey.RIGHT) {
setDirection(1);
} else {
setState("idle");
}
if (oKey.JUMP) {
initJump();
}
}
}
function jump() {
super.jump();
checkAirControl();
}
function fall() {
super.fall();
checkAirControl();
}
function hurt() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
loseEnergy();
setState("respawn");
}
}
function land() {
super.land();
if (stateStarting()) {
sarbakan.sound.SoundManager.play("step1", GameData.VOLUME_LAND, 1, false);
}
}
function respawn() {
nSpeedX = 0;
nSpeedY = 0;
if (stateStarting()) {
var _local3 = getRespawnPoint();
teleportTo(_local3.x, _local3.y);
if (nEnergy == 0) {
mc.state.stop();
_global.C.loseGame();
} else {
sarbakan.sound.SoundManager.play("spawn", GameData.VOLUME_SPAWN, 1, false);
if (oSpawnPoint != undefined) {
oSpawnPoint.setState("spawning");
}
if (isControlledCharacter()) {
lockControl();
_global.C.oSideScroller.focusOnCurrentCharacter();
}
}
}
if (stateFinished()) {
setState("idle");
}
}
function activateSwitch() {
nSpeedX = 0;
nSpeedY = 0;
lockControl();
if (stateStarting()) {
onSwitchSound();
}
if (stateCurrentFrame() == FRAME_SWITCH_TRIGGER) {
elements.Switch.onSwitchActivate();
}
if (stateFinished()) {
setState("idle");
}
}
function activateLever() {
nSpeedX = 0;
nSpeedY = 0;
lockControl();
if (stateStarting()) {
onLeverSound();
}
if (stateCurrentFrame() == FRAME_LEVER_TRIGGER) {
elements.Switch.onSwitchActivate();
}
if (stateFinished()) {
setState("idle");
}
}
function onStepSound() {
if (nLastStepID == 1) {
nLastStepID = 2;
} else {
nLastStepID = 1;
}
sarbakan.sound.SoundManager.play("step" + nLastStepID, GameData.VOLUME_STEP, 1, false);
}
function onLeverSound() {
}
function onSwitchSound() {
}
function setupKeys() {
oKey = sarbakan.input.KeyManager.getInstance();
oKey.addKeyListener(37, "LEFT");
oKey.addKeyListener(39, "RIGHT");
oKey.addKeyListener(38, "JUMP");
oKey.addKeyListener(40, "DOWN");
oKey.addKeyListener(32, "ACTION");
oKey.addKeyListener(90, "PREV");
oKey.addKeyListener(88, "NEXT");
oKey.addKeyListener(73, "EASTER_EGG");
}
function isControlledCharacter() {
return((!bLockedControl) && (this == oControlledCharacter));
}
function checkSwitchControl() {
if (nSwitchDelayCount < SWITCH_DELAY) {
nSwitchDelayCount++;
} else if (!dialogScripts.Tutorial.bLockCharacterSwitching) {
if (oKey.NEXT) {
switchControl(CHARACTER_NEXT);
}
if (oKey.PREV) {
switchControl(CHARACTER_PREV);
}
}
}
function checkAirControl() {
if (isControlledCharacter()) {
if ((!oKey.LEFT) && (!oKey.RIGHT)) {
nAirSpeedX = 0;
}
if ((nDirection == 1) && (oKey.LEFT)) {
setDirection(-1);
}
if ((nDirection == -1) && (oKey.RIGHT)) {
setDirection(1);
}
if ((nSpeedX == 0) && (oKey.RIGHT || (oKey.LEFT))) {
if (oKey.RIGHT) {
setDirection(1);
} else {
setDirection(-1);
}
nSpeedX = nDirection * SPEED_RUN;
}
}
}
function switchControl(_sCharacterID) {
var _local3;
if (dialogScripts.Tutorial.bMustSwitchToKatara) {
_local3 = oOwner.oDynamicElements.katara;
} else if (dialogScripts.Tutorial.bMustSwitchToToph) {
_local3 = oOwner.oDynamicElements.toph;
} else if (dialogScripts.Tutorial.bMustSwitchToAang) {
_local3 = oOwner.oDynamicElements.aang;
} else {
_local3 = oOwner.oDynamicElements[_sCharacterID];
}
_global.C.oSideScroller.switchCharacter(_local3);
nSwitchDelayCount = 0;
}
function initJump() {
setState("jump");
sarbakan.sound.SoundManager.play("jump", GameData.VOLUME_JUMP, 1, false);
}
function getRespawnPoint() {
var _local2 = {};
if (oSpawnPoint != undefined) {
_local2.x = oSpawnPoint.oAttachProperties._x;
_local2.y = oSpawnPoint.oAttachProperties._y;
} else {
_local2.x = oOriginalSpawnX;
_local2.y = oOriginalSpawnY;
}
return(_local2);
}
function isHittingWall() {
var _local2;
var _local3 = ["frontB"];
for (var _local6 in _local3) {
_local2 = getGlobalPos(mc[_local3[_local6]]);
if (collideWithMap(sWallColliderID, {x:_local2.x + nSpeedX, y:_local2.y + nSpeedY})) {
return(-1);
}
}
}
var SPEED_INAIR_BREAK = 0.33;
var SPEED_AIR_MOVEX = 4.75;
var GRAVITY = 0.25;
var JUMP_FORCE = -37.5;
var CHANCE_KILLED_OFFSCREEN = 0.05;
static var SWITCH_DELAY = 5;
}
Symbol 1641 MovieClip [__Packages.elements.SpawnPoint] Frame 0
class elements.SpawnPoint extends sarbakan.visual.element.DynamicElement
{
var setMC, setLinkage, removeReferenceMC, attachMC, oOwner, collideWithElement, setState, stateFinished;
function SpawnPoint (_mc) {
super("spawnPoint" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage("spawnPoint");
}
function init() {
removeReferenceMC();
attachMC();
}
function idle() {
for (var _local3 in GameData.CHARACTERS) {
var _local2 = oOwner.oDynamicElements[GameData.CHARACTERS[_local3]];
if ((_local2.oSpawnPoint != this) && (collideWithElement(GameData.CHARACTERS[_local3]))) {
_local2.setSpawnPoint(this);
setState("active");
sarbakan.sound.SoundManager.play("hitSpawn", GameData.VOLUME_SPAWN_HIT, 1, false);
}
}
}
function active() {
idle();
if (stateFinished()) {
setState("idle");
}
}
}
Symbol 1642 MovieClip [__Packages.sarbakan.sound.SoundManager] Frame 0
class sarbakan.sound.SoundManager
{
static var mc, aSounds, oRootSound, oEnterFrameListener, bMuted;
function SoundManager () {
}
static function init(_mc) {
mc = _mc;
aSounds = [];
oRootSound = new Sound(mc);
if (!oEnterFrameListener) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, update);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
}
}
static function play(_sLinkage, _nVolume, _nLoop, _bUnique) {
if (!mc) {
trace(("WARNING: Unitialized SoundManager OR Invalid base movieclip (" + _sLinkage) + ")");
}
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 1;
}
if (_bUnique == undefined) {
_bUnique = false;
}
var _local3 = canPlaySound(_sLinkage);
if (_local3 == true) {
var _local1 = {};
_local1.mc = mc.createEmptyMovieClip(MOVIECLIP_BASE_NAME + mc.getNextHighestDepth(), mc.getNextHighestDepth());
_local1.sLinkage = _sLinkage;
_local1.bUnique = _bUnique;
_local1.aFade = [];
_local1.oSound = new Sound(_local1.mc);
_local1.oSound.attachSound(_sLinkage);
_local1.oSound.onSoundComplete = sarbakan.utils.Delegate.create(sarbakan.sound.SoundManager, remove, _local1.oSound);
_local1.oSound.start(0, _nLoop);
_local1.oSound.setVolume(_nVolume);
aSounds.push(_local1);
return(_local1.oSound);
}
return(_local3);
}
static function stop(_oSound) {
_oSound.stop();
remove(_oSound);
}
static function mute() {
bMuted = true;
oRootSound.setVolume(0);
}
static function unmute() {
bMuted = false;
oRootSound.setVolume(100);
}
static function fade(_oSound, _nFadeType, _nDestination, _nSpeed, _bDelete) {
var _local2;
var _local3;
switch (_nFadeType) {
case FADE_VOLUME :
_local2 = sarbakan.utils.Delegate.create(_oSound, _oSound.getVolume);
_local3 = sarbakan.utils.Delegate.create(_oSound, _oSound.setVolume);
break;
case FADE_PAN :
_local2 = sarbakan.utils.Delegate.create(_oSound, _oSound.getPan);
_local3 = sarbakan.utils.Delegate.create(_oSound, _oSound.setPan);
}
var _local4 = getSoundData(_oSound);
if (_nDestination < _local2()) {
_nSpeed = _nSpeed * -1;
}
aSounds[_local4.nPosition].aFade[_nFadeType] = {nDest:_nDestination, nSpeed:_nSpeed, fSet:_local3, fGet:_local2, bDelete:_bDelete};
}
static function fadeInAll(_nSpeed) {
if (!_nSpeed) {
_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 100, _nSpeed);
}
static function fadeOutAll(_nSpeed) {
if (!_nSpeed) {
_nSpeed = FADE_DEFAULT_SPEED;
}
fadeAll(FADE_VOLUME, 0, _nSpeed);
}
static function getLinkage(_oSound) {
return(getSoundData(_oSound).oData.sLinkage);
}
static function isSoundPlaying(_oSound) {
var _local2 = false;
if ((_oSound.position != undefined) && (_oSound.duration != undefined)) {
if (_oSound.position < _oSound.duration) {
_local2 = true;
}
}
return(_local2);
}
static function isMuted() {
return(bMuted);
}
static function remove(_oSound) {
var _local1 = getSoundData(_oSound);
_local1.oData.mc.removeMovieClip();
delete aSounds[_local1.nPosition].oSound;
delete aSounds[_local1.nPosition];
aSounds.splice(_local1.nPosition, 1);
}
static function update() {
for (var _local2 in aSounds) {
for (var _local1 in aSounds[_local2].aFade) {
if (aSounds[_local2].aFade[_local1]) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].fGet() + aSounds[_local2].aFade[_local1].nSpeed);
if (((aSounds[_local2].aFade[_local1].nSpeed > 0) && (aSounds[_local2].aFade[_local1].fGet() >= aSounds[_local2].aFade[_local1].nDest)) or ((aSounds[_local2].aFade[_local1].nSpeed < 0) && (aSounds[_local2].aFade[_local1].fGet() <= aSounds[_local2].aFade[_local1].nDest))) {
aSounds[_local2].aFade[_local1].fSet(aSounds[_local2].aFade[_local1].nDest);
if (aSounds[_local2].aFade[_local1].bDelete) {
stop(aSounds[_local2].oSound);
}
delete aSounds[_local2].aFade[_local1];
}
}
}
}
}
static function canPlaySound(_sLinkage) {
for (var _local2 in aSounds) {
if (aSounds[_local2].bUnique && (aSounds[_local2].sLinkage == _sLinkage)) {
return(aSounds[_local2].oSound);
}
}
return(true);
}
static function getSoundData(_oSound) {
for (var _local4 in aSounds) {
if (aSounds[_local4].oSound == _oSound) {
return({oData:aSounds[_local4], nPosition:_local4});
}
}
}
static function fadeAll(_nFadeType, _nDestination, _nSpeed) {
for (var _local4 in aSounds) {
fade(aSounds[_local4].oSound, _nFadeType, _nDestination, _nSpeed);
}
}
static var MOVIECLIP_BASE_NAME = "mcSounds";
static var FADE_DEFAULT_SPEED = 10;
static var FADE_VOLUME = 0;
static var FADE_PAN = 1;
}
Symbol 1643 MovieClip [__Packages.sarbakan.utils.ActionSequencer] Frame 0
class sarbakan.utils.ActionSequencer
{
static var aActionQueue, aListeners, oCurrentAction, nCurrentActionStartAt;
function ActionSequencer () {
}
static function init() {
aActionQueue = [];
aListeners = [];
delete oCurrentAction;
delete nCurrentActionStartAt;
}
static function addListener(_fListener) {
aListeners.push(_fListener);
}
static function queue(_sActionID, _nDelay, _oActionObjet, _sMethod) {
arguments.splice(0, 4);
aActionQueue.push({id:_sActionID, delay:_nDelay * 1000, obj:_oActionObjet, method:_sMethod, arguments:arguments});
}
static function update() {
if ((!oCurrentAction) && (aActionQueue.length > 0)) {
oCurrentAction = aActionQueue.shift();
if (oCurrentAction.delay > 0) {
nCurrentActionStartAt = oCurrentAction.delay + getTimer();
} else {
nCurrentActionStartAt = getTimer();
}
} else if (nCurrentActionStartAt && (getTimer() > nCurrentActionStartAt)) {
oCurrentAction.obj[oCurrentAction.method].apply(oCurrentAction.obj, oCurrentAction.arguments);
delete nCurrentActionStartAt;
}
}
static function clear() {
init();
}
static function onActionDone(_sActionID) {
if (_sActionID == oCurrentAction.id) {
notify(oCurrentAction.id);
delete oCurrentAction;
}
}
static function notify(_sActionID) {
for (var _local1 in aListeners) {
aListeners[_local1](_sActionID);
}
}
}
Symbol 1644 MovieClip [__Packages.elements.characters.BaseEnemy] Frame 0
class elements.characters.BaseEnemy extends sarbakan.visual.element.DynamicElement
{
static var oActiveEnnemy;
var nEnnemyType, id, nDirection, mc;
function BaseEnemy (_sID, _nEnnemyType) {
super(_sID);
nEnnemyType = _nEnnemyType;
if (!oActiveEnnemy) {
oActiveEnnemy = {};
}
if (!oActiveEnnemy[nEnnemyType]) {
oActiveEnnemy[nEnnemyType] = {};
}
}
static function reset() {
oActiveEnnemy = {};
}
function enable() {
super.enable();
oActiveEnnemy[nEnnemyType][id] = this;
}
function disable() {
super.disable();
delete oActiveEnnemy[nEnnemyType][id];
}
static function checkIfHit(_oCharacter, _mcHit, _nEnnemyType) {
for (var _local3 in oActiveEnnemy[_nEnnemyType]) {
if (oActiveEnnemy[_nEnnemyType][_local3].mc.state.hitTest(_mcHit)) {
oActiveEnnemy[_nEnnemyType][_local3].onHit();
}
}
}
function setDirection(_nDirection) {
if ((_nDirection >= -1) && (_nDirection <= 1)) {
nDirection = _nDirection;
mc._xscale = Math.abs(mc._xscale) * nDirection;
}
}
}
Symbol 1645 MovieClip [__Packages.elements.characters.FireGuard] Frame 0
class elements.characters.FireGuard extends elements.characters.BaseEnemy
{
static var ENERGY_FULL, DELAY_ATTACK, nTotalInstance, nTotalInstanceDestroyed;
var setMC, setLinkage, setDirection, CHANCE_ATTACK, nEnergy, oSeenCharacter, nAttackDelayCount, removeReferenceMC, attachMC, setState, stateCurrentFrame, oOwner, nDirection, mc, sFire, stateFinished, stateStarting, remove, stateIsNot, collideWithElementBox;
function FireGuard (_mc) {
super("fireGuard" + sarbakan.visual.element.BaseElement.getNextID(), GameData.ELEMENT_FIREGUARD);
setMC(_mc);
setLinkage("fireGuard");
if (_mc._name == "l") {
setDirection(-1);
} else {
setDirection(1);
}
ENERGY_FULL = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].guard_energyMax;
DELAY_ATTACK = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].guard_delayAttack;
CHANCE_ATTACK = GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].guard_chanceAttack;
nEnergy = ENERGY_FULL;
oSeenCharacter = {};
nAttackDelayCount = 0;
nTotalInstance++;
}
function init() {
removeReferenceMC();
attachMC();
}
static function resetInstanceCount() {
nTotalInstance = 0;
nTotalInstanceDestroyed = 0;
}
function idle() {
updateCharactersInSight();
var _local2 = getCharacterInSight();
if (_local2 != undefined) {
if (canSwitchDirection()) {
switchDirection(_local2);
}
if (((++nAttackDelayCount) >= DELAY_ATTACK) && (canAttack(_local2))) {
nAttackDelayCount = 0;
setState("attack");
}
}
}
function attack() {
if (stateCurrentFrame() < FRAME_ATTACK_THROW) {
if (canSwitchDirection()) {
switchDirection(getCharacterInSight());
}
}
if (stateCurrentFrame() == FRAME_ATTACK_THROW) {
if (canThrowFire()) {
var _local3 = elements.Fire.create(oOwner.mc, mc._x + (nDirection * FIRE_DISTANCE_X), mc._y + FIRE_DISTANCE_Y);
sFire = _local3.id;
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_FIRE, _local3);
} else {
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_FIREBALL, new elements.FireBall(nDirection, mc._x + mc.fireball._x, mc._y + mc.fireball._y));
var _local4 = sarbakan.sound.SoundManager.play("sndFireBall", 0, 1, false);
sarbakan.sound.SoundManager.fade(_local4, sarbakan.sound.SoundManager.FADE_VOLUME, GameData.VOLUME_FIREBALL, 4);
}
}
if (stateFinished()) {
setState("idle");
}
}
function hurt() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("fireHit" + sarbakan.utils.MoreMath.random(1, 3), GameData.VOLUME_FIREGUARD_HIT, 1, false);
}
if (stateFinished()) {
nAttackDelayCount = DELAY_ATTACK;
setState("idle");
}
}
function die() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("fireHit" + sarbakan.utils.MoreMath.random(1, 3), GameData.VOLUME_FIREGUARD_HIT, 1, false);
removeCharactersInSight();
}
if (stateFinished()) {
remove();
nTotalInstanceDestroyed++;
_global.C.musicEnnemyStop();
_global.C.oHUD.addScore(GameData.SCORE_ENNEMY);
}
}
function onHit() {
if (stateIsNot("hurt", "die")) {
nEnergy--;
if (nEnergy > 0) {
setState("hurt");
} else {
setState("die");
}
}
}
function updateCharactersInSight() {
for (var _local3 in GameData.CHARACTERS) {
if (collideWithElementBox(GameData.CHARACTERS[_local3], mc.lineOfSight)) {
_global.C.musicEnnemyStart();
if (!oSeenCharacter[GameData.CHARACTERS[_local3]]) {
oSeenCharacter[GameData.CHARACTERS[_local3]] = oOwner.oDynamicElements[GameData.CHARACTERS[_local3]];
oSeenCharacter[GameData.CHARACTERS[_local3]].addSeeingFireGuard(this);
}
} else if (oSeenCharacter[GameData.CHARACTERS[_local3]]) {
oSeenCharacter[GameData.CHARACTERS[_local3]].removeSeeingFireGuard(this);
delete oSeenCharacter[GameData.CHARACTERS[_local3]];
if (getCharacterInSight() == undefined) {
_global.C.musicEnnemyStop();
}
}
}
}
function removeCharactersInSight() {
for (var _local2 in GameData.CHARACTERS) {
oSeenCharacter[GameData.CHARACTERS[_local2]].removeSeeingFireGuard(this);
}
}
function getCharacterInSight() {
var _local2;
for (var _local3 in oSeenCharacter) {
_local2 = oSeenCharacter[_local3];
break;
}
return(_local2);
}
function switchDirection(_oCharacter) {
if ((nDirection == 1) && (_oCharacter.mc._x < mc._x)) {
setDirection(-1);
} else if ((nDirection == -1) && (_oCharacter.mc._x > mc._x)) {
setDirection(1);
}
}
function canSwitchDirection() {
return(Math.random() <= CHANCE_SWITCH_DIRECTION);
}
function canAttack(_oCharacter) {
return((Math.random() <= CHANCE_ATTACK) && (((nDirection == 1) && (_oCharacter.mc._x >= mc._x)) || ((nDirection == -1) && (_oCharacter.mc._x <= mc._x))));
}
function canThrowFire() {
var _local2 = CHANCE_CREATE_FIRE;
if (nEnergy < ENERGY_FULL) {
_local2 = _local2 * 2;
}
return((Math.random() < _local2) && (!oOwner.oDynamicElements[sFire]));
}
static var CHANCE_SWITCH_DIRECTION = 0.7;
static var CHANCE_CREATE_FIRE = 0.33;
static var FIRE_DISTANCE_X = 50;
static var FIRE_DISTANCE_Y = -15;
static var FRAME_ATTACK_THROW = 31;
}
Symbol 1646 MovieClip [__Packages.elements.Fire] Frame 0
class elements.Fire extends elements.characters.BaseEnemy
{
var setMC, setLinkage, nRespawnDelay, mc, bKeepStateOnEnable, bDynamic, removeReferenceMC, attachMC, bRespawnDisabled, setState, bExtinguishFocus, bRespawnFocus, isActive, oAttachProperties, oOwner, collideWithElement, stateStarting, stateFinished, nRespawnCount, bExtinguishHint, remove, sState;
function Fire (_mc) {
super("fire" + sarbakan.visual.element.BaseElement.getNextID(), GameData.ELEMENT_FIRE);
setMC(_mc);
setLinkage("fire");
if (Number(_mc._name) != NaN) {
nRespawnDelay = Number(mc._name);
} else {
nRespawnDelay = 0;
}
bKeepStateOnEnable = true;
bDynamic = false;
}
function init() {
if (!bDynamic) {
removeReferenceMC();
}
attachMC();
}
static function create(_mcAttach, _nX, _nY) {
var _local1 = new elements.Fire();
_local1.bDynamic = true;
_local1.oAttachProperties = {_x:_nX, _y:_nY};
_local1.bAlwaysActive = true;
_local1.disable = function () {
};
elements.characters.BaseEnemy.oActiveEnnemy[GameData.ELEMENT_FIRE][_local1.id] = _local1;
_local1.onSpawnSound();
return(_local1);
}
function disableRespawn() {
bRespawnDisabled = true;
}
function enableRespawn() {
bRespawnDisabled = false;
}
function focusOnExtinguish() {
setState("idle");
bExtinguishFocus = true;
_global.C.oSideScroller.focusOnElement(this, sarbakan.utils.Delegate.create(this, onExtinguishFocusDone));
}
function focusOnRespawn() {
setState("idleExtinguished");
bRespawnFocus = true;
_global.C.oSideScroller.focusOnElement(this, sarbakan.utils.Delegate.create(this, onRespawnFocusDone));
}
function getCoord() {
var _local2 = {};
if (isActive()) {
_local2.x = mc._x - GameData.CAMERA_CORRECTION_X;
_local2.y = mc._y - GameData.CAMERA_CORRECTION_Y;
} else {
_local2.x = oAttachProperties._x - GameData.CAMERA_CORRECTION_X;
_local2.y = oAttachProperties._y - GameData.CAMERA_CORRECTION_Y;
}
return(_local2);
}
function idle() {
for (var _local3 in GameData.CHARACTERS) {
var _local2 = oOwner.oDynamicElements[GameData.CHARACTERS[_local3]];
if (_local2.stateIsNot("hurt", "teleportOut", "whip", "crackWalls", "easterEgg") && (collideWithElement(GameData.CHARACTERS[_local3]))) {
_local2.setState("hurt");
sarbakan.sound.SoundManager.play("fireHurt", GameData.VOLUME_FIRE_HURT, 1, false);
}
}
}
function extinguish() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("fireExtinguish", GameData.VOLUME_FIRE_EXTINGUISH, 1, false);
}
if (stateFinished()) {
if (nRespawnDelay > 0) {
setState("idleExtinguished");
nRespawnCount = 0;
if (bExtinguishFocus) {
_global.C.oSideScroller.focusOnCurrentCharacter();
bExtinguishFocus = false;
}
if (bExtinguishHint) {
bExtinguishHint = false;
elements.characters.BaseCharacter.lockControl();
_global.C.oPopup.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), GameData.DIALOGS.HINT_SWITCH_FIRE, sarbakan.utils.Delegate.create(elements.characters.BaseCharacter, elements.characters.BaseCharacter.unlockControl), false);
}
} else {
_global.C.oHUD.addScore(GameData.SCORE_GENERIC);
remove();
}
}
}
function idleExtinguished() {
if ((!bRespawnDisabled) && ((++nRespawnCount) >= nRespawnDelay)) {
setState("respawn");
}
}
function respawn() {
if (stateStarting()) {
onSpawnSound();
}
if (stateFinished()) {
setState("idle");
if (bRespawnFocus) {
_global.C.oSideScroller.focusOnCurrentCharacter();
bRespawnFocus = false;
}
}
}
function onHit() {
if (sState == "idle") {
setState("extinguish");
}
}
function onExtinguishFocusDone() {
setState("extinguish");
}
function onRespawnFocusDone() {
setState("respawn");
}
function onSpawnSound() {
var _local1 = sarbakan.sound.SoundManager.play("fireSpawn", GameData.VOLUME_FIRE_SPAWN, 1, false);
sarbakan.sound.SoundManager.fade(_local1, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 2);
}
}
Symbol 1647 MovieClip [__Packages.elements.FireBall] Frame 0
class elements.FireBall extends sarbakan.visual.element.DynamicElement
{
var setLinkage, nDirection, nSpeedX, oAttachProperties, bAlwaysActive, nDistanceCount, attachMC, stateStarting, oOwner, collideWithElement, setState, collideWithMap, mc, stateFinished, remove;
function FireBall (_nDirection, _nX, _nY) {
super("fireball" + sarbakan.visual.element.BaseElement.getNextID());
setLinkage("fireBall");
nDirection = _nDirection;
nSpeedX = SPEED * nDirection;
oAttachProperties = {_x:_nX, _y:_nY};
bAlwaysActive = true;
nDistanceCount = 0;
}
function init() {
attachMC();
setDirection(nDirection);
}
function disable() {
}
function idle() {
if (!stateStarting()) {
for (var _local3 in GameData.CHARACTERS) {
var _local2 = oOwner.oDynamicElements[GameData.CHARACTERS[_local3]];
if (_local2.stateIsNot("hurt", "crackWalls", "teleportOut") && (collideWithElement(GameData.CHARACTERS[_local3]))) {
if (((_local2.getState() == "whip") && (_local2.mc.state._currentFrame >= elements.characters.Katara.FRAME_WHIP_HIT_START)) && (_local2.mc.state._currentFrame <= elements.characters.Katara.FRAME_WHIP_HIT_END)) {
setState("hit");
sarbakan.sound.SoundManager.play("fireExtinguish", GameData.VOLUME_FIRE_EXTINGUISH, 1, false);
} else {
_local2.setState("hurt");
nSpeedX = 0;
setState("hit");
sarbakan.sound.SoundManager.play("fireBallHurt", GameData.VOLUME_FIREBALL_HIT, 1, false);
}
break;
}
}
nDistanceCount = nDistanceCount + Math.abs(nSpeedX);
if (nDistanceCount >= DISTANCE_MAX) {
setState("hit");
} else if (collideWithMap("wall", mc.front)) {
setState("hit");
sarbakan.sound.SoundManager.play("fireBallHit", GameData.VOLUME_FIREBALL_HIT, 1, false);
}
}
}
function hit() {
nSpeedX = 0;
if (stateFinished()) {
super.disable();
remove();
}
}
function setDirection(_nDirection) {
if ((_nDirection >= -1) && (_nDirection <= 1)) {
nDirection = _nDirection;
mc._xscale = Math.abs(mc._xscale) * nDirection;
}
}
static var SPEED = 12;
static var DISTANCE_MAX = 1200;
}
Symbol 1648 MovieClip [__Packages.elements.characters.Katara] Frame 0
class elements.characters.Katara extends elements.characters.BaseCharacter
{
var mc, isControlledCharacter, setState, nSpeedX, nSpeedY, stateCurrentFrame, oWhipSound, stateFinished;
function Katara (_mc) {
super("katara", "katara", _mc);
}
function idle() {
super.idle();
mc.whip.gotoAndStop(2);
if (isControlledCharacter()) {
if (elements.characters.BaseCharacter.oKey.ACTION) {
mc.whip.gotoAndStop(1);
setState("whip");
}
}
}
function run() {
super.run();
if (isControlledCharacter()) {
if (elements.characters.BaseCharacter.oKey.ACTION) {
setState("whip");
}
}
}
function whip() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == FRAME_WHIP_SOUND) {
oWhipSound = sarbakan.sound.SoundManager.play("whip", GameData.VOLUME_KATARA_WHIP, 1, false);
}
if (stateCurrentFrame() == FRAME_WHIP_SOUND_FADE) {
sarbakan.sound.SoundManager.fade(oWhipSound, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 4);
}
if ((stateCurrentFrame() >= FRAME_WHIP_HIT_START) && (stateCurrentFrame() <= FRAME_WHIP_HIT_END)) {
elements.characters.BaseEnemy.checkIfHit(this, mc.state, GameData.ELEMENT_FIREGUARD);
elements.characters.BaseEnemy.checkIfHit(this, mc.state, GameData.ELEMENT_FIRE);
elements.Switch.checkIfWhipped(this, mc.state);
}
if (stateFinished()) {
setState("idle");
}
}
function onWhipSwitch() {
setState("activateSwitch");
}
function onLeverSound() {
oWhipSound = sarbakan.sound.SoundManager.play("whip", GameData.VOLUME_KATARA_WHIP, 1, false);
sarbakan.sound.SoundManager.fade(oWhipSound, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 1);
}
function onSwitchSound() {
onLeverSound();
}
var SPEED_RUN = 6.5;
var CHARACTER_NEXT = "toph";
var CHARACTER_PREV = "aang";
static var FRAME_WHIP_HIT_START = 11;
static var FRAME_WHIP_HIT_END = 21;
static var FRAME_WHIP_SOUND = 8;
static var FRAME_WHIP_SOUND_FADE = 15;
var FRAME_SWITCH_TRIGGER = 11;
var FRAME_LEVER_TRIGGER = 13;
}
Symbol 1649 MovieClip [__Packages.elements.Switch] Frame 0
class elements.Switch extends sarbakan.visual.element.DynamicElement
{
static var oRegisteredSwitches, oCurrentSwitch;
var setMC, setLinkage, sSwitchType, sSwitchID, fOnScript, fOffScript, bKeepStateOnEnable, bMustDisappear, removeReferenceMC, attachMC, DEFAULT_STATE, getState, setState, isActive, mc, oAttachProperties, id, oCharacter, stateStarting, stateFinished, oOwner, bPuzzleHint;
function Switch (_sLinkage, _mc) {
super("switch" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
if ((_sLinkage == "lever") || (_sLinkage == "leverExit")) {
sSwitchType = "lever";
} else {
sSwitchType = "switch";
}
sSwitchID = _mc._name;
registerSwitch(sSwitchID, this);
if (_mc.fOnScript == undefined) {
fOnScript = switchScripts.OpenDoor;
fOffScript = switchScripts.CloseDoor;
} else {
fOnScript = _mc.fOnScript;
fOffScript = _mc.fOffScript;
}
bKeepStateOnEnable = true;
bMustDisappear = false;
}
static function reset() {
oRegisteredSwitches = {};
delete oCurrentSwitch;
}
function init() {
removeReferenceMC();
attachMC();
}
static function switchIDActivated(_sSwitchID) {
var _local2 = true;
for (var _local3 in oRegisteredSwitches[_sSwitchID]) {
if (oRegisteredSwitches[_sSwitchID][_local3].getState() == "idle") {
_local2 = false;
break;
}
}
return(_local2);
}
function deleteScripts() {
delete fOnScript;
delete fOffScript;
}
static function getSwitchByID(_sID) {
return(oRegisteredSwitches[_sID]);
}
function setHidden() {
DEFAULT_STATE = "idleDisappeared";
}
function onAppear() {
if ((getState() == "idleActivated") || (getState() == "idle")) {
_global.C.oSideScroller.focusOnCurrentCharacter();
bMustDisappear = false;
} else {
_global.C.oSideScroller.focusOnElement(this, sarbakan.utils.Delegate.create(this, onAppearFocusDone));
}
}
function onDisappear() {
if (getState() == "idleActivated") {
_global.C.oSideScroller.focusOnCurrentCharacter();
bMustDisappear = true;
} else {
_global.C.oSideScroller.focusOnElement(this, sarbakan.utils.Delegate.create(this, onDisappearFocusDone));
}
}
function onAppearFocusDone() {
setState("appear");
}
function onDisappearFocusDone() {
setState("disappear");
}
static function checkIfWhipped(_oCharacter, _mcHit) {
for (var _local4 in oRegisteredSwitches) {
for (var _local3 in oRegisteredSwitches[_local4]) {
var _local1 = oRegisteredSwitches[_local4][_local3];
if (((_local1.isActive() && (_local1.getState() == "idle")) && (_local1.sSwitchType == "lever")) && (_local1.mc.hitTest(_oCharacter.mc))) {
_local1.setState("activate");
break;
}
}
}
}
function getCoord() {
var _local2 = {};
if (isActive()) {
_local2.x = mc._x - GameData.CAMERA_CORRECTION_X;
_local2.y = mc._y - GameData.CAMERA_CORRECTION_Y;
} else {
_local2.x = oAttachProperties._x - GameData.CAMERA_CORRECTION_X;
_local2.y = oAttachProperties._y - GameData.CAMERA_CORRECTION_Y;
}
return(_local2);
}
function idle() {
var _local2 = elements.characters.BaseCharacter.getControlledCharacter();
if ((((!oCurrentSwitch) && (_local2.stateIsNot("jump", "jumpStart", "fall", "fallStart", "land", "crackWalls", "easterEgg"))) && (_local2.mc.bottom != undefined)) && (_local2.collideWithElement(id, _local2.mc.bottom))) {
oCurrentSwitch = this;
oCharacter = _local2;
if (sSwitchType == "switch") {
_local2.setState("activateSwitch");
} else {
_local2.setState("activateLever");
}
}
}
function activate() {
if (stateStarting()) {
if (sSwitchType == "lever") {
sarbakan.sound.SoundManager.play("sndLever", GameData.VOLUME_LEVER, 1, false);
} else {
sarbakan.sound.SoundManager.play("sndSwitch", GameData.VOLUME_SWITCH, 1, false);
}
}
if (stateFinished()) {
setState("idleActivated");
delete oCurrentSwitch;
elements.characters.BaseCharacter.unlockControl();
fOnScript.execute({switchInstance:this, switchID:sSwitchID});
}
}
function idleActivated() {
if (sSwitchType == "switch") {
if (oCharacter.isActive() && (!oCharacter.collideWithElement(id, oCharacter.mc.bottom))) {
var _local2;
for (var _local3 in GameData.CHARACTERS) {
var _local4 = oOwner.oDynamicElements[GameData.CHARACTERS[_local3]];
if (((_local4 != oCharacter) && (_local4.isActive())) && (_local4.collideWithElement(id, _local4.mc.bottom))) {
_local2 = _local4;
break;
}
}
if (_local2 != undefined) {
oCharacter = _local2;
} else {
var _local4 = elements.characters.BaseCharacter.getControlledCharacter();
if (switchIDActivated(sSwitchID) && (_local4.getState() == "run")) {
elements.characters.BaseCharacter.lockControl();
_local4.setState("idle");
}
setState("desactivate");
}
}
}
}
function desactivate() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("switchOff", GameData.VOLUME_SWITCH, 1, false);
}
if (stateFinished()) {
if (bMustDisappear) {
setState("disappear");
} else {
setState("idle");
}
delete oCharacter;
elements.characters.BaseCharacter.unlockControl();
fOffScript.execute({switchInstance:this, switchID:sSwitchID});
}
}
function disappear() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("magic", GameData.VOLUME_MAGIC, 1, false);
}
if (stateFinished()) {
if (bMustDisappear) {
bMustDisappear = false;
} else {
_global.C.oSideScroller.focusOnCurrentCharacter();
}
setState("idleDisappeared");
}
}
function appear() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("magic", GameData.VOLUME_MAGIC, 1, false);
}
if (stateFinished()) {
_global.C.oSideScroller.focusOnCurrentCharacter();
setState("idle");
if (bPuzzleHint) {
bPuzzleHint = false;
elements.characters.BaseCharacter.lockControl();
_global.C.oPopup.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), GameData.DIALOGS.HINT_SWITCH_SWITCH, sarbakan.utils.Delegate.create(elements.characters.BaseCharacter, elements.characters.BaseCharacter.unlockControl), false);
}
}
}
static function onSwitchActivate() {
oCurrentSwitch.setState("activate");
}
static function registerSwitch(_sID, _oInstance) {
if (!oRegisteredSwitches) {
oRegisteredSwitches = {};
}
if (!oRegisteredSwitches[_sID]) {
oRegisteredSwitches[_sID] = [];
}
oRegisteredSwitches[_sID].push(_oInstance);
}
}
Symbol 1650 MovieClip [__Packages.sarbakan.structure.Script] Frame 0
class sarbakan.structure.Script
{
function Script () {
}
static function execute(_oData) {
}
static function reset() {
}
}
Symbol 1651 MovieClip [__Packages.switchScripts.OpenDoor] Frame 0
class switchScripts.OpenDoor extends sarbakan.structure.Script
{
static var bDoorDHint;
function OpenDoor () {
super();
}
static function execute(_oData) {
if (elements.Switch.switchIDActivated(_oData.switchID)) {
elements.Door.onOpen(_oData.switchID);
} else if (((_oData.switchID == "d") && (!bDoorDHint)) && (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL)) {
bDoorDHint = true;
elements.characters.BaseCharacter.lockControl();
_global.C.oPopup.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), GameData.DIALOGS.HINT_SWITCH_MULTIPLE, sarbakan.utils.Delegate.create(elements.characters.BaseCharacter, elements.characters.BaseCharacter.unlockControl), false);
}
}
static function reset() {
bDoorDHint = false;
}
}
Symbol 1652 MovieClip [__Packages.elements.Door] Frame 0
class elements.Door extends sarbakan.visual.element.DynamicElement
{
static var oRegisteredDoors, oCurrentDoor;
var setMC, setLinkage, sDoorID, bKeepStateOnEnable, removeReferenceMC, attachMC, isActive, mc, oAttachProperties, stateStarting, stateFinished, setState, sLinkage, id;
function Door (_mc, _sLinkage) {
super("door" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
sDoorID = _mc._name;
registerDoor(sDoorID, this);
bKeepStateOnEnable = true;
}
static function reset() {
oRegisteredDoors = {};
delete oCurrentDoor;
}
function init() {
removeReferenceMC();
attachMC();
attachCollider();
}
function getCoord() {
var _local2 = {};
if (isActive()) {
_local2.x = mc._x - GameData.CAMERA_CORRECTION_X;
_local2.y = mc._y - GameData.CAMERA_CORRECTION_Y;
} else {
_local2.x = oAttachProperties._x - GameData.CAMERA_CORRECTION_X;
_local2.y = oAttachProperties._y - GameData.CAMERA_CORRECTION_Y;
}
return(_local2);
}
function open() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("doorOpen", GameData.VOLUME_DOOR, 1, false);
}
if (stateFinished()) {
setState("idleOpened");
detachCollider();
if (dialogScripts.Tutorial.bMustWhipFirstSwitch) {
dialogScripts.Tutorial.bMustWhipFirstSwitch = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onKataraFirstWhip");
} else if (dialogScripts.Tutorial.bMustJumpOnSwitch) {
dialogScripts.Tutorial.bMustJumpOnSwitch = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onAangJumpSwitch");
}
_global.C.oSideScroller.focusOnCurrentCharacter();
}
}
function close() {
if (stateStarting()) {
sarbakan.sound.SoundManager.play("doorClose", GameData.VOLUME_DOOR, 1, false);
}
if (stateFinished()) {
setState("idle");
attachCollider();
_global.C.oSideScroller.focusOnCurrentCharacter();
}
}
static function onOpen(_sReceivedDoorID) {
var _local2 = oRegisteredDoors[_sReceivedDoorID];
if (_local2.getState() == "idle") {
oCurrentDoor = _local2;
_global.C.oSideScroller.focusOnElement(oCurrentDoor, sarbakan.utils.Delegate.create(elements.Door, onOpenFocusDone));
}
}
static function onOpenFocusDone() {
oCurrentDoor.setState("open");
}
static function onClose(_sReceivedDoorID) {
var _local2 = oRegisteredDoors[_sReceivedDoorID];
if (_local2.getState() == "idleOpened") {
elements.characters.BaseCharacter.lockControl();
oCurrentDoor = _local2;
_global.C.oSideScroller.focusOnElement(oCurrentDoor, sarbakan.utils.Delegate.create(elements.Door, onCloseFocusDone));
}
}
static function onCloseFocusDone() {
oCurrentDoor.setState("close");
}
static function registerDoor(_sID, _oInstance) {
if (!oRegisteredDoors) {
oRegisteredDoors = {};
}
oRegisteredDoors[_sID] = _oInstance;
}
function attachCollider() {
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall;
_local3.attachMC(sLinkage + "Collider", mc._x, mc._y, id);
}
function detachCollider() {
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall.getMC();
_local3[id].removeMovieClip();
}
}
Symbol 1653 MovieClip [__Packages.dialogScripts.Tutorial] Frame 0
class dialogScripts.Tutorial extends sarbakan.structure.Script
{
static var bLockCharacterSwitching, bMustSwitchToKatara, bMustSwitchToToph, bMustSwitchToAang, bMustJumpOnSwitch, bMustWhipFirstSwitch, bMustBreakWall;
function Tutorial () {
super();
}
static function execute(_oData) {
var _local2 = _global.C.oPopup;
bLockCharacterSwitching = true;
bMustSwitchToKatara = false;
bMustSwitchToToph = false;
bMustSwitchToAang = false;
bMustJumpOnSwitch = false;
bMustWhipFirstSwitch = false;
bMustBreakWall = false;
sarbakan.utils.ActionSequencer.queue("tuto_lockControl", 4, elements.characters.BaseCharacter, "lockControl");
sarbakan.utils.ActionSequencer.queue("tuto_a_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_A, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_a_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_A, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_aang_move", 0, dialogScripts.Tutorial, "aangMove");
sarbakan.utils.ActionSequencer.queue("tuto_lockControl", 2, elements.characters.BaseCharacter, "lockControl");
sarbakan.utils.ActionSequencer.queue("tuto_b_dialog", 0, _local2, "showDialog", GameData.ELEMENT_KATARA, GameData.DIALOGS.TUTO_B, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_b_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_B, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_onSwitchToKatara", 0, dialogScripts.Tutorial, "switchToKatara");
sarbakan.utils.ActionSequencer.queue("tuto_lockSwitch", 0, dialogScripts.Tutorial, "lockCharacterSwitching");
sarbakan.utils.ActionSequencer.queue("tuto_c_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_C, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_c_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_C, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_onKataraFirstWhip", 0, dialogScripts.Tutorial, "waitForKataraWhip");
sarbakan.utils.ActionSequencer.queue("tuto_lockControl", 0.8, elements.characters.BaseCharacter, "lockControl");
sarbakan.utils.ActionSequencer.queue("tuto_d_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_D, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_e_dialog", 0, _local2, "showDialog", GameData.ELEMENT_KATARA, GameData.DIALOGS.TUTO_E, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_e_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_E, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_onSwitchToAang", 0, dialogScripts.Tutorial, "switchToAang");
sarbakan.utils.ActionSequencer.queue("tuto_lockSwitch", 0, dialogScripts.Tutorial, "lockCharacterSwitching");
sarbakan.utils.ActionSequencer.queue("tuto_f_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_F, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_f_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_F, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_onAangJumpSwitch", 0, dialogScripts.Tutorial, "waitForAangJump");
sarbakan.utils.ActionSequencer.queue("tuto_lockControl", 0.6, elements.characters.BaseCharacter, "lockControl");
sarbakan.utils.ActionSequencer.queue("tuto_g_dialog", 0, _local2, "showDialog", GameData.ELEMENT_TOPH, GameData.DIALOGS.TUTO_G, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_h_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_H, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_h_instruction", 0, _local2, "showInstruction", GameData.INSTRUCTIONS.TUTO_H, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_onSwitchToToph", 0, dialogScripts.Tutorial, "switchToToph");
sarbakan.utils.ActionSequencer.queue("tuto_onTophBreak", 0, dialogScripts.Tutorial, "waitForTophBreak");
sarbakan.utils.ActionSequencer.queue("tuto_lockControl", 0.5, elements.characters.BaseCharacter, "lockControl");
sarbakan.utils.ActionSequencer.queue("tuto_i_dialog", 0, _local2, "showDialog", GameData.ELEMENT_KATARA, GameData.DIALOGS.TUTO_I, onPopupClosed, true);
sarbakan.utils.ActionSequencer.queue("tuto_j_dialog", 0, _local2, "showDialog", GameData.ELEMENT_AANG, GameData.DIALOGS.TUTO_J, onPopupClosed, false);
sarbakan.utils.ActionSequencer.queue("tuto_closeFloor", 0, dialogScripts.Tutorial, "closeTutorialFloor");
sarbakan.utils.ActionSequencer.queue("tuto_onSwitchToAang", 0, dialogScripts.Tutorial, "switchToAangAuto");
sarbakan.utils.ActionSequencer.queue("tuto_unlockControl", 0, elements.characters.BaseCharacter, "unlockControl");
}
static function onPopupClosed() {
sarbakan.utils.ActionSequencer.onActionDone("tuto_a_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_a_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_b_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_b_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_c_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_c_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_d_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_e_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_e_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_f_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_f_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_g_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_h_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_h_instruction");
sarbakan.utils.ActionSequencer.onActionDone("tuto_i_dialog");
sarbakan.utils.ActionSequencer.onActionDone("tuto_j_dialog");
}
static function lockCharacterSwitching() {
bLockCharacterSwitching = true;
sarbakan.utils.ActionSequencer.onActionDone("tuto_lockSwitch");
}
static function aangMove() {
elements.characters.BaseCharacter.unlockControl();
sarbakan.utils.ActionSequencer.onActionDone("tuto_aang_move");
}
static function switchToKatara() {
elements.characters.BaseCharacter.unlockControl();
bLockCharacterSwitching = false;
bMustSwitchToKatara = true;
}
static function waitForKataraWhip() {
elements.characters.BaseCharacter.unlockControl();
bMustWhipFirstSwitch = true;
}
static function switchToAang() {
elements.characters.BaseCharacter.unlockControl();
bLockCharacterSwitching = false;
bMustSwitchToAang = true;
}
static function switchToToph() {
elements.characters.BaseCharacter.unlockControl();
bLockCharacterSwitching = false;
bMustSwitchToToph = true;
}
static function waitForAangJump() {
elements.characters.BaseCharacter.unlockControl();
bMustJumpOnSwitch = true;
}
static function waitForTophBreak() {
elements.characters.BaseCharacter.unlockControl();
bMustBreakWall = true;
}
static function switchToAangAuto() {
bLockCharacterSwitching = false;
bMustSwitchToAang = true;
_global.C.oSideScroller.switchCharacter(_global.C.oSideScroller.oLayerGame.oDynamicElements.aang);
}
static function closeTutorialFloor() {
closeFloor("tutoA");
closeFloor("tutoB");
sarbakan.utils.ActionSequencer.onActionDone("tuto_closeFloor");
}
static function closeFloor(_sID) {
var _local1 = elements.DynamicFloor.getFloorByID(_sID);
if (_local1.stateIsNot("idleClosed")) {
elements.DynamicFloor.onClose(_sID, true);
}
}
}
Symbol 1654 MovieClip [__Packages.elements.DynamicFloor] Frame 0
class elements.DynamicFloor extends sarbakan.visual.element.DynamicElement
{
static var oRegisteredFloors, bPuzzleHint, oCurrentFloor;
var setMC, setLinkage, sFloorID, mc, bInitiallyActive, bKeepStateOnEnable, removeReferenceMC, attachMC, setState, updateState, isActive, oAttachProperties, bSkipSound, stateStarting, stateFinished, id;
function DynamicFloor (_mc) {
super("dynamicFloor" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage("dynamicFloor");
sFloorID = mc._name;
registerFloor(sFloorID, this);
if (mc.bInitiallyActive) {
bInitiallyActive = true;
}
bKeepStateOnEnable = true;
}
function init() {
removeReferenceMC();
attachMC();
if (bInitiallyActive) {
setState("idleOpened");
updateState();
attachCollider();
}
}
function getCoord() {
var _local2 = {};
if (isActive()) {
_local2.x = mc._x - GameData.CAMERA_CORRECTION_X;
_local2.y = mc._y - GameData.CAMERA_CORRECTION_Y;
} else {
_local2.x = oAttachProperties._x - GameData.CAMERA_CORRECTION_X;
_local2.y = oAttachProperties._y - GameData.CAMERA_CORRECTION_Y;
}
return(_local2);
}
static function getFloorByID(_sID) {
return(oRegisteredFloors[_sID]);
}
function open() {
if ((bSkipSound != true) && (stateStarting())) {
sarbakan.sound.SoundManager.play("magic", GameData.VOLUME_MAGIC, 1, false);
}
bSkipSound = false;
if (stateFinished()) {
setState("idleOpened");
attachCollider();
_global.C.oSideScroller.focusOnCurrentCharacter();
sarbakan.utils.ActionSequencer.onActionDone("FloorFocus");
}
}
function close() {
if ((bSkipSound != true) && (stateStarting())) {
sarbakan.sound.SoundManager.play("magic", GameData.VOLUME_MAGIC, 1, false);
}
bSkipSound = false;
if (stateFinished()) {
setState("idle");
detachCollider();
_global.C.oSideScroller.focusOnCurrentCharacter();
sarbakan.utils.ActionSequencer.onActionDone("FloorFocus");
if (bPuzzleHint) {
bPuzzleHint = false;
elements.characters.BaseCharacter.lockControl();
_global.C.oPopup.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), GameData.DIALOGS.HINT_SWITCH_PLATFORM, sarbakan.utils.Delegate.create(elements.characters.BaseCharacter, elements.characters.BaseCharacter.unlockControl), false);
}
}
}
static function onOpen(_sReceivedFloorID, _bInstant) {
var _local2 = oRegisteredFloors[_sReceivedFloorID];
if (_local2 != undefined) {
_local2.bSkipSound = _bInstant;
if (_local2.getState() == "idle") {
if (_bInstant) {
_local2.setState("open");
} else {
oCurrentFloor = _local2;
_global.C.oSideScroller.focusOnElement(oCurrentFloor, sarbakan.utils.Delegate.create(elements.DynamicFloor, onOpenFocusDone));
}
}
} else {
sarbakan.utils.ActionSequencer.onActionDone("FloorFocus");
}
}
static function onOpenFocusDone() {
oCurrentFloor.setState("open");
}
static function onClose(_sReceivedFloorID, _bInstant) {
var _local2 = oRegisteredFloors[_sReceivedFloorID];
if (_local2 != undefined) {
_local2.bSkipSound = _bInstant;
if (_local2.getState() == "idleOpened") {
elements.characters.BaseCharacter.lockControl();
if (_bInstant) {
_local2.setState("close");
} else {
oCurrentFloor = _local2;
_global.C.oSideScroller.focusOnElement(oCurrentFloor, sarbakan.utils.Delegate.create(elements.DynamicFloor, onCloseFocusDone));
}
}
} else {
sarbakan.utils.ActionSequencer.onActionDone("FloorFocus");
}
}
static function onCloseFocusDone() {
oCurrentFloor.setState("close");
}
static function registerFloor(_sID, _oInstance) {
if (!oRegisteredFloors) {
oRegisteredFloors = {};
}
oRegisteredFloors[_sID] = _oInstance;
}
function attachCollider() {
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.floor;
_local3.attachMC("dynamicFloorCollider", mc._x, mc._y, id);
var _local4 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall;
_local4.attachMC("dynamicFloorCollider", mc._x, mc._y, id);
}
function detachCollider() {
var _local4 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.floor.getMC();
_local4[id].removeMovieClip();
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall.getMC();
_local3[id].removeMovieClip();
}
}
Symbol 1655 MovieClip [__Packages.switchScripts.CloseDoor] Frame 0
class switchScripts.CloseDoor extends sarbakan.structure.Script
{
function CloseDoor () {
super();
}
static function execute(_oData) {
elements.Door.onClose(_oData.switchID);
}
}
Symbol 1656 MovieClip [__Packages.sarbakan.utils.MoreMath] Frame 0
class sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function random(_nMin, _nMax) {
return(Math.floor(Math.random() * (_nMax - _nMin)) + _nMin);
}
static function randomFromPredefined(_oPredefined, _nMin, _nMax) {
return(Math.floor(_oPredefined.get() * (_nMax - _nMin)) + _nMin);
}
static function getDistance(_x1, _y1, _x2, _y2) {
return(Math.sqrt(Math.pow(Math.abs(_x2 - _x1), 2) + Math.pow(Math.abs(_y2 - _y1), 2)));
}
static function getManhattanDistance(_x1, _y1, _x2, _y2) {
return(Math.abs(_x1 - _x2) + Math.abs(_y1 - _y2));
}
static function getAngle(_oPt1, _oPt2) {
var _local2 = 0;
var _local3 = 0;
var _local1 = 0;
var _local4 = 0;
_local2 = (_oPt1.x - _oPt2.x) * -1;
_local3 = (_oPt1.y - _oPt2.y) * -1;
_local1 = Math.atan2(_local3, _local2);
_local1 = (_local1 * 180) / Math.PI;
if (_local1 < 0) {
_local1 = _local1 * -1;
_local4 = 180 - _local1;
_local1 = 180 + _local4;
}
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
static function getRadian(_oPt1, _oPt2) {
var _local1 = 0;
var _local2 = 0;
var _local3 = 0;
_local1 = (_oPt1.x - _oPt2.x) * -1;
_local2 = (_oPt1.y - _oPt2.y) * -1;
_local3 = Math.atan2(_local2, _local1);
return(_local3);
}
}
Symbol 1657 MovieClip [__Packages.sarbakan.utils.PredefinedRandom] Frame 0
class sarbakan.utils.PredefinedRandom
{
var nListSize, aList, aOriginalList;
function PredefinedRandom (_nListSize) {
if (_nListSize) {
nListSize = _nListSize;
} else {
nListSize = DEFAULT_LIST_SIZE;
}
regenerate();
}
function reset() {
aList = sarbakan.utils.Tools.copyArray(aOriginalList);
}
function regenerate() {
aList = [];
var _local2 = 0;
while (_local2 < nListSize) {
aList.push(Math.random());
_local2++;
}
aOriginalList = sarbakan.utils.Tools.copyArray(aList);
}
function get() {
var _local2 = aList.pop();
aList.unshift(_local2);
return(_local2);
}
function getLastGetted() {
return(aList[0]);
}
static var DEFAULT_LIST_SIZE = 50;
}
Symbol 1658 MovieClip [__Packages.sarbakan.utils.Tools] Frame 0
class sarbakan.utils.Tools
{
function Tools () {
}
static function copyArray(_aArraySource) {
var _local3 = new Array();
var _local1 = 0;
_local1 = 0;
while (_local1 < _aArraySource.length) {
if (_aArraySource[_local1] instanceof Array) {
_local3.push(copyArray(_aArraySource[_local1]));
} else {
_local3.push(_aArraySource[_local1]);
}
_local1++;
}
return(_local3);
}
}
Symbol 1659 MovieClip [__Packages.Packaging] Frame 0
class Packaging
{
var mc, bMuted, nCurrentScreen, oHiScoreBoard, bQuit, nFinalScore;
function Packaging (_mc) {
mc = _mc;
bMuted = false;
goto("title", "Normal");
_global.oHS = new objHSNick();
_global.oHS.fDoHSInit();
}
function goto(_sDest, _sTransitionToUse) {
_quality = "high";
nCurrentScreen = _sDest;
if (_sTransitionToUse != undefined) {
_global.C.transitionTo(_sTransitionToUse, sarbakan.utils.Delegate.create(this, goto, _sDest));
} else {
mc.gotoAndStop(_sDest);
initScreen(_sDest);
}
if (((_sDest != "menu") && (_sDest != "menuQuit")) && (!(_global.C.isInGame() && ((_sDest == "instructions1") || (_sDest == "instructions2"))))) {
_global.C.initPackagingMusic();
}
}
function hide() {
if (_global.PerformanceTestResult < GameData.FRAME_PERFORMANCE_THRESHOLD) {
_quality = "low";
} else {
_quality = "medium";
}
mc.gotoAndStop("hidden");
if (oHiScoreBoard) {
delete oHiScoreBoard;
}
}
function onButtonPlay() {
clickSound();
if (_global.C.isInGame()) {
_global.C.unpause();
hide();
} else {
showLevelChoice();
}
}
function onButtonInstructions() {
clickSound();
goto("instructions1");
}
function onButtonBackInstructions() {
clickSound();
goto("instructions1");
}
function onButtonNext() {
clickSound();
goto("instructions2");
}
function onButtonLevel(_nDifficulty) {
clickSound();
sarbakan.sound.SoundManager.fade(_global.C.oMusicPackaging, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 2);
_global.C.transitionTo("Load", sarbakan.utils.Delegate.create(this, onStartGame, _nDifficulty));
}
function onStartGame(_nDifficulty) {
_global.C.initGame(_nDifficulty);
hide();
}
function onButtonResume() {
clickSound();
mc.mcScreen.play();
}
function onMenuHidden() {
hide();
_global.C.unpause();
}
function onButtonQuit() {
clickSound();
goto("menuQuit");
}
function onQuitHidden() {
if (bQuit == true) {
hide();
_global.C.loseGame();
} else {
onMenuHidden();
}
}
function onButtonQuitConfirm(_bConfirm) {
clickSound();
bQuit = _bConfirm;
mc.mcScreen.play();
}
function onButtonToggleSound() {
if (bMuted) {
sarbakan.sound.SoundManager.unmute();
bMuted = false;
} else {
sarbakan.sound.SoundManager.mute();
bMuted = true;
}
clickSound();
initScreen("menu");
}
function onButtonRestart() {
clickSound();
_global.C.unpause();
_global.C.destroyGame();
showLevelChoice();
}
function onButtonContinue() {
clickSound();
elements.characters.BaseCharacter.nEnergy = elements.characters.BaseCharacter.ENERGY_FULL;
elements.characters.BaseCharacter.nToken--;
_global.C.oHUD.nProgressCount = _global.C.oHUD.nProgressCount - (GameData.CONTINUE_TIME_VALUE * 60);
if (_global.C.oHUD.nProgressCount < 0) {
_global.C.oHUD.nProgressCount = 0;
}
_global.C.oHUD.updateToken();
onMenuHidden();
_global.C.initGameMusic();
}
function onButtonScore(_bFromTitle, _bSubmit) {
clickSound();
goto("hiscore");
if (_bSubmit) {
mc.mcScreen.btScoreSubmit._visible = false;
}
_global.oHS.bSubmitHS = _bSubmit;
_global.oHS.fDoViewHS(mc, true);
initHiScore(_bFromTitle);
}
function onButtonScoreFromScore() {
clickSound();
mc.mcScreen.btScoreSubmit._visible = false;
oHiScoreBoard.clearScores();
_global.oHS.bSubmitHS = true;
_global.oHS.fDoViewHS(mc, true);
initHiScore(false);
}
function onButtonBack() {
clickSound();
goto("title");
}
function initScreen(_sDest) {
switch (_sDest) {
case "title" :
mc.mcScreen.btPlay.onRelease = sarbakan.utils.Delegate.create(this, onButtonPlay);
mc.mcScreen.btScoreView.onRelease = sarbakan.utils.Delegate.create(this, onButtonScore, true, false);
mc.mcScreen.btInstructions.onRelease = sarbakan.utils.Delegate.create(this, onButtonInstructions);
break;
case "instructions1" :
mc.mcScreen.btPlay.onRelease = sarbakan.utils.Delegate.create(this, onButtonPlay);
mc.mcScreen.btNext.onRelease = sarbakan.utils.Delegate.create(this, onButtonNext);
break;
case "instructions2" :
mc.mcScreen.btPlay.onRelease = sarbakan.utils.Delegate.create(this, onButtonPlay);
mc.mcScreen.btBack.onRelease = sarbakan.utils.Delegate.create(this, onButtonBackInstructions);
break;
case "menu" :
mc.mcScreen.mcButtons.btResume.onRelease = sarbakan.utils.Delegate.create(this, onButtonResume);
mc.mcScreen.mcButtons.btQuit.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuit);
mc.mcScreen.mcButtons.btInstructions.onRelease = sarbakan.utils.Delegate.create(this, onButtonInstructions);
if (bMuted) {
mc.mcScreen.mcButtons.mcSound.gotoAndStop("off");
mc.mcScreen.mcButtons.mcSound.btOn.onRelease = sarbakan.utils.Delegate.create(this, onButtonToggleSound);
} else {
mc.mcScreen.mcButtons.mcSound.gotoAndStop("on");
mc.mcScreen.mcButtons.mcSound.btOff.onRelease = sarbakan.utils.Delegate.create(this, onButtonToggleSound);
}
break;
case "menuQuit" :
bQuit = false;
mc.mcScreen.mcButtons.btYes.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuitConfirm, true);
mc.mcScreen.mcButtons.btNo.onRelease = sarbakan.utils.Delegate.create(this, onButtonQuitConfirm, false);
break;
case "win" :
_global.C.destroyGame();
_global.C.stopMusic();
case "lose" :
if ((elements.characters.BaseCharacter.nToken < 1) || (bQuit == true)) {
mc.mcScreen.btContinue._visible = false;
bQuit = false;
}
mc.mcScreen.btContinue.onRelease = sarbakan.utils.Delegate.create(this, onButtonContinue);
mc.mcScreen.btRestart.onRelease = sarbakan.utils.Delegate.create(this, onButtonRestart);
mc.mcScreen.btScoreView.onRelease = sarbakan.utils.Delegate.create(this, onButtonScore, false, false);
mc.mcScreen.btScoreSubmit.onRelease = sarbakan.utils.Delegate.create(this, onButtonScore, false, true);
if (!_global.gProxyObj.getIsLoggedIn()) {
mc.mcScreen.btScoreSubmit._visible = false;
}
calculateScore();
break;
case "hiscore" :
mc.mcScreen.btScoreSubmit.onRelease = sarbakan.utils.Delegate.create(this, onButtonScoreFromScore, false, true);
if (_global.gProxyObj.getIsLoggedIn()) {
break;
}
mc.mcScreen.btScoreSubmit._visible = false;
}
}
function showLevelChoice() {
mc.mcLevelChoice.gotoAndStop(2);
mc.mcLevelChoice.btNormal.onRelease = sarbakan.utils.Delegate.create(this, onButtonLevel, GameData.DIFFICULTY_NORMAL);
mc.mcLevelChoice.btHard.onRelease = sarbakan.utils.Delegate.create(this, onButtonLevel, GameData.DIFFICULTY_HARD);
if (_global.C.isMasterUnlocked()) {
mc.mcLevelChoice.mcMaster.gotoAndStop(2);
mc.mcLevelChoice.mcMaster.btMaster.onRelease = sarbakan.utils.Delegate.create(this, onButtonLevel, GameData.DIFFICULTY_MASTER);
} else {
mc.mcLevelChoice.mcMaster.gotoAndStop(1);
}
}
function calculateScore() {
mc.mcScreen.txtScore.text = _global.C.oHUD.nScore;
var _local3 = 0;
if (elements.characters.FireGuard.nTotalInstance == elements.characters.FireGuard.nTotalInstanceDestroyed) {
_local3 = _local3 + GameData.SCORE_ENNEMY_ALL;
}
if (elements.bonuses.Token.nTotalInstance == elements.bonuses.Token.nTotalInstanceDestroyed) {
_local3 = _local3 + GameData.SCORE_TOKEN_ALL;
}
if (nCurrentScreen == "win") {
_local3 = _local3 + GameData.SCORE_COMPLETE;
_local3 = _local3 + (GameData.SCORE_TIME_REMAINING * (_global.C.oHUD.nProgressLimit - _global.C.oHUD.nProgressCount));
var _local4 = Math.round(_global.C.oHUD.nProgressCount / 60);
if (_local4 < GameData.BONUS_TIME_MASTER) {
_local3 = _local3 + GameData.SCORE_SPEED_BONUS_MASTER;
} else if (_local4 < GameData.BONUS_TIME_LIGHTNING) {
_local3 = _local3 + GameData.SCORE_SPEED_BONUS_LIGHTNING;
} else if (_local4 < GameData.BONUS_TIME) {
_local3 = _local3 + GameData.SCORE_SPEED_BONUS;
}
_local3 = _local3 + (GameData.SCORE_ENERGY_REMAINING * elements.characters.BaseCharacter.nEnergy);
if (elements.characters.BaseCharacter.nEnergy == elements.characters.BaseCharacter.ENERGY_FULL) {
_local3 = _local3 + GameData.SCORE_ENERGY_FULL;
}
_local3 = _local3 * GameData.DIFFICULTY_SETTINGS[_global.C.nDifficultyLevel].score_multiplier;
if (_global.C.nDifficultyLevel == GameData.DIFFICULTY_HARD) {
_global.C.unlockMasterMode();
}
}
mc.mcScreen.txtBonus.text = _local3;
nFinalScore = _global.C.oHUD.nScore + _local3;
mc.mcScreen.txtTotal.text = nFinalScore;
mc.mcScreen.txtToken.text = elements.characters.BaseCharacter.nToken;
mc.mcScreen.txtNP.text = calculateNickPoints();
}
function calculateNickPoints() {
var _local3 = 0;
if ((nFinalScore >= 1) && (nFinalScore <= 7500)) {
_local3 = 5;
} else if ((nFinalScore >= 7501) && (nFinalScore <= 15000)) {
_local3 = 10;
} else if ((nFinalScore >= 15001) && (nFinalScore <= 25000)) {
_local3 = 20;
} else if ((nFinalScore >= 25001) && (nFinalScore <= 35000)) {
_local3 = 35;
} else if ((nFinalScore >= 35001) && (nFinalScore <= 50000)) {
_local3 = 50;
} else if ((nFinalScore >= 50001) && (nFinalScore <= 70000)) {
_local3 = 75;
} else if (nFinalScore >= 70001) {
_local3 = 100;
}
trace("Send le score");
_global.rootScore.awardPoints(_local3);
trace("nNP : " + _local3);
trace("_global.rootScore.awardPoints : " + _global.rootScore.awardPoints);
trace("_global.rootScore : " + _global.rootScore);
return(_local3);
}
function initHiScore(_bFromTitle) {
oHiScoreBoard = new sarbakan.packaging.HighScoreBoard(mc.mcScreen.mcHiScore, mc.mcScreen.mcHiScore.mcLine, 150);
oHiScoreBoard.setScrollButtons(mc.mcScreen.mcScroll.btUp, mc.mcScreen.mcScroll.btDown);
oHiScoreBoard.setMargin(-4);
_global.oHS.fSetHSBoard(mc);
_global.oHS.bGetHS = true;
if (_bFromTitle) {
mc.mcScreen.btRestart._visible = false;
mc.mcScreen.btScoreSubmit._visible = false;
mc.mcScreen.btBack.onRelease = sarbakan.utils.Delegate.create(this, onButtonBack);
} else {
mc.mcScreen.btBack._visible = false;
mc.mcScreen.btRestart.onRelease = sarbakan.utils.Delegate.create(this, onButtonRestart);
}
if ((_global.oHS.bGetHS == true) && (_global.oHS.bSubmitHS != true)) {
_global.oHS.bGetHS = false;
_global.oHS.getScores();
} else if (_global.oHS.bSubmitHS == true) {
_global.oHS.bSubmitHS = false;
_global.oHS.submitScore(nFinalScore);
}
}
function clickSound() {
sarbakan.sound.SoundManager.play("button", GameData.VOLUME_BUTTON, 1, false);
}
}
Symbol 1660 MovieClip [__Packages.sarbakan.packaging.HighScoreBoard] Frame 0
class sarbakan.packaging.HighScoreBoard
{
var mcBoard, mcFields, nNextY, nFieldID, nMargin, nScrollPC, nBoardHeight, nResultHeight, nScorePosition, btUp, btDown, mcScrollBar, nScrollMin, nScrollMax, nScrollOrigin, bScrolling, bButtonScrolling, nScrollUpdateCount, nButtonScrollingDirection;
function HighScoreBoard (_mcBoard, _mcFields, _nBoardHeight) {
mcBoard = _mcBoard;
mcFields = _mcFields;
nNextY = mcFields._y;
mcFields._visible = false;
nFieldID = 0;
nMargin = DEFAULT_MARGIN;
nScrollPC = 0;
nBoardHeight = _nBoardHeight;
nResultHeight = 0;
nScorePosition = 0;
_mcBoard.onEnterFrame = sarbakan.utils.Delegate.create(this, onScrollUpdate);
setMessage("Retrieving scores...");
}
function setScrollButtons(_btUp, _btDown) {
btUp = _btUp;
btUp.onPress = sarbakan.utils.Delegate.create(this, startButtonScroll, -1);
btUp.onRelease = sarbakan.utils.Delegate.create(this, endButtonScroll);
btDown = _btDown;
btDown.onPress = sarbakan.utils.Delegate.create(this, startButtonScroll, 1);
btDown.onRelease = sarbakan.utils.Delegate.create(this, endButtonScroll);
}
function setScrollBar(_mc, _nMinY, _nMaxY) {
mcScrollBar = _mc;
mcScrollBar._visible = false;
nScrollMin = _nMinY;
nScrollMax = _nMaxY;
mcScrollBar.onPress = sarbakan.utils.Delegate.create(this, onScrollBarClick);
mcScrollBar.onRelease = sarbakan.utils.Delegate.create(this, onScrollBarRelease);
mcScrollBar.onReleaseOutside = mcScrollBar.onRelease;
}
function setMargin(_nMargin) {
nMargin = _nMargin;
}
function enableScroll() {
mcScrollBar._visible = true;
btUp._visible = true;
btDown._visible = true;
}
function disableScroll() {
mcScrollBar._visible = false;
btUp._visible = false;
btDown._visible = false;
}
function addEntry(_sName, _nScore) {
var _local2 = mcFields.duplicateMovieClip("mcField" + (nFieldID++), mcFields._parent.getNextHighestDepth());
_local2._visible = true;
_local2._y = nNextY;
nNextY = nNextY + (mcFields._height + nMargin);
_local2.position = (++nScorePosition) + ".";
_local2.name = _sName;
_local2.score = _nScore;
clearMessage();
if (nNextY > nBoardHeight) {
enableScroll();
}
}
function setMessage(_sMessage) {
mcBoard.message = _sMessage;
disableScroll();
}
function clearMessage() {
mcBoard.message = "";
}
function clearScores() {
var _local2 = nFieldID;
while (_local2 >= 0) {
mcBoard["mcField" + _local2].removeMovieClip();
_local2--;
}
nFieldID = 0;
nNextY = mcFields._y;
nScrollPC = 0;
nResultHeight = 0;
scrollTo(0);
}
function scrollTo(_nScrollPC) {
if (!nScrollOrigin) {
nScrollOrigin = mcBoard._y;
}
mcBoard._y = nScrollOrigin - ((mcBoard._height - nBoardHeight) * (_nScrollPC / 100));
}
function scrollUp() {
nScrollPC = nScrollPC - 10;
if (nScrollPC < 0) {
nScrollPC = 0;
}
scrollTo(nScrollPC);
}
function scrollDown() {
nScrollPC = nScrollPC + 10;
if (nScrollPC > 100) {
nScrollPC = 100;
}
scrollTo(nScrollPC);
}
function onScrollUpdate() {
if (bScrolling) {
var _local2 = Math.round(((mcScrollBar._y - nScrollMin) / (nScrollMax - nScrollMin)) * 100);
if (_local2 != nScrollPC) {
nScrollPC = _local2;
scrollTo(nScrollPC);
}
}
if (bButtonScrolling && ((++nScrollUpdateCount) >= SCROLL_UPDATE_RATE)) {
nScrollUpdateCount = 0;
if (nButtonScrollingDirection == 1) {
scrollDown();
} else {
scrollUp();
}
}
}
function onScrollBarClick() {
bScrolling = true;
mcScrollBar.startDrag(false, mcScrollBar._x, nScrollMin, mcScrollBar._x, nScrollMax);
}
function onScrollBarRelease() {
bScrolling = false;
mcScrollBar.stopDrag();
}
function startButtonScroll(_nDirection) {
bButtonScrolling = true;
nButtonScrollingDirection = _nDirection;
nScrollUpdateCount = SCROLL_UPDATE_RATE;
}
function endButtonScroll() {
bButtonScrolling = false;
}
static var DEFAULT_MARGIN = 5;
static var SCROLL_UPDATE_RATE = 3;
}
Symbol 1661 MovieClip [__Packages.objHSNick] Frame 0
class objHSNick
{
var bHSAvailable, G_TestHighScore, bSubmitHS, bGetHS, G_GameID, mcHSZone;
function objHSNick () {
bHSAvailable = true;
G_TestHighScore = false;
bSubmitHS = false;
bGetHS = false;
G_GameID = "av_escape";
mcHSZone = undefined;
if (G_TestHighScore == true) {
_global.gProxyObj.setServer("www.nick.com");
_global.gProxyObj.setScreenName("dd_programmer");
_global.gProxyObj.setIsLoggedIn(true);
}
}
function getScores() {
trace("getScore " + _global.gProxyObj);
if (_global.gProxyObj == undefined) {
listScores();
} else {
_global.gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
addMessage("The high score list is updating!");
_global.gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
_global.gProxyObj.setGame_Id(G_GameID);
}
function getScoreString() {
var _local8 = "Oops! The high score list is not available right now!";
if (_global.gProxyObj != undefined) {
var _local7 = _global.gProxyObj.getScoreCount();
trace(_local7);
if (_local7 > 0) {
var _local3;
var _local4;
var _local5;
var _local6;
removeMessage();
_local3 = 0;
while (_local3 < _local7) {
_local8 = "";
_local4 = _global.gProxyObj.getScoreItem(_local3);
_local5 = _local4[0];
trace(_local5);
_local6 = _local4[1];
_global.C.oPackaging.oHiScoreBoard.addEntry(_local5, _local6);
_local3++;
}
} else {
addMessage("Oops! The high score list is not available right now!");
}
} else {
addMessage("Oops! The high score list is not available right now!");
}
return(_local8);
}
function listScores() {
getScoreString();
}
function cbFunc(thisBool) {
trace("cbFunc" + thisBool);
if (thisBool) {
_global.oHS.listScores();
} else {
addMessage("Oops! The high score list is not available right now!");
}
}
function cbFunc2(thisBool) {
trace("*" + thisBool);
if (thisBool) {
_global.oHS.listScores();
} else {
addMessage("Oops! The high score list is not available right now!");
}
}
function fDoHSInit() {
initHiScores();
if (_global.gProxyObj.getIsLoggedIn()) {
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function fDoSubmitHS(l_mcStage) {
bSubmitHS = true;
}
function fDoViewHS(l_mcStage, l_bFromGame) {
bGetHS = true;
_global.KMC.startHighScore(l_mcStage, l_bFromGame);
}
function fSetHSBoard(P_mcRef) {
mcHSZone = P_mcRef;
if (_global.gProxyObj.getIsLoggedIn()) {
mcHSZone.btnSubmitHS._visible = true;
} else {
mcHSZone.btnSubmitHS._visible = false;
}
}
function addMessage(l_sMsg) {
_global.C.oPackaging.oHiScoreBoard.setMessage(l_sMsg);
}
function removeMessage() {
_global.C.oPackaging.oHiScoreBoard.clearMessage();
}
}
Symbol 1662 MovieClip [__Packages.elements.bonuses.Bonus] Frame 0
class elements.bonuses.Bonus extends sarbakan.visual.element.DynamicElement
{
var setMC, setLinkage, removeReferenceMC, attachMC, collideWithElement, setState, stateFinished, remove;
function Bonus (_mc, _sLinkage) {
super("bonus" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
}
function init() {
removeReferenceMC();
attachMC();
}
function onPick() {
}
function idle() {
var _local2 = elements.characters.BaseCharacter.getControlledCharacter();
if (_local2.stateIsNot("whip", "crackWalls", "easterEgg") && (collideWithElement(_local2.id))) {
onPick();
setState("pick");
}
}
function pick() {
if (stateFinished()) {
remove();
}
}
}
Symbol 1663 MovieClip [__Packages.elements.bonuses.Token] Frame 0
class elements.bonuses.Token extends elements.bonuses.Bonus
{
static var nTotalInstance, nTotalInstanceDestroyed;
function Token (_mc) {
super(_mc, "token");
nTotalInstance++;
}
static function resetInstanceCount() {
nTotalInstance = 0;
nTotalInstanceDestroyed = 0;
}
function onPick() {
elements.characters.BaseCharacter.gainToken();
sarbakan.sound.SoundManager.play("sndToken", GameData.VOLUME_BONUS_TOKEN, 1, false);
_global.C.oHUD.addScore(GameData.SCORE_TOKEN);
nTotalInstanceDestroyed++;
}
}
Symbol 1664 MovieClip [__Packages.sarbakan.packaging.TransitionManager] Frame 0
class sarbakan.packaging.TransitionManager
{
var mc, oEnterFrameListener, oCurrentTransition, sState;
function TransitionManager (_mc) {
mc = _mc;
mc.gotoAndStop("inactive");
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = sarbakan.utils.Delegate.create(this, update);
}
function startTransition(_oTransition) {
oCurrentTransition = _oTransition;
sState = "Out";
mc.gotoAndStop(oCurrentTransition.outID);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
}
function endTransition() {
MovieClip.removeListener(oEnterFrameListener);
if (typeof(oCurrentTransition.endListener) != "function") {
for (var _local2 in oCurrentTransition.endListener) {
oCurrentTransition.endListener[_local2];
}
} else {
oCurrentTransition.endListener();
}
delete oCurrentTransition;
sState = "";
mc.gotoAndStop("inactive");
}
function update() {
if (sState == "Out") {
if (stateFinished()) {
mc.gotoAndStop(oCurrentTransition.inID);
sState = "In";
if (typeof(oCurrentTransition.middleListener) != "function") {
for (var _local2 in oCurrentTransition.middleListener) {
oCurrentTransition.middleListener[_local2]();
}
} else {
oCurrentTransition.middleListener();
}
}
} else if (sState == "In") {
if (stateFinished()) {
endTransition();
}
}
}
function stateStarting() {
return(mc.state._currentframe == 1);
}
function stateFinished() {
return(mc.state._currentframe == mc.state._totalframes);
}
}
Symbol 1665 MovieClip [__Packages.SideScroller] Frame 0
class SideScroller extends sarbakan.structure.Sequence
{
var mcBase, oView, oCam, oLayerForeground, oLayerGame, oLayerWallnFloor, oLayerBackground, bFirstUpdate, bSwitchedCharacter;
function SideScroller (_mcBase) {
super();
mcBase = _mcBase;
}
function init() {
elements.bonuses.Token.resetInstanceCount();
elements.characters.FireGuard.resetInstanceCount();
elements.characters.BaseEnemy.reset();
elements.Door.reset();
elements.characters.BaseEnemy.reset();
elements.Switch.reset();
switchScripts.Exit.reset();
switchScripts.OpenDoor.reset();
switchScripts.ExtinguishFire.reset();
switchScripts.OpenFloorPuzzle.reset();
switchScripts.OpenSwitchPuzzle.reset();
oView = new sarbakan.visual.layer.LayerManager(mcBase.mcSize._width, mcBase.mcSize._height, GameData.SCREEN_WIDTH, GameData.SCREEN_HEIGHT);
oCam = oView.getCamera();
oLayerForeground = new sarbakan.visual.layer.Layer(mcBase.mcForeground, new sarbakan.visual.activation.GridActivation());
oView.addLayer(oLayerForeground, 1, 1);
oLayerGame = new sarbakan.visual.layer.Layer(mcBase.mcElements, new sarbakan.visual.activation.GridActivation());
oView.addLayer(oLayerGame, 1, 1);
oLayerGame.addCollisionMap(new sarbakan.visual.layer.CollisionMap("floor", oLayerGame, 12632256));
oLayerGame.addCollisionMap(new sarbakan.visual.layer.CollisionMap("wall", oLayerGame, 65535));
oLayerWallnFloor = new sarbakan.visual.layer.Layer(mcBase.mcWallFloor, new sarbakan.visual.activation.GridActivation());
oView.addLayer(oLayerWallnFloor, 1, 1);
oLayerBackground = new sarbakan.visual.layer.Layer(mcBase.mcBackground, new sarbakan.visual.activation.GridActivation());
oView.addLayer(oLayerBackground, 1, 1);
_global.C.initGameMusic();
sarbakan.utils.ActionSequencer.init();
if (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL) {
dialogScripts.Tutorial.execute();
}
elements.characters.BaseCharacter.unlockControl();
bFirstUpdate = true;
}
function update() {
if (bFirstUpdate && (elements.characters.BaseCharacter.ENERGY_FULL != undefined)) {
bFirstUpdate = false;
_global.C.oHUD.init();
}
bSwitchedCharacter = false;
sarbakan.utils.ActionSequencer.update();
oView.update();
}
function destroy() {
oView.destroy();
}
function addInteractiveElement(_nElementType, _oElement) {
oLayerGame.addDynamicElement(_oElement);
if (!(_nElementType === GameData.DEFAULT_CHARACTER)) {
} else {
switchCharacter(_oElement, true);
}
}
function addFloor(_oElement) {
oLayerWallnFloor.addStaticElement(_oElement);
}
function addDynamicFloor(_oElement) {
oLayerWallnFloor.addDynamicElement(_oElement);
}
function addWall(_oElement) {
oLayerWallnFloor.addStaticElement(_oElement);
}
function addDecorationBackground(_oElement) {
oLayerBackground.addStaticElement(_oElement);
}
function addDecorationForeground(_oElement) {
oLayerForeground.addStaticElement(_oElement);
}
function switchCharacter(_oCharacter, _bInstant) {
if (!bSwitchedCharacter) {
bSwitchedCharacter = true;
setCamSpeed(_oCharacter);
oCam.lockOn(sarbakan.utils.Delegate.create(_oCharacter, _oCharacter.getCoord), _bInstant, sarbakan.utils.Delegate.create(this, onSwitchCharacterDone));
elements.characters.BaseCharacter.setControlledCharacter(_oCharacter);
if (!_bInstant) {
elements.characters.BaseCharacter.lockControl();
}
_global.C.oHUD.updateCharacters();
}
}
function focusOnElement(_oElement, _fEndListener) {
setCamSpeed(_oElement);
oCam.lockOn(sarbakan.utils.Delegate.create(_oElement, _oElement.getCoord), false, _fEndListener);
elements.characters.BaseCharacter.lockControl();
}
function focusOnCurrentCharacter() {
var _local2 = elements.characters.BaseCharacter.getControlledCharacter();
setCamSpeed(_local2);
oCam.lockOn(sarbakan.utils.Delegate.create(_local2, _local2.getCoord), false, sarbakan.utils.Delegate.create(this, onSwitchCharacterDone));
}
function onSwitchCharacterDone() {
if (dialogScripts.Tutorial.bMustSwitchToKatara) {
dialogScripts.Tutorial.bMustSwitchToKatara = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onSwitchToKatara");
} else if (dialogScripts.Tutorial.bMustSwitchToToph) {
dialogScripts.Tutorial.bMustSwitchToToph = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onSwitchToToph");
} else if (dialogScripts.Tutorial.bMustSwitchToAang) {
dialogScripts.Tutorial.bMustSwitchToAang = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onSwitchToAang");
} else {
elements.characters.BaseCharacter.unlockControl();
}
}
function setCamSpeed(_oTarget) {
var _local2 = GameData.CAMERA_BASE_SPEED;
var _local3 = _oTarget.getCoord();
var _local4 = sarbakan.utils.MoreMath.getDistance(oCam.getX() * -1, oCam.getY() * -1, _local3.x, _local3.y);
_local2 = _local2 + Math.round(_local4 / GameData.CAMERA_SPEED_ADJUST_STEP);
oCam.setSpeed(_local2);
}
}
Symbol 1666 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1667 MovieClip [__Packages.sarbakan.visual.Camera] Frame 0
class sarbakan.visual.Camera
{
static var oEnterFrameListener;
var nX, nY, nViewZoneW, nViewZoneH, nStageW, nStageH, bLockedOn, nSpeed, bTravelling, oTweenX, fEasing, oTweenY, nTravelDestX, nTravelDestY, fEndListener, fLockedFunction, __get__x, __get__y;
function Camera (_viewZoneW, _viewZoneH, _nStageW, _nStageH) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = mx.utils.Delegate.create(this, update);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
nX = 0;
nY = 0;
nViewZoneW = _viewZoneW;
nViewZoneH = _viewZoneH;
nStageW = _nStageW;
nStageH = _nStageH;
setSpeed(DEFAULT_SPEED);
setEasing(DEFAULT_EASING);
bLockedOn = false;
}
function travelTo(_nDestX, _nDestY, _fListener) {
var _local2 = Math.round(sarbakan.utils.MoreMath.getDistance(nX * -1, nY * -1, _nDestX, _nDestY) / nSpeed);
if (_local2 == 0) {
_local2 = 1;
}
if (!bTravelling) {
oTweenX = new mx.transitions.Tween(this, "x", fEasing, nX * -1, _nDestX, _local2, false);
oTweenY = new mx.transitions.Tween(this, "y", fEasing, nY * -1, _nDestY, _local2, false);
oTweenX.onMotionFinished = mx.utils.Delegate.create(this, onTravelFinished);
} else {
oTweenX.continueTo(_nDestX, _local2);
oTweenY.continueTo(_nDestY, _local2);
}
nTravelDestX = _nDestX;
nTravelDestY = _nDestY;
if (_fListener) {
fEndListener = _fListener;
}
bTravelling = true;
}
function moveTo(_nDestX, _nDestY) {
x = (_nDestX);
y = (_nDestY);
}
function lockOn(_fLockFunction, _bInstant, _fEndListener) {
bLockedOn = true;
fLockedFunction = _fLockFunction;
var _local2 = fLockedFunction();
if ((_local2.x != nX) || (_local2.y != nY)) {
if (_bInstant) {
moveTo(_local2.x, _local2.y);
} else {
travelTo(_local2.x, _local2.y, _fEndListener);
}
}
}
function unlock() {
bLockedOn = false;
fLockedFunction = undefined;
}
function setSpeed(_nSpeed) {
if (_nSpeed) {
nSpeed = _nSpeed;
} else {
setSpeed(DEFAULT_SPEED);
}
}
function setEasing(_fEasing) {
if (_fEasing) {
fEasing = _fEasing;
} else {
setEasing(DEFAULT_EASING);
}
}
function set x(_nX) {
nX = _nX;
if (nX < 0) {
nX = 0;
}
if (nX > (nViewZoneW - nStageW)) {
nX = Math.round(nViewZoneW - nStageW);
}
nX = nX * -1;
//return(__get__x());
}
function set y(_nY) {
nY = _nY;
if (nY < 0) {
nY = 0;
}
if (nY > (nViewZoneH - nStageH)) {
nY = Math.round(nViewZoneH - nStageH);
}
nY = nY * -1;
//return(__get__y());
}
function getX() {
return(nX);
}
function getY() {
return(nY);
}
function destroy() {
MovieClip.removeListener(oEnterFrameListener);
}
function pause() {
oTweenX.stop();
oTweenY.stop();
}
function unpause() {
oTweenX.resume();
oTweenY.resume();
}
function update() {
if (bLockedOn) {
var _local2;
if ((!bTravelling) && (bLockedOn)) {
_local2 = fLockedFunction();
moveTo(_local2.x, _local2.y);
} else if ((_local2.x != nTravelDestX) || (_local2.y != nTravelDestY)) {
}
}
}
function onTravelFinished() {
bTravelling = false;
if (fEndListener) {
fEndListener();
fEndListener = undefined;
}
}
static var DEFAULT_SPEED = 5;
static var DEFAULT_EASING = mx.transitions.easing.Regular.easeOut;
}
Symbol 1668 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1669 MovieClip [__Packages.sarbakan.visual.layer.LayerManager] Frame 0
class sarbakan.visual.layer.LayerManager
{
var nStageW, nStageH, oCam, aLayers, bPaused, bWillPause;
function LayerManager (_nViewZoneW, _nViewZoneH, _nStageW, _nStageH) {
nStageW = _nStageW;
nStageH = _nStageH;
oCam = new sarbakan.visual.Camera(_nViewZoneW, _nViewZoneH, nStageW, nStageH);
aLayers = [];
bPaused = false;
bWillPause = false;
}
function addLayer(_oLayer, _parallaxRatioX, _parallaxRatioY) {
aLayers.push({layer:_oLayer, mc:_oLayer.mc, ratioX:_parallaxRatioX, ratioY:_parallaxRatioY});
_oLayer.init(nStageW, nStageH);
}
function getCamera() {
return(oCam);
}
function destroy() {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.destroy();
_local2++;
}
oCam.destroy();
}
function pause() {
bWillPause = true;
}
function unpause() {
if (bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.unpause();
_local2++;
}
oCam.unpause();
sarbakan.visual.PauseManager.unpause();
}
bPaused = false;
bWillPause = false;
}
function togglePause() {
if (!bPaused) {
pause();
} else {
unpause();
}
}
function update() {
if (bWillPause) {
bPaused = true;
bWillPause = false;
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.pause();
_local2++;
}
oCam.pause();
sarbakan.visual.PauseManager.pause();
}
if (!bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.update();
_local2++;
}
var _local4 = oCam.getX();
var _local3 = oCam.getY();
_local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].mc._x = Math.round(_local4 * aLayers[_local2].ratioX);
aLayers[_local2].mc._y = Math.round(_local3 * aLayers[_local2].ratioY);
_local2++;
}
}
}
}
Symbol 1670 MovieClip [__Packages.switchScripts.Exit] Frame 0
class switchScripts.Exit extends sarbakan.structure.Script
{
static var nExitLeverActivated;
function Exit () {
super();
}
static function reset() {
nExitLeverActivated = 0;
}
static function execute(_oData) {
var _local2 = _global.C.oPopup;
nExitLeverActivated++;
_global.C.musicIncreaseIntensity();
if (nExitLeverActivated < 3) {
elements.characters.BaseCharacter.lockControl();
_local2.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), GameData.DIALOGS.EXIT_LEVER, sarbakan.utils.Delegate.create(elements.characters.BaseCharacter, elements.characters.BaseCharacter.unlockControl), false);
} else {
elements.Door.onOpen("exit");
}
}
}
Symbol 1671 MovieClip [__Packages.switchScripts.ExtinguishFire] Frame 0
class switchScripts.ExtinguishFire extends sarbakan.structure.Script
{
static var oGroups, bExtinguishHint;
function ExtinguishFire () {
super();
}
static function execute(_oData) {
if (oGroups[_oData.switchID]) {
var _local4 = true;
for (var _local5 in oGroups[_oData.switchID]) {
var _local2 = oGroups[_oData.switchID][_local5];
_local2.setState("extinguish");
_local2.disableRespawn();
if (_local4) {
_local4 = false;
_local2.focusOnExtinguish();
}
if (((((_oData.switchID == "fireA") || (_oData.switchID == "fireB")) || (_oData.switchID == "fireC")) && (!bExtinguishHint)) && (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL)) {
bExtinguishHint = true;
_local2.bExtinguishHint = true;
}
}
}
}
static function addFire(_oFire, _sGroup) {
if (oGroups == undefined) {
oGroups = {};
}
if (oGroups[_sGroup] == undefined) {
oGroups[_sGroup] = [];
}
oGroups[_sGroup].push(_oFire);
}
static function reset() {
bExtinguishHint = false;
}
}
Symbol 1672 MovieClip [__Packages.switchScripts.OpenFloorPuzzle] Frame 0
class switchScripts.OpenFloorPuzzle extends sarbakan.structure.Script
{
static var bPuzzleHint;
function OpenFloorPuzzle () {
super();
}
static function execute(_oData) {
elements.characters.BaseCharacter.lockControl();
sarbakan.utils.ActionSequencer.queue("FloorFocus", 0, elements.DynamicFloor, "onOpen", _oData.switchID + "-a");
sarbakan.utils.ActionSequencer.queue("FloorFocus", 0, elements.DynamicFloor, "onClose", _oData.switchID + "-d");
sarbakan.utils.ActionSequencer.queue("unlockControl", 0, elements.characters.BaseCharacter, "unlockControl");
if ((!bPuzzleHint) && (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL)) {
bPuzzleHint = true;
elements.DynamicFloor.bPuzzleHint = true;
}
}
static function reset() {
bPuzzleHint = false;
}
}
Symbol 1673 MovieClip [__Packages.switchScripts.OpenSwitchPuzzle] Frame 0
class switchScripts.OpenSwitchPuzzle extends sarbakan.structure.Script
{
static var bPuzzleHint;
function OpenSwitchPuzzle () {
super();
}
static function execute(_oData) {
elements.characters.BaseCharacter.lockControl();
var _local3 = Number(_oData.switchID.substr(1, 1)) + 1;
var _local2 = elements.Switch.getSwitchByID("o" + _local3)[0];
sarbakan.utils.ActionSequencer.clear();
sarbakan.utils.ActionSequencer.queue("SwitchFocus", 0, _local2, "onAppear");
sarbakan.utils.ActionSequencer.queue("unlockControl", 0, elements.characters.BaseCharacter, "unlockControl");
if ((!bPuzzleHint) && (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL)) {
bPuzzleHint = true;
_local2.bPuzzleHint = true;
}
}
static function reset() {
bPuzzleHint = false;
}
}
Symbol 1674 MovieClip [__Packages.sarbakan.visual.activation.GridActivation] Frame 0
class sarbakan.visual.activation.GridActivation extends sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight, oDynamicElementsZone, oAlwaysActive, oStaticElementsZone, oCurrentZone, nCurrentX, nCurrentY, aVisibleZones;
function GridActivation () {
super();
}
function init(_nZoneWidth, _nZoneHeight) {
super.init();
nZoneWidth = _nZoneWidth;
nZoneHeight = _nZoneHeight;
oDynamicElementsZone = [];
oAlwaysActive = [];
oStaticElementsZone = [];
oCurrentZone = {};
oCurrentZone = {x:-999999, y:-999999};
}
function getActiveElements() {
var _local4 = {};
var _local2 = getSurroundingZones(oCurrentZone);
_local2.push(oCurrentZone);
for (var _local6 in _local2) {
for (var _local5 in oDynamicElementsZone[_local2[_local6].x][_local2[_local6].y]) {
var _local3 = oDynamicElementsZone[_local2[_local6].x][_local2[_local6].y][_local5];
_local4[_local3.id] = _local3;
}
}
for (var _local6 in oAlwaysActive) {
_local4[oAlwaysActive[_local6].id] = oAlwaysActive[_local6];
}
return(_local4);
}
function addDynamicElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
addToActivationZones(oDynamicElementsZone, _oElement, _nX, _nY, _nWidth, _nHeight);
}
function removeDynamicElement(_oElement) {
for (var _local5 in oDynamicElementsZone) {
for (var _local4 in oDynamicElementsZone[_local5]) {
if (oDynamicElementsZone[_local5][_local4]) {
for (var _local3 in oDynamicElementsZone[_local5][_local4]) {
if (oDynamicElementsZone[_local5][_local4][_local3]) {
if (_oElement == oDynamicElementsZone[_local5][_local4][_local3]) {
oDynamicElementsZone[_local5][_local4].splice(_local3, 1);
}
}
}
}
}
}
}
function addStaticElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
addToActivationZones(oStaticElementsZone, _oElement, _nX, _nY, _nWidth, _nHeight);
}
function removeStaticElement(_oElement) {
}
function addAlwaysActiveElement(_oElement) {
oAlwaysActive.push(_oElement);
}
function removeAlwaysActiveElement(_oElement) {
for (var _local3 in oAlwaysActive) {
if (oAlwaysActive[_local3] == _oElement) {
oAlwaysActive.splice(_local3, 1);
break;
}
}
}
function updateActivation(_nX, _nY, _bForceUpdate) {
nCurrentX = _nX;
nCurrentY = _nY;
var _local10 = getCurrentZone();
var _local7 = getSurroundingZones(_local10);
_local7.push(_local10);
if (((_bForceUpdate || (_local10.x != oCurrentZone.x)) || (_local10.y != oCurrentZone.y)) || (zoneChanged(_local7))) {
var _local8 = getSurroundingZones(oCurrentZone);
var _local4 = {};
for (var _local11 in _local8) {
_nX = _local8[_local11].x;
_nY = _local8[_local11].y;
for (var _local9 in oDynamicElementsZone[_nX][_nY]) {
_local4[oDynamicElementsZone[_nX][_nY][_local9].id] = {element:oDynamicElementsZone[_nX][_nY][_local9], enabled:false};
}
for (var _local9 in oStaticElementsZone[_nX][_nY]) {
_local4[oStaticElementsZone[_nX][_nY][_local9].id] = {element:oStaticElementsZone[_nX][_nY][_local9], enabled:false};
}
}
for (var _local11 in _local7) {
_nX = _local7[_local11].x;
_nY = _local7[_local11].y;
for (var _local9 in oDynamicElementsZone[_nX][_nY]) {
_local4[oDynamicElementsZone[_nX][_nY][_local9].id] = {element:oDynamicElementsZone[_nX][_nY][_local9], enabled:true};
}
for (var _local9 in oStaticElementsZone[_nX][_nY]) {
_local4[oStaticElementsZone[_nX][_nY][_local9].id] = {element:oStaticElementsZone[_nX][_nY][_local9], enabled:true};
}
}
for (var _local11 in _local4) {
if (_local4[_local11].enabled == true) {
_local4[_local11].element.enable();
} else {
_local4[_local11].element.disable();
}
}
}
oCurrentZone = _local10;
aVisibleZones = _local7;
}
function elementOnScreen(_oElement) {
var _local6 = _oElement.oAttachProperties._x;
var _local4 = _oElement.oAttachProperties._y;
var _local5 = _oElement.oAttachProperties._x + _oElement.oAttachProperties._width;
var _local3 = _oElement.oAttachProperties._y + _oElement.oAttachProperties._height;
return(((((_local6 >= nCurrentX) && (_local6 <= (nCurrentX + nZoneWidth))) || ((_local4 >= nCurrentY) && (_local4 <= (nCurrentY + nZoneHeight)))) || ((_local5 >= nCurrentX) && (_local5 <= (nCurrentX + nZoneWidth)))) || ((_local3 >= nCurrentY) && (_local3 <= (nCurrentY + nZoneHeight))));
}
function addToActivationZones(_aZoneTable, _oElementToRegister, _nPosX, _nPosY, _nWidth, _nHeight) {
var _local8;
var _local7;
_local8 = _nWidth / nZoneWidth;
if (_local8 < 1) {
_local8 = 1;
}
_local8 = Math.round(_local8);
_local7 = _nHeight / nZoneHeight;
if (_local7 < 1) {
_local7 = 1;
}
_local7 = Math.round(_local7);
addToZone(_aZoneTable, _oElementToRegister, _nPosX, _nPosY);
var _local2 = 1;
while (_local2 <= _local8) {
addToZone(_aZoneTable, _oElementToRegister, _nPosX + (nZoneWidth * _local2), _nPosY);
_local2++;
}
_local2 = 1;
while (_local2 <= _local7) {
addToZone(_aZoneTable, _oElementToRegister, _nPosX, _nPosY + (nZoneHeight * _local2));
_local2++;
}
}
function addToZone(_aZoneTable, _oElementToRegister, _nPosX, _nPosY) {
var _local2 = getZone(_nPosX, _nPosY);
if (!_aZoneTable[_local2.x]) {
_aZoneTable[_local2.x] = [];
}
if (!_aZoneTable[_local2.x][_local2.y]) {
_aZoneTable[_local2.x][_local2.y] = [];
}
_aZoneTable[_local2.x][_local2.y].push(_oElementToRegister);
}
function getZone(_nPosX, _nPosY) {
var _local3 = Math.floor(_nPosX / nZoneWidth) * nZoneWidth;
var _local2 = Math.floor(_nPosY / nZoneHeight) * nZoneHeight;
return({x:_local3, y:_local2});
}
function getSurroundingZones(_oZone) {
var _local3 = [];
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y - nZoneHeight});
_local3.push({x:_oZone.x, y:_oZone.y - nZoneHeight});
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y - nZoneHeight});
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y});
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y});
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y + nZoneHeight});
_local3.push({x:_oZone.x, y:_oZone.y + nZoneHeight});
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y + nZoneHeight});
return(_local3);
}
function getVisibleZones(_oZone) {
var _local3 = [];
var _local5 = Math.abs(Math.floor(nCurrentX / nZoneWidth) - (nCurrentX / nZoneWidth));
var _local4 = Math.abs(Math.floor(nCurrentY / nZoneHeight) - (nCurrentY / nZoneHeight));
if (_local5 < 0.5) {
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y});
if (_local4 < 0.5) {
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:_oZone.x - nZoneWidth, y:_oZone.y + nZoneHeight});
}
} else if (_local5 > 0.5) {
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y});
if (_local4 < 0.5) {
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:_oZone.x + nZoneWidth, y:_oZone.y + nZoneHeight});
}
}
if (_local4 < 0.5) {
_local3.push({x:_oZone.x, y:_oZone.y - nZoneHeight});
}
if (_local4 > 0.5) {
_local3.push({x:_oZone.x, y:_oZone.y + nZoneHeight});
}
return(_local3);
}
function getCurrentZone() {
return(getZone(nCurrentX, nCurrentY));
}
function zoneChanged(_oVisibleZones) {
for (var _local3 in aVisibleZones) {
if ((aVisibleZones[_local3].x != _oVisibleZones[_local3].x) || (aVisibleZones[_local3].y != _oVisibleZones[_local3].y)) {
return(true);
}
}
return(false);
}
function mustStayEnabled(_nX, _nY, _oVisibleZones) {
var _local2 = false;
for (var _local3 in _oVisibleZones) {
if ((_oVisibleZones[_local3].x == _nX) && (_oVisibleZones[_local3].y == _nY)) {
_local2 = true;
break;
}
}
return(_local2);
}
}
Symbol 1675 MovieClip [__Packages.elements.Decoration] Frame 0
class elements.Decoration extends sarbakan.visual.element.StaticElement
{
var setMC, setLinkage, removeReferenceMC, attachMC;
function Decoration (_mc, _sLinkage) {
super("deco" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
}
function init() {
removeReferenceMC();
attachMC();
}
}
Symbol 1676 MovieClip [__Packages.elements.Floor] Frame 0
class elements.Floor extends sarbakan.visual.element.StaticElement
{
var setMC, setLinkage, removeReferenceMC, attachMC;
function Floor (_mc, _sLinkage) {
super("floor" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
var _local5 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.floor;
_local5.drawRect(_mc._x + _mc.mcCollider._x, _mc._y + _mc.mcCollider._y, _mc.mcCollider._width, _mc.mcCollider._height);
var _local6 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall;
_local6.drawRect(_mc._x + _mc.mcColliderFloor._x, _mc._y + _mc.mcColliderFloor._y, _mc.mcColliderFloor._width, _mc.mcColliderFloor._height);
}
function init() {
removeReferenceMC();
attachMC();
}
}
Symbol 1677 MovieClip [__Packages.elements.Wall] Frame 0
class elements.Wall extends sarbakan.visual.element.StaticElement
{
var setMC, setLinkage, removeReferenceMC, attachMC;
function Wall (_mc, _sLinkage) {
super("wall" + sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setLinkage(_sLinkage);
var _local5 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall;
_local5.drawRect(_mc._x + _mc.mcCollider._x, _mc._y + _mc.mcCollider._y, _mc.mcCollider._width, _mc.mcCollider._height);
}
function init() {
removeReferenceMC();
attachMC();
}
}
Symbol 1678 MovieClip [__Packages.elements.CrackedWall] Frame 0
class elements.CrackedWall extends elements.characters.BaseEnemy
{
var setMC, setLinkage, removeReferenceMC, attachMC, stateStarting, stateFinished, remove, setState, mc, id;
function CrackedWall (_mc, _sLinkage) {
super("crackedWall" + sarbakan.visual.element.BaseElement.getNextID(), GameData.ELEMENT_CRACKEDWALL);
setMC(_mc);
setLinkage(_sLinkage);
}
function init() {
removeReferenceMC();
attachMC();
attachCollider();
}
function collapse() {
if (stateStarting()) {
var _local3 = sarbakan.sound.SoundManager.play("crumble", GameData.VOLUME_CRUMBLE, 1, true);
sarbakan.sound.SoundManager.fade(_local3, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 3);
}
if (stateFinished()) {
if (dialogScripts.Tutorial.bMustBreakWall) {
dialogScripts.Tutorial.bMustBreakWall = false;
sarbakan.utils.ActionSequencer.onActionDone("tuto_onTophBreak");
}
_global.C.oHUD.addScore(GameData.SCORE_GENERIC);
detachCollider();
remove();
}
}
function onHit() {
setState("collapse");
}
function attachCollider() {
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall;
_local3.attachMC("wallCollider", mc._x, mc._y, id);
}
function detachCollider() {
var _local3 = _global.C.oSideScroller.oLayerGame.oCollisionMaps.wall.getMC();
_local3[id].removeMovieClip();
}
}
Symbol 1679 MovieClip [__Packages.switchScripts.RespawnFire] Frame 0
class switchScripts.RespawnFire extends sarbakan.structure.Script
{
function RespawnFire () {
super();
}
static function execute(_oData) {
if (switchScripts.ExtinguishFire.oGroups[_oData.switchID]) {
var _local2 = true;
for (var _local4 in switchScripts.ExtinguishFire.oGroups[_oData.switchID]) {
var _local1 = switchScripts.ExtinguishFire.oGroups[_oData.switchID][_local4];
_local1.setState("respawn");
_local1.enableRespawn();
if (_local2) {
_local2 = false;
_local1.focusOnRespawn();
}
}
}
}
}
Symbol 1680 MovieClip [__Packages.switchScripts.OpenFloor] Frame 0
class switchScripts.OpenFloor extends sarbakan.structure.Script
{
function OpenFloor () {
super();
}
static function execute(_oData) {
if (elements.Switch.switchIDActivated(_oData.switchID)) {
elements.DynamicFloor.onOpen(_oData.switchID);
}
}
}
Symbol 1681 MovieClip [__Packages.switchScripts.CloseFloor] Frame 0
class switchScripts.CloseFloor extends sarbakan.structure.Script
{
function CloseFloor () {
super();
}
static function execute(_oData) {
elements.DynamicFloor.onClose(_oData.switchID);
}
}
Symbol 1682 MovieClip [__Packages.switchScripts.CloseFloorPuzzle] Frame 0
class switchScripts.CloseFloorPuzzle extends sarbakan.structure.Script
{
function CloseFloorPuzzle () {
super();
}
static function execute(_oData) {
elements.characters.BaseCharacter.lockControl();
sarbakan.utils.ActionSequencer.queue("FloorFocus", 0, elements.DynamicFloor, "onClose", _oData.switchID + "-a");
sarbakan.utils.ActionSequencer.queue("FloorFocus", 0, elements.DynamicFloor, "onOpen", _oData.switchID + "-d");
sarbakan.utils.ActionSequencer.queue("unlockControl", 0, elements.characters.BaseCharacter, "unlockControl");
}
}
Symbol 1683 MovieClip [__Packages.switchScripts.EndPuzzle] Frame 0
class switchScripts.EndPuzzle extends sarbakan.structure.Script
{
function EndPuzzle () {
super();
}
static function execute(_oData) {
closeFloor("p1-a");
closeFloor("p1-d");
closeFloor("p2-d");
closeFloor("p3-d");
closeFloor("p4-a");
closeFloor("p4-d");
closeFloor("p5-d");
disableSwitch("p1");
disableSwitch("p2");
disableSwitch("p3");
disableSwitch("p4");
disableSwitch("p5");
sarbakan.sound.SoundManager.play("magic", GameData.VOLUME_MAGIC, 1, false);
}
static function closeFloor(_sID) {
var _local1 = elements.DynamicFloor.getFloorByID(_sID);
if (_local1.stateIsNot("idleClosed")) {
elements.DynamicFloor.onClose(_sID, true);
}
}
static function disableSwitch(_sID) {
var _local1 = elements.Switch.getSwitchByID(_sID)[0];
_local1.deleteScripts();
}
}
Symbol 1684 MovieClip [__Packages.switchScripts.CloseSwitchPuzzle] Frame 0
class switchScripts.CloseSwitchPuzzle extends sarbakan.structure.Script
{
function CloseSwitchPuzzle () {
super();
}
static function execute(_oData) {
elements.characters.BaseCharacter.lockControl();
var _local1 = Number(_oData.switchID.substr(1, 1)) + 1;
var _local2 = elements.Switch.getSwitchByID("o" + _local1)[0];
sarbakan.utils.ActionSequencer.clear();
sarbakan.utils.ActionSequencer.queue("SwitchFocus", 0, _local2, "onDisappear");
sarbakan.utils.ActionSequencer.queue("unlockControl", 0, elements.characters.BaseCharacter, "unlockControl");
}
}
Symbol 1685 MovieClip [__Packages.elements.bonuses.Life] Frame 0
class elements.bonuses.Life extends elements.bonuses.Bonus
{
var bMustRemove, remove;
function Life (_mc) {
super(_mc, "life");
bMustRemove = (Number(_mc._name) != NaN) && (Number(_mc._name) < _global.C.nDifficultyLevel);
}
function init() {
super.init();
if (bMustRemove == true) {
remove();
}
}
function onPick() {
elements.characters.BaseCharacter.gainEnergy();
sarbakan.sound.SoundManager.play("sndLife", GameData.VOLUME_BONUS_LIFE, 1, false);
_global.C.oHUD.addScore(GameData.SCORE_HEART);
}
}
Symbol 1686 MovieClip [__Packages.elements.Exit] Frame 0
class elements.Exit extends sarbakan.visual.element.DynamicElement
{
var setMC, setLinkage, aCharactersIn, removeReferenceMC, attachMC, oOwner, collideWithElementBox;
function Exit (_mc) {
super("exit");
setMC(_mc);
setLinkage("exit");
aCharactersIn = [false, false, false];
}
function init() {
removeReferenceMC();
attachMC();
}
function idle() {
if (numberCharacterIn() < 3) {
for (var _local8 in GameData.CHARACTERS) {
var _local6 = oOwner.oDynamicElements[GameData.CHARACTERS[_local8]];
if (_local6.stateIsNot("hurt", "teleportOut", "whip", "crackWalls") && (collideWithElementBox(GameData.CHARACTERS[_local8]))) {
if (aCharactersIn[_local8] == false) {
if (numberCharacterIn() == 0) {
aCharactersIn[_local8] = true;
var _local7 = getCharactersOut();
var _local3 = sarbakan.utils.MoreString.replace(GameData.DIALOGS.EXIT_REACHED_A, "##MISSING_CHARACTER1##", _local7[0]);
_local3 = sarbakan.utils.MoreString.replace(_local3, "##MISSING_CHARACTER2##", _local7[1]);
sarbakan.sound.SoundManager.play("sndExit", GameData.VOLUME_EXIT, 1, false);
} else if (numberCharacterIn() == 1) {
aCharactersIn[_local8] = true;
var _local5 = getCharactersIn();
var _local7 = getCharactersOut();
var _local4 = _local5[0];
if (_local4 == sarbakan.utils.MoreString.upperFirstChar(GameData.CHARACTERS[_local8])) {
_local4 = _local5[1];
}
var _local3 = sarbakan.utils.MoreString.replace(GameData.DIALOGS.EXIT_REACHED_B, "##INCOMING_CHARACTER##", _local4);
_local3 = sarbakan.utils.MoreString.replace(_local3, "##MISSING_CHARACTER##", _local7[0]);
sarbakan.sound.SoundManager.play("sndExit", GameData.VOLUME_EXIT, 1, false);
} else {
var _local3 = GameData.DIALOGS.EXIT_REACHED_C;
sarbakan.sound.SoundManager.play("sndExitFinal", GameData.VOLUME_EXIT, 1, false);
aCharactersIn[_local8] = true;
}
elements.characters.BaseCharacter.lockControl();
_global.C.oPopup.showDialog(elements.characters.BaseCharacter.getControlledCharacterID(), _local3, sarbakan.utils.Delegate.create(this, onExitPopupDone), false);
}
} else if (aCharactersIn[_local8] == true) {
aCharactersIn[_local8] = false;
}
}
}
}
function onExitPopupDone() {
if (numberCharacterIn() < 3) {
elements.characters.BaseCharacter.unlockControl();
} else {
_global.C.oPopup.mc.gotoAndStop("idle");
_global.C.winGame();
}
}
function numberCharacterIn() {
var _local2 = 0;
for (var _local3 in aCharactersIn) {
if (aCharactersIn[_local3] == true) {
_local2++;
}
}
return(_local2);
}
function getCharactersIn() {
var _local2 = [];
for (var _local3 in aCharactersIn) {
if (aCharactersIn[_local3] == true) {
_local2.push(sarbakan.utils.MoreString.upperFirstChar(GameData.CHARACTERS[_local3]));
}
}
return(_local2);
}
function getCharactersOut() {
var _local2 = [];
for (var _local3 in aCharactersIn) {
if (aCharactersIn[_local3] == false) {
_local2.push(sarbakan.utils.MoreString.upperFirstChar(GameData.CHARACTERS[_local3]));
}
}
return(_local2);
}
}
Symbol 1687 MovieClip [__Packages.sarbakan.utils.MoreString] Frame 0
class sarbakan.utils.MoreString
{
function MoreString () {
}
static function pad(_sToPad, _sCharPad, _nMinLength, _sSideToPad) {
var _local1 = String(_sToPad);
while (_local1.length < _nMinLength) {
if (_sSideToPad == "RIGHT") {
_local1 = _local1 + _sCharPad;
} else {
_local1 = _sCharPad + _local1;
}
}
return(_local1);
}
static function trim(_sToTrim, _sCharTrim, _sSideToTrim) {
var _local1 = String(_sToTrim);
if (_sSideToTrim == "RIGHT") {
while (_local1.substr(_local1.length - 2, 1) == _sCharTrim) {
_local1 = _local1.slice(-1);
}
} else {
while (_local1.substr(0, 1) == _sCharTrim) {
_local1 = _local1.slice(1);
}
}
return(_local1);
}
static function replace(_sString, _sFind, _sReplace) {
return(_sString.split(_sFind).join(_sReplace));
}
static function formatTime(_nTime) {
var _local2 = _nTime;
var _local1 = Math.floor(_local2 / 60);
var _local3 = Math.round(_local2 - (_local1 * 60));
return((pad(String(_local1), "0", 2) + ":") + pad(String(_local3), "0", 2));
}
static function upperFirstChar(_sString) {
return(_sString.substr(0, 1).toUpperCase() + _sString.substr(1));
}
}
Symbol 1688 MovieClip [__Packages.elements.characters.Toph] Frame 0
class elements.characters.Toph extends elements.characters.BaseCharacter
{
var isControlledCharacter, setState, nSpeedX, nSpeedY, stateCurrentFrame, mc, stateFinished;
function Toph (_mc) {
super("toph", "toph", _mc);
}
function idle() {
super.idle();
if (isControlledCharacter()) {
if (elements.characters.BaseCharacter.oKey.ACTION) {
setState("crackWalls");
} else if (elements.characters.BaseCharacter.oKey.EASTER_EGG) {
setState("easterEgg");
}
}
}
function crackWalls() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == FRAME_CRACK_COLLAPSE) {
sarbakan.sound.SoundManager.play("hitGround", GameData.VOLUME_TOPH_HITGROUND, 1, false);
elements.characters.BaseEnemy.checkIfHit(this, mc.hit, GameData.ELEMENT_CRACKEDWALL);
}
if (stateFinished()) {
setState("idle");
}
}
function activateSwitch() {
super.activateSwitch();
if (stateCurrentFrame() == FRAME_SWITCH_TRIGGER) {
sarbakan.sound.SoundManager.play("hitGround", GameData.VOLUME_TOPH_HITGROUND, 1, false);
}
}
function easterEgg() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == FRAME_CRACK_COLLAPSE) {
sarbakan.sound.SoundManager.play("toph_Easter", GameData.VOLUME_TOPH_HITGROUND, 1, false);
_global.C.oSideScroller.oLayerForeground.mc.mcHiddenWall.play();
}
if (stateFinished()) {
setState("idle");
}
}
function onLeverSound() {
sarbakan.sound.SoundManager.play("aangLever", GameData.VOLUME_LEVER, 1, false);
}
var SPEED_RUN = 6;
var CHARACTER_NEXT = "aang";
var CHARACTER_PREV = "katara";
static var FRAME_CRACK_COLLAPSE = 17;
var FRAME_SWITCH_TRIGGER = 13;
var FRAME_LEVER_TRIGGER = 14;
}
Symbol 1689 MovieClip [__Packages.elements.characters.Aang] Frame 0
class elements.characters.Aang extends elements.characters.BaseCharacter
{
var oRunSound, bRunSoundActive, sState, isControlledCharacter;
function Aang (_mc) {
super("aang", "aang", _mc);
oRunSound = sarbakan.sound.SoundManager.play("aangRun", GameData.VOLUME_AANG_RUN, 9999999, false);
oRunSound.setVolume(0);
bRunSoundActive = false;
}
function updateState() {
super.updateState();
if ((bRunSoundActive == true) && (sState != "run")) {
sarbakan.sound.SoundManager.fade(oRunSound, sarbakan.sound.SoundManager.FADE_VOLUME, 0, 6);
bRunSoundActive = false;
}
}
function idle() {
super.idle();
if (isControlledCharacter()) {
if (elements.characters.BaseCharacter.oKey.ACTION) {
initJump();
}
}
}
function run() {
super.run();
if (bRunSoundActive == false) {
sarbakan.sound.SoundManager.fade(oRunSound, sarbakan.sound.SoundManager.FADE_VOLUME, GameData.VOLUME_AANG_RUN, 10);
bRunSoundActive = true;
}
if (isControlledCharacter()) {
if (elements.characters.BaseCharacter.oKey.ACTION) {
initJump();
}
}
}
function onLeverSound() {
sarbakan.sound.SoundManager.play("aangLever", GameData.VOLUME_LEVER, 1, false);
}
function onSwitchSound() {
sarbakan.sound.SoundManager.play("jump", GameData.VOLUME_JUMP, 1, false);
}
function initJump() {
if (elements.characters.BaseCharacter.oKey.ACTION) {
JUMP_FORCE = JUMP_FORCE_BIG;
sarbakan.sound.SoundManager.play("aangJump", GameData.VOLUME_AANG_JUMP, 1, false);
} else {
JUMP_FORCE = JUMP_FORCE_NORMAL;
}
super.initJump();
}
static var JUMP_FORCE_NORMAL = -37.5;
static var JUMP_FORCE_BIG = -50;
var JUMP_FORCE = JUMP_FORCE_NORMAL;
var SPEED_RUN = 5;
var CHARACTER_NEXT = "katara";
var CHARACTER_PREV = "toph";
var FRAME_SWITCH_TRIGGER = 9;
var FRAME_LEVER_TRIGGER = 7;
}
Symbol 1210 MovieClip Frame 1
onRelease = function () {
};
useHandCursor = false;
_alpha = 0;
Symbol 1268 MovieClip Frame 1
stop();
Instance of Symbol 1119 MovieClip [spawnPoint] in Symbol 1324 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Symbol 1383 MovieClip Frame 5
stop();
Symbol 1427 MovieClip Frame 20
stop();
Symbol 1427 MovieClip Frame 37
_global.C.oPackaging.onMenuHidden();
Symbol 1436 MovieClip Frame 1
stop();
Symbol 1436 MovieClip Frame 18
_global.C.oPackaging.onQuitHidden();
Symbol 1437 MovieClip Frame 1
stop();
Instance of Symbol 14 MovieClip in Symbol 1437 MovieClip Frame 1
onClipEvent (load) {
mcLoad.gotoAndStop(100);
}
Symbol 1441 MovieClip Frame 1
Symbol 1450 MovieClip Frame 1
stop();
Symbol 1460 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "appa"));
Symbol 1463 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "machineRoue"));
Symbol 1464 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "tuyeau1"));
Symbol 1465 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "tuyeau2"));
Symbol 1466 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "tuyeau3"));
Symbol 1467 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "porte1"));
Symbol 1468 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "escalier1"));
Symbol 1469 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "tuyeau6"));
Symbol 1470 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "device2"));
Symbol 1471 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "lampe1"));
Symbol 1472 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "machine1"));
Symbol 1473 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "lampe2"));
Symbol 1474 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "plaqueMur"));
Symbol 1475 MovieClip Frame 1
_global.C.oSideScroller.addDecorationBackground(new elements.Decoration(this, "tuyeau5"));
Symbol 1477 MovieClip Frame 1
_global.C.oSideScroller.addFloor(new elements.Floor(this, "floor_1"));
Symbol 1478 MovieClip Frame 1
_global.C.oSideScroller.addWall(new elements.Wall(this, "wall_1"));
Symbol 1479 MovieClip Frame 1
_global.C.oSideScroller.addFloor(new elements.Floor(this, "floor_2"));
Symbol 1481 MovieClip Frame 1
_global.C.oSideScroller.addWall(new elements.Wall(this, "wall_2"));
Symbol 1482 MovieClip Frame 1
_global.C.oSideScroller.addWall(new elements.Wall(this, "wall_3"));
Symbol 1483 MovieClip Frame 1
_global.C.oSideScroller.addDynamicFloor(new elements.DynamicFloor(this));
Symbol 1484 MovieClip Frame 1
_global.C.oSideScroller.addFloor(new elements.Floor(this, "floor_3"));
Symbol 1485 MovieClip Frame 1
_global.C.oSideScroller.addWall(new elements.Wall(this, "wall_invisible"));
Instance of Symbol 1483 MovieClip "tutoA" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
if (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL) {
this.bInitiallyActive = true;
}
}
Instance of Symbol 1483 MovieClip "tutoB" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
if (_global.C.nDifficultyLevel == GameData.DIFFICULTY_NORMAL) {
this.bInitiallyActive = true;
}
}
Instance of Symbol 1483 MovieClip "p2-d" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
this.bInitiallyActive = true;
}
Instance of Symbol 1483 MovieClip "p1-d" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
this.bInitiallyActive = true;
}
Instance of Symbol 1483 MovieClip "p4-d" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
this.bInitiallyActive = true;
}
Instance of Symbol 1483 MovieClip "p3-d" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
this.bInitiallyActive = true;
}
Instance of Symbol 1483 MovieClip "p5-d" in Symbol 1486 MovieClip Frame 1
onClipEvent (load) {
this.bInitiallyActive = true;
}
Symbol 1487 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_CRACKEDWALL, new elements.CrackedWall(this, "crackedWallSmall"));
Symbol 1488 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_DOOR, new elements.Door(this, "door"));
Symbol 1489 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_SWITCH, new elements.Switch("lever", this));
Symbol 1490 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_DOOR, new elements.Door(this, "doorSmall"));
Symbol 1491 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_CRACKEDWALL, new elements.CrackedWall(this, "crackedWall"));
Symbol 1492 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_SWITCH, new elements.Switch("switch", this));
Symbol 1493 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_FIRE, new elements.Fire(this));
Symbol 1495 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_FIREGUARD, new elements.characters.FireGuard(this));
Symbol 1497 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_SPAWNPOINT, new elements.SpawnPoint(this));
Symbol 1498 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_SWITCH, new elements.Switch("leverExit", this));
Symbol 1499 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_BONUS_LIFE, new elements.bonuses.Life(this));
Symbol 1500 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_EXIT, new elements.Exit(this));
Symbol 1501 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_BONUS_TOKEN, new elements.bonuses.Token(this));
Symbol 1505 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_TOPH, new elements.characters.Toph(this));
Symbol 1531 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_KATARA, new elements.characters.Katara(this));
Symbol 1553 MovieClip Frame 1
_global.C.oSideScroller.addInteractiveElement(GameData.ELEMENT_AANG, new elements.characters.Aang(this));
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireB");
};
}
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireB");
};
}
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireC");
};
}
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireA");
};
}
Instance of Symbol 1492 MovieClip "fireC" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.ExtinguishFire;
fOffScript = switchScripts.RespawnFire;
}
Instance of Symbol 1492 MovieClip "fireB" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.ExtinguishFire;
fOffScript = switchScripts.RespawnFire;
}
Instance of Symbol 1492 MovieClip "fireA" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.ExtinguishFire;
fOffScript = switchScripts.RespawnFire;
}
Instance of Symbol 1492 MovieClip "exitFloor" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloor;
fOffScript = switchScripts.CloseFloor;
}
Instance of Symbol 1492 MovieClip "exitFloor" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloor;
fOffScript = switchScripts.CloseFloor;
}
Instance of Symbol 1498 MovieClip "exit" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.Exit;
}
Instance of Symbol 1492 MovieClip "p1" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloorPuzzle;
fOffScript = switchScripts.CloseFloorPuzzle;
}
Instance of Symbol 1492 MovieClip "p2" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloorPuzzle;
fOffScript = switchScripts.CloseFloorPuzzle;
}
Instance of Symbol 1492 MovieClip "p3" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloorPuzzle;
fOffScript = switchScripts.CloseFloorPuzzle;
}
Instance of Symbol 1492 MovieClip "p4" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloorPuzzle;
fOffScript = switchScripts.CloseFloorPuzzle;
}
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireC");
};
}
Instance of Symbol 1493 MovieClip "15" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
switchScripts.ExtinguishFire.addFire(_oElement, "fireA");
};
}
Instance of Symbol 1489 MovieClip in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.EndPuzzle;
}
Instance of Symbol 1498 MovieClip "exit" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.Exit;
}
Instance of Symbol 1492 MovieClip "o1" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
fOffScript = switchScripts.CloseSwitchPuzzle;
}
Instance of Symbol 1492 MovieClip "o2" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
fOffScript = switchScripts.CloseSwitchPuzzle;
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1492 MovieClip "o3" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
fOffScript = switchScripts.CloseSwitchPuzzle;
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1492 MovieClip "o5" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
fOffScript = switchScripts.CloseSwitchPuzzle;
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1492 MovieClip "o4" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
fOffScript = switchScripts.CloseSwitchPuzzle;
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1492 MovieClip "o6" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenSwitchPuzzle;
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1489 MovieClip "o7" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
onElementCreated = function (_oElement) {
_oElement.setHidden();
};
}
Instance of Symbol 1489 MovieClip "w" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloor;
}
Instance of Symbol 1489 MovieClip "trap2" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.OpenFloor;
}
Instance of Symbol 1498 MovieClip "exit" in Symbol 1554 MovieClip Frame 1
onClipEvent (load) {
fOnScript = switchScripts.Exit;
}
Symbol 1559 MovieClip Frame 1
stop();
Symbol 1559 MovieClip Frame 33
gotoAndStop (1);
Symbol 1560 MovieClip Frame 1
Symbol 1563 MovieClip Frame 2
stop();
Symbol 1599 MovieClip Frame 2
stop();
Symbol 1620 MovieClip Frame 1
new Controller(this);