Frame 1
var _oPreloaderScreen = (new com.disney.gem.games.kp_ice.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.kp_ice.Controller(this, _oPreloaderScreen);
Symbol 1871 MovieClip [__Packages.com.sarbakan.BaseDisneyController] Frame 0
class com.sarbakan.BaseDisneyController
{
static var oInstance;
var mcTimeline, oPreloaderScreen, oMainBroadcaster, oFrameRate, aPopups, oTransitionManager, bSoundMuted, nLastSoundToggleTimer, bPaused, oDXDControllerWrapper, nGamePhase, oCurrentScreen, fScreenShowTransitionCallBack, fScreenHideCallBack, nLevel, nScore, bInstructionCanBeDisplayed, bInstructionActive, nLastUpdateTimer;
function BaseDisneyController (_mcTimeline, _oPreloaderScreen) {
oInstance = this;
mcTimeline = _mcTimeline;
_mcTimeline.stop();
oPreloaderScreen = _oPreloaderScreen;
oMainBroadcaster = new Object();
AsBroadcaster.initialize(oMainBroadcaster);
oMainBroadcaster.addListener(this);
if (bDEBUG) {
oFrameRate = new com.sarbakan.utils.FrameRateDisplayer(_mcTimeline, nFRAME_RATE, nGAME_STAGE_WIDTH);
oMainBroadcaster.addListener(oFrameRate);
} else {
Stage.showMenu = false;
mcTimeline._focusrect = false;
}
aPopups = new Array();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
setDXDCallback();
} else {
initStandAloneController();
}
}
static function getInstance() {
return(oInstance);
}
function init() {
setGamePhase(nGAME_PHASE_PACKAGING);
stopScreenContainers();
oTransitionManager = new com.sarbakan.utils.TransitionManager(mcTimeline.mcTransitions);
oMainBroadcaster.addListener(oTransitionManager);
bSoundMuted = false;
nLastSoundToggleTimer = getTimer();
}
function update(_nElapsed) {
if (bPaused) {
oMainBroadcaster.broadcastMessage("onUpdatePaused", _nElapsed);
} else {
oMainBroadcaster.broadcastMessage("onUpdate", _nElapsed);
}
checkGlobalKeys();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
bSoundMuted = oDXDControllerWrapper.isMuted();
}
}
function pause() {
if (!bPaused) {
bPaused = true;
oMainBroadcaster.broadcastMessage("onPause");
}
}
function unpause() {
if (bPaused) {
bPaused = false;
oMainBroadcaster.broadcastMessage("onUnPause");
}
}
function togglePause() {
if (bPaused) {
unpause();
} else {
pause();
}
}
function getControllerMode() {
var _local1;
if (com.disney.gem.base.BaseObject == undefined) {
_local1 = nCONTROLLER_MODE_STANDALONE;
} else {
_local1 = nCONTROLLER_MODE_DXD;
}
return(_local1);
}
function setGamePhase(_nPhase) {
nGamePhase = _nPhase;
switch (_nPhase) {
case nGAME_PHASE_PRELOADER :
mcTimeline.gotoAndStop("preloader");
break;
case nGAME_PHASE_PACKAGING :
mcTimeline.gotoAndStop("packaging");
break;
case nGAME_PHASE_INGAME :
mcTimeline.gotoAndStop("game");
}
}
function getGamePhase() {
return(nGamePhase);
}
function gameLog(_sText) {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.gameLog(_sText);
}
}
function showScreen(_oScreenController, _bInOut, _sTransitionID, _fMidTransitionCallBack) {
if (oCurrentScreen) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, showScreen, _oScreenController, _bInOut, null, _fMidTransitionCallBack), _sTransitionID);
} else {
oCurrentScreen = _oScreenController;
oCurrentScreen.setGameController(this);
if (_sTransitionID != undefined) {
fScreenShowTransitionCallBack = _fMidTransitionCallBack;
oTransitionManager.playTransition(_sTransitionID, com.sarbakan.utils.Delegate.create(this, onScreenShowTransitionMiddle, _bInOut));
} else {
oCurrentScreen.show(_bInOut);
_fMidTransitionCallBack();
}
oMainBroadcaster.addListener(oCurrentScreen);
}
}
function hideCurrentScreen(_fHideCallBack, _sTransition, _fEndCallBack) {
fScreenHideCallBack = _fHideCallBack;
if (_sTransition != undefined) {
oTransitionManager.playTransition(_sTransition, com.sarbakan.utils.Delegate.create(oCurrentScreen, oCurrentScreen.hide, com.sarbakan.utils.Delegate.create(this, onScreenHidden)), _fEndCallBack);
} else {
oCurrentScreen.hide(com.sarbakan.utils.Delegate.create(this, onScreenHidden));
}
}
function showPopup(_oPopupController, _bInOut) {
var _local5 = false;
var _local2 = aPopups.length - 1;
while (_local2 >= 0) {
var _local3 = aPopups[_local2];
if (_oPopupController.getRef() == _local3.getRef()) {
_local5 = true;
_local3.destroy();
oMainBroadcaster.removeListener(_local3);
aPopups[_local2] = _oPopupController;
break;
}
_local2--;
}
if (!_local5) {
aPopups.push(_oPopupController);
}
_oPopupController.setGameController(this);
_oPopupController.show(_bInOut);
oMainBroadcaster.addListener(_oPopupController);
}
function setLevel(_nLevel) {
nLevel = _nLevel;
}
function getLevel() {
return(nLevel);
}
function setScore(_nScore) {
nScore = _nScore;
}
function increaseScore(_nIncrement) {
nScore = nScore + _nIncrement;
}
function getScore() {
return(nScore);
}
function allowInstructions() {
bInstructionCanBeDisplayed = true;
}
function disallowInstructions() {
bInstructionCanBeDisplayed = false;
}
function showInstructions() {
if (canShowInstructions()) {
bInstructionActive = true;
showInstructionsScreen();
}
}
function hideInstructions() {
if (canHideInstructions()) {
bInstructionActive = false;
hideInstructionsScreen();
}
}
function toggleSound() {
if ((getTimer() - nLastSoundToggleTimer) >= nSOUND_TOGGLE_DELAY) {
bSoundMuted = !bSoundMuted;
nLastSoundToggleTimer = getTimer();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.toggleSound();
} else {
toggleSoundStandalone();
}
}
}
function onPreloadingDone() {
hideCurrentScreen();
init();
}
function onGameStart() {
setLevel(1);
setScore(0);
}
function onLevelStart() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.startLevel(nLevel, nScore);
}
}
function onLevelEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endLevel(nLevel, nScore);
}
}
function onGameEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endGame(nLevel, nScore);
}
}
function onTransitionStart(_mcTransition) {
}
function onTransitionMiddle(_mcTransition) {
}
function onEnterFrame() {
var _local2 = getTimer();
update(_local2 - nLastUpdateTimer);
nLastUpdateTimer = _local2;
}
function onScreenShowTransitionMiddle(_bInOut) {
fScreenShowTransitionCallBack();
oCurrentScreen.show(_bInOut);
}
function onScreenHidden() {
oMainBroadcaster.removeListener(oCurrentScreen);
delete oCurrentScreen;
fScreenHideCallBack();
}
function setDXDCallback() {
mcTimeline.init = com.sarbakan.utils.Delegate.create(this, initDXDController);
}
function initDXDController(_oOwner) {
oDXDControllerWrapper = new com.sarbakan.DXDControllerWrapper(this, mcTimeline, _oOwner);
return(oDXDControllerWrapper);
}
function initStandAloneController() {
mcTimeline.onEnterFrame = com.sarbakan.utils.Delegate.create(this, onEnterFrame);
nLastUpdateTimer = getTimer();
initPreloader();
}
function initPreloader() {
setGamePhase(nGAME_PHASE_PRELOADER);
showScreen(oPreloaderScreen);
}
function checkGlobalKeys() {
if (Key.isDown(nKEY_INSTRUCTIONS)) {
if (!bInstructionActive) {
showInstructions();
} else {
hideInstructions();
}
}
if (Key.isDown(nKEY_SOUND)) {
toggleSound();
}
}
function toggleSoundStandalone() {
var _local2 = new Sound(mcTimeline);
if (!bSoundMuted) {
_local2.setVolume(100);
} else {
_local2.setVolume(0);
}
}
function canShowInstructions() {
return((((!bInstructionActive) && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function canHideInstructions() {
return(((bInstructionActive && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function showInstructionsScreen() {
}
function hideInstructionsScreen() {
}
function stopScreenContainers() {
var _local3 = [mcTimeline.mcPopups, mcTimeline.mcScreens];
var _local2 = _local3.length - 1;
while (_local2 >= 0) {
for (var _local4 in _local3[_local2]) {
_local3[_local2][_local4].stop();
}
_local2--;
}
}
static var bDEBUG = true;
static var nFRAME_RATE = 30;
static var nCONTROLLER_MODE_STANDALONE = 1;
static var nCONTROLLER_MODE_DXD = 2;
static var nGAME_PHASE_PRELOADER = 1;
static var nGAME_PHASE_PACKAGING = 2;
static var nGAME_PHASE_INGAME = 3;
static var nKEY_INSTRUCTIONS = 72;
static var nKEY_SOUND = 77;
static var nGAME_STAGE_WIDTH = 580;
static var nGAME_STAGE_HEIGHT = 400;
static var nSOUND_TOGGLE_DELAY = 100;
}
Symbol 1872 MovieClip [__Packages.com.sarbakan.utils.StateManaged] Frame 0
class com.sarbakan.utils.StateManaged
{
var mcRef, bPausable, sNextState, sState;
function StateManaged (_mcRef) {
setMC(_mcRef);
setPausable(true);
}
function setMC(_mcRef) {
mcRef = _mcRef;
}
function setPausable(_bPausable) {
bPausable = _bPausable;
}
function setState(_sState, _bInstant, _bForce) {
sNextState = _sState;
if (_bInstant) {
checkStateChange();
}
if (_bForce) {
mcRef.mcState.gotoAndPlay(1);
}
}
function getState() {
return(sState);
}
function stateStarting() {
return(mcRef.mcState._currentframe == 1);
}
function stateFinished() {
return(mcRef.mcState._currentframe == mcRef.mcState._totalframes);
}
function stateCurrentFrame() {
return(mcRef.mcState._currentframe);
}
function stateIsNot() {
var _local4 = false;
var _local3 = arguments.length - 1;
while (_local3 >= 0) {
if (arguments[_local3] == sState) {
_local4 = true;
break;
}
_local3--;
}
return(!_local4);
}
function destroy() {
delete mcRef;
}
function get Mc() {
return(mcRef);
}
function onUpdate() {
checkStateChange();
this["state_" + sState]();
}
function checkStateChange() {
if ((sNextState != undefined) && (sNextState != sState)) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mcRef.gotoAndStop(sState);
this[("state_" + sState) + "_init"]();
}
}
function onUpdatePaused() {
if (bPausable == false) {
onUpdate();
}
}
function onPause() {
if (bPausable) {
mcRef.mcState.stop();
}
}
function onUnPause() {
if (bPausable) {
mcRef.mcState.play();
}
}
}
Symbol 1873 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
for (var _local3 in mcTransitionContainer) {
mcTransitionContainer[_local3].stop();
}
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
if (mcTransition == undefined) {
} else {
bTransitionning = true;
setMC(mcTransition);
setState(sSTATE_IN);
}
}
function isTransitionning() {
return(bTransitionning);
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_OUT);
fMiddleCallBack();
}
}
function state_out() {
if (stateFinished()) {
bTransitionning = false;
setState(sSTATE_HIDDEN);
fEndCallBack();
}
}
function state_in_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionStart(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionMiddle(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_IN = "in";
static var sSTATE_OUT = "out";
static var sSTATE_HIDDEN = "hidden";
}
Symbol 1874 MovieClip [__Packages.com.sarbakan.utils.MoreString] Frame 0
class com.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 formatNumber(__sNumber, __nMinimumChar) {
var _local1 = String(__sNumber);
var _local3 = "";
var _local4 = _local1.length;
_local4 = _local4 / 3;
var _local5;
var _local2;
if (_local4 <= 1) {
_local5 = _local1;
if (_local5.length < __nMinimumChar) {
_local5 = "0" + _local5;
}
} else {
_local2 = _local4;
while (_local2 > 1) {
_local3 = (" " + _local1.substr(-3)) + _local3;
_local1 = _local1.substr(0, -3);
_local2--;
}
_local5 = _local1 + _local3;
if (_local5.length < __nMinimumChar) {
_local5 = "0" + _local5;
}
}
return(_local5);
}
static function upperFirstChar(_sString) {
return(_sString.substr(0, 1).toUpperCase() + _sString.substr(1));
}
static function lowerFirstChar(_sString) {
return(_sString.substr(0, 1).toLowerCase() + _sString.substr(1));
}
static function convertToBoolean(_sString) {
return(_sString.toLowerCase() == "true");
}
static function formatMoney(_nMoney, _sDelimiteur, _bDecimalOpt) {
var _local5;
var _local3;
var _local2;
var _local1;
var _local6;
if (_bDecimalOpt == undefined) {
_local6 = true;
} else {
_local6 = _bDecimalOpt;
}
_local5 = String(_nMoney).split(".");
if (_local5[1] != undefined) {
_local3 = _local5[1].substr(0, 2);
switch (_local3.length) {
case 0 :
_local3 = _local3 + "00";
break;
case 1 :
_local3 = _local3 + "0";
break;
case 2 :
break;
default :
_local3 = "00";
}
} else {
_local3 = "00";
}
_local1 = _local5[0];
_local2 = "";
while (_local1.length > 3) {
_local2 = (_sDelimiteur + _local1.substr(_local1.length - 3)) + _local2;
_local1 = _local1.substr(0, _local1.length - 3);
}
_local2 = _local1 + _local2;
if (_local6) {
return(((_local2 + ".") + _local3) + "$");
}
return(_local2 + " $");
}
static function getOrdinalSuffix(_nNumber) {
var _local2;
var _local1 = String(_nNumber);
if (((_local1.substr(-2, 2) == 11) || (_local1.substr(-2, 2) == 12)) || (_local1.substr(-2, 2) == 13)) {
_local2 = "th";
} else if (_local1.substr(-1, 1) == 1) {
_local2 = "st";
} else if (_local1.substr(-1, 1) == 2) {
_local2 = "nd";
} else if (_local1.substr(-1, 1) == 3) {
_local2 = "rd";
} else {
_local2 = "th";
}
return(_local2);
}
}
Symbol 1875 MovieClip [__Packages.com.sarbakan.DXDControllerWrapper] Frame 0
class com.sarbakan.DXDControllerWrapper extends com.disney.gem.games.BaseGameController
{
var oRealController, __owner;
function DXDControllerWrapper (_oRealController, _mcTimeline, _oOwner) {
super(_mcTimeline, _oOwner);
oRealController = _oRealController;
}
function init() {
super.init();
oRealController.init();
}
function update(_nElapsed) {
oRealController.update(_nElapsed);
}
function toggleSound() {
__owner.onToggleSound();
}
function isMuted() {
return(!__owner.__soundOn);
}
function gameLog(_sText) {
__owner.gameLog(_sText, "game");
}
}
Symbol 1876 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
interface com.disney.gem.games.GameContainer
{
}
Symbol 1877 MovieClip [__Packages.com.sarbakan.utils.FrameRateDisplayer] Frame 0
class com.sarbakan.utils.FrameRateDisplayer
{
var nMovieFPS, nUpdateCounter, nAverageFps, nCurrentFPS, nUpdateCount, mcDebug, nLastGetTimer;
function FrameRateDisplayer (_mcTimeline, _nMovieFPS, _nStageWidth) {
nMovieFPS = _nMovieFPS;
nUpdateCounter = 0;
nAverageFps = 0;
nCurrentFPS = nMovieFPS;
reset();
startDebug(_mcTimeline, _nStageWidth);
}
function get fps() {
return(nCurrentFPS);
}
function onUpdate() {
if ((++nUpdateCount) == nMovieFPS) {
computeFrameRate();
updateDebug();
}
}
function onUpdatePaused() {
onUpdate();
}
function startDebug(_mcTimeline, _nStageWidth) {
mcDebug = _mcTimeline.createEmptyMovieClip("PerformanceWatcherDebug", DEBUG_DEPTH);
mcDebug._x = (_nStageWidth - DEBUG_RIGHT_MARGIN) - 400;
mcDebug._y = DEBUG_TOP_MARGIN;
mcDebug.createTextField("field", 2, 0, 0, 400, 50);
var _local2 = new TextFormat();
_local2.font = DEBUG_FONT;
_local2.size = DEBUG_FONT_SIZE;
_local2.color = DEBUG_FONT_COLOR;
_local2.align = "right";
mcDebug.field.setNewTextFormat(_local2);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 400, 50);
var _local3 = new TextFormat();
_local3.font = DEBUG_FONT;
_local3.size = DEBUG_FONT_SIZE;
_local3.color = DEBUG_FONT_SHADOW_COLOR;
_local3.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local3);
mcDebug.fieldShadow.selectable = false;
}
function reset() {
nUpdateCount = 0;
nLastGetTimer = getTimer();
}
function computeFrameRate() {
var _local2 = getTimer() - nLastGetTimer;
var _local3 = _local2 / 1000;
nCurrentFPS = Math.round(nMovieFPS / _local3);
reset();
}
function updateDebug() {
if (mcDebug != undefined) {
nUpdateCounter++;
var _local2 = ((nCurrentFPS + " fps (avg ") + getAverage()) + ")";
mcDebug.field.text = _local2;
mcDebug.fieldShadow.text = _local2;
}
}
function getAverage() {
nAverageFps = nAverageFps + ((nCurrentFPS - nAverageFps) * (1 / nUpdateCounter));
var _local3 = "";
var _local2 = String(nAverageFps).split(".");
if (_local2[1] == undefined) {
_local3 = nAverageFps + ".00";
} else if (_local2[1].length == 1) {
_local3 = (_local2[0] + ".0") + _local2[1];
} else {
_local3 = (_local2[0] + ".") + _local2[1].substr(0, 2);
}
return(_local3);
}
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;
}
Symbol 1878 MovieClip [__Packages.com.sarbakan.utils.ScreenController] Frame 0
class com.sarbakan.utils.ScreenController extends com.sarbakan.utils.StateManaged
{
var setMC, setState, setPausable, oController, bInOut, fHideCallBack, mcRef, sState, stateFinished;
function ScreenController (_mcRef) {
super();
setMC(_mcRef);
setState(sSTATE_HIDDEN);
setPausable(false);
}
function setGameController(_oController) {
oController = _oController;
}
function show(_bInOut) {
bInOut = _bInOut;
if (bInOut) {
setState(sSTATE_IN, true);
} else {
setState(sSTATE_IDLE, true);
}
}
function hide(_fHideCallBack, _bInOutOverride) {
fHideCallBack = _fHideCallBack;
var _local2 = bInOut;
if (_bInOutOverride != undefined) {
_local2 = _bInOutOverride;
}
if (_local2) {
setState(sSTATE_OUT);
} else {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function getRef() {
return(mcRef);
}
function isInOutTransitionning() {
return((sState == sSTATE_IN) || (sState == sSTATE_OUT));
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_out() {
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function state_in_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_idle_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IN = "in";
static var sSTATE_IDLE = "idle";
static var sSTATE_OUT = "out";
}
Symbol 1879 MovieClip [__Packages.com.sarbakan.utils.Delegate] Frame 0
class com.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 1880 MovieClip [__Packages.com.disney.gem.games.kp_ice.Controller] Frame 0
class com.disney.gem.games.kp_ice.Controller extends com.sarbakan.BaseDisneyController
{
var mcTimeline, allowInstructions, onGameStart, setLevel, nLife, hideCurrentScreen, oGame, onGameEnd, nGamePhase, pause, unpause, showPopup, oMusic, sNextMusicLinkage, oClickSound, bInitGameAtNextFrame, bDestroyingGame, bTeleport, getLevel, bResetingLevel, oCurrentScreen, fScreenShowTransitionCallBack, oTransitionManager, onScreenShowTransitionMiddle, oMainBroadcaster, nPreviousScore, getScore, bInstructionActive, setGamePhase, onLevelStart;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
com.sarbakan.sound.SoundManager.doInit(_mcTimeline.createEmptyMovieClip("mcSound", 99999999));
}
static function getInstance() {
return(com.disney.gem.games.kp_ice.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function init() {
super.init();
_global.ASSetPropFlags(Array.prototype, null, 1, 1);
showTitleScreen(false);
}
function showTitleScreen(_bShowTransition, _fTransitionCallBack) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.kp_ice.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT, _fTransitionCallBack);
playTransitionSound();
} else {
showScreen(new com.disney.gem.games.kp_ice.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, undefined, _fTransitionCallBack);
}
playTransitionSound();
allowInstructions();
setMusic("MusicPack.wav");
}
function startNewGame() {
onGameStart();
setLevel(1);
nLife = com.disney.gem.games.kp_ice.GameData.nGAME_LIFE;
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, initGameEngine), sTRANSITION_DEFAULT);
setMusic("MusicGame.wav");
playTransitionSound();
}
function quitGame() {
oGame.oActivePlayer.bControlsLock = true;
onGameEnd();
showTitleScreen(true, com.sarbakan.utils.Delegate.create(this, destroyGameEngine));
}
function showInstructionsScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
pause();
}
showScreen(new com.disney.gem.games.kp_ice.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
playTransitionSound();
}
function hideInstructionsScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, unpause), sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.kp_ice.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
}
playTransitionSound();
}
function showInGameMenu() {
pause();
oGame.oView.pause();
showPopup(new com.disney.gem.games.kp_ice.popups.MenuPopup(mcTimeline.mcPopups.mcMenu), true);
}
function hideInGameMenu() {
unpause();
}
function setMusic(_sLinkage, _sNextLinkage) {
oMusic.doFadeTo(0, true);
if (!_sNextLinkage) {
oMusic = com.sarbakan.sound.SoundManager.doPlaySound(_sLinkage, com.disney.gem.games.kp_ice.GameData.nVOLUME_MUSIC, 99999);
} else {
oMusic = com.sarbakan.sound.SoundManager.doPlaySound(_sLinkage, com.disney.gem.games.kp_ice.GameData.nVOLUME_MUSIC, 1);
sNextMusicLinkage = _sNextLinkage;
oMusic.doAddListener(this);
}
}
function stopMusic() {
oMusic.doFadeTo(0, true);
}
function playRollSound() {
oClickSound.doStop();
oClickSound = com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sBUTTON_ROLL, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function playClickSound() {
oClickSound.doStop();
oClickSound = com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sBUTTON_CLICK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function playTransitionSound() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sTRANSITION, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function update() {
super.update();
onUpdateCheated();
}
function onUpdateCheated() {
if (bInitGameAtNextFrame) {
bInitGameAtNextFrame = false;
initGameEngine();
}
if ((com.sarbakan.BaseDisneyController.bDEBUG && (Key.isDown(35))) && (!bDestroyingGame)) {
nLife++;
oGame.oHUD.updateLife();
}
if (((com.sarbakan.BaseDisneyController.bDEBUG && (Key.isDown(46))) && (!bDestroyingGame)) && (!bTeleport)) {
bTeleport = true;
oGame.oActivePlayer.teleportTo(16000, oGame.oActivePlayer.getCoord().y);
oGame.oCam.setSpeed(250);
} else {
bTeleport = false;
}
}
function onPause() {
oGame.oView.pause();
}
function onUnPause() {
oGame.oView.unpause();
}
function onNextTransitionMiddle() {
setLevel(getLevel() + 1);
destroyGameEngine();
bInitGameAtNextFrame = true;
}
function onResetTransitionMiddle() {
oGame.oPlayer1.respawn();
oGame.oPlayer2.respawn();
oGame.respawnEnemmies();
oGame.oPlayer1.bControlsLock = true;
oGame.oPlayer2.bControlsLock = true;
setMusic("MusicGame.wav");
}
function onNextTransitionEnd() {
oGame.unlockPlayer();
}
function onResetTransitionEnd() {
oGame.unlockPlayer();
bResetingLevel = false;
}
function showScreen(_oScreenController, _bInOut, _sTransitionID, _fMidTransitionCallBack) {
if (oCurrentScreen) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, showScreen, _oScreenController, _bInOut), _sTransitionID);
} else {
oCurrentScreen = _oScreenController;
oCurrentScreen.setGameController(this);
if (_sTransitionID != undefined) {
fScreenShowTransitionCallBack = _fMidTransitionCallBack;
oGame.oActivePlayer.bControlsLock = true;
oTransitionManager.playTransition(_sTransitionID, com.sarbakan.utils.Delegate.create(this, onScreenShowTransitionMiddle, _bInOut), com.sarbakan.utils.Delegate.create(this, onNextTransitionEnd));
} else {
oCurrentScreen.show(_bInOut);
}
oMainBroadcaster.addListener(oCurrentScreen);
}
}
function onDie() {
if ((!bResetingLevel) && (!bDestroyingGame)) {
if ((--nLife) == 0) {
bDestroyingGame = true;
showScreen(new com.disney.gem.games.kp_ice.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, destroyGameEngine));
onGameEnd();
} else {
bResetingLevel = true;
oGame.oActivePlayer.bControlsLock = true;
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, onResetTransitionMiddle), com.sarbakan.utils.Delegate.create(this, onResetTransitionEnd));
}
playTransitionSound();
}
}
function onWin() {
bDestroyingGame = true;
stopMusic();
setMusic("MusicPack.wav");
showScreen(new com.disney.gem.games.kp_ice.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, destroyGameEngine));
onGameEnd();
}
function onLevelEnd() {
super.onLevelEnd();
oGame.oActivePlayer.bControlsLock = true;
oGame.oActivePlayer.nSpeedX = 0;
oGame.oActivePlayer.bControlsLock = true;
showPopup(new com.disney.gem.games.kp_ice.popups.CompletePopup(mcTimeline.mcPopups.mcComplete, nPreviousScore), true);
nPreviousScore = getScore();
if (getLevel() < com.disney.gem.games.kp_ice.GameData.nTOTAL_LEVEL) {
}
}
function levelEndPopupOver() {
if (getLevel() < com.disney.gem.games.kp_ice.GameData.nTOTAL_LEVEL) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, onNextTransitionMiddle), com.sarbakan.utils.Delegate.create(this, onNextTransitionEnd));
} else {
bDestroyingGame = true;
showScreen(new com.disney.gem.games.kp_ice.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, destroyGameEngine));
onGameEnd();
}
playTransitionSound();
}
function onScreenHidden() {
bInstructionActive = false;
super.onScreenHidden();
}
function doSoundEvent(_nEventType, _oSound) {
setMusic(sNextMusicLinkage);
}
function onTransitionInSound() {
}
function onTransitionOutSound() {
}
function initGameEngine() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
nPreviousScore = 0;
oGame = new com.disney.gem.games.kp_ice.GameEngine(this, mcTimeline.mcGame);
oMainBroadcaster.addListener(oGame);
onLevelStart();
}
function destroyGameEngine() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING);
oMainBroadcaster.removeListener(oGame);
oGame.destroy();
oGame = null;
bDestroyingGame = false;
}
static var sTRANSITION_DEFAULT = "default";
}
Symbol 1881 MovieClip [__Packages.com.disney.gem.games.kp_ice.GameEngine] Frame 0
class com.disney.gem.games.kp_ice.GameEngine
{
var oController, mcGame, oFirstUseManager, oGrapplingObject, oHUD, oView, oCam, oLayerGame, oPlayer1, oPlayer2, oBoss, oActivePlayer, bMustReleaseSwitchKey, bInit, nBackIndex, aBackgrounds, oCameraLocks;
function GameEngine (_oController, _mcGame) {
com.disney.gem.games.kp_ice.elements.characters.Ennemy.resetEnnemies();
oController = _oController;
mcGame = _mcGame;
oFirstUseManager = new com.disney.gem.games.kp_ice.scripts.FirstUsesManager(oController.mcTimeline, this);
oGrapplingObject = new com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager();
oHUD = new com.disney.gem.games.kp_ice.HUD(oController, mcGame.mcHUD);
mcGame.mcLevels.gotoAndStop("level" + oController.getLevel());
var _local4 = mcGame.mcLevels.mcLevel;
oView = new com.disney.gem.games.kp_ice.sarbakan.visual.layer.LayerManager(_local4._width, _local4._height, 580, 410);
oCam = oView.getVisualCamera();
setNormalCamSpeed();
oLayerGame = new com.disney.gem.games.kp_ice.sarbakan.visual.layer.Layer(_local4.mcGame, new com.disney.gem.games.kp_ice.sarbakan.visual.activation.GridActivation());
oLayerGame.addCollisionMap(new com.disney.gem.games.kp_ice.sarbakan.visual.layer.CollisionMap("floor", oLayerGame, 16732159));
oLayerGame.getCollisionMap("floor").setNewSource(_local4.mcGame.mcFloorCollisionMap);
oLayerGame.addCollisionMap(new com.disney.gem.games.kp_ice.sarbakan.visual.layer.CollisionMap("wall", oLayerGame, 16776960));
oLayerGame.getCollisionMap("wall").setNewSource(_local4.mcGame.mcWallCollisionMap);
oLayerGame.addCollisionMap(new com.disney.gem.games.kp_ice.sarbakan.visual.layer.CollisionMap("ceiling", oLayerGame, 13260));
oLayerGame.getCollisionMap("ceiling").setNewSource(_local4.mcGame.mcCeilingCollisionMap);
oView.addLayer(oLayerGame, 1, 1);
oPlayer1 = new com.disney.gem.games.kp_ice.elements.characters.Player1(_local4.mcGame.mcPlayer1, "mcPlayer_1", "player1");
oLayerGame.addDynamicElement(oPlayer1);
oPlayer2 = new com.disney.gem.games.kp_ice.elements.characters.Player2(_local4.mcGame.mcPlayer2, "mcPlayer_2", "player2");
oLayerGame.addDynamicElement(oPlayer2);
oBoss = new com.disney.gem.games.kp_ice.elements.characters.boss.BossAI(_local4.mcGame.mcBoss, _local4.mcGame.mcRailLeft, _local4.mcGame.mcRailRight);
oLayerGame.addDynamicElement(oBoss);
MovieClip(_local4.mcGame.mcBossFloor).swapDepths(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.nBOSS_DEPTH + 1000);
oActivePlayer = oPlayer1;
bMustReleaseSwitchKey = false;
camLock(true);
bInit = false;
nBackIndex = 0;
var _local3 = _local4.mcGame.mcBackground;
aBackgrounds = new Array(_local3.BG_01, _local3.BG_02, _local3.BG_03, _local3.BG_04, _local3.BG_05, _local3.BG_06, _local3.BG_07, _local3.BG_08, _local3.BG_09, _local3.BG_10, _local3.BG_11, _local3.BG_12, _local3.BG_13, _local3.BG_14, _local3.BG_15, _local3.BG_16);
if (!com.sarbakan.BaseDisneyController.bDEBUG) {
var _local2 = 1;
while (_local2 < aBackgrounds.length) {
aBackgrounds[_local2]._visible = false;
_local2++;
}
}
}
function camLock(_bInstant) {
oCam.lockOn(com.sarbakan.utils.Delegate.create(oActivePlayer, oActivePlayer.getCoordVisualCamera), _bInstant);
}
function switchActivePlayer() {
if (oActivePlayer.canSwitch()) {
oActivePlayer.bControlsLock = true;
if (oActivePlayer == oPlayer1) {
oActivePlayer = oPlayer2;
} else if (oActivePlayer == oPlayer2) {
oActivePlayer = oPlayer1;
}
unlockPlayer();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIMUNICATOR_USE, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nKIMMUNICATOR);
oHUD.switchCharacter(oActivePlayer);
}
}
function addDynamicElement(_oElement) {
oLayerGame.addDynamicElement(_oElement);
}
function addStaticElement(_oElement) {
oLayerGame.addStaticElement(_oElement);
}
function setNormalCamSpeed() {
oCam.setSpeed(com.disney.gem.games.kp_ice.GameData.nVisualCamera_SPEED_NORMAL);
}
function setFastCamSpeed() {
oCam.setSpeed(com.disney.gem.games.kp_ice.GameData.nVisualCamera_SPEED_FAST);
}
function cameraLocked(_oCameraLock) {
if ((oCameraLocks != _oCameraLock) && (oCameraLocks != undefined)) {
oActivePlayer.bControlsLock = true;
oCameraLocks = _oCameraLock;
oController.oTransitionManager.playTransition(com.disney.gem.games.kp_ice.Controller.sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, moveLockedCam), com.sarbakan.utils.Delegate.create(this, unlockPlayer));
oController.playTransitionSound();
} else if (oCameraLocks != _oCameraLock) {
oCameraLocks = _oCameraLock;
oCam.unlock();
oCam.travelTo(oCameraLocks.mc._x, oCameraLocks.mc._y);
}
}
function unlockPlayer() {
oActivePlayer.bControlsLock = false;
}
function moveLockedCam() {
oCam.unlock();
oCam.moveTo(oCameraLocks.mc._x, oCameraLocks.mc._y);
com.disney.gem.games.kp_ice.elements.RufusZones.newScreen();
if (com.disney.gem.games.kp_ice.elements.characters.BasePlayer.bRadioEnabled) {
if (oActivePlayer == oPlayer1) {
oPlayer2.moveTo(oPlayer1.mc._x, oPlayer1.mc_y);
} else {
oPlayer1.moveTo(oPlayer2.mc._x, oPlayer2.mc._y);
}
com.disney.gem.games.kp_ice.elements.characters.Ennemy.respawnAfter(Math.max(oPlayer1.getRespawn("x"), oPlayer2.getRespawn("x")));
com.disney.gem.games.kp_ice.elements.Laser.respawnAfter(Math.max(oPlayer1.getRespawn("x"), oPlayer2.getRespawn("x")));
} else {
com.disney.gem.games.kp_ice.elements.characters.Ennemy.respawnAfter(oActivePlayer.getRespawn("x"));
com.disney.gem.games.kp_ice.elements.Laser.respawnAfter(oActivePlayer.getRespawn("x"));
}
aBackgrounds[nBackIndex]._visible = false;
nBackIndex++;
aBackgrounds[nBackIndex]._visible = true;
}
function respawnEnemmies() {
if (com.disney.gem.games.kp_ice.elements.characters.BasePlayer.bRadioEnabled) {
if (oActivePlayer == oPlayer1) {
oPlayer2.moveTo(oPlayer1.mc._x, oPlayer1.mc_y);
} else {
oPlayer1.moveTo(oPlayer2.mc._x, oPlayer2.mc._y);
}
com.disney.gem.games.kp_ice.elements.characters.Ennemy.respawnAfter(Math.max(oPlayer1.getRespawn("x"), oPlayer2.getRespawn("x")));
} else {
com.disney.gem.games.kp_ice.elements.characters.Ennemy.respawnAfter(oActivePlayer.getRespawn("x"));
}
}
function activateBoss() {
oBoss.activate();
}
function destroy() {
com.disney.gem.games.kp_ice.elements.Switch.destroy();
com.disney.gem.games.kp_ice.elements.RufusZones.destroy();
com.disney.gem.games.kp_ice.elements.Laser.destroy();
com.disney.gem.games.kp_ice.elements.Hook.destroy();
com.disney.gem.games.kp_ice.elements.GrapplingZone.destroy();
com.disney.gem.games.kp_ice.elements.Elevator.destroy();
com.disney.gem.games.kp_ice.elements.Door.destroy();
mcGame.mcLevels.gotoAndStop("reset");
oView.destroy();
}
function onUpdate() {
oView.update();
oHUD.update();
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_SWITCH) && (!bMustReleaseSwitchKey)) {
switchActivePlayer();
bMustReleaseSwitchKey = true;
}
if ((!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_SWITCH)) && (bMustReleaseSwitchKey)) {
bMustReleaseSwitchKey = false;
}
if (!bInit) {
bInit = true;
oGrapplingObject.init();
}
}
function onUpdatePaused() {
onUpdate();
}
}
Symbol 1882 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 1883 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.VisualCamera] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.VisualCamera
{
static var oEnterFrameListener;
var nViewZoneW, nViewZoneH, aViewZones, nStageW, nStageH, bLockedOn, nX, nY, nSpeed, bTravelling, oTweenX, fEasing, oTweenY, nTravelDestX, nTravelDestY, fEndListener, fLockedFunction, bWrappedX, __get__x, bWrappedY, __get__y;
function VisualCamera (_viewZoneW, _viewZoneH, _nStageW, _nStageH) {
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, update);
MovieClip.removeListener(oEnterFrameListener);
MovieClip.addListener(oEnterFrameListener);
resetPosition();
nViewZoneW = _viewZoneW;
nViewZoneH = _viewZoneH;
aViewZones = [];
nStageW = _nStageW;
nStageH = _nStageH;
setSpeed(DEFAULT_SPEED);
setEasing(DEFAULT_EASING);
bLockedOn = false;
}
function resetPosition() {
nX = 0;
nY = 0;
}
function travelTo(_nDestX, _nDestY, _fListener) {
var _local2 = Math.round(com.disney.gem.games.kp_ice.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 = com.disney.gem.games.kp_ice.sarbakan.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 relock() {
lockOn(fLockedFunction);
}
function unlock() {
bLockedOn = false;
}
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) {
if (hasViewZones()) {
if (((isInViewZone(_nX, nY * -1) && (isInViewZone(_nX + nStageW, (nY * -1) + nStageH))) && (isInViewZone(_nX + nStageW, nY * -1))) && (isInViewZone(_nX, (nY * -1) + nStageH))) {
nX = _nX * -1;
bWrappedX = false;
} else {
bWrappedX = true;
}
} else {
nX = _nX;
if (nX < 0) {
nX = 0;
}
if (nX > (nViewZoneW - nStageW)) {
nX = Math.round(nViewZoneW - nStageW);
}
nX = nX * -1;
bWrappedX = false;
}
//return(__get__x());
}
function set y(_nY) {
if (hasViewZones()) {
if (((isInViewZone(nX * -1, _nY) && (isInViewZone((nX * -1) + nStageW, _nY + nStageH))) && (isInViewZone((nX * -1) + nStageW, _nY))) && (isInViewZone(nX * -1, _nY + nStageH))) {
nY = _nY * -1;
bWrappedY = false;
} else {
bWrappedY = true;
}
} else {
nY = _nY;
if (nY < 0) {
nY = 0;
}
if (nY > (nViewZoneH - nStageH)) {
nY = Math.round(nViewZoneH - nStageH);
}
nY = nY * -1;
bWrappedY = false;
}
//return(__get__y());
}
function getX() {
return(nX);
}
function getY() {
return(nY);
}
function addViewZone(_mcZone) {
var _local2 = _mcZone.getRect(_mcZone._parent);
aViewZones.push(new flash.geom.Rectangle(_local2.xMin, _local2.yMin, _local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin));
_mcZone.swapDepths(90210);
_mcZone.removeMovieClip();
}
function destroy() {
MovieClip.removeListener(oEnterFrameListener);
}
function pause() {
oTweenX.stop();
oTweenY.stop();
}
function unpause() {
oTweenX.resume();
oTweenY.resume();
}
function update() {
if (bLockedOn) {
var _local2 = fLockedFunction();
if (bTravelling) {
if ((_local2.x != nTravelDestX) || (_local2.y != nTravelDestY)) {
travelTo(_local2.x, _local2.y, fEndListener);
}
} else {
var _local6 = bWrappedX || (bWrappedY);
var _local4 = nX;
var _local3 = nY;
moveTo(_local2.x, _local2.y);
var _local5 = bWrappedX || (bWrappedY);
}
}
}
function onTravelFinished() {
bTravelling = false;
if (fEndListener) {
fEndListener();
fEndListener = undefined;
}
}
function isInViewZone(_nX, _nY) {
var _local3 = false;
var _local2 = aViewZones.length - 1;
while (_local2 >= 0) {
if (aViewZones[_local2].contains(_nX, _nY)) {
_local3 = true;
break;
}
_local2--;
}
return(_local3);
}
function hasViewZones() {
return(aViewZones.length > 0);
}
static var DEFAULT_SPEED = 10;
static var DEFAULT_EASING = mx.transitions.easing.Regular.easeOut;
}
Symbol 1884 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 1885 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 1886 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 1887 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.utils.Delegate] Frame 0
class com.disney.gem.games.kp_ice.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 1888 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.utils.MoreMath] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function random(_nMin, _nMax) {
_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 wrapInRange(_nNumber, _nMin, _nMax) {
_nNumber = Math.max(_nNumber, _nMin);
_nNumber = Math.min(_nNumber, _nMax);
return(_nNumber);
}
static function convertToRadians(_nAngle) {
return((_nAngle * Math.PI) / 180);
}
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);
}
static function getLowestValue() {
var _local3 = arguments[arguments.length - 1];
var _local2 = arguments.length - 1;
while (_local2 >= 0) {
if (arguments[_local2] > _local3) {
_local3 = arguments[_local2];
}
_local2--;
}
return(_local3);
}
static function getHighestValue() {
var _local3 = arguments[arguments.length - 1];
var _local2 = arguments.length - 1;
while (_local2 >= 0) {
if (arguments[_local2] < _local3) {
_local3 = arguments[_local2];
}
_local2--;
}
return(_local3);
}
}
Symbol 1889 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.utils.PredefinedRandom] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.utils.PredefinedRandom
{
var nListSize, aList, aOriginalList;
function PredefinedRandom (_nListSize) {
if (_nListSize) {
nListSize = _nListSize;
} else {
nListSize = DEFAULT_LIST_SIZE;
}
regenerate();
}
function reset() {
aList = com.disney.gem.games.kp_ice.sarbakan.utils.Tools.copyArray(aOriginalList);
}
function regenerate() {
aList = [];
var _local2 = 0;
while (_local2 < nListSize) {
aList.push(Math.random());
_local2++;
}
aOriginalList = com.disney.gem.games.kp_ice.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 1890 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.utils.Tools] Frame 0
class com.disney.gem.games.kp_ice.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);
}
static function copyObject(_oObjectSource) {
var _local2 = new Object();
for (var _local3 in _oObjectSource) {
if (_oObjectSource[_local3] === _oObjectSource) {
_local2[_local3] = _local2;
} else {
_local2[_local3] = ((typeof(_oObjectSource[_local3]) == "object") ? (copyObject(_oObjectSource[_local3])) : (_oObjectSource[_local3]));
}
}
return(_local2);
}
static function spliceRandomValue(_aArray) {
return(_aArray.splice(com.disney.gem.games.kp_ice.sarbakan.utils.MoreMath.random(0, _aArray.length - 1), 1)[0]);
}
static function getObjectSize(_oObject) {
var _local1 = 0;
for (var _local2 in _oObject) {
_local1++;
}
return(_local1);
}
static function updateProperties(_oBaseObject, _oUpdateObject) {
for (var _local4 in _oBaseObject) {
for (var _local3 in _oUpdateObject) {
if (_local4 == _local3) {
_oBaseObject[_local4] = _oUpdateObject[_local3];
break;
}
}
}
return(_oUpdateObject);
}
static function getObjectTotalElements(_oTargetObject) {
var _local1 = {mc:0, objects:0, vars:0};
for (var _local6 in _oTargetObject) {
if (typeof(_oTargetObject[_local6]) == "movieclip") {
_local1.mc++;
var _local4 = getObjectTotalElements(_oTargetObject[_local6]);
_local1.mc = _local1.mc + _local4.mc;
_local1.objects = _local1.objects + _local4.objects;
_local1.vars = _local1.vars + _local4.vars;
} else if (typeof(_oTargetObject[_local6]) == "object") {
_local1.objects++;
var _local3 = getObjectTotalElements(_oTargetObject[_local6]);
_local1.mc = _local1.mc + _local3.mc;
_local1.objects = _local1.objects + _local3.objects;
_local1.vars = _local1.vars + _local3.vars;
} else if (typeof(_oTargetObject[_local6]) == "array") {
var _local5 = getObjectTotalElements(_oTargetObject[_local6]);
_local1.mc = _local1.mc + _local5.mc;
_local1.objects = _local1.objects + _local5.objects;
_local1.vars = _local1.vars + _local5.vars;
} else {
_local1.vars++;
}
}
return(_local1);
}
static function getObjectTotalSize(_oTargetObject, _nMaxLevel, _ObjectsLevel) {
if (_nMaxLevel == undefined) {
_nMaxLevel = 1;
}
if (_ObjectsLevel == undefined) {
_ObjectsLevel = 0;
}
var _local2 = {mcs:0, size:0};
for (var _local9 in _oTargetObject) {
if (typeof(_oTargetObject[_local9]) == "movieclip") {
var _local7 = _oTargetObject[_local9]._target.split("/");
if (_local7.length > _ObjectsLevel) {
_local2.mcs++;
var _local6 = _oTargetObject[_local9].getBytesLoaded();
if (_local6 != undefined) {
_local2.size = _local2.size + _local6;
}
if (_nMaxLevel > 0) {
var _local4 = getObjectTotalSize(_oTargetObject[_local9], _nMaxLevel - 1, _local7.length);
_local2.mcs = _local2.mcs + _local4.mcs;
if (_local4.size != undefined) {
_local2.size = _local2.size + _local4.size;
}
}
}
} else if (typeof(_oTargetObject[_local9]) == "object") {
if (_nMaxLevel > 0) {
var _local3 = getObjectTotalSize(_oTargetObject[_local9], _nMaxLevel - 1, _ObjectsLevel);
_local2.mcs = _local2.mcs + _local3.mcs;
if (_local3.size != undefined) {
_local2.size = _local2.size + _local3.size;
}
}
}
}
return(_local2);
}
}
Symbol 1891 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.layer.LayerManager] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.layer.LayerManager
{
var nStageW, nStageH, oCam, aLayers, bPaused, bWillPause;
function LayerManager (_nViewZoneW, _nViewZoneH, _nStageW, _nStageH) {
nStageW = _nStageW;
nStageH = _nStageH;
oCam = new com.disney.gem.games.kp_ice.sarbakan.visual.VisualCamera(_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 getVisualCamera() {
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();
com.disney.gem.games.kp_ice.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();
com.disney.gem.games.kp_ice.sarbakan.visual.PauseManager.pause();
}
if (!bPaused) {
var _local2 = 0;
while (_local2 < aLayers.length) {
aLayers[_local2].layer.update();
_local2++;
}
updateVisualCameraPosition();
}
}
function updateVisualCameraPosition() {
var _local4 = oCam.getX();
var _local3 = oCam.getY();
var _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 1892 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.layer.Layer] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.layer.Layer
{
var mc, oDynamicElements, aStaticElements, oCollisionMaps, oActivationManager, nHighestDepth, aReservedDepth, nOriginalX, nOriginalY, nStageWHalf, nStageHHalf;
function Layer (_mc, _oActivationManager) {
mc = _mc;
oDynamicElements = {};
aStaticElements = [];
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);
aStaticElements.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) {
if (_local2[_local3].bGarbaged != true) {
_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();
}
var _local2 = aStaticElements.length - 1;
while (_local2 >= 0) {
aStaticElements[_local2].removeMovieClip();
_local2--;
}
for (_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 1893 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.activation.ActivationManager] Frame 0
class com.disney.gem.games.kp_ice.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 1894 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement
{
static var nNextID;
var id, oAttachProperties, oOwner, mc, sLinkage, nAttachDepth, bActive;
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(_mcAttach) {
if (nAttachDepth == undefined) {
nAttachDepth = oOwner.getNextDepth();
oOwner.reserveDepth(nAttachDepth);
}
if (_mcAttach == undefined) {
_mcAttach = oOwner.mc;
}
setMC(_mcAttach.attachMovie(sLinkage, id, nAttachDepth, oAttachProperties));
}
function detachMC() {
if (mc != undefined) {
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;
}
function getMCProperty(_sProperty) {
if (bActive) {
return(mc[_sProperty]);
}
return(oAttachProperties[_sProperty]);
}
static function getNextID() {
if (!nNextID) {
nNextID = 0;
}
return(nNextID++);
}
}
Symbol 1895 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement extends com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement
{
var nSpeedX, nSpeedXLast, nSpeedY, nSpeedYLast, bAlwaysActive, bStaticMovieClip, bAnimStopped, bKeepStateOnEnable, sState, sNextState, detachMC, mc, bNoPause, bGarbaged, oOwner, oAttachProperties, bMoved;
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 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.mcState.stop();
}
function unpause() {
if (!bAnimStopped) {
mc.mcState.play();
}
}
function disablePause() {
bNoPause = true;
bAnimStopped = true;
}
function enablePause() {
bNoPause = false;
}
function stopOnLastFrame() {
mc.mcState.stop();
bAnimStopped = true;
}
function remove() {
bGarbaged = true;
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, _bInstant) {
sNextState = _sState;
if (_bInstant) {
updateState();
}
}
function getState() {
return(sState);
}
function stateStarting() {
return(mc.mcState._currentframe == 1);
}
function stateFinished() {
return(mc.mcState._currentframe == mc.mcState._totalframes);
}
function stateCurrentFrame() {
return(mc.mcState._currentframe);
}
function stateIs() {
var _local4 = false;
var _local3 = arguments.length - 1;
while (_local3 >= 0) {
if ((arguments[_local3] == sState) || (arguments[_local3] == sState.substr(2))) {
_local4 = true;
break;
}
_local3--;
}
return(_local4);
}
function stateIsNot() {
var _local4 = false;
var _local3 = arguments.length - 1;
while (_local3 >= 0) {
if ((arguments[_local3] == sState) || (arguments[_local3] == sState.substr(2))) {
_local4 = true;
break;
}
_local3--;
}
return(!_local4);
}
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 collideWithElementCollider(_sElementID, _sColliderID) {
var _local3 = oOwner.oDynamicElements[_sElementID].mc;
var _local2 = getGlobalPos(_local3[_sColliderID]);
return(mc.hitTest(_local2.x, _local2.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) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mc.gotoAndStop(sState);
this[("state_" + sState) + "_init"]();
if (!bNoPause) {
bAnimStopped = false;
}
mc.mcState.oOwner = this;
mc.mcState.stopOnLastFrame = com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, stopOnLastFrame);
}
this["state_" + sState]();
}
function updateMove() {
mc._x = nSpeedX + mc._x;
mc._y = nSpeedY + mc._y;
if ((!bAlwaysActive) && ((nSpeedX != 0) || (nSpeedY != 0))) {
bMoved = true;
}
}
function updatePosInActivation() {
if (bMoved) {
bMoved = false;
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 1896 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.element.StaticElement] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.element.StaticElement extends com.disney.gem.games.kp_ice.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 1897 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.layer.CollisionMap] Frame 0
class com.disney.gem.games.kp_ice.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);
}
function get color() {
return(nColor);
}
static var BASE_DEPTH = 64000;
}
Symbol 1898 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.PauseManager] Frame 0
class com.disney.gem.games.kp_ice.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 () {
com.disney.gem.games.kp_ice.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 1899 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.element.basicElement.Character] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.element.basicElement.Character extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var sFloorColliderID, sWallColliderID, sCeilingColliderID, sFrontColliderName, sBackColliderName, sBottomColliderName, sTopColliderName, nMoveSpeedX, nAirSpeedX, bNoFlip, nDirection, mc, setState, nSpeedX, nSpeedY, stateFinished, stateStarting, sState, getGlobalPos, collideWithMap;
function Character (_sID) {
super(_sID);
sFloorColliderID = "floor";
sWallColliderID = "wall";
sCeilingColliderID = "ceiling";
sFrontColliderName = "front";
sBackColliderName = "back";
sBottomColliderName = "bottom";
sTopColliderName = "top";
nMoveSpeedX = nSPEED_RUN;
nAirSpeedX = nSPEED_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 state_idle() {
nSpeedX = 0;
nSpeedY = 0;
checkFall();
setPositionOutFloor();
}
function state_run() {
nSpeedX = nMoveSpeedX * nDirection;
nSpeedY = 0;
checkFall();
setPositionOutFloor();
checkWall();
}
function state_jumpSwitch() {
nSpeedY = nSpeedY - (nSpeedY * nGRAVITY);
if (nSpeedY > nSPEED_FALL) {
nSpeedY = nSPEED_FALL;
}
if (stateFinished()) {
setState("jumpFall");
}
checkWall();
}
function state_jumpFall(_bSkipFirstFrameCheck) {
if ((!_bSkipFirstFrameCheck) && (stateStarting())) {
nSpeedY = 1;
}
if (stateFinished()) {
mc.mcState.stop();
}
nSpeedY = nSpeedY + (nSpeedY * nGRAVITY);
if (nSpeedY > nSPEED_FALL) {
nSpeedY = nSPEED_FALL;
}
if (isOnGround()) {
setPositionOutFloor();
setState("jumpLand");
} else if (nSpeedX != 0) {
nSpeedX = nDirection * nAirSpeedX;
}
checkWall();
}
function state_jumpLand() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
initIdle();
}
setPositionOutFloor();
checkWall();
}
function state_jump() {
if (stateStarting()) {
nAirSpeedX = nSPEED_AIR_MOVEX;
nSpeedY = nJUMP_FORCE;
} else {
nSpeedY = nSpeedY - (nSpeedY * nGRAVITY);
if (nSpeedX != 0) {
nSpeedX = nDirection * nAirSpeedX;
}
if (nSpeedY > -1) {
setState("jumpSwitch");
}
}
if (nSpeedY <= -1) {
checkCeiling();
}
checkWall();
}
function state_jumpStart() {
if (stateFinished()) {
setState("jump");
}
}
function onEnable() {
setDirection(nDirection);
}
function checkFall() {
var _local2 = mc._y;
while (!isOnGround()) {
mc._y = mc._y + nADJUST_FLOOR;
if ((mc._y - _local2) > nDISTANCE_FALL) {
if (sState != "jumpAttack") {
setState("jumpFall");
}
break;
}
nSpeedY = mc._y - _local2;
}
if (mc._y != _local2) {
mc._y = _local2;
return(false);
}
return(true);
}
function checkWall() {
if (isHittingWall()) {
nSpeedX = 0;
}
}
function checkCeiling() {
if (isHittingCeiling()) {
nSpeedY = 0;
setState("jumpFall");
}
}
function isOnGround() {
var _local2 = getGlobalPos(mc[sBottomColliderName]);
return(collideWithMap(sFloorColliderID, {x:Math.round(_local2.x + nSpeedX), y:Math.round(_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 _local3;
var _local2 = 0;
while (_local2 < 15) {
_local3 = isHittingWall();
nSpeedX = nSpeedX + (_local3 * (mc._xscale / Math.abs(mc._xscale)));
_local2++;
}
}
var nADJUST_FLOOR = 1;
var nDISTANCE_FALL = 8;
var nJUMP_FORCE = -20;
var nGRAVITY = 0.42;
var nSPEED_RUN = 3;
var nSPEED_FALL = 30;
var nSPEED_AIR_MOVEX = 4;
}
Symbol 1900 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.BasePlayer] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.BasePlayer extends com.disney.gem.games.kp_ice.sarbakan.visual.element.basicElement.Character
{
static var bRadioEnabled;
var setLinkage, setMC, setDirection, bEndRun, nCamOffsetHorizontal, sBackColliderName, nMoveSpeedX, nRunFullSpeedCount, nEscalatorSteps, nEnergy, bMustReleaseAttackKey, bMustReleaseJumpKey, bControlsLock, bAutoPilot, setState, nDirection, removeReferenceMC, attachMC, mc, bFirstRespawnPoint, bMustReleaseUseKey, nRespawnX, nRespawnY, isActive, bInvincible, nCustomPushBackSpeed, bInAirHurt, bDieFall, oCamOffsetHorizontalTween, stateIs, nDamage, bSwitchDirection, nDirectionSwitchCount, nSpeedX, nSpeedY, stateFinished, checkFall, setPositionOutFloor, checkWall, stateStarting, sState, bJumpAttacked, nFallDistance, bKickedDownstairs, isOnGround, nDirectionLast, oUsedSwitch, nAirSpeedX, nInvincibleDelayCount, oTargetPos, getGlobalPos;
function BasePlayer (_mc, _sLinkage, _sID) {
super(_sID);
setLinkage(_sLinkage);
setMC(_mc);
setDirection(1);
bEndRun = false;
nCamOffsetHorizontal = (nCAM_OFFSET_HORIZONTAL_MIN + nCAM_OFFSET_HORIZONTAL_MAX) / 2;
delete sBackColliderName;
nMoveSpeedX = nSPEED_RUN;
nRunFullSpeedCount = 0;
nEscalatorSteps = 0;
nEnergy = com.disney.gem.games.kp_ice.GameData.nENERGY_FULL;
bMustReleaseAttackKey = false;
bMustReleaseJumpKey = false;
bControlsLock = false;
if (!com.sarbakan.BaseDisneyController.bDEBUG) {
bRadioEnabled = false;
} else {
bRadioEnabled = true;
}
bAutoPilot = false;
}
function gotRadio() {
bRadioEnabled = true;
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().stepsOn(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nKIMMUNICATOR);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIMUNICATOR_FOUND, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function regainEnergy(_nQty) {
nEnergy = nEnergy + _nQty;
nEnergy = Math.min(nEnergy, com.disney.gem.games.kp_ice.GameData.nENERGY_FULL);
}
function doEndRun() {
bControlsLock = true;
setState(sSTATE_RUN_START);
nDirection = 1;
bEndRun = true;
}
function init() {
removeReferenceMC();
attachMC();
setRespawnLocation(mc._x, mc._y);
bFirstRespawnPoint = true;
}
function update() {
super.update();
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == this) {
updateCamOffset();
}
updateInvincibility();
mc.swapDepths(mc._parent.getNextHighestDepth());
if (bMustReleaseAttackKey && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_ATTACK))) {
bMustReleaseAttackKey = false;
}
if (bMustReleaseUseKey && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_USE))) {
bMustReleaseUseKey = false;
}
if (bMustReleaseJumpKey && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_JUMP))) {
bMustReleaseJumpKey = false;
}
if (bAutoPilot) {
moveAuto();
}
}
function getCoordVisualCamera() {
var _local3 = super.getCoord();
return({x:_local3.x - nCamOffsetHorizontal, y:_local3.y - nCAM_OFFSET_VERTICAL});
}
function setRespawnLocation(_nX, _nY) {
nRespawnX = _nX;
nRespawnY = _nY;
bFirstRespawnPoint = false;
}
function respawn(_nX, _nY) {
if ((_nX == undefined) || (_nY == undefined)) {
_nX = nRespawnX;
_nY = nRespawnY;
}
nEnergy = com.disney.gem.games.kp_ice.GameData.nENERGY_FULL;
mc._x = nRespawnX;
mc._y = nRespawnY - 35;
nDirection = 1;
if (isActive()) {
setState(sSTATE_IDLE, true);
} else {
setState(sSTATE_IDLE);
}
setDirection(1);
startInvincibility();
}
function hurt(_nEnergy, _nCustomPushBackSpeed) {
if ((!isHurt()) && (!bInvincible)) {
nEnergy = nEnergy - _nEnergy;
nCustomPushBackSpeed = _nCustomPushBackSpeed;
if (nEnergy > 0) {
if (isJumping()) {
bInAirHurt = true;
}
setState(sSTATE_HURT, true);
startInvincibility();
} else {
die();
}
}
}
function die(_bNoFall) {
if (_bNoFall) {
bDieFall = false;
} else {
bDieFall = true;
}
nEnergy = 0;
setState(sSTATE_DIE_START);
delete oCamOffsetHorizontalTween;
}
function isJumping() {
return(stateIs(sSTATE_JUMP, sSTATE_JUMP_ATTACK, sSTATE_JUMP_FALL, sSTATE_JUMP_SWITCH));
}
function isHurt() {
return(stateIs(sSTATE_HURT, sSTATE_DIE_END, sSTATE_DIE_FALL, sSTATE_DIE_START));
}
function getHurtValue() {
return(nDamage);
}
function isAttacking() {
return(stateIs(sSTATE_ATTACK, sSTATE_JUMP_ATTACK));
}
function isDieing() {
return(stateIs(sSTATE_DIE_END, sSTATE_DIE_FALL, sSTATE_DIE_START));
}
function isIdle() {
return(stateIs(sSTATE_IDLE));
}
function canSwitch() {
return(((isIdle() && (!isHurt())) && (!bInvincible)) && (bRadioEnabled));
}
function moveTo(_nXpos, _nYpos) {
mc._x = _nXpos;
mc._y = _nYpos;
}
function getRespawn(_sRespawnCoord) {
if (_sRespawnCoord == "x") {
return(nRespawnX);
}
if (_sRespawnCoord == "y") {
return(nRespawnY);
}
return(0);
}
function onOffsetTweenEnd() {
delete oCamOffsetHorizontalTween;
}
function state_idle_init() {
if (bSwitchDirection) {
setDirection(nDirection * -1);
bSwitchDirection = false;
}
nMoveSpeedX = 0;
}
function state_idle(_bSkipKeyCheck) {
super.state_idle();
if (!_bSkipKeyCheck) {
checkIdleControl();
}
}
function state_runStart_init() {
state_idle_init();
nRunFullSpeedCount = 0;
nDirectionSwitchCount = 0;
nSpeedX = 0;
nSpeedY = 0;
nMoveSpeedX = 1;
}
function state_runStart() {
state_run();
if (stateFinished()) {
setState(sSTATE_RUN);
}
}
function state_run() {
if (nMoveSpeedX < nSPEED_RUN) {
nMoveSpeedX = nMoveSpeedX * nRUN_ACEL_RATE;
nMoveSpeedX = Math.min(nMoveSpeedX, nSPEED_RUN);
} else {
nRunFullSpeedCount++;
}
super.state_run();
checkRunControl();
if (bAutoPilot && (nSpeedX == 0)) {
activateSwitch();
}
}
function state_turn_init() {
nSpeedX = 0;
nSpeedY = 0;
}
function state_turn() {
if (stateFinished()) {
if ((Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) || (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) || (bAutoPilot)) {
setState(sSTATE_RUN_START);
} else {
setState(sSTATE_IDLE);
}
bSwitchDirection = true;
}
checkFall();
setPositionOutFloor();
}
function state_runStop() {
checkIdleControl();
nSpeedX = nSpeedX / nRUN_DECEL_RATE;
if (stateFinished()) {
setState(sSTATE_IDLE);
}
checkFall();
checkWall();
setPositionOutFloor();
}
function state_jump() {
super.state_jump();
if (stateStarting()) {
if (nRunFullSpeedCount >= nBIG_JUMP_RUN_FRAME_NEEDED) {
nSpeedY = nJUMP_FORCE;
}
}
if (stateFinished()) {
mc.mcState.stop();
}
checkAirControl();
}
function state_jumpSwitch() {
super.state_jumpSwitch();
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_ATTACK)) {
attack();
}
checkAirControl();
}
function state_jumpAttack() {
if (stateFinished()) {
mc.gotoAndStop(sSTATE_JUMP_FALL);
mc.mcState.gotoAndStop(2);
sState = sSTATE_JUMP_FALL;
}
state_jumpFall(bJumpAttacked);
bJumpAttacked = true;
}
function state_jumpFall_init() {
nFallDistance = 0;
}
function state_jumpFall(_bSkipFirstFrameCheck) {
super.state_jumpFall(_bSkipFirstFrameCheck);
nFallDistance = nFallDistance + nSpeedY;
checkAirControl();
}
function state_jumpLand() {
bJumpAttacked = false;
nRunFullSpeedCount = 0;
if (stateStarting()) {
delete sBackColliderName;
}
super.state_jumpLand();
state_idle(true);
}
function state_attack() {
state_idle(true);
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_hurt_init() {
sBackColliderName = "back";
}
function state_hurt() {
if (bInAirHurt) {
state_jumpFall();
} else {
state_idle(true);
}
if (nCustomPushBackSpeed) {
nSpeedX = nCustomPushBackSpeed;
} else {
nSpeedX = nPUSHBACK_SPEED * (-nDirection);
}
if (stateFinished()) {
if (bInAirHurt) {
setState(sSTATE_JUMP_FALL);
} else {
setState(sSTATE_IDLE);
}
bInAirHurt = false;
}
checkWall();
if (stateFinished()) {
delete sBackColliderName;
}
}
function state_dieStart_init() {
if (bKickedDownstairs) {
nSpeedX = (nKICKED_DOWNSTAIRS_SPEEDX_BASE * (mc._x / nKICKED_DOWNSTAIRS_FLOOR_X_START)) + nKICKED_DOWNSTAIRS_SPEEDX_MIN;
nSpeedY = nKICKED_DOWNSTAIRS_SPEEDY_BASE;
} else {
nSpeedX = 0;
nSpeedY = 0;
}
}
function state_dieStart() {
if (bDieFall || (bKickedDownstairs)) {
sBackColliderName = "back";
if (stateFinished()) {
setState(sSTATE_DIE_FALL);
}
} else if (stateFinished()) {
setState(sSTATE_DIE_END);
}
}
function state_dieFall_init() {
if (!bKickedDownstairs) {
nSpeedX = nSpeedX * -1;
nSpeedY = 9;
} else {
nSpeedY = 15;
}
}
function state_dieFall() {
if (bKickedDownstairs && (mc._x < nKICKED_DOWNSTAIRS_FLOOR_X_END)) {
nSpeedX = nKICKED_DOWNSTAIRS_SPEEDX_MIN;
}
checkWall();
if (isOnGround()) {
setPositionOutFloor();
setState(sSTATE_DIE_END);
bDieFall = false;
}
}
function state_dieEnd() {
nSpeedX = 0;
if (stateStarting()) {
com.disney.gem.games.kp_ice.Controller.getInstance().stopMusic();
}
setPositionOutFloor();
if (stateFinished()) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.setNormalCamSpeed();
com.disney.gem.games.kp_ice.Controller.getInstance().onDie();
mc.mcState.stop();
}
}
function state_crouchStart() {
if (stateFinished()) {
setState(sSTATE_CROUCH);
}
state_idle(true);
}
function state_crouch() {
state_idle(true);
}
function state_crouchEnd() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
state_idle(true);
}
function state_switchOn() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_switchOff() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function updateCamOffset() {
if (nDirection != nDirectionLast) {
var _local2;
if (nDirection == 1) {
_local2 = nCAM_OFFSET_HORIZONTAL_MIN;
} else {
_local2 = nCAM_OFFSET_HORIZONTAL_MAX;
}
if (oCamOffsetHorizontalTween == undefined) {
oCamOffsetHorizontalTween = new mx.transitions.Tween(this, "nCamOffsetHorizontal", mx.transitions.easing.Regular.easeInOut, nCamOffsetHorizontal, _local2, nCAM_OFFSET_HORIZONTAL_DURATION);
oCamOffsetHorizontalTween.onMotionFinished = com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, onOffsetTweenEnd);
} else {
oCamOffsetHorizontalTween.continueTo(_local2, nCAM_OFFSET_HORIZONTAL_DURATION);
}
}
nDirectionLast = nDirection;
}
function checkIdleControl() {
if ((com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == this) && (!bAutoPilot)) {
if (bControlsLock == false) {
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT)) {
if (nDirection == 1) {
setState(sSTATE_TURN);
} else {
setState(sSTATE_RUN_START);
}
} else if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT)) {
if (nDirection == -1) {
setState(sSTATE_TURN);
} else {
setState(sSTATE_RUN_START);
}
}
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_JUMP) && (!bMustReleaseJumpKey)) {
setState(sSTATE_JUMP);
bMustReleaseJumpKey = true;
}
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_ATTACK)) {
attack();
bMustReleaseAttackKey = true;
}
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_USE)) {
checkUses();
bMustReleaseUseKey = true;
}
}
}
}
function checkRunControl() {
if ((com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == this) && (!bAutoPilot)) {
if (bControlsLock == false) {
if ((++nDirectionSwitchCount) == nRUN_SWITCH_DIRECTION_DELAY) {
if (((nDirection == 1) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT))) && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) {
setState(sSTATE_TURN);
} else if (((nDirection == -1) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT))) {
setState(sSTATE_TURN);
}
nDirectionSwitchCount = 0;
}
if (((!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT)) && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) && (oUsedSwitch == undefined)) {
nRunFullSpeedCount = 0;
setState(sSTATE_RUN_STOP);
}
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_JUMP) && (!bMustReleaseJumpKey)) {
setState(sSTATE_JUMP);
bMustReleaseJumpKey = true;
}
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_ATTACK)) {
attack();
}
} else if (bEndRun) {
} else {
nRunFullSpeedCount = 0;
setState(sSTATE_RUN_STOP);
}
}
}
function checkAirControl() {
if ((com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == this) && (!bAutoPilot)) {
if (bControlsLock == false) {
if ((!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT)) && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) {
nAirSpeedX = 0;
}
if ((nDirection == 1) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT))) {
setDirection(-1);
} else if ((nDirection == -1) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) {
setDirection(1);
}
if ((Math.abs(nSpeedX) < nSPEED_AIR_MOVEX) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) || (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT)))) {
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT)) {
setDirection(1);
} else {
setDirection(-1);
}
nSpeedX = nDirection * nSPEED_AIR_MOVEX;
checkWall();
}
if ((!isAttacking()) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_ATTACK))) {
attack();
}
} else {
nAirSpeedX = 0;
}
}
}
function attack() {
if (!bMustReleaseAttackKey) {
bMustReleaseAttackKey = true;
if (isJumping()) {
if (!bJumpAttacked) {
setState(sSTATE_JUMP_ATTACK);
}
} else {
setState(sSTATE_ATTACK);
}
}
}
function startInvincibility() {
bInvincible = true;
nInvincibleDelayCount = 0;
}
function endInvincibility() {
mc._visible = true;
bInvincible = false;
}
function updateInvincibility() {
if (bInvincible && (!isHurt())) {
if ((++nInvincibleDelayCount) == nINVINCIBLE_DELAY) {
endInvincibility();
} else if ((nInvincibleDelayCount % nINVINCIBLE_FLASH_RATE) == 1) {
if (mc._visible) {
mc._visible = false;
} else {
mc._visible = true;
}
}
} else {
mc._visible = true;
}
}
function checkUses() {
checkSwitchesUses();
}
function checkSwitchesUses() {
if ((!bMustReleaseUseKey) && (isIdle())) {
var _local3 = com.disney.gem.games.kp_ice.elements.Switch.aSWITCHES;
var _local2 = 0;
while (_local2 < _local3.length) {
if (com.disney.gem.games.kp_ice.elements.Switch(_local3[_local2]).isActive()) {
if (com.disney.gem.games.kp_ice.elements.Switch(_local3[_local2]).isOnSwitch(this)) {
bMustReleaseUseKey = true;
oUsedSwitch = _local3[_local2];
oTargetPos = getGlobalPos(oUsedSwitch.mc.mcState.mcPoint);
bAutoPilot = true;
}
}
_local2++;
}
}
}
function moveAuto() {
var _local2 = getGlobalPos(mc);
if (isIdle()) {
if ((_local2.x > oTargetPos.x) && (nDirection == 1)) {
setState(sSTATE_TURN);
} else if ((_local2.x < oTargetPos.x) && (nDirection == -1)) {
setState(sSTATE_TURN);
} else if (((_local2.x + nAUTO_PILOT_THRESHOLD) > oTargetPos.x) && ((_local2.x - nAUTO_PILOT_THRESHOLD) < oTargetPos.x)) {
activateSwitch();
} else {
setState(sSTATE_RUN_START);
}
} else if (isRunning()) {
if (oUsedSwitch.__get__Direction() == 1) {
if (nDirection == 1) {
if (((_local2.x - nSpeedX) < oTargetPos.x) || (nSpeedX == 0)) {
activateSwitch();
}
} else if (nDirection == -1) {
if ((_local2.x - nSpeedX) < oTargetPos.x) {
setState(sSTATE_TURN);
}
}
} else if (oUsedSwitch.__get__Direction() == -1) {
if (nDirection == -1) {
if (((_local2.x - nSpeedX) > oTargetPos.x) || (nSpeedX == 0)) {
activateSwitch();
}
} else if (nDirection == 1) {
if ((_local2.x - nSpeedX) > oTargetPos.x) {
setState(sSTATE_TURN);
}
}
}
}
}
function activateSwitch() {
var _local2 = getGlobalPos(mc);
var _local3 = oTargetPos.x - _local2.x;
if (oUsedSwitch.used()) {
if (oUsedSwitch.getState() == com.disney.gem.games.kp_ice.elements.Switch.sSTATE_OFF) {
setState(sSTATE_SWITCH_OFF);
} else {
setState(sSTATE_SWITCH_ON);
}
}
nSpeedX = 0;
nSpeedY = 0;
oUsedSwitch = undefined;
bAutoPilot = false;
oTargetPos = undefined;
}
function isRunning() {
return(stateIs(sSTATE_RUN_START, sSTATE_RUN, sSTATE_RUN_STOP));
}
var nJUMP_FORCE = -36;
var nGRAVITY = 0.45;
var nSPEED_RUN = 7;
var nSPEED_FALL = 30;
var nSPEED_AIR_MOVEX = 4;
static var nPUSHBACK_SPEED = 3;
static var nRUN_ACEL_RATE = 1.3;
static var nRUN_DECEL_RATE = 1.1;
static var nBIG_JUMP_RUN_FRAME_NEEDED = 10;
static var nJUMP_FALL_DISTANCE_LAND = 200;
static var nCAM_OFFSET_HORIZONTAL_MIN = 160;
static var nCAM_OFFSET_HORIZONTAL_MAX = 420;
static var nCAM_OFFSET_HORIZONTAL_DURATION = 20;
static var nCAM_OFFSET_VERTICAL = 250;
static var nINVINCIBLE_DELAY = 40;
static var nINVINCIBLE_FLASH_RATE = 2;
var nKICKED_DOWNSTAIRS_SPEEDX_BASE = -25;
var nKICKED_DOWNSTAIRS_SPEEDX_MIN = -10;
var nKICKED_DOWNSTAIRS_SPEEDY_BASE = -9;
var nKICKED_DOWNSTAIRS_FLOOR_X_START = 800;
var nKICKED_DOWNSTAIRS_FLOOR_X_END = 500;
var nRUN_SWITCH_DIRECTION_DELAY = 5;
static var sSTATE_IDLE = "idle";
static var sSTATE_RUN_START = "runStart";
static var sSTATE_RUN = "run";
static var sSTATE_RUN_STOP = "runStop";
static var sSTATE_TURN = "turn";
static var sSTATE_JUMP = "jump";
static var sSTATE_JUMP_ATTACK = "jumpAttack";
static var sSTATE_JUMP_SWITCH = "jumpSwitch";
static var sSTATE_JUMP_FALL = "jumpFall";
static var sSTATE_ATTACK = "attack";
static var sSTATE_HURT = "hurt";
static var sSTATE_DIE_START = "dieStart";
static var sSTATE_DIE_FALL = "dieFall";
static var sSTATE_DIE_END = "dieEnd";
static var sSTATE_CROUCH_START = "crouchStart";
static var sSTATE_CROUCH = "crouch";
static var sSTATE_CROUCH_END = "crouchEnd";
static var sSTATE_SWITCH_ON = "switchOn";
static var sSTATE_SWITCH_OFF = "switchOff";
static var nAUTO_PILOT_THRESHOLD = 5;
}
Symbol 1901 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Switch] Frame 0
class com.disney.gem.games.kp_ice.elements.Switch extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var aActionsON, aActionsOFF, bItemSet, bOn, setLinkage, setMC, bBossSwitch, removeReferenceMC, attachMC, collideWithElementBox, mc, setState, DEFAULT_STATE, sLinkage, stateFinished;
function Switch (_mc, _aTurnOnAction, _aTurnOffAction, _sLinkage) {
super("switch" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
aActionsON = _aTurnOnAction;
aActionsOFF = _aTurnOffAction;
bItemSet = false;
bOn = false;
if (_sLinkage == undefined) {
_sLinkage = sFACE_FRONT;
}
setLinkage(_sLinkage);
setMC(_mc);
aSWITCHES.push(this);
bBossSwitch = false;
}
function init() {
removeReferenceMC();
attachMC();
}
function isOnSwitch(_oPlayer) {
var _local2 = false;
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id, mc.mcState.mcHit)) {
_local2 = true;
}
return(_local2);
}
function used() {
bOn = !bOn;
var _local3 = true;
if (!bOn) {
var _local4 = true;
var _local2 = 0;
while (_local2 < aActionsOFF.length) {
if (!aActionsOFF[_local2].id.isReady()) {
_local4 = false;
_local3 = false;
break;
}
_local2++;
}
if (_local4) {
setState(sSTATE_TURN_OFF);
DEFAULT_STATE = sSTATE_OFF;
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sSWITCH_OFF, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
_local2 = 0;
while (_local2 < aActionsOFF.length) {
aActionsOFF[_local2].id.use(aActionsOFF[_local2].hidden);
_local2++;
}
} else {
bOn = !bOn;
}
} else {
var _local4 = true;
var _local2 = 0;
while (_local2 < aActionsOFF.length) {
if (!aActionsOFF[_local2].id.isReady()) {
_local4 = false;
_local3 = false;
break;
}
_local2++;
}
if (_local4) {
setState(sSTATE_TURN_ON);
DEFAULT_STATE = sSTATE_ON;
_local2 = 0;
while (_local2 < aActionsON.length) {
aActionsON[_local2].id.use(aActionsON[_local2].hidden);
_local2++;
}
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sSWITCH_ON, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
} else {
bOn = !bOn;
}
}
return(_local3);
}
function get Direction() {
if ((sLinkage == sFACE_LEFT) || (sLinkage == sFACE_FRONT)) {
return(-1);
}
if (sLinkage == sFACE_RIGHT) {
return(1);
}
return(-1);
}
function shutOff() {
setState(sSTATE_OFF);
bOn = false;
}
static function destroy() {
aSWITCHES = new Array();
}
function onEnable() {
if (bBossSwitch) {
var _local2 = mc.getDepth();
mc.swapDepths((com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.nBOSS_DEPTH + _local2) + 2000);
}
}
function update() {
super.update();
if (!bItemSet) {
setItems();
if (bBossSwitch) {
onEnable();
}
}
}
function state_idle_init() {
setState(sSTATE_OFF);
DEFAULT_STATE = sSTATE_OFF;
}
function state_turnOn() {
if (stateFinished()) {
setState(sSTATE_ON);
}
}
function state_turnOff() {
if (stateFinished()) {
setState(sSTATE_OFF);
}
}
function setItems() {
bItemSet = true;
var _local2 = 0;
while (_local2 < aActionsON.length) {
aActionsON[_local2].id = findItem(aActionsON[_local2].id);
_local2++;
}
_local2 = 0;
while (_local2 < aActionsOFF.length) {
aActionsOFF[_local2].id = findItem(aActionsOFF[_local2].id);
_local2++;
}
}
function findItem(_sMcName) {
var _local2;
var _local3 = false;
var _local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Door.aDOORS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Door(com.disney.gem.games.kp_ice.elements.Door.aDOORS[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.Door(com.disney.gem.games.kp_ice.elements.Door.aDOORS[_local4]);
_local3 = true;
break;
}
_local4++;
}
if (!_local3) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Hook.aHOOKS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]);
_local3 = true;
break;
}
_local4++;
}
}
if (!_local3) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Laser.aLASERS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Laser(com.disney.gem.games.kp_ice.elements.Laser.aLASERS[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.Laser(com.disney.gem.games.kp_ice.elements.Laser.aLASERS[_local4]);
_local3 = true;
break;
}
_local4++;
}
}
if (!_local3) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Hook.aHOOKS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]);
_local3 = true;
break;
}
_local4++;
}
}
if (!_local3) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Elevator(com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.Elevator(com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS[_local4]);
_local3 = true;
break;
}
_local4++;
}
}
if (!_local3) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.characters.boss.Wire(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES[_local4]).sName) {
_local2 = com.disney.gem.games.kp_ice.elements.characters.boss.Wire(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES[_local4]);
_local2.setSwitch(this);
_local3 = true;
bBossSwitch = true;
break;
}
_local4++;
}
}
return(_local2);
}
static var sSTATE_IDLE = "idle";
static var sSTATE_ON = "on";
static var sSTATE_TURN_ON = "turnOn";
static var sSTATE_OFF = "off";
static var sSTATE_TURN_OFF = "turnOff";
static var aSWITCHES = new Array();
static var sFACE_LEFT = "mcSwitchLeft";
static var sFACE_RIGHT = "mcSwitchRight";
static var sFACE_FRONT = "mcSwitchFront";
}
Symbol 1902 MovieClip [__Packages.com.sarbakan.sound.SoundManager] Frame 0
class com.sarbakan.sound.SoundManager
{
static var aSounds, mcAttach, nSoundNum, aSoundCategories, nMasterVolume, oEnterFrameListener;
function SoundManager () {
}
static function doPlaySound(_sLinkage, _nVolume, _nLoop, _bUnique) {
return(doPlaySoundInCat(sDEFAULT_CATEGORY, _sLinkage, _nVolume, _nLoop, _bUnique));
}
static function doPlaySoundInCat(_sCategoryName, _sLinkage, _nVolume, _nLoop, _bUnique) {
doCheckInit();
var _local1;
if (NewSoundAllowed) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 1;
}
if (_bUnique == undefined) {
_bUnique = false;
}
var _local2;
if (_bUnique) {
var _local4 = isSoundPlaying(_sLinkage);
if (_local4.bPlaying) {
_local2 = false;
_local1 = _local4.oSound;
} else {
_local2 = true;
}
} else {
_local2 = true;
}
if (_local2) {
doManageCategory(_sCategoryName);
var _local5 = getMCForSound();
var _local3 = new Sound(_local5);
_local3.attachSound(_sLinkage);
if (_local3.duration != undefined) {
_local1 = new com.sarbakan.sound.SoundItem(_local3, _sLinkage, _nVolume, _nLoop, _sCategoryName, _local5);
}
_local1.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_local1);
}
}
return(_local1);
}
static function isSoundPlaying(_sLinkageName) {
var _local2 = new Object();
_local2.bPlaying = false;
_local2.oSound = undefined;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (aSounds[_local1].LinkageName == _sLinkageName) {
_local2.oSound = aSounds[_local1];
_local2.bPlaying = true;
}
_local1--;
}
return(_local2);
}
function getPlayingQty(_sLinkageName) {
var _local2 = 0;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (aSounds[_local1].LinkageName == _sLinkageName) {
_local2++;
}
_local1--;
}
return(_local2);
}
static function doManageExternalSound(_oSound) {
doCheckInit();
doManageCategory(_oSound.__get__Category());
_oSound.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_oSound);
}
static function getMCForSound() {
var _local1 = getNextDepth();
var _local2 = mcAttach.createEmptyMovieClip("Snd" + _local1, _local1);
return(_local2);
}
static function getNextDepth() {
nSoundNum++;
return(nSoundNum);
}
static function doInit(_mcAttach) {
if (!bInited) {
mcAttach = _mcAttach;
bInited = true;
nSoundNum = 0;
aSounds = new Array();
aSoundCategories = new Array();
nMasterVolume = 100;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = com.sarbakan.utils.Delegate.create(com.sarbakan.sound.SoundManager, doEnterFrame);
MovieClip.addListener(oEnterFrameListener);
}
}
static function doEnterFrame() {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doEnterFrame();
_local1--;
}
}
static function setCategoryVolume(_sCategoryName, _nVol) {
doManageCategory(_sCategoryName);
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].nVolume = _nVol;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local2;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
_local2 = aSoundCategories[_local1].nVolume;
}
_local1--;
}
return(_local2);
}
static function isCategoryMuted(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local2;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
_local2 = aSoundCategories[_local1].bMuted;
}
_local1--;
}
return(_local2);
}
static function doSoundEvent(_nEvent, _oSound) {
if (!(_nEvent === nEVENT_SOUND_COMPLETE)) {
} else {
var _local2 = false;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (!_local2) {
if (aSounds[_local1] == _oSound) {
_local2 = true;
delete aSounds[_local1];
aSounds.splice(Number(_local1), 1);
}
}
_local1--;
}
}
}
static function doMuteCategory(_sCategoryName) {
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].bMuted = true;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(_sCategoryName) {
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].bMuted = false;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function setMasterVolume(_nVol) {
nMasterVolume = _nVol;
doUpdateAllSoundsVolume();
}
static function get NewSoundAllowed() {
return(aSounds.length < nMAX_SOUNDS_PLAYING);
}
static function get MasterVolume() {
return(nMasterVolume);
}
static function doRemoveListenerFromAllSounds(_oListener) {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doRemoveListener(_oListener);
_local1--;
}
}
static function doDestroy() {
doRemoveListenerFromAllSounds();
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doDestroy();
_local1--;
}
mcAttach.removeMovieClip();
delete mcAttach;
nSoundNum = 0;
bInited = false;
nMasterVolume = 100;
delete aSounds;
delete aSoundCategories;
delete oEnterFrameListener;
}
static function get Inited() {
return(bInited);
}
static function doUpdateAllSoundsVolume() {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doUpdateSound();
_local1--;
}
}
static function doCheckInit() {
if (!bInited) {
}
}
static function doManageCategory(_sCategoryName) {
doCheckInit();
var _local2 = false;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
_local2 = true;
}
_local1--;
}
if (!_local2) {
var _local4 = new Object();
_local4.sName = _sCategoryName;
_local4.nVolume = 100;
_local4.bMuted = false;
aSoundCategories.push(_local4);
}
}
static var nEVENT_SOUND_COMPLETE = 1;
static var sDEFAULT_CATEGORY = "SFX";
static var nMAX_SOUNDS_PLAYING = 32;
static var bInited = false;
}
Symbol 1903 MovieClip [__Packages.com.sarbakan.sound.SoundItem] Frame 0
class com.sarbakan.sound.SoundItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, nCurrentTime, aEventListeners, bStopAfterFade;
function SoundItem (_sndObject, _sLinkage, _nVolume, _nLoop, _sCategory, _mc) {
sndObj = _sndObject;
sLinkage = _sLinkage;
mcRef = _mc;
nRemainingLoop = _nLoop;
nCurrentVolume = _nVolume;
nTargetVolume = _nVolume;
nFadeRate = nFADE_RATE;
sCategory = _sCategory;
bFadeAtEnd = false;
bMuted = false;
bPaused = false;
bNeedFreshStart = false;
sndObj.onSoundComplete = com.sarbakan.utils.Delegate.create(this, doSoundComplete);
doStart(_nLoop);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
nCurrentTime = 0;
aEventListeners = new Array();
}
function doEnterFrame() {
if (!bPaused) {
if (nCurrentTime > sndObj.position) {
nRemainingLoop--;
}
nCurrentTime = sndObj.position;
}
doCheckFadeAtEnd();
doManageFade();
}
function doAddListener(_oListener) {
aEventListeners.push(_oListener);
}
function doRemoveListener(_oListener) {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
if (aEventListeners[_local2] == _oListener) {
delete aEventListeners[_local2];
aEventListeners.splice(_local2, 1);
}
_local2++;
}
}
function doSoundComplete() {
if (bNeedFreshStart && (nRemainingLoop > 1)) {
sndObj.start(0, nRemainingLoop - 1);
} else {
doManageEndEvent();
}
}
function doUpdateSound() {
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
function doMute() {
bMuted = true;
doUpdateSound();
}
function doUnMute() {
bMuted = false;
doUpdateSound();
}
function doPause() {
sndObj.stop();
bPaused = true;
}
function doResume() {
bPaused = false;
bNeedFreshStart = true;
sndObj.start(nCurrentTime / 1000, 1);
}
function doStart(_nLoop) {
if (_nLoop == undefined) {
_nLoop = 1;
}
if (sLinkage.indexOf(".mp3") != -1) {
sndObj.start(0.015, _nLoop);
} else {
sndObj.start(0, _nLoop);
}
}
function doStop() {
sndObj.stop();
doManageEndEvent();
}
function doFadeTo(_nVolume, _bStopAndDelete) {
if (_bStopAndDelete == undefined) {
_bStopAndDelete = true;
}
bStopAfterFade = _bStopAndDelete;
nTargetVolume = _nVolume;
}
function setFadeRate(_nRate) {
if (_nRate == undefined) {
_nRate = nFADE_RATE;
}
nFadeRate = _nRate;
}
function setFadeAtEnd(_bFadeAtEnd) {
bFadeAtEnd = true;
}
function setPan(_nPan) {
sndObj.setPan(_nPan);
}
function get Category() {
return(sCategory);
}
function get LinkageName() {
return(sLinkage);
}
function doDestroy() {
sndObj.stop();
delete sndObj;
mcRef.removeMovieClip();
}
function doCheckFadeAtEnd() {
if (bFadeAtEnd) {
if (nRemainingLoop == 1) {
if ((sndObj.duration - nCurrentTime) <= nFADE_AT_END_TIME) {
doFadeTo(0);
}
}
}
}
function doManageEndEvent() {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
aEventListeners[_local2].doSoundEvent(com.sarbakan.sound.SoundManager.nEVENT_SOUND_COMPLETE, this);
_local2++;
}
aEventListeners = new Array();
mcRef.removeMovieClip();
delete mcRef;
delete aEventListeners;
delete sndObj.onSoundComplete;
delete sndObj;
}
function doManageFade() {
if (nCurrentVolume != nTargetVolume) {
nCurrentVolume = com.sarbakan.utils.MoreMath.getReachNum(nCurrentVolume, nTargetVolume, nFadeRate);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
if ((nCurrentVolume <= 0) && (bStopAfterFade)) {
sndObj.stop();
doManageEndEvent();
}
}
function returnComputedVolume(_nVolume) {
var _local2;
if ((!bMuted) && (!com.sarbakan.sound.SoundManager.isCategoryMuted(sCategory))) {
var _local3 = com.sarbakan.sound.SoundManager.__get__MasterVolume() / 100;
var _local4 = com.sarbakan.sound.SoundManager.getCategoryVolume(sCategory) / 100;
_local2 = _nVolume;
_local2 = _local2 * _local4;
_local2 = _local2 * _local3;
} else {
_local2 = 0;
}
return(_local2);
}
static var nFADE_RATE = 8;
static var nFADE_AT_END_TIME = 800;
}
Symbol 1904 MovieClip [__Packages.com.sarbakan.utils.MoreMath] Frame 0
class com.sarbakan.utils.MoreMath
{
function MoreMath () {
}
static function getRandomRange(__nMin, __nMax) {
return(Math.floor(Math.random() * ((__nMax + 1) - __nMin)) + __nMin);
}
static function getPolarity(__nNum) {
var _local1 = 0;
if (__nNum < 0) {
_local1 = -1;
} else if (__nNum > 0) {
_local1 = 1;
}
return(_local1);
}
static function getReachZero(__nNum, __nReducer) {
return(getReachNum(__nNum, 0, __nReducer));
}
static function getReachNum(__nNum, __nTargetNum, __nReducer) {
var _local1 = __nNum;
if (_local1 != __nTargetNum) {
if (_local1 < __nTargetNum) {
_local1 = _local1 + __nReducer;
if (_local1 > __nTargetNum) {
_local1 = __nTargetNum;
}
} else {
_local1 = _local1 - __nReducer;
if (_local1 < __nTargetNum) {
_local1 = __nTargetNum;
}
}
}
return(_local1);
}
static function getDistance(__nX1, __nY1, __nX2, __nY2) {
return(Math.sqrt(Math.pow(Math.abs(__nX2 - __nX1), 2) + Math.pow(Math.abs(__nY2 - __nY1), 2)));
}
static function getManhattanDistance(_x1, _y1, _x2, _y2) {
return(Math.abs(_x1 - _x2) + Math.abs(_y1 - _y2));
}
static function getHypotenuse(__nDX, __nDY) {
return(Math.sqrt(Math.pow(__nDX, 2) + Math.pow(__nDY, 2)));
}
static function getAngle(__nX1, __nY1, __nX2, __nY2) {
var _local2;
var _local1;
var _local4;
var _local3;
_local2 = __nX2 - __nX1;
_local1 = __nY2 - __nY1;
_local4 = Math.atan2(_local1, _local2);
_local3 = getDegreeFromRadius(_local4);
return(_local3);
}
static function getCleanedAngle(_nAngle) {
while (_nAngle < 360) {
_nAngle = _nAngle + 360;
}
_nAngle = _nAngle % 360;
return(_nAngle);
}
static function getDegreeFromRadius(__nRadius) {
var _local1 = (__nRadius / MATH_PI) * 180;
return(_local1);
}
static function getRadianFromDegree(__nDegree) {
var _local1 = __nDegree * (MATH_PI / 180);
return(_local1);
}
static function getBoundsCenter(_oBox) {
var _local3 = (_oBox.xMin + _oBox.xMax) / 2;
var _local2 = (_oBox.yMin + _oBox.yMax) / 2;
return({x:_local3, y:_local2});
}
static var MATH_PI = Math.PI;
}
Symbol 1905 MovieClip [__Packages.com.disney.gem.games.kp_ice.GameData] Frame 0
class com.disney.gem.games.kp_ice.GameData
{
function GameData () {
}
static var nKEYCODE_LEFT = 37;
static var nKEYCODE_RIGHT = 39;
static var nKEYCODE_JUMP = 38;
static var nKEYCODE_CROUCH = 40;
static var nKEYCODE_ATTACK = String("B").charCodeAt(0);
static var nKEYCODE_USE = 32;
static var nKEYCODE_SWITCH = String("K").charCodeAt(0);
static var nTOTAL_LEVEL = 3;
static var nGAME_LIFE = 5;
static var nENERGY_FULL = 100;
static var nHURT_PLAYER_ENNEMY = 10;
static var nHURT_ENNEMY_NORMAL = 34;
static var nHURT_ENNEMY_GHOST = 20;
static var nSCORE_POTION = 250;
static var nSCORE_ENNEMY = 500;
static var nSTAGE_WIDTH = 580;
static var nSTAGE_HEIGHT = 410;
static var nVisualCamera_SPEED_NORMAL = 15;
static var nVisualCamera_SPEED_FAST = 22;
static var nVOLUME_MUSIC = 70;
static var nVOLUME_SOUND = 100;
static var sBUTTON_ROLL = "ButtonRoll_02.wav";
static var sBUTTON_CLICK = "ButtonClick_02.wav";
static var sTRANSITION = "Transition.wav";
static var aKIM_JUMPS = ["KimJump_without_landing_01.wav", "KimJump_without_landing_02.wav"];
static var sKIM_LAND = "KimLand.wav";
static var aKIM_FOOTSTEPS = ["KimFootstep1.wav", "KimFootstep2.wav", "KimFootstep3.wav"];
static var sKIM_DIES = "KimDies.wav";
static var sKIM_HURT = "KimHurt.wav";
static var sKIM_ATTACK = "KimAttack_01.wav";
static var aKIM_SHOOT_IN = ["HookIn_01.wav", "HookIn_03.wav", "HookIn_04.wav"];
static var aKIM_SHOOT_OUT = ["HookOut_01.wav", "HookOut_02.wav", "HookOut_03.wav", "HookOut_04.wav"];
static var sKIM_SLIDE = "KimSlide.wav";
static var sKIM_TURN = "TurnSwoosh_03_fixed.wav";
static var aRON_JUMPS = ["RonJump_without_landing_01.wav", "RonJump_without_landing_02.wav", "RonJump_without_landing_03.wav"];
static var sRON_LAND = "RonLand.wav";
static var aRON_FOOTSTEPS = ["RonFootstep1.wav", "RonFootstep2.wav", "RonFootstep3.wav"];
static var sRON_DIES = "RonDies.wav";
static var sRON_HURT = "RonHurt.wav";
static var sRON_ATTACK = "RonAttack_01.wav";
static var sRON_TURN = "TurnSwoosh_02_fixed.wav";
static var sRUFUS_IN = "RufusIn_01.wav";
static var sRUFUS_OUT = "RufusOut.wav";
static var sRUFUS_WALKS = "RufusWalk.wav";
static var sRUFUS_PRESS = "RufusPressSwitch.wav";
static var sSWITCH_ON = "ActivateSwitch_on.wav";
static var sSWITCH_OFF = "ActivateSwitch_off.wav";
static var aDOOR_OPENING = ["DoorblockOpening.wav", "DoorblockOpening_02.wav", "DoorblockOpening_03.wav"];
static var aDOOR_CLOSING = ["DoorblockClosing.wav", "DoorblockClosing_03.wav"];
static var sLASER_ON = "LaserOn.wav";
static var sLASER_OFF = "LaserOff.wav";
static var aLASER_BUZZ = ["LaserBuzz_01.wav", "LaserBuzz_02.wav", "LaserBuzz_03.wav", "LaserBuzz_04.wav"];
static var sHENCHMAN_ATTACK = "HenchAttack_01.wav";
static var sHENCHMAN_DIES = "HenchDies_02.wav";
static var sHENCHMAN_HURT = "HenchHurt.wav";
static var sKIMUNICATOR_FOUND = "Kimunnicator.wav";
static var sKIMUNICATOR_USE = "KimunnicatorUse.wav";
static var sBONUS_BATTERY = "BonusBattery.wav";
static var sBONUS_HEALTH = "BonusHealth.wav";
static var sBOSS_MOVING = "BossMoving.wav";
static var aBOSS_ATTACK = ["BossAttack1.wav", "BossAttack2.wav", "BossAttack3.wav"];
static var aBOSS_HURT = ["BossHurt1.wav", "BossHurt2.wav"];
static var sELECTRIC_CABLE = "ElectricCableBuzz.wav";
}
Symbol 1906 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.boss.BossAI] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.boss.BossAI extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
static var oBossAI;
var setLinkage, setMC, oArmLeft, oArmRight, oActiveArm, nTargetHeadFrame, bActivated, bMoving, bDead, aActivatedWires, nLife, setState, aWireCombination, removeReferenceMC, attachMC, mc, nTimerAttack, nTimerMovement, oTargetPlayer, nHurtTimer, getGlobalPos, nLastHeadFrame, stateFinished;
function BossAI (_mcBoss, _mcLeftRail, _mcRightRail) {
super("boss" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcBoss");
setMC(_mcBoss);
oArmLeft = new com.disney.gem.games.kp_ice.elements.characters.boss.Arm(_mcLeftRail.mcVerticalRail.mcArm, this, _mcLeftRail);
oArmRight = new com.disney.gem.games.kp_ice.elements.characters.boss.Arm(_mcRightRail.mcVerticalRail.mcArm, this, _mcRightRail);
var _local3 = [oArmLeft, oArmRight];
oActiveArm = _local3[Math.floor(Math.random() * _local3.length)];
nTargetHeadFrame = 50;
bActivated = false;
bMoving = false;
oBossAI = this;
bDead = false;
aActivatedWires = new Array();
aWIRES = new Array();
nLife = nSTARTING_LIFE;
setState(sSTATE_IDLE);
aWireCombination = com.disney.gem.games.kp_ice.sarbakan.utils.Tools.copyArray(aWIRE_COMBINATIONS);
}
function init() {
removeReferenceMC();
attachMC();
oArmLeft.init();
oArmRight.init();
mc.swapDepths(nBOSS_DEPTH);
oArmLeft.__get__HorizontalRail().swapDepths(nBOSS_DEPTH + 10);
oArmRight.__get__HorizontalRail().swapDepths(nBOSS_DEPTH + 20);
}
function activate() {
bActivated = true;
var _local2 = 0;
while (_local2 < com.disney.gem.games.kp_ice.elements.Hook.aHOOKS.length) {
if (com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local2]).sName == "hookBoss") {
com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local2]).use(false);
break;
}
_local2++;
}
nTimerAttack = 0;
nTimerMovement = nTIMER_MOVEMENT;
}
function armsDone(_oArmDone) {
oActiveArm.getBack();
switchArm();
oTargetPlayer = undefined;
nTimerMovement = nTIMER_MOVEMENT;
}
function get TargetedPlayer() {
return(oTargetPlayer);
}
function addWire(_oWire) {
aWIRES.push(_oWire);
}
static function getInstance() {
return(oBossAI);
}
function wireUsed(_oWire) {
aActivatedWires.push(_oWire);
if (aActivatedWires.length >= 2) {
var _local4 = com.disney.gem.games.kp_ice.elements.characters.boss.Wire(aActivatedWires[0]);
var _local3 = com.disney.gem.games.kp_ice.elements.characters.boss.Wire(aActivatedWires[1]);
if (_local4.sName != _local3.sName) {
var _local2 = 0;
while (_local2 < aWireCombination.length) {
if (((_local4.sName == aWireCombination[_local2][0]) || (_local4.sName == aWireCombination[_local2][1])) && ((_local3.sName == aWireCombination[_local2][0]) || (_local3.sName == aWireCombination[_local2][1]))) {
nHurtTimer = nTIMER_HURT_FRAME;
_local4.fire();
_local3.fire();
nLife--;
aWireCombination.splice(_local2, 1);
break;
}
_local2++;
}
}
var _local2 = 0;
while (_local2 < aActivatedWires.length) {
com.disney.gem.games.kp_ice.elements.characters.boss.Wire(aActivatedWires[_local2]).shutOff();
_local2++;
}
aActivatedWires = new Array();
}
}
function getGlobalCoords(_mc) {
return(getGlobalPos(_mc));
}
function onEnable() {
setState(sSTATE_IDLE);
}
function update() {
super.update();
oArmLeft.update();
oArmRight.update();
if (bActivated) {
checkTimers();
checkMovement();
checkHurtTimer();
}
}
function state_Idle_init() {
mc.mcState.BossHead.gotoAndStop(nLastHeadFrame);
}
function state_Attack_init() {
mc.mcState.BossHead.gotoAndStop(nLastHeadFrame);
}
function state_Idle() {
var _local2 = oTargetPlayer;
if (_local2 == undefined) {
_local2 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer;
}
nTargetHeadFrame = Math.ceil((100 * getGlobalCoords(_local2.mc).x) / com.disney.gem.games.kp_ice.GameData.nSTAGE_WIDTH);
if (mc.mcState.BossHead._currentframe > nTargetHeadFrame) {
mc.mcState.BossHead.prevFrame();
} else {
mc.mcState.BossHead.nextFrame();
}
nLastHeadFrame = mc.mcState.BossHead._currentframe;
}
function state_Attack() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
state_Idle();
}
function state_Hit() {
if (stateFinished()) {
if (nLife > 0) {
setState(sSTATE_IDLE);
} else {
setState(sSTATE_IDLE, true, true);
com.disney.gem.games.kp_ice.Controller.getInstance().onWin();
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.bControlsLock = true;
com.disney.gem.games.kp_ice.Controller.getInstance().increaseScore(com.disney.gem.games.kp_ice.GameData.nSCORE_ENNEMY);
}
}
}
function move() {
bMoving = true;
}
function attack() {
bMoving = false;
if (!bDead) {
setState(sSTATE_ATTACK);
}
oActiveArm.attack();
}
function checkTimers() {
if (nTimerAttack > 0) {
nTimerAttack--;
if (nTimerAttack == 0) {
attack();
}
}
if (nTimerMovement > 0) {
nTimerMovement--;
if (nTimerMovement == 0) {
move();
nTimerAttack = nTIMER_ATTACK;
}
}
}
function checkMovement() {
if (bMoving) {
if (oTargetPlayer != undefined) {
var _local2 = getGlobalPos(oActiveArm.__get__ClawFront());
var _local3 = getGlobalPos(oTargetPlayer.mc);
if (oActiveArm == oArmRight) {
if (_local3.x < _local2.x) {
if (oActiveArm.__get__HorizontalRail()._currentframe != oActiveArm.__get__HorizontalRail()._totalframes) {
oActiveArm.__get__HorizontalRail().nextFrame();
}
} else if (_local3.x > _local2.x) {
if (oActiveArm.__get__HorizontalRail()._currentframe != 1) {
oActiveArm.__get__HorizontalRail().prevFrame();
}
}
} else if (_local3.x > _local2.x) {
if (oActiveArm.__get__HorizontalRail()._currentframe != oActiveArm.__get__HorizontalRail()._totalframes) {
oActiveArm.__get__HorizontalRail().nextFrame();
}
} else if (_local3.x < _local2.x) {
if (oActiveArm.__get__HorizontalRail()._currentframe != 1) {
oActiveArm.__get__HorizontalRail().prevFrame();
}
}
if ((_local3.y - nPLAYER_HEIGHT) > _local2.y) {
if (oActiveArm.__get__VerticalRail()._currentframe != oActiveArm.__get__HorizontalRail()._totalframes) {
oActiveArm.__get__VerticalRail().nextFrame();
}
} else if ((_local3.y + nPLAYER_HEIGHT) < _local2.y) {
if (oActiveArm.__get__VerticalRail()._currentframe != 1) {
oActiveArm.__get__VerticalRail().prevFrame();
}
}
} else {
setTargetPlayer();
}
}
}
function setTargetPlayer() {
var _local3 = getGlobalPos(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.mc);
var _local2 = getGlobalPos(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.mc);
if (oActiveArm == oArmLeft) {
if (_local3.x < _local2.x) {
oTargetPlayer = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1;
} else {
oTargetPlayer = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2;
}
} else if (_local3.x > _local2.x) {
oTargetPlayer = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1;
} else {
oTargetPlayer = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2;
}
}
function switchArm() {
if (oActiveArm == oArmLeft) {
oActiveArm = oArmRight;
} else {
oActiveArm = oArmLeft;
}
}
function checkHurtTimer() {
if (nHurtTimer > 0) {
nHurtTimer--;
if (nHurtTimer <= 0) {
setState(sSTATE_HURT, true);
if (nLife <= 0) {
bDead = true;
}
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.aBOSS_HURT[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aBOSS_HURT.length)], com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
}
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_ATTACK = "Attack";
static var sSTATE_HURT = "Hit";
static var nSTARTING_LIFE = 3;
static var nBOSS_DEPTH = 30000;
static var nTIMER_ATTACK = 100;
static var nTIMER_MOVEMENT = 40;
static var aWIRES = new Array();
static var aWIRE_COMBINATIONS = [["mcWire1", "mcWire4"], ["mcWire1", "mcWire3"], ["mcWire2", "mcWire4"]];
static var nTIMER_HURT_FRAME = 60;
static var nPLAYER_HEIGHT = 40;
}
Symbol 1907 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.boss.Arm] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.boss.Arm extends com.sarbakan.utils.StateManaged
{
var oBoss, oClaw, mcHorizontalRail, mcVerticalRail, setMC, bGetBack, setState, stateFinished, nUnstretchStart, __get__Mc;
function Arm (_mcArm, _oBoss, _mcRail) {
super(_mcArm);
oBoss = _oBoss;
oClaw = new com.disney.gem.games.kp_ice.elements.characters.boss.Claw(_mcArm.mcState.mcClaw, this);
mcHorizontalRail = _mcRail;
mcVerticalRail = _mcRail.mcVerticalRail;
setMC(_mcArm);
bGetBack = false;
}
function init() {
oClaw.init();
setState(sSTATE_IDLE);
mcHorizontalRail.stop();
mcVerticalRail.stop();
}
function get HorizontalRail() {
return(mcHorizontalRail);
}
function get VerticalRail() {
return(mcVerticalRail);
}
function get ClawFront() {
return(oClaw.__get__ClawFront());
}
function attack() {
setState(sSTATE_STRETCH);
oClaw.attack();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.aBOSS_ATTACK[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aBOSS_ATTACK.length)], com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function getBack() {
bGetBack = true;
}
function update() {
super.onUpdate();
oClaw.update();
checkGetBack();
}
function state_Idle_init() {
}
function state_Stretching_init() {
state_Idle_init();
}
function state_Stretching() {
if (stateFinished()) {
setState(sSTATE_UNSTRETCH);
}
checkCollisions();
}
function state_Unstretching_init() {
if (nUnstretchStart != undefined) {
__get__Mc().mcState.gotoAndPlay(__get__Mc().mcState._totalframes - (nUnstretchStart * 2));
nUnstretchStart = undefined;
}
state_Idle_init();
}
function state_Unstretching() {
if (stateFinished()) {
setState(sSTATE_IDLE);
oBoss.armsDone(this);
}
}
function checkGetBack() {
if (bGetBack) {
if (HorizontalRail._currentframe > 1) {
HorizontalRail.prevFrame();
} else if (VerticalRail._currentframe > 1) {
VerticalRail.prevFrame();
} else {
bGetBack = false;
}
}
}
function checkCollisions() {
var _local3 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("wall").getMC();
var _local2 = oBoss.getGlobalCoords(oClaw.__get__Mc());
if (_local3.hitTest(_local2.x, _local2.y, true)) {
nUnstretchStart = __get__Mc().mcState._currentframe;
setState(sSTATE_UNSTRETCH, true);
}
if (oClaw.__get__ClawFront().hitTest(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.mc.body)) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.hurt(com.disney.gem.games.kp_ice.elements.characters.boss.Claw.nCLAW_DAMAGE);
}
if (oClaw.__get__ClawFront().hitTest(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.mc.body)) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.hurt(com.disney.gem.games.kp_ice.elements.characters.boss.Claw.nCLAW_DAMAGE);
}
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_STRETCH = "Stretching";
static var sSTATE_UNSTRETCH = "Unstretching";
}
Symbol 1908 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.boss.Claw] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.boss.Claw extends com.sarbakan.utils.StateManaged
{
var oArm, setState, __get__Mc, stateFinished;
function Claw (_mcClaw, _oArm) {
super(_mcClaw);
oArm = _oArm;
}
function init() {
setState(sSTATE_IDLE);
}
function get ClawFront() {
return(__get__Mc().front);
}
function attack() {
setState(sSTATE_CLOSING);
}
function setMC(_mc) {
super.setMC(_mc);
setState(sSTATE_IDLE);
}
function update() {
super.onUpdate();
}
function state_Closing() {
if (stateFinished()) {
setState(sSTATE_IDLE, true);
}
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_CLOSING = "Closing";
static var nCLAW_DAMAGE = 10;
}
Symbol 1909 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Hook] Frame 0
class com.disney.gem.games.kp_ice.elements.Hook extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var sName, bHidden, setLinkage, setMC, DEFAULT_STATE, removeReferenceMC, attachMC, setState, sState, stateFinished;
function Hook (_mc, _bHidden) {
super("hook" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
sName = _mc._name;
bHidden = _bHidden;
setLinkage("mcHook");
setMC(_mc);
if (bHidden) {
DEFAULT_STATE = sSTATE_OFF;
} else {
DEFAULT_STATE = sSTATE_IDLE;
}
aHOOKS.push(this);
}
function init() {
removeReferenceMC();
attachMC();
if (bHidden) {
setState(sSTATE_TURN_OFF);
DEFAULT_STATE = sSTATE_OFF;
} else {
setState(sSTATE_TURN_ON);
DEFAULT_STATE = sSTATE_IDLE;
}
}
function use(_bHidden) {
if (bHidden != _bHidden) {
bHidden = _bHidden;
if (bHidden) {
setState(sSTATE_TURN_OFF);
DEFAULT_STATE = sSTATE_OFF;
} else {
setState(sSTATE_TURN_ON);
DEFAULT_STATE = sSTATE_IDLE;
}
}
}
function isOn() {
return(sState == sSTATE_IDLE);
}
function isReady() {
return(true);
}
static function destroy() {
aHOOKS = new Array();
}
function state_turnOff() {
if (stateFinished()) {
setState(sSTATE_OFF);
}
}
function state_turnOn() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
static var aHOOKS = new Array();
static var sSTATE_IDLE = "idle";
static var sSTATE_OFF = "off";
static var sSTATE_TURN_ON = "turnOn";
static var sSTATE_TURN_OFF = "turnOff";
}
Symbol 1910 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.boss.Wire] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.boss.Wire extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var sName, setLinkage, setMC, bOn, removeReferenceMC, attachMC, mc, oControllingSwitch, setState, stateFinished;
function Wire (_mcRef) {
super("wire" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
sName = _mcRef._name;
setLinkage(sName);
setMC(_mcRef);
bOn = false;
}
function init() {
super.init();
removeReferenceMC();
attachMC();
mc.swapDepths(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.nBOSS_DEPTH + nDepth);
nDepth++;
com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.getInstance().addWire(this);
}
function use(_bUse) {
bOn = !bOn;
com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.getInstance().wireUsed(this);
}
function setSwitch(_oSwitch) {
oControllingSwitch = _oSwitch;
}
function shutOff() {
oControllingSwitch.shutOff();
}
function fire() {
setState(sSTATE_LIGHT, true);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sELECTRIC_CABLE, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function onEnable() {
var _local2 = mc.getDepth();
mc.swapDepths((com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.nBOSS_DEPTH + _local2) + 1000);
}
function isReady() {
return(true);
}
function state_Light() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_LIGHT = "Light";
static var nDepth = 5000;
}
Symbol 1911 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Door] Frame 0
class com.disney.gem.games.kp_ice.elements.Door extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var bHidden, nOrientation, sName, setLinkage, setMC, removeReferenceMC, attachMC, setState, DEFAULT_STATE, sState, mcBlockedDoor, mcBlockedCeil, aBlocksShown, mc, nHeightToUse, aBlocksHidden, collideWithMap, nDiffSpacing;
function Door (_mc, _nOrientation, _bHidden) {
super("door" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
bHidden = _bHidden;
nOrientation = _nOrientation;
sName = _mc._name;
if (nOrientation == nORIENTATION_FLOOR) {
setLinkage("mcDoorToFloor");
} else if (nOrientation == nORIENTATION_CEIL) {
setLinkage("mcDoorToCeil");
} else if (nOrientation == nORIENTATION_WALL) {
setLinkage("mcDoorToWall");
}
setMC(_mc);
aDOORS.push(this);
}
function init() {
removeReferenceMC();
attachMC();
if (bHidden) {
setState(sSTATE_OPEN);
DEFAULT_STATE = sSTATE_OPEN;
} else {
setState(sSTATE_CLOSED);
DEFAULT_STATE = sSTATE_CLOSED;
}
}
function enable() {
super.enable();
setHeight();
}
function use(_bHidden) {
if (bHidden != _bHidden) {
bHidden = _bHidden;
if (bHidden) {
setState(sSTATE_OPENING);
DEFAULT_STATE = sSTATE_OPEN;
} else {
setState(sSTATE_CLOSING);
DEFAULT_STATE = sSTATE_CLOSED;
}
}
}
static function destroy() {
aDOORS = new Array();
}
function isReady() {
return((sState == sSTATE_CLOSED) || (sState == sSTATE_OPEN));
}
function state_closing_init() {
setHeight();
hideUnusedBlocks();
hideUsedBlocks();
}
function state_closing() {
closeBlocks();
}
function state_closed_init() {
setHeight();
hideUnusedBlocks();
if (mcBlockedDoor != undefined) {
mcBlockedDoor.removeMovieClip();
}
if (mcBlockedCeil != undefined) {
mcBlockedCeil.removeMovieClip();
}
mcBlockedDoor = setColliderSurface();
mcBlockedCeil = setCeillingSurface();
}
function state_opening_init() {
setHeight();
hideUnusedBlocks();
}
function state_opening() {
openBlocks();
}
function state_open_init() {
setHeight();
hideUnusedBlocks();
hideUsedBlocks();
if (mcBlockedDoor != undefined) {
mcBlockedDoor.removeMovieClip();
}
if (mcBlockedCeil != undefined) {
mcBlockedCeil.removeMovieClip();
}
}
function setColliderSurface() {
var _local3;
var _local5 = new flash.geom.Rectangle();
var _local6;
var _local4;
switch (nOrientation) {
case nORIENTATION_CEIL :
case nORIENTATION_FLOOR :
_local3 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("ceiling");
_local6 = aBlocksShown[0].getRect(_local3.mc);
var _local2 = 0;
while (_local2 < aBlocksShown.length) {
if (!aBlocksShown[_local2]._visible) {
_local4 = aBlocksShown[_local2].getRect(_local3.mc);
break;
}
if (_local2 == (aBlocksShown.length - 1)) {
_local4 = aBlocksShown[_local2].getRect(_local3.mc);
}
_local2++;
}
_local5.topLeft = new flash.geom.Point(_local6.xMin, _local6.yMin);
_local5.bottomRight = new flash.geom.Point(_local4.xMax, _local4.yMax);
break;
case nORIENTATION_WALL :
_local3 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("ceiling");
_local6 = aBlocksShown[0].getRect(_local3.mc);
_local2 = 0;
while (_local2 < aBlocksShown.length) {
if (!aBlocksShown[_local2]._visible) {
_local4 = aBlocksShown[_local2].getRect(_local3.mc);
break;
}
if (_local2 == (aBlocksShown.length - 1)) {
_local4 = aBlocksShown[_local2].getRect(_local3.mc);
}
_local2++;
}
_local5.topLeft = new flash.geom.Point(_local4.xMin, _local4.yMin);
_local5.bottomRight = new flash.geom.Point(_local6.xMax, _local6.yMax);
}
var _local7 = _local3.attachMC("mcCruncherZone", _local5.left, _local5.top, "doorZone" + nDOOR_ID);
nDOOR_ID++;
_local7._width = _local5.width;
_local7._height = _local5.height;
return(_local7);
}
function setCeillingSurface() {
var _local4;
var _local5 = new flash.geom.Rectangle();
var _local6;
var _local3;
switch (nOrientation) {
case nORIENTATION_CEIL :
case nORIENTATION_FLOOR :
_local4 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("wall");
_local6 = aBlocksShown[0].getRect(_local4.mc);
var _local2 = 0;
while (_local2 < aBlocksShown.length) {
if (!aBlocksShown[_local2]._visible) {
_local3 = aBlocksShown[_local2].getRect(_local4.mc);
break;
}
if (_local2 == (aBlocksShown.length - 1)) {
_local3 = aBlocksShown[_local2].getRect(_local4.mc);
}
_local2++;
}
_local5.topLeft = new flash.geom.Point(_local6.xMin, _local6.yMin);
_local5.bottomRight = new flash.geom.Point(_local3.xMax, _local3.yMax);
break;
case nORIENTATION_WALL :
_local4 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("floor");
_local6 = aBlocksShown[0].getRect(_local4.mc);
_local2 = 0;
while (_local2 < aBlocksShown.length) {
if (!aBlocksShown[_local2]._visible) {
_local3 = aBlocksShown[_local2].getRect(_local4.mc);
break;
}
if (_local2 == (aBlocksShown.length - 1)) {
_local3 = aBlocksShown[_local2].getRect(_local4.mc);
}
_local2++;
}
if (mc._rotation >= 180) {
_local5.topLeft = new flash.geom.Point(_local6.xMin, _local3.yMin);
_local5.bottomRight = new flash.geom.Point(_local3.xMax, _local6.yMax);
} else {
_local5.topLeft = new flash.geom.Point(_local3.xMin, _local3.yMin);
_local5.bottomRight = new flash.geom.Point(_local6.xMax, _local6.yMax);
}
}
var _local7 = _local4.attachMC("mcCruncherZone", _local5.left, _local5.top, "doorZone" + nDOOR_ID);
nDOOR_ID++;
_local7._width = _local5.width;
_local7._height = _local5.height;
return(_local7);
}
function setHeight() {
if (nHeightToUse == undefined) {
if (mc.mcState != undefined) {
aBlocksShown = new Array();
aBlocksHidden = new Array();
aBlocksShown.push(mc.mcState.mcBlock0, mc.mcState.mcBlock1, mc.mcState.mcBlock2, mc.mcState.mcBlock3, mc.mcState.mcBlock4, mc.mcState.mcBlock5, mc.mcState.mcBlock6, mc.mcState.mcBlock7, mc.mcState.mcBlock8, mc.mcState.mcBlock9, mc.mcState.mcBlock10, mc.mcState.mcBlock11, mc.mcState.mcBlock12, mc.mcState.mcBlock13, mc.mcState.mcBlock14, mc.mcState.mcBlock15);
var _local5;
switch (nOrientation) {
case nORIENTATION_FLOOR :
_local5 = "floor";
break;
case nORIENTATION_CEIL :
_local5 = "ceiling";
break;
case nORIENTATION_WALL :
_local5 = "wall";
}
var _local2 = 0;
while (_local2 < nSEARCH_MAX_HEIGHT) {
mc.mcState.mcDoorEnd._y = mc.mcState.mcDoorEnd._y - _local2;
if (collideWithMap(_local5, mc.mcState.mcDoorEnd)) {
nHeightToUse = Math.abs(mc.mcState.mcDoorEnd._y);
break;
}
_local2++;
}
if (nHeightToUse != undefined) {
var _local6 = mc.mcState.mcBlock0;
var _local4 = Math.ceil(nHeightToUse / _local6._height);
nHeightToUse = nHeightToUse + ((_local4 * _local6._height) - nHeightToUse);
_local2 = 0;
while (_local2 < aBlocksShown.length) {
if (_local2 >= _local4) {
var _local3 = aBlocksShown.splice(_local2, 1);
aBlocksHidden.push(_local3[0]);
_local2--;
} else {
aBlocksShown[_local2].stop();
}
_local2++;
}
nDiffSpacing = Math.abs(mc.mcState.mcDoorEnd._y - (MovieClip(aBlocksShown[aBlocksShown.length - 2])._y - _local6._height));
if (nOrientation == nORIENTATION_WALL) {
mc._x = mc._x + ((_local4 * _local6._height) - nHeightToUse);
} else {
mc._y = mc._y - ((_local4 * _local6._height) - nHeightToUse);
}
hideUnusedBlocks();
}
}
} else {
var _local2 = 0;
while (_local2 < aBlocksShown.length) {
aBlocksShown[_local2].stop();
_local2++;
}
}
}
function closeBlocks() {
var _local2;
var _local3 = 0;
while (_local3 < aBlocksShown.length) {
_local2 = aBlocksShown[_local3];
if (!_local2._visible) {
_local2._visible = true;
_local2.gotoAndStop(_local2._totalframes);
var _local4 = com.disney.gem.games.kp_ice.GameData.aDOOR_CLOSING[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aDOOR_CLOSING.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local4, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
break;
}
if (_local2._currentframe != 1) {
break;
}
if (_local2 == aBlocksShown[aBlocksShown.length - 1]) {
setState(sSTATE_CLOSED);
}
if (mcBlockedDoor != undefined) {
mcBlockedDoor.removeMovieClip();
}
if (mcBlockedCeil != undefined) {
mcBlockedCeil.removeMovieClip();
}
mcBlockedDoor = setColliderSurface();
mcBlockedCeil = setCeillingSurface();
_local3++;
}
_local2.prevFrame();
MovieClip(aBlocksShown[aBlocksShown.length - 1])._height = nDiffSpacing;
}
function openBlocks() {
var _local3;
var _local2 = aBlocksShown.length - 1;
while (_local2 >= 0) {
_local3 = aBlocksShown[_local2];
if (_local3._visible) {
break;
}
_local2--;
}
_local3.nextFrame();
MovieClip(aBlocksShown[aBlocksShown.length - 1])._height = nDiffSpacing;
if (_local3._currentframe == _local3._totalframes) {
_local3._visible = false;
if (_local3 == aBlocksShown[0]) {
setState(sSTATE_OPEN);
}
if (mcBlockedDoor != undefined) {
mcBlockedDoor.removeMovieClip();
}
if (mcBlockedCeil != undefined) {
mcBlockedCeil.removeMovieClip();
}
mcBlockedDoor = setColliderSurface();
mcBlockedCeil = setCeillingSurface();
var _local4 = com.disney.gem.games.kp_ice.GameData.aDOOR_OPENING[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aDOOR_OPENING.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local4, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
}
function hideUnusedBlocks() {
var _local2 = 0;
while (_local2 < aBlocksHidden.length) {
aBlocksHidden[_local2]._visible = false;
_local2++;
}
MovieClip(aBlocksShown[aBlocksShown.length - 1])._height = nDiffSpacing;
}
function hideUsedBlocks() {
var _local2 = 0;
while (_local2 < aBlocksShown.length) {
aBlocksShown[_local2]._visible = false;
_local2++;
}
MovieClip(aBlocksShown[aBlocksShown.length - 1])._height = nDiffSpacing;
}
static var nORIENTATION_FLOOR = 0;
static var nORIENTATION_CEIL = 1;
static var nORIENTATION_WALL = 2;
static var sSTATE_OPEN = "open";
static var sSTATE_OPENING = "opening";
static var sSTATE_CLOSING = "closing";
static var sSTATE_CLOSED = "closed";
static var nSEARCH_START_HEIGHT = 50;
static var nSEARCH_MAX_HEIGHT = 1000;
static var aDOORS = new Array();
static var nDOOR_ID = 0;
}
Symbol 1912 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Laser] Frame 0
class com.disney.gem.games.kp_ice.elements.Laser extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var nOrientation, bTurnedOn, sName, setLinkage, DEFAULT_STATE, setMC, removeReferenceMC, attachMC, setState, stateFinished, collideWithElementBox, mc, getElement, nTimer, sState;
function Laser (_mc, _nOrientation, _bTurnedOn) {
super("Laser" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
nOrientation = _nOrientation;
bTurnedOn = _bTurnedOn;
sName = _mc._name;
switch (nOrientation) {
case nORIENTATION_FLOOR :
setLinkage("mcLaserFloorNormal");
break;
case nORIENTATION_CEIL :
setLinkage("mcLaserCeilNormal");
}
if (bTurnedOn) {
DEFAULT_STATE = sSTATE_IDLE;
} else {
DEFAULT_STATE = sSTATE_OFF;
}
setMC(_mc);
aLASERS.push(this);
}
function init() {
removeReferenceMC();
attachMC();
}
function use(_bTurnOn) {
if (bTurnedOn != _bTurnOn) {
bTurnedOn = _bTurnOn;
if (!bTurnedOn) {
setState(sSTATE_TURN_OFF, true);
DEFAULT_STATE = sSTATE_OFF;
} else {
setState(sSTATE_TURN_ON, true);
DEFAULT_STATE = sSTATE_IDLE;
}
}
}
static function respawnAfter(_nX) {
var _local1 = 0;
while (_local1 < aLASERS.length) {
if (com.disney.gem.games.kp_ice.elements.Laser(aLASERS[_local1]).getCoord().x < _nX) {
com.disney.gem.games.kp_ice.elements.Laser(aLASERS[_local1]).remove();
}
_local1++;
}
}
function isReady() {
return(true);
}
static function destroy() {
aLASERS = new Array();
}
function state_buzz_init() {
var _local1 = com.disney.gem.games.kp_ice.GameData.aLASER_BUZZ[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aLASER_BUZZ.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local1, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_idle_init() {
}
function state_buzz() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_idle() {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.id, mc.mcState.mcHit)) {
if (!com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.isGrappling()) {
com.disney.gem.games.kp_ice.elements.characters.BasePlayer(getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.id)).hurt(nENERGY_LOST);
setState(sSTATE_BUZZ);
}
}
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.id, mc.mcState.mcHit)) {
com.disney.gem.games.kp_ice.elements.characters.BasePlayer(getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.id)).hurt(nENERGY_LOST);
setState(sSTATE_BUZZ);
}
checkTimer();
}
function state_off() {
checkTimer();
}
function state_turnOff_init() {
nTimer = 0;
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sLASER_OFF, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_turnOff() {
if (stateFinished()) {
setState(sSTATE_OFF);
}
}
function state_turnOn_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sLASER_ON, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_turnOn() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
state_idle();
}
function checkTimer() {
if (bTurnedOn) {
nTimer++;
if (nTimer >= nTIME_CHANGE) {
switchState();
nTimer = 0;
}
}
}
function switchState() {
if (sState == sSTATE_IDLE) {
setState(sSTATE_TURN_OFF);
} else if (sState == sSTATE_OFF) {
setState(sSTATE_TURN_ON);
}
}
static var zID = 1;
static var nORIENTATION_FLOOR = zID++;
static var nORIENTATION_CEIL = zID++;
static var nSEARCH_START_HEIGHT = 50;
static var nSEARCH_MAX_HEIGHT = 1000;
static var nSEARCH_INCREMENT = 3;
static var nENERGY_LOST = 7.5;
static var nTIME_CHANGE = 60;
static var sSTATE_IDLE = "idle";
static var sSTATE_BUZZ = "buzz";
static var sSTATE_OFF = "off";
static var sSTATE_TURN_ON = "turnOn";
static var sSTATE_TURN_OFF = "turnOff";
static var aLASERS = new Array();
}
Symbol 1913 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Elevator] Frame 0
class com.disney.gem.games.kp_ice.elements.Elevator extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var sName, mcPlatform, sCurrentDirection, sStartingDirection, nStartingPoint, bMoving, bOn, nTimer, setLinkage, setMC, removeReferenceMC, attachMC, nArrivalPoint, mc;
function Elevator (_mc, _sStartingDirection) {
super("elevator" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
sName = _mc._name;
mcPlatform = setFloor(_mc.mcFloor);
sCurrentDirection = _sStartingDirection;
sStartingDirection = _sStartingDirection;
nStartingPoint = _mc._y;
bMoving = false;
bOn = false;
nTimer = nDELAY_MOUVEMENTS;
setLinkage("mcPlatform");
setMC(_mc);
aELEVATORS.push(this);
}
function init() {
removeReferenceMC();
attachMC();
}
function use(_bTurnedOn) {
bOn = !_bTurnedOn;
if (!bOn) {
switch (sStartingDirection) {
case sDIRECTION_DOWN :
sCurrentDirection = sDIRECTION_UP;
break;
case sDIRECTION_UP :
sCurrentDirection = sDIRECTION_DOWN;
}
bMoving = true;
if (sCurrentDirection == sStartingDirection) {
nTimer = nDELAY_MOUVEMENTS;
}
}
}
static function addArrival(_mcArrival) {
aARRIVAL_POINTS.push(_mcArrival);
}
function isReady() {
return(true);
}
static function destroy() {
aELEVATORS = new Array();
}
function update() {
super.update();
if ((aARRIVAL_POINTS.length > 0) && (nArrivalPoint == undefined)) {
setArrival();
}
checkMouvement();
}
function setFloor(_mc) {
var _local4 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("floor");
var _local1 = new flash.geom.Rectangle();
var _local2 = _mc.getRect(_local4.mc);
_local1.topLeft = new flash.geom.Point(_local2.xMin, _local2.yMin);
_local1.bottomRight = new flash.geom.Point(_local2.xMax, _local2.yMax);
var _local3 = _local4.attachMC("mcCruncherZone", _local1.left, _local1.top);
_local3._width = _local1.width;
_local3._height = _local1.height;
return(_local3);
}
function checkMouvement() {
if (!bMoving) {
nTimer++;
} else {
move();
}
if ((nTimer >= nDELAY_MOUVEMENTS) && (bOn)) {
bMoving = !bMoving;
nTimer = 0;
}
}
function move() {
switch (sCurrentDirection) {
case sDIRECTION_UP :
mc._y = mc._y - nMOVING_SPEED;
mcPlatform._y = mcPlatform._y - nMOVING_SPEED;
if (sStartingDirection == sDIRECTION_UP) {
if (mc._y <= nArrivalPoint) {
bMoving = false;
sCurrentDirection = sDIRECTION_DOWN;
}
} else if (sStartingDirection == sDIRECTION_DOWN) {
if (mc._y <= nStartingPoint) {
bMoving = false;
sCurrentDirection = sDIRECTION_DOWN;
}
}
break;
case sDIRECTION_DOWN :
mc._y = mc._y + nMOVING_SPEED;
mcPlatform._y = mcPlatform._y + nMOVING_SPEED;
if (sStartingDirection == sDIRECTION_UP) {
if (mc._y >= nStartingPoint) {
bMoving = false;
sCurrentDirection = sDIRECTION_UP;
}
} else {
if (sStartingDirection != sDIRECTION_DOWN) {
break;
}
if (mc._y < nArrivalPoint) {
break;
}
bMoving = false;
sCurrentDirection = sDIRECTION_UP;
}
}
}
function setArrival() {
var _local3 = 0;
while (_local3 < aARRIVAL_POINTS.length) {
var _local2 = aARRIVAL_POINTS[_local3];
if ((_local2._x > (mc._x - (mc._width / 2))) && (_local2._x < (mc._x + (mc._width / 2)))) {
if (sStartingDirection == sDIRECTION_DOWN) {
if (_local2._y > nStartingPoint) {
nArrivalPoint = _local2._y;
_local2.swapDepths(11111);
_local2.removeMovieClip();
aARRIVAL_POINTS.splice(_local3, 1);
break;
}
} else if (sStartingDirection == sDIRECTION_UP) {
if (_local2._y < nStartingPoint) {
nArrivalPoint = _local2._y;
_local2.swapDepths(11111);
_local2.removeMovieClip();
aARRIVAL_POINTS.splice(_local3, 1);
break;
}
}
}
_local3++;
}
}
static var nMOVING_SPEED = 6;
static var nDELAY_MOUVEMENTS = 60;
static var sDIRECTION_UP = "up";
static var sDIRECTION_DOWN = "dowm";
static var sSTATE_IDLE = "idle";
static var sSTATE_MOVE = "move";
static var aARRIVAL_POINTS = new Array();
static var aELEVATORS = new Array();
}
Symbol 1914 MovieClip [__Packages.com.disney.gem.games.kp_ice.scripts.FirstUsesManager] Frame 0
class com.disney.gem.games.kp_ice.scripts.FirstUsesManager
{
static var oInstance;
var mcTimeline, oGameEngine, nFrameToShow, oShownPopup, bShowKimmunicator, bShownGrappling, bShownSliding, bShownDoubleJump, bShownRufus, bShownCloseSwitch, bShownBoss;
function FirstUsesManager (_mcTimeline, _oGameEngine) {
oInstance = this;
mcTimeline = _mcTimeline;
oGameEngine = _oGameEngine;
}
static function getInstance() {
return(com.disney.gem.games.kp_ice.scripts.FirstUsesManager(oInstance));
}
function addZone(_mcZone, _nZoneID) {
var _local2 = new com.disney.gem.games.kp_ice.elements.FirstUseZones(_mcZone, _nZoneID, this);
oGameEngine.addDynamicElement(_local2);
}
function get ShownID() {
return(nFrameToShow);
}
function setPopup(_oShownPopup) {
if (oShownPopup != undefined) {
oShownPopup.hide();
}
oShownPopup = _oShownPopup;
oShownPopup.setManager(this);
}
function didAction(_nActionID) {
if ((oShownPopup != undefined) && (ShownID == _nActionID)) {
oShownPopup.hide();
oShownPopup = undefined;
}
}
function pressedKey() {
oShownPopup.hide();
oShownPopup = undefined;
}
function stepsOn(_nUsedItem) {
var _local2 = false;
switch (_nUsedItem) {
case nKIMMUNICATOR :
if (!bShowKimmunicator) {
bShowKimmunicator = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
break;
case nGRAPPLING :
if (!bShownGrappling) {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1) {
bShownGrappling = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
}
break;
case nSLIDING :
if (!bShownSliding) {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1) {
bShownSliding = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
}
break;
case nDOUBLE_JUMP :
if (!bShownDoubleJump) {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2) {
bShownDoubleJump = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
}
break;
case nRUFUS :
if (!bShownRufus) {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2) {
bShownRufus = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
}
break;
case nCLOSESWITCH :
if (!bShownCloseSwitch) {
bShownCloseSwitch = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
break;
case nBOSS :
if (bShownBoss) {
break;
}
bShownBoss = true;
com.disney.gem.games.kp_ice.Controller.getInstance().showPopup(new com.disney.gem.games.kp_ice.popups.FirstUsePopup(mcTimeline.mcPopups.mcFirstUse), true);
_local2 = true;
}
nFrameToShow = _nUsedItem;
return(_local2);
}
static var nKIMMUNICATOR = 1;
static var nGRAPPLING = 2;
static var nSLIDING = 3;
static var nDOUBLE_JUMP = 4;
static var nRUFUS = 5;
static var nCLOSESWITCH = 6;
static var nBOSS = 7;
}
Symbol 1915 MovieClip [__Packages.com.disney.gem.games.kp_ice.popups.FirstUsePopup] Frame 0
class com.disney.gem.games.kp_ice.popups.FirstUsePopup extends com.sarbakan.utils.ScreenController
{
var nTimer, oManager, mcRef;
function FirstUsePopup (_mcRef) {
super(_mcRef);
nTimer = 0;
}
function setManager(_oFirstUseManager) {
oManager = _oFirstUseManager;
}
function onKeyDown() {
Key.removeListener(this);
Mouse.removeListener(this);
pressedKey();
}
function onMouseDown() {
onKeyDown();
}
function state_in_init() {
super.state_in_init();
setFrame();
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().setPopup(this);
}
function state_in() {
super.state_in();
setFrame();
}
function state_idle_init() {
super.state_idle_init();
setFrame();
}
function state_idle() {
nTimer++;
if (nTimer >= nTIMER_ACTIVATION) {
activatePressAny();
}
}
function state_out_init() {
super.state_out_init();
setFrame();
}
function state_out() {
super.state_out();
setFrame();
}
function setFrame() {
mcRef.mcState.mcContent.gotoAndStop(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().__get__ShownID());
}
function activatePressAny() {
Key.addListener(this);
Mouse.addListener(this);
}
function pressedKey() {
oManager.pressedKey();
}
static var nTIMER_ACTIVATION = 20;
}
Symbol 1916 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.FirstUseZones] Frame 0
class com.disney.gem.games.kp_ice.elements.FirstUseZones extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var nZoneID, oManager, setLinkage, setMC, removeReferenceMC, attachMC, collideWithElement, remove;
function FirstUseZones (_mc, _nZoneID, _oManager) {
super("firstUseZone" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
nZoneID = _nZoneID;
oManager = _oManager;
setLinkage("mcFirstTimeZone");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
}
function update() {
super.update();
if (collideWithElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)) {
if (oManager.stepsOn(nZoneID)) {
remove();
}
}
}
}
Symbol 1917 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.Player1] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.Player1 extends com.disney.gem.games.kp_ice.elements.characters.BasePlayer
{
var nDamage, bHookingAfterTurn, oHookingDestination, oHookingStarting, mc, mcHook, nHookingVerticalMax, nHookingDirection, nDirection, setState, stateIs, bMustReleaseSlidingKey, nSpeedX, stateFinished, nSlidingTimer, checkFall, checkWall, setPositionOutFloor, getGlobalPos, sTopColliderName, collideWithMap, sWallColliderID, nSpeedY, bSwitchDirection, bAutoPilot, nTimerSlidingKey, bMustReleaseUseKey, sNextState, sState, bNoPause, bAnimStopped, stopOnLastFrame;
function Player1 (_mc, _sLinkage, _sID) {
super(_mc, _sLinkage, _sID);
nDamage = nDAMAGE_DEALT;
bHookingAfterTurn = false;
oHookingDestination = new flash.geom.Point();
oHookingStarting = new flash.geom.Point();
}
function setHooking(_oDeparture) {
oHookingDestination.x = _oDeparture.getArrival().mc._x;
oHookingDestination.y = _oDeparture.getArrival().mc._y;
oHookingStarting.x = mc._x;
oHookingStarting.y = mc._y;
mcHook = _oDeparture.getHook();
nHookingVerticalMax = (mc._y - (oHookingDestination.y - oHookingStarting.y)) + nHOOKING_VERTICAL_WEIGHT;
if (mc._x > oHookingDestination.x) {
nHookingDirection = -1;
} else {
nHookingDirection = 1;
}
if (mc._x < oHookingDestination.x) {
if (nDirection != 1) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_TURN);
bHookingAfterTurn = true;
} else {
setState(sSTATE_HOOK_START);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nGRAPPLING);
}
} else if (mc._x > oHookingDestination.x) {
if (nDirection != -1) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_TURN);
bHookingAfterTurn = true;
} else {
setState(sSTATE_HOOK_START);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nGRAPPLING);
}
}
}
function isGrappling() {
return(stateIs(sSTATE_HOOK + sSTATE_LEFT, sSTATE_HOOK + sSTATE_RIGHT, sSTATE_HOOK_START + sSTATE_RIGHT, sSTATE_HOOK_START + sSTATE_RIGHT));
}
function update() {
super.update();
checkSlideTimer();
if ((bMustReleaseSlidingKey && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT))) && (!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) {
bMustReleaseSlidingKey = false;
}
}
function isIdle() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_RIGHT));
}
function isDieing() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_END + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_FALL + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_START + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_END + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_FALL + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_START + sSTATE_LEFT));
}
function isAttacking() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_ATTACK + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_ATTACK + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_ATTACK + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_ATTACK + sSTATE_LEFT));
}
function isJumping() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_ATTACK + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_ATTACK + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_LEFT));
}
function isHurt() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_HURT + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_END + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_FALL + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_START + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_HURT + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_END + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_FALL + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_DIE_START + sSTATE_LEFT));
}
function isRunning() {
return(stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_STOP + sSTATE_RIGHT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_STOP + sSTATE_LEFT));
}
function state_slideStartLeft_init() {
state_slideStart_init();
}
function state_slideStartRight_init() {
state_slideStart_init();
}
function state_slideStart_init() {
if (nDirection == 1) {
nSpeedX = nSpeedX + nSLIDING_FORCE;
} else {
nSpeedX = nSpeedX - nSLIDING_FORCE;
}
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nSLIDING);
}
function state_slideStartLeft() {
state_slideStart();
}
function state_slideStartRight() {
state_slideStart();
}
function state_slideStart() {
if (stateFinished()) {
setState(sSTATE_SLIDE);
nSlidingTimer = nSLIDE_DURATION;
}
checkFall();
checkWall();
setPositionOutFloor();
}
function state_slideLeft() {
state_slide();
}
function state_slideRight() {
state_slide();
}
function state_slide() {
if (nSlidingTimer > 0) {
nSlidingTimer--;
if (nDirection == 1) {
if (nSpeedX <= nSLIDING_MIN_THRESHOLD) {
nSlidingTimer = 0;
}
} else if (nSpeedX >= (-nSLIDING_MIN_THRESHOLD)) {
nSlidingTimer = 0;
}
} else {
checkEndSlide();
}
checkFall();
checkWall();
setPositionOutFloor();
}
function checkEndSlide() {
if (!isTouchingWallWithHead()) {
setState(sSTATE_SLIDE_END);
} else {
nSlidingTimer = nSlidingTimer + (nSLIDE_DURATION / 2);
}
}
function isTouchingWallWithHead() {
var _local2 = getGlobalPos(mc[sTopColliderName]);
return(collideWithMap(sWallColliderID, {x:Math.round(_local2.x + nSpeedX), y:Math.round(_local2.y + nSpeedY)}));
}
function state_slideEndLeft() {
state_slideEnd();
}
function state_slideEndRight() {
state_slideEnd();
}
function state_slideEnd() {
if (stateFinished()) {
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) || (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START);
} else {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE);
}
}
checkFall();
checkWall();
setPositionOutFloor();
}
function state_shootHookLeft_init() {
state_shootHook_init();
}
function state_shootHookRight_init() {
state_shootHook_init();
}
function state_shootHook_init() {
if (bSwitchDirection) {
setDirection(nDirection * -1);
bSwitchDirection = false;
}
}
function state_shootHookLeft() {
state_shootHook();
}
function state_shootHookRight() {
state_shootHook();
}
function state_shootHook() {
if (stateFinished()) {
setState(sSTATE_HOOK);
} else if (mc.mcState._currentframe == nSHOOT_HOOK_FRAME) {
var _local2 = com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_IN[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_IN.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local2, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
drawHook();
}
function state_hookedLeft() {
state_hooked();
}
function state_hookedRight() {
state_hooked();
}
function state_hooked() {
checkHookMouvement();
drawHook();
}
function state_runLeft() {
state_run();
}
function state_runRight() {
state_run();
}
function state_run() {
super.state_run();
var _local3 = 0;
while (_local3 < aFOOT_STEPS_FRAMES.length) {
if (mc.mcState._currentframe == aFOOT_STEPS_FRAMES[_local3]) {
var _local4 = com.disney.gem.games.kp_ice.GameData.aKIM_FOOTSTEPS[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aKIM_FOOTSTEPS.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local4, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
break;
}
_local3++;
}
}
function state_runStartLeft_init() {
state_runStart_init();
}
function state_runStartRight_init() {
state_runStart_init();
}
function state_runStart_init() {
super.state_runStart_init();
}
function state_runStartLeft() {
state_runStart();
}
function state_runStartRight() {
state_runStart();
}
function state_runStart() {
super.state_runStart();
}
function state_turnLeft() {
state_turn();
}
function state_turnRight() {
state_turn();
}
function state_turn() {
if (stateFinished()) {
if (bHookingAfterTurn) {
setState(sSTATE_HOOK_START);
bHookingAfterTurn = false;
} else if ((Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) || (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) || (bAutoPilot)) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START);
} else {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE);
}
bSwitchDirection = true;
}
checkFall();
setPositionOutFloor();
}
function state_turnLeft_init() {
state_turn_init();
}
function state_turnRight_init() {
state_turn_init();
}
function state_turn_init() {
super.state_turn_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_TURN, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_turnRight_end() {
state_turn_end();
}
function state_turnLeft_end() {
state_turn_end();
}
function state_turn_end() {
}
function state_jumpLeft_init() {
state_jump_init();
}
function state_jumpRight_init() {
state_jump_init();
}
function state_jump_init() {
var _local1 = com.disney.gem.games.kp_ice.GameData.aKIM_JUMPS[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aKIM_JUMPS.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local1, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_jumpLandLeft_init() {
state_jumpLand_init();
}
function state_jumpLandRight_init() {
state_jumpLand_init();
}
function state_jumpLand_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_LAND, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_jumpAttackLeft_init() {
state_jumpAttack_init();
}
function state_jumpAttackRight_init() {
state_jumpAttack_init();
}
function state_jumpAttack_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_ATTACK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_attackLeft() {
state_attack();
}
function state_attackRight() {
state_attack();
}
function state_attack() {
super.state_attack();
}
function state_attackLeft_init() {
state_attack_init();
}
function state_attackRight_init() {
state_attack_init();
}
function state_attack_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_ATTACK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_hurtLeft_init() {
state_hurt_init();
}
function state_hurtRight_init() {
state_hurt_init();
}
function state_hurt_init() {
super.state_hurt_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_HURT, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_dieStartLeft_init() {
state_dieStart_init();
}
function state_dieStartRight_init() {
state_dieStart_init();
}
function state_dieStart_init() {
super.state_dieStart_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sKIM_DIES, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_idleLeft_init() {
super.state_idle_init();
}
function state_idleRight_init() {
super.state_idle_init();
}
function state_idleLeft() {
super.state_idle();
}
function state_idleRight() {
super.state_idle();
}
function state_runStopLeft() {
super.state_runStop();
}
function state_runStopRight() {
super.state_runStop();
}
function state_jumpLeft() {
super.state_jump();
}
function state_jumpRight() {
super.state_jump();
}
function state_jumpAttackLeft() {
state_jumpAttack();
}
function state_jumpAttackRight() {
state_jumpAttack();
}
function state_jumpAttack() {
super.state_jumpAttack();
}
function state_jumpSwitchLeft() {
super.state_jumpSwitch();
}
function state_jumpSwitchRight() {
super.state_jumpSwitch();
}
function state_jumpFallLeft_init() {
super.state_jumpFall_init();
}
function state_jumpFallRight_init() {
super.state_jumpFall_init();
}
function state_jumpFallLeft() {
super.state_jumpFall();
}
function state_jumpFallRight() {
super.state_jumpFall();
}
function state_jumpLandRight() {
super.state_jumpLand();
}
function state_jumpLandLeft() {
super.state_jumpLand();
}
function state_hurtLeft() {
super.state_hurt();
}
function state_hurtRight() {
super.state_hurt();
}
function state_dieStartLeft() {
super.state_dieStart();
}
function state_dieStartRight() {
super.state_dieStart();
}
function state_dieFallLeft_init() {
super.state_dieFall_init();
}
function state_dieFallRight_init() {
super.state_dieFall_init();
}
function state_dieFallLeft() {
super.state_dieFall();
}
function state_dieFallRight() {
super.state_dieFall();
}
function state_dieEndLeft() {
super.state_dieEnd();
}
function state_dieEndRight() {
super.state_dieEnd();
}
function state_crouchStartLeft() {
super.state_crouchStart();
}
function state_crouchStartRight() {
super.state_crouchStart();
}
function state_crouchLeft() {
super.state_crouch();
}
function state_crouchRight() {
super.state_crouch();
}
function state_crouchEndLeft() {
super.state_crouchEnd();
}
function state_crouchEndRight() {
super.state_crouchEnd();
}
function state_switchOnLeft() {
super.state_switchOn();
}
function state_switchOnRight() {
super.state_switchOn();
}
function state_switchOffLeft() {
super.state_switchOff();
}
function state_switchOffRight() {
super.state_switchOff();
}
function checkRunControl() {
super.checkRunControl();
checkSlidingActivation();
}
function checkIdleControl() {
super.checkIdleControl();
checkSlidingActivation();
}
function checkSlidingActivation() {
if ((com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer == this) && (!bAutoPilot)) {
if (nDirection == 1) {
if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT) && (!bMustReleaseSlidingKey)) {
activateSlideTimer();
}
} else if (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) && (!bMustReleaseSlidingKey)) {
activateSlideTimer();
}
}
}
function activateSlideTimer() {
bMustReleaseSlidingKey = true;
if (nTimerSlidingKey > 0) {
setState(sSTATE_SLIDE_START);
} else {
nTimerSlidingKey = nSLIDER_KEYSTROKES_TIMER;
}
}
function checkSlideTimer() {
if (nTimerSlidingKey > 0) {
nTimerSlidingKey--;
}
}
function checkUses() {
super.checkUses();
if ((!bMustReleaseUseKey) && (isIdle())) {
var _local4 = com.disney.gem.games.kp_ice.elements.GrapplingZone.aGRAPPLING_ZONE;
var _local3 = 0;
while (_local3 < _local4.length) {
com.disney.gem.games.kp_ice.elements.GrapplingZone(_local4[_local3]).checkUse(this);
_local3++;
}
}
}
function checkHookMouvement() {
var _local2 = ((mc._x - oHookingStarting.x) * 100) / (oHookingDestination.x - oHookingStarting.x);
if (_local2 < 1) {
_local2 = 1;
}
if (_local2 <= 50) {
nSpeedX = ((nHOOKING_HORIZONTAL_SPEED * nHookingDirection) * _local2) / 50;
var _local4 = ((mc._x - oHookingStarting.x) * 100) / ((oHookingDestination.x - oHookingStarting.x) / 2);
var _local3;
if (oHookingStarting.y > oHookingDestination.y) {
_local3 = ((oHookingStarting.y - nHookingVerticalMax) * _local4) / 100;
} else {
_local3 = ((nHookingVerticalMax - oHookingStarting.y) * _local4) / 100;
}
nSpeedY = (oHookingStarting.y - _local3) - mc._y;
} else if (_local2 < 100) {
nSpeedX = ((nHOOKING_HORIZONTAL_SPEED * nHookingDirection) * (100 - _local2)) / 50;
var _local4 = ((mc._x - oHookingStarting.x) * 100) / ((oHookingDestination.x - oHookingStarting.x) / 2);
if (oHookingStarting.y > oHookingDestination.y) {
var _local3 = ((oHookingDestination.y - nHookingVerticalMax) * (100 - _local4)) / 100;
} else {
var _local3 = ((nHookingVerticalMax - oHookingDestination.y) * (100 - _local4)) / 100;
}
nSpeedY = (oHookingStarting.y - _local3) - mc._y;
if (Math.abs(mc._x - oHookingDestination.x) < nHOOKING_THRESHOLD) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH);
var _local5 = com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_OUT[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_OUT.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local5, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
} else {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH);
var _local5 = com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_OUT[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aKIM_SHOOT_OUT.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local5, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
}
function drawHook() {
var _local6 = false;
if (stateIs(sSTATE_HOOK_START + sSTATE_LEFT, sSTATE_HOOK_START + sSTATE_RIGHT)) {
if (mc.mcState._currentframe >= nHOOKING_DRAW_START) {
_local6 = true;
}
} else if (stateIs(sSTATE_HOOK + sSTATE_LEFT, sSTATE_HOOK + sSTATE_RIGHT)) {
_local6 = true;
}
if (_local6) {
var _local2 = new flash.geom.Point(-nSpeedX, -nSpeedY);
var _local4 = MovieClip(mc.mcState);
var _local5 = _local4.createEmptyMovieClip("mcLineDraw", 1);
mcHook.localToGlobal(_local2);
_local5.globalToLocal(_local2);
_local5.lineStyle(2, 10066329, 100);
_local5.moveTo(_local4.mcHookAnchor._x, _local4.mcHookAnchor._y);
_local5.lineTo(_local2.x, _local2.y);
var _local3 = _local5.attachMovie("mcGrappling", "mcGrappling", 400);
_local3._x = _local2.x - (_local3._width / 2);
_local3._y = (_local2.y - (_local3._height / 2)) + 5;
var _local7 = getDirection(_local4.mcHookAnchor._x, _local4.mcHookAnchor._y + 5, _local2.x, _local2.y) - 90;
_local3._rotation = _local7;
}
}
function getDirection(_nPosX1, _nPosY1, _nPosX2, _nPosY2) {
var _local1;
_local1 = ((Math.atan2(_nPosY2 - _nPosY1, _nPosX2 - _nPosX1) * 180) / Math.PI) + 90;
if (_local1 > 180) {
_local1 = -360 + _local1;
return(_local1);
}
return(_local1);
}
function updateState() {
var _local2;
if (nDirection == 1) {
_local2 = sSTATE_RIGHT;
} else {
_local2 = sSTATE_LEFT;
}
if (sNextState != undefined) {
this[("state_" + sState) + "_end"]();
sState = sNextState + _local2;
sNextState = undefined;
mc.gotoAndStop(sState);
this[("state_" + sState) + "_init"]();
if (!bNoPause) {
bAnimStopped = false;
}
mc.mcState.oOwner = this;
mc.mcState.stopOnLastFrame = com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, stopOnLastFrame);
}
this["state_" + sState]();
}
function setDirection(_nDirection) {
if ((_nDirection >= -1) && (_nDirection <= 1)) {
nDirection = _nDirection;
if (stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_RIGHT);
} else {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE + sSTATE_LEFT);
}
} else if (stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_RIGHT);
} else {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START + sSTATE_LEFT);
}
} else if (stateIs(sSTATE_HOOK_START + sSTATE_LEFT, sSTATE_HOOK_START + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(sSTATE_HOOK_START + sSTATE_RIGHT);
} else {
mc.gotoAndStop(sSTATE_HOOK_START + sSTATE_LEFT);
}
} else if (stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_RIGHT);
} else {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_SWITCH + sSTATE_LEFT);
}
} else if (stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_RIGHT);
} else {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP_FALL + sSTATE_LEFT);
}
} else if (stateIs(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_LEFT, com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_RIGHT)) {
if (nDirection == 1) {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_RIGHT);
} else {
mc.gotoAndStop(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_JUMP + sSTATE_LEFT);
}
}
}
}
static var nSLIDE_DURATION = 5;
static var nSLIDING_FORCE = 5;
static var nSLIDING_MIN_THRESHOLD = 0.5;
static var nRUN_DECEL_RATE_SLIDING = 1.05;
static var nSLIDER_KEYSTROKES_TIMER = 10;
static var sSTATE_SLIDE_START = "slideStart";
static var sSTATE_SLIDE = "slide";
static var sSTATE_SLIDE_END = "slideEnd";
static var sSTATE_HOOK_START = "shootHook";
static var sSTATE_HOOK = "hooked";
static var sSTATE_LEFT = "Left";
static var sSTATE_RIGHT = "Right";
static var nDAMAGE_DEALT = 20;
static var nHOOKING_HORIZONTAL_SPEED = 30;
static var nHOOKING_THRESHOLD = 5;
static var nHOOKING_VERTICAL_WEIGHT = 10;
static var nHOOKING_DRAW_START = 12;
static var nHOOKING_DRAW_ENDS = 29;
static var aFOOT_STEPS_FRAMES = [5, 15];
static var nSHOOT_HOOK_FRAME = 12;
}
Symbol 1918 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.GrapplingZone] Frame 0
class com.disney.gem.games.kp_ice.elements.GrapplingZone extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, oMatchingZone, oHook, isActive, getGlobalPos, mc;
function GrapplingZone (_mc) {
super("mcGrappingZone" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcFirstTimeZone");
setMC(_mc);
aGRAPPLING_ZONE.push(this);
}
function init() {
removeReferenceMC();
attachMC();
}
function setMatchingZone(_oMatchingZone) {
oMatchingZone = _oMatchingZone;
}
function setHook(_oHook) {
oHook = _oHook;
}
function getHook() {
return(oHook.mc);
}
function checkUse(_oPlayer) {
if (isActive() && (oHook.isOn())) {
var _local2 = getGlobalPos(mc);
var _local3 = getGlobalPos(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.mc);
if (com.sarbakan.utils.MoreMath.getDistance(_local2.x, _local2.y, _local3.x, _local3.y) < nHIT_ZONE) {
_oPlayer.setHooking(this);
}
}
}
function getArrival() {
return(oMatchingZone);
}
static function destroy() {
aGRAPPLING_ZONE = new Array();
}
static var aGRAPPLING_ZONE = new Array();
static var nHIT_ZONE = 30;
}
Symbol 1919 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.Player2] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.Player2 extends com.disney.gem.games.kp_ice.elements.characters.BasePlayer
{
var bCanDoubleJump, bDoublejumpEnabled, bRufusAfterTurn, nDamage, nCurrentZoneIndex, oRufus, mc, nDirection, setState, setDirection, stateFinished, nSpeedX, nSpeedY, bAutoPilot, bSwitchDirection, checkFall, setPositionOutFloor, sJumpSound, bMustReleaseUseKey, isIdle;
function Player2 (_mc, _sLinkage, _sID) {
super(_mc, _sLinkage, _sID);
bCanDoubleJump = false;
bDoublejumpEnabled = false;
bRufusAfterTurn = false;
nDamage = nDAMAGE_DEALT;
}
function update() {
super.update();
}
function hurt(_nEnergy, _nCustomPushBackSpeed) {
super.hurt(_nEnergy, _nCustomPushBackSpeed);
}
function setRufus(_nRufusPos, _oZone) {
nCurrentZoneIndex = _nRufusPos;
oRufus = _oZone;
if (((oRufus.getButtonRef()._x > mc._x) && (nDirection == 1)) || ((oRufus.getButtonRef()._x < mc._x) && (nDirection == -1))) {
setState(aRUFUS_STATES[nCurrentZoneIndex]);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_OUT, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nRUFUS);
} else {
bRufusAfterTurn = true;
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_TURN, true);
}
}
function state_jumpDouble() {
super.state_jump();
}
function state_Rufus1_init() {
state_Rufus_init();
}
function state_Rufus2_init() {
state_Rufus_init();
}
function state_Rufus3_init() {
state_Rufus_init();
}
function state_Rufus4_init() {
state_Rufus_init();
}
function state_Rufus5_init() {
state_Rufus_init();
}
function state_Rufus6_init() {
state_Rufus_init();
}
function state_Rufus7_init() {
state_Rufus_init();
}
function state_Rufus8_init() {
state_Rufus_init();
}
function state_Rufus_init() {
if (bRufusAfterTurn) {
bRufusAfterTurn = false;
setDirection(nDirection * -1);
}
}
function state_Rufus1() {
state_Rufus();
}
function state_Rufus2() {
state_Rufus();
}
function state_Rufus3() {
state_Rufus();
}
function state_Rufus4() {
state_Rufus();
}
function state_Rufus5() {
state_Rufus();
}
function state_Rufus6() {
state_Rufus();
}
function state_Rufus7() {
state_Rufus();
}
function state_Rufus8() {
state_Rufus();
}
function state_Rufus() {
if (mc.mcState._currentframe == nRUFUS_WALK_FRAME) {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_WALKS, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND, 999);
}
if (mc.mcState._currentframe == (aRUFUS_STATES_TIMINGS[nCurrentZoneIndex] - nRUFUS_PRESS_FRAME)) {
stopRufusWalkSound();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_PRESS, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
if (mc.mcState._currentframe == aRUFUS_STATES_TIMINGS[nCurrentZoneIndex]) {
oRufus.used();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_WALKS, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND, 999);
}
if (mc.mcState._currentframe == (mc.mcState._totalframes - nRUFUS_IN_FRAME)) {
stopRufusWalkSound();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_IN, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
if (stateFinished()) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE);
}
nSpeedX = 0;
nSpeedY = 0;
}
function state_turn() {
if (stateFinished()) {
if (bRufusAfterTurn) {
setState(aRUFUS_STATES[nCurrentZoneIndex]);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRUFUS_OUT, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nRUFUS);
} else {
if ((Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_LEFT) || (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_RIGHT))) || (bAutoPilot)) {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_RUN_START);
} else {
setState(com.disney.gem.games.kp_ice.elements.characters.BasePlayer.sSTATE_IDLE);
}
bSwitchDirection = true;
}
}
checkFall();
setPositionOutFloor();
}
function state_run() {
super.state_run();
var _local3 = 0;
while (_local3 < aFOOT_STEPS_FRAMES.length) {
if (mc.mcState._currentframe == aFOOT_STEPS_FRAMES[_local3]) {
var _local4 = com.disney.gem.games.kp_ice.GameData.aRON_FOOTSTEPS[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aRON_FOOTSTEPS.length)];
com.sarbakan.sound.SoundManager.doPlaySound(_local4, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
break;
}
_local3++;
}
}
function state_jumpDouble_init() {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nDOUBLE_JUMP);
var _local2 = com.sarbakan.sound.SoundManager.isSoundPlaying(sJumpSound);
if (_local2.bPlaying) {
com.sarbakan.sound.SoundItem(_local2.oSound).doStop();
}
sJumpSound = com.disney.gem.games.kp_ice.GameData.aRON_JUMPS[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aRON_JUMPS.length)];
com.sarbakan.sound.SoundManager.doPlaySound(sJumpSound, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_turn_init() {
super.state_turn_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_TURN, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_jump_init() {
sJumpSound = com.disney.gem.games.kp_ice.GameData.aRON_JUMPS[Math.floor(Math.random() * com.disney.gem.games.kp_ice.GameData.aRON_JUMPS.length)];
com.sarbakan.sound.SoundManager.doPlaySound(sJumpSound, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_jumpLand_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_LAND, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_jumpAttack_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_ATTACK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_attack_init() {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_ATTACK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_hurt_init() {
super.state_hurt_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_HURT, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function state_dieStart_init() {
super.state_dieStart_init();
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sRON_DIES, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function checkAirControl() {
super.checkAirControl();
if ((bDoublejumpEnabled && (bCanDoubleJump)) && (Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_JUMP))) {
bCanDoubleJump = false;
setState(sSTATE_JUMP_DOUBLE);
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().didAction(com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nDOUBLE_JUMP);
}
if ((!Key.isDown(com.disney.gem.games.kp_ice.GameData.nKEYCODE_JUMP)) && (bCanDoubleJump)) {
bDoublejumpEnabled = true;
}
}
function state_jumpLand() {
super.state_jumpLand();
bDoublejumpEnabled = false;
bCanDoubleJump = true;
}
function checkUses() {
super.checkUses();
if ((!bMustReleaseUseKey) && (isIdle())) {
var _local4 = com.disney.gem.games.kp_ice.elements.RufusZones.aRUFUS_ZONES;
var _local3 = 0;
while (_local3 < _local4.length) {
com.disney.gem.games.kp_ice.elements.RufusZones(_local4[_local3]).checkUse(this);
_local3++;
}
}
}
function stopRufusWalkSound() {
var _local1 = com.sarbakan.sound.SoundManager.isSoundPlaying(com.disney.gem.games.kp_ice.GameData.sRUFUS_WALKS);
if (_local1.bPlaying) {
com.sarbakan.sound.SoundItem(_local1.oSound).doStop();
}
}
static var aRUFUS_STATES = ["Rufus1", "Rufus2", "Rufus3", "Rufus4", "Rufus5", "Rufus6", "Rufus7", "Rufus8"];
static var aRUFUS_STATES_TIMINGS = [35, 38, 38, 41, 49, 33, 68, 37];
static var sSTATE_JUMP_DOUBLE = "jumpDouble";
static var nDAMAGE_DEALT = 15;
static var aFOOT_STEPS_FRAMES = [9, 20];
static var nRUFUS_IN_FRAME = 5;
static var nRUFUS_PRESS_FRAME = 10;
static var nRUFUS_WALK_FRAME = 20;
}
Symbol 1920 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.RufusZones] Frame 0
class com.disney.gem.games.kp_ice.elements.RufusZones extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
static var bSorted, nCurrentScreen, nCurrentRufusZone;
var setLinkage, setMC, bItemSet, bOn, bBossSwitch, nXcoord, mc, oRufusButton, aActionsOFF, aActionsON, removeReferenceMC, attachMC, isActive, collideWithElement;
function RufusZones (_mc, _aActionON, _aActionOFF, _mcRufusButton) {
super("mcRufusZone" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcRufusZone");
setMC(_mc);
bItemSet = false;
bSorted = false;
bOn = false;
bBossSwitch = false;
nCurrentScreen = 0;
nCurrentRufusZone = 0;
aRUFUS_ZONES.push(this);
nXcoord = mc._x;
oRufusButton = new com.disney.gem.games.kp_ice.elements.RufusButton(_mcRufusButton);
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(oRufusButton);
aActionsOFF = _aActionOFF;
aActionsON = _aActionON;
}
function init() {
removeReferenceMC();
attachMC();
}
function checkUse(_oPlayer) {
if (isActive()) {
if (collideWithElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id, mc)) {
_oPlayer.setRufus(getPos(), this);
}
}
}
function getButtonRef() {
return(oRufusButton.mc);
}
function used() {
bOn = !bOn;
if (!bOn) {
var _local2 = 0;
while (_local2 < aActionsOFF.length) {
aActionsOFF[_local2].id.use(aActionsOFF[_local2].hidden);
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < aActionsON.length) {
aActionsON[_local2].id.use(aActionsON[_local2].hidden);
_local2++;
}
}
oRufusButton.setPress();
}
static function newScreen() {
nCurrentScreen++;
if (nCurrentScreen >= aRUFUS_ZONES_SCREENS[nCurrentRufusZone + 1]) {
nCurrentRufusZone++;
nCurrentRufusZone = Math.min(nCurrentRufusZone, aRUFUS_ZONES_SCREENS.length);
}
}
function onEnable() {
if (bBossSwitch) {
var _local2 = oRufusButton.mc.getDepth();
oRufusButton.mc.swapDepths((com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.nBOSS_DEPTH + _local2) + 2000);
}
}
static function destroy() {
aRUFUS_ZONES = new Array();
}
function update() {
super.update();
if (!bItemSet) {
setItems();
if (bBossSwitch) {
onEnable();
}
}
if (!bSorted) {
bSorted = true;
sortArray();
}
}
function sortArray() {
aRUFUS_ZONES.sortOn("nXcoord", Array.NUMERIC);
}
function getPos() {
return(nCurrentRufusZone);
}
function setItems() {
bItemSet = true;
var _local2 = 0;
while (_local2 < aActionsON.length) {
aActionsON[_local2].id = findItem(aActionsON[_local2].id);
_local2++;
}
_local2 = 0;
while (_local2 < aActionsOFF.length) {
aActionsOFF[_local2].id = findItem(aActionsOFF[_local2].id);
_local2++;
}
}
function findItem(_sMcName) {
var _local3;
var _local2 = false;
var _local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Door.aDOORS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Door(com.disney.gem.games.kp_ice.elements.Door.aDOORS[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.Door(com.disney.gem.games.kp_ice.elements.Door.aDOORS[_local4]);
_local2 = true;
break;
}
_local4++;
}
if (!_local2) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Hook.aHOOKS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]);
_local2 = true;
break;
}
_local4++;
}
}
if (!_local2) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Laser.aLASERS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Laser(com.disney.gem.games.kp_ice.elements.Laser.aLASERS[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.Laser(com.disney.gem.games.kp_ice.elements.Laser.aLASERS[_local4]);
_local2 = true;
break;
}
_local4++;
}
}
if (!_local2) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Hook.aHOOKS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.Hook(com.disney.gem.games.kp_ice.elements.Hook.aHOOKS[_local4]);
_local2 = true;
break;
}
_local4++;
}
}
if (!_local2) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.Elevator(com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.Elevator(com.disney.gem.games.kp_ice.elements.Elevator.aELEVATORS[_local4]);
_local2 = true;
break;
}
_local4++;
}
}
if (!_local2) {
_local4 = 0;
while (_local4 < com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES.length) {
if (_sMcName == com.disney.gem.games.kp_ice.elements.characters.boss.Wire(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES[_local4]).sName) {
_local3 = com.disney.gem.games.kp_ice.elements.characters.boss.Wire(com.disney.gem.games.kp_ice.elements.characters.boss.BossAI.aWIRES[_local4]);
_local2 = true;
bBossSwitch = true;
break;
}
_local4++;
}
}
return(_local3);
}
static var aRUFUS_ZONES = new Array();
static var aRUFUS_ZONES_SCREENS = [4, 7, 8, 9, 10, 11, 14, 15];
}
Symbol 1921 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.RufusButton] Frame 0
class com.disney.gem.games.kp_ice.elements.RufusButton extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, setState, stateFinished;
function RufusButton (_mc) {
super("mcRufusButton" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcButton");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
}
function setPress() {
setState(sSTATE_PRESS);
}
function state_press() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
static var sSTATE_IDLE = "idle";
static var sSTATE_PRESS = "press";
}
Symbol 1922 MovieClip [__Packages.com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager] Frame 0
class com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager
{
static var oInstance;
var aDepartures, aHooks, aArrivals;
function GrapplingZoneManager () {
aDepartures = new Array();
aHooks = new Array();
aArrivals = new Array();
oInstance = this;
}
static function getInstance() {
return(com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager(oInstance));
}
function addGrapplingElement(_mcGrapplingElement, _nType) {
switch (_nType) {
case nGRAPPLING_DEPARTURE :
var _local3 = new com.disney.gem.games.kp_ice.elements.GrapplingZone(_mcGrapplingElement);
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(_local3);
aDepartures.push(_local3);
break;
case nGRAPPLING_HOOK :
var _local4 = new com.disney.gem.games.kp_ice.elements.Hook(_mcGrapplingElement, true);
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(_local4);
aHooks.push(_local4);
break;
case nGRAPPLING_ARRIVAL :
var _local2 = new com.disney.gem.games.kp_ice.elements.GrapplingZone(_mcGrapplingElement);
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(_local2);
aArrivals.push(_local2);
}
}
function init() {
aDepartures.sortOn("x", Array.NUMERIC);
aHooks.sortOn("x", Array.NUMERIC);
aArrivals.sortOn("x", Array.NUMERIC);
var _local2 = 0;
while (_local2 < aDepartures.length) {
aDepartures[_local2].setMatchingZone(aArrivals[_local2]);
aArrivals[_local2].setMatchingZone(aDepartures[_local2]);
aDepartures[_local2].setHook(aHooks[_local2]);
aArrivals[_local2].setHook(aHooks[_local2]);
_local2++;
}
}
static var nGRAPPLING_DEPARTURE = 0;
static var nGRAPPLING_HOOK = 1;
static var nGRAPPLING_ARRIVAL = 2;
}
Symbol 1923 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.CameraLock] Frame 0
class com.disney.gem.games.kp_ice.elements.CameraLock extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, bWallSet, removeReferenceMC, attachMC, mc, collideWithElementBox;
function CameraLock (_mc) {
super("cameraLock" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcRespawnPoint");
setMC(_mc);
bWallSet = false;
}
function init() {
removeReferenceMC();
attachMC();
mc._visible = false;
}
function state_idle() {
if (!bWallSet) {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.mc._x > mc._x) {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id, mc)) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.cameraLocked(this);
setWall(mc.mcState);
bWallSet = true;
}
}
}
}
function setWall(_mc) {
var _local4 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oLayerGame.getCollisionMap("wall");
var _local1 = new flash.geom.Rectangle();
var _local2 = _mc.getRect(_local4.mc);
_local1.topLeft = new flash.geom.Point(_local2.xMin - nX_DECAL, _local2.yMin);
_local1.bottomRight = new flash.geom.Point(_local2.xMax - nX_DECAL, _local2.yMax);
var _local3 = _local4.attachMC("mcCruncherZone", _local1.left, _local1.top);
_local3._width = _local1.width;
_local3._height = _local1.height;
return(_local3);
}
static var nX_DECAL = 20;
}
Symbol 1924 MovieClip [__Packages.com.disney.gem.games.kp_ice.HUD] Frame 0
class com.disney.gem.games.kp_ice.HUD
{
var oController, mc, nPreviousScore;
function HUD (_oController, _mcHUD) {
oController = _oController;
mc = _mcHUD;
nPreviousScore = com.disney.gem.games.kp_ice.Controller.getInstance().getScore();
mc.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
mc.btMenu.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
mc.mcScore.mcScore.txtScore.text = oController.getScore();
mc.mcEnergy1.gotoAndStop(100);
mc.mcEnergy2.gotoAndStop(100);
mc.mcCharacters.gotoAndStop(nKIM_FRAME);
}
function update() {
updateEnergy();
updateLife();
updateScore();
}
function switchCharacter(_oActiveChar) {
if (_oActiveChar == com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1) {
mc.mcCharacters.gotoAndStop(nKIM_FRAME);
} else {
mc.mcCharacters.gotoAndStop(nRON_FRAME);
}
}
function onBtMenu() {
oController.showInGameMenu();
oController.playClickSound();
}
function updateEnergy() {
if ((mc.mcEnergy1._currentframe > 1) && (mc.mcEnergy1._currentframe > oController.oGame.oPlayer1.nEnergy)) {
mc.mcEnergy1.prevFrame();
} else if (mc.mcEnergy1._currentframe < oController.oGame.oPlayer1.nEnergy) {
mc.mcEnergy1.gotoAndStop(oController.oGame.oPlayer1.nEnergy);
}
if ((mc.mcEnergy2._currentframe > 1) && (mc.mcEnergy2._currentframe > oController.oGame.oPlayer2.nEnergy)) {
mc.mcEnergy2.prevFrame();
} else if (mc.mcEnergy2._currentframe < oController.oGame.oPlayer2.nEnergy) {
mc.mcEnergy2.gotoAndStop(oController.oGame.oPlayer2.nEnergy);
}
}
function updateLife() {
mc.mcLifes.txtLife.text = oController.nLife;
}
function updateScore() {
var _local2 = nPreviousScore;
if (_local2 < oController.getScore()) {
_local2 = _local2 + nSCORE_INCREMENT_STEP;
_local2 = Math.min(_local2, oController.getScore());
nPreviousScore = _local2;
mc.mcScore.mcScore.txtScore.text = com.sarbakan.utils.Tools.getFormatedNumber(_local2);
}
}
static var nSCORE_INCREMENT_STEP = 10;
static var nKIM_FRAME = 2;
static var nRON_FRAME = 1;
}
Symbol 1925 MovieClip [__Packages.com.sarbakan.utils.Tools] Frame 0
class com.sarbakan.utils.Tools
{
function Tools () {
}
static function isItemInArray(_aArray, _oItem) {
var _local3 = false;
var _local1 = _aArray.length - 1;
while (_local1 >= 0) {
if (_aArray[_local1] == _oItem) {
_local3 = true;
}
_local1--;
}
return(_local3);
}
static function doCopyArray(_aArraySource) {
var _local3 = new Array();
var _local1 = 0;
_local1 = 0;
while (_local1 < _aArraySource.length) {
if (_aArraySource[_local1] instanceof Array) {
_local3.push(doCopyArray(_aArraySource[_local1]));
} else {
_local3.push(_aArraySource[_local1]);
}
_local1++;
}
return(_local3);
}
static function getFormatedNumber(_nNumber, _nMinimumChar) {
return(returnFormatedNumber(_nNumber, _nMinimumChar));
}
static function returnFormatedNumber(_nNumber, _nMinimumChar) {
var _local1 = String(_nNumber);
while (_local1.length < _nMinimumChar) {
_local1 = "0" + _local1;
}
var _local3 = new Array();
var _local6 = _local1.length - 1;
var _local2;
_local2 = 0;
while (_local2 <= _local6) {
var _local5 = _local1.charAt(_local2);
_local3.push(_local5);
_local2++;
}
_local1 = "";
var _local4 = 0;
_local2 = _local3.length - 1;
while (_local2 >= 0) {
if (((_local4 % 3) == 0) && (_local4 != 0)) {
_local1 = "," + _local1;
}
_local1 = _local3[_local2] + _local1;
_local4++;
_local2--;
}
return(_local1);
}
static function getFormatedTime(_nTime, _bIncludeMilliseconds, _bShowMinutes) {
if (_bIncludeMilliseconds == undefined) {
_bIncludeMilliseconds = false;
}
if (_bShowMinutes == undefined) {
_bShowMinutes = true;
}
var _local6 = false;
if (_nTime < 0) {
_local6 = true;
_nTime = Math.abs(_nTime);
}
var _local4 = Math.floor(_nTime / 1000);
var _local3;
if (_bIncludeMilliseconds) {
var _local5;
if (_nTime >= 1000) {
_local5 = _nTime % (_local4 * 1000);
} else {
_local5 = _nTime;
}
_local3 = String(_local5).substr(0, 2);
if (_local3.length <= 1) {
_local3 = "0" + _local3;
}
}
var _local7 = Math.floor(_local4 / 60);
var _local8 = Math.floor(_local4 % 60);
var _local11 = "";
var _local9 = "";
if (_local8 < 10) {
_local9 = "0";
}
if (_local7 < 10) {
_local11 = "0";
}
var _local1 = "";
if (_bShowMinutes) {
_local1 = _local1 + String((_local11 + _local7) + ":");
}
_local1 = _local1 + (_local9 + _local8);
if (_bIncludeMilliseconds) {
_local1 = _local1 + (":" + _local3);
}
if (_local6) {
_local1 = "-" + _local1;
}
return(_local1);
}
static function getTrimmedString(_sStr) {
while (_sStr.charAt(0) == " ") {
_sStr = _sStr.substring(1, _sStr.length);
}
while (_sStr.charAt(_sStr.length - 1) == " ") {
_sStr = _sStr.substring(0, _sStr.length - 1);
}
return(_sStr);
}
}
Symbol 1926 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.BaseEnnemy] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.BaseEnnemy extends com.disney.gem.games.kp_ice.sarbakan.visual.element.basicElement.Character
{
var setMC, setDirection, bHitMode, bFlashActive, oDecisionMaker, id, removeReferenceMC, attachMC, oPlayer, nAttackDelayCount, oHitColorTranform, mc, stateIsNot, nEnergy, setState, fTurnCallBack, nHitFlashTimer, nFlashDelay, nMoveSpeedX, bNoFlip, nDirection, stateIs, setPositionOutFloor, bSwitchDirection, nSpeedX, nSpeedY, isActive, checkFall, stateFinished, stateStarting, fJumpCallBack, sBackColliderName, collideWithMap, sFloorColliderID, nPlayerSwitchCheck;
function BaseEnnemy (_mc) {
super("ennemy" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setMC(_mc);
setDirection(1);
bHitMode = false;
bFlashActive = false;
oDecisionMaker = new com.disney.gem.games.kp_ice.sarbakan.ai.DecisionMaker(this, id);
respawn();
}
function init() {
removeReferenceMC();
attachMC();
oPlayer = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer;
nAttackDelayCount = 0;
oHitColorTranform = MovieClip(mc.mcAdvancedRef).transform.colorTransform;
}
function update() {
super.update();
if (mc.mcAdvancedRef) {
mc.mcAdvancedRef.swapDepths(651);
mc.mcAdvancedRef.removeMovieClip();
}
if ((stateIsNot("hurt") && (!oDecisionMaker.isEmpty())) && (oDecisionMaker.isDecisionCompleted())) {
oDecisionMaker.makeDecision();
}
if (nAttackDelayCount < nATTACK_DELAY) {
nAttackDelayCount++;
}
if (bHitMode) {
hitFlash();
}
checkHurt();
checkPlayerSwitch();
}
function respawn() {
nEnergy = com.disney.gem.games.kp_ice.GameData.nENERGY_FULL;
setState(sSTATE_IDLE, true);
setBehaviorRegular();
}
function initTurn(_fCallBack) {
fTurnCallBack = _fCallBack;
setState(sSTATE_TURN, true);
}
function initAttack() {
setState(sSTATE_ATTACK);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sHENCHMAN_ATTACK, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function initHurt(_nEnergy) {
nEnergy = nEnergy - _nEnergy;
if (nEnergy > 0) {
setState(sSTATE_HURT);
nHitFlashTimer = nHIT_FLASH_TIMER;
nFlashDelay = nFLASH_DELAY;
bHitMode = true;
} else {
initDie(false);
}
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sHENCHMAN_HURT, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
function initDie(_bRemoved) {
if (!_bRemoved) {
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sHENCHMAN_DIES, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
setState(sSTATE_DIE);
} else {
setState(sSTATE_DEAD);
}
bHitMode = false;
mc.transform.colorTransform = new flash.geom.ColorTransform();
}
function initWalkBackward() {
nMoveSpeedX = nMoveSpeedX * 1.5;
setState(sSTATE_RUN);
bNoFlip = true;
setDirection(oPlayer.nDirection);
}
function endWalkBackward() {
bNoFlip = false;
nMoveSpeedX = nMoveSpeedX / 1.5;
setDirection(nDirection * -1);
}
function isOnPlayerFloor() {
var _local2 = Math.abs(mc._y - oPlayer.mc._y);
return((!oPlayer.isJumping()) && (_local2 <= nDISTANCE_FLOOR));
}
function isOnPlayerFloorOrNearJumping() {
var _local2 = Math.abs(mc._y - oPlayer.mc._y);
return(_local2 <= nDISTANCE_FLOOR);
}
function isFarFromPlayer(_nDistance) {
var _local2 = Math.abs(mc._x - oPlayer.mc._x);
return(_local2 >= _nDistance);
}
function isNearPlayer(_nDistance, _bAllowInAir) {
var _local2 = Math.abs(mc._x - oPlayer.mc._x);
if (_nDistance == undefined) {
_nDistance = nDISTANCE_NEAR;
}
return((_local2 <= _nDistance) && (_bAllowInAir || (isOnPlayerFloor())));
}
function isHurt() {
return(stateIs(sSTATE_HURT, sSTATE_DIE));
}
function isNotTurning() {
return(stateIsNot(sSTATE_TURN));
}
function isMoveAvailable() {
return(stateIsNot(sSTATE_HURT, sSTATE_DIE, sSTATE_DEAD));
}
function isAttacked() {
return(oPlayer.isAttacking() && (isNearPlayer(nDISTANCE_NEAR * 1.5)));
}
function isLookingAtPlayer() {
return(((nDirection == 1) && (mc._x <= oPlayer.mc._x)) || ((nDirection == -1) && (mc._x >= oPlayer.mc._x)));
}
function isPlayerLookingAtEnnemy() {
return(((oPlayer.nDirection == 1) && (oPlayer.mc._x <= mc._x)) || ((oPlayer.nDirection == -1) && (oPlayer.mc._x >= mc._x)));
}
function canAttack() {
return((stateIs(sSTATE_IDLE, sSTATE_RUN, sSTATE_RUN_START) && (isNearPlayer())) && (nAttackDelayCount >= nATTACK_DELAY));
}
function onEnable() {
if (nEnergy <= 0) {
setState(sSTATE_DEAD);
} else {
setPositionOutFloor();
}
}
function state_idle_init() {
if (bSwitchDirection) {
setDirection(nDirection * -1);
bSwitchDirection = false;
if (fTurnCallBack) {
fTurnCallBack();
fTurnCallBack = null;
}
}
}
function state_idle() {
nSpeedX = 0;
nSpeedY = 0;
if (isActive()) {
checkFall();
setPositionOutFloor();
}
}
function state_runStart() {
if (stateFinished()) {
setState(sSTATE_RUN);
}
nSpeedX = 0;
nSpeedY = 0;
if (isActive()) {
checkFall();
setPositionOutFloor();
}
}
function state_run() {
nSpeedX = nMoveSpeedX * nDirection;
nSpeedY = 0;
if (isActive()) {
checkFall();
setPositionOutFloor();
checkWall();
}
if (isOnFloorEgde()) {
nSpeedX = 0;
}
}
function state_turn() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
bSwitchDirection = true;
setState(sSTATE_IDLE);
}
}
function state_attack_init() {
nSpeedX = 0;
nSpeedY = 0;
}
function state_attack() {
if (mc.sword.hitTest(oPlayer.mc.body)) {
oPlayer.hurt(com.disney.gem.games.kp_ice.GameData.nHURT_PLAYER_ENNEMY);
}
if (isOnFloorEgde(true) || (isOnFloorEgde(false, true))) {
nSpeedX = 0;
}
checkWall();
if (stateFinished()) {
nAttackDelayCount = 0;
setState(sSTATE_IDLE);
}
if (isActive()) {
checkFall();
setPositionOutFloor();
}
}
function state_block() {
nSpeedX = 0;
nSpeedY = 0;
if (stateStarting()) {
}
if (stateFinished()) {
setState(sSTATE_IDLE);
}
if (isActive()) {
checkFall();
setPositionOutFloor();
}
}
function state_hurt_init() {
bNoFlip = true;
setDirection(oPlayer.nDirection);
nSpeedX = nPUSHBACK_SPEED * nDirection;
}
function state_hurt(_bNoLookTowardPlayer) {
if (isActive()) {
checkFall();
setPositionOutFloor();
checkWall();
}
if (isOnFloorEgde(true) || (isOnFloorEgde(false, true))) {
nSpeedX = 0;
}
if (stateFinished()) {
bNoFlip = false;
nSpeedX = 0;
if ((!_bNoLookTowardPlayer) && (!isLookingAtPlayer())) {
setDirection(nDirection * -1);
}
setState(sSTATE_IDLE);
oDecisionMaker.abortCurrentDecision();
setBehaviorDefensive();
oDecisionMaker.makeDecision();
setBehaviorRegular();
}
}
function state_die_init() {
oDecisionMaker.clear();
}
function state_die() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
com.disney.gem.games.kp_ice.Controller.getInstance().increaseScore(com.disney.gem.games.kp_ice.GameData.nSCORE_ENNEMY);
setState(sSTATE_DEAD);
}
}
function state_dead() {
nSpeedX = 0;
nSpeedY = 0;
oDecisionMaker.clear();
}
function state_jump() {
super.state_jump();
if (stateFinished()) {
mc.mcState.stop();
}
}
function state_jumpLand() {
super.state_jumpLand();
fJumpCallBack();
}
function hitFlash() {
nHitFlashTimer--;
if (nHitFlashTimer <= 0) {
bHitMode = false;
mc.transform.colorTransform = new flash.geom.ColorTransform();
} else {
nFlashDelay--;
if (nFlashDelay <= 0) {
nFlashDelay = nFLASH_DELAY;
bFlashActive = !bFlashActive;
if (bFlashActive) {
mc.transform.colorTransform = oHitColorTranform;
} else {
mc.transform.colorTransform = new flash.geom.ColorTransform();
}
}
}
}
function setBehaviorRegular() {
}
function setBehaviorDefensive() {
}
function checkHurt() {
if (stateIsNot(sSTATE_DIE, sSTATE_DEAD, sSTATE_HURT)) {
if (mc.body.hitTest(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.mc.sword) || (mc.body.hitTest(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.mc.sword))) {
initHurt(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.getHurtValue());
}
}
}
function checkWall() {
if (bNoFlip || (((nDirection == 1) && (nSpeedX < 0)) || ((nDirection == -1) && (nSpeedX > 0)))) {
sBackColliderName = "back";
} else {
sBackColliderName = undefined;
}
super.checkWall();
}
function isOnFloorEgde(_bCheckBack, _bCheckFront) {
var _local2;
if ((!_bCheckFront) && (bNoFlip || (_bCheckBack))) {
_local2 = mc.backEdge;
} else {
_local2 = mc.frontEdge;
}
return(!collideWithMap(sFloorColliderID, _local2));
}
function checkPlayerSwitch() {
nPlayerSwitchCheck++;
if ((nPlayerSwitchCheck >= nPLAYER_SWITCH_CHECK) && (com.disney.gem.games.kp_ice.elements.characters.BasePlayer.bRadioEnabled)) {
nPlayerSwitchCheck = 0;
var _local5 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1;
var _local2 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2;
var _local4 = com.disney.gem.games.kp_ice.sarbakan.utils.MoreMath.getManhattanDistance(mc._x, mc._y, _local5.mc._x, _local5.mc._y);
var _local3 = com.disney.gem.games.kp_ice.sarbakan.utils.MoreMath.getManhattanDistance(mc._x, mc._y, _local2.mc._x, _local2.mc._y);
if ((_local4 < _local3) || (!_local2.isActive())) {
if (oPlayer != _local5) {
oPlayer = _local5;
}
} else if ((_local3 <= _local4) || (!_local5.isActive())) {
if (oPlayer != _local2) {
oPlayer = _local2;
}
}
} else if (nPlayerSwitchCheck >= nPLAYER_SWITCH_CHECK) {
nPlayerSwitchCheck = 0;
var _local5 = com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1;
oPlayer = _local5;
}
}
var nSPEED_RUN = 5;
static var nPUSHBACK_SPEED = 4;
var nDISTANCE_FLOOR = 70;
static var nDISTANCE_NEAR = 70;
var nATTACK_DELAY = 5;
static var nFLASH_DELAY = 2;
static var nHIT_FLASH_TIMER = 20;
static var sSTATE_IDLE = "idle";
static var sSTATE_RUN_START = "runStart";
static var sSTATE_RUN = "run";
static var sSTATE_TURN = "turn";
static var sSTATE_ATTACK = "attack";
static var sSTATE_HURT = "hurt";
static var sSTATE_DIE = "die";
static var sSTATE_DEAD = "dead";
static var nPLAYER_SWITCH_CHECK = 60;
}
Symbol 1927 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.ai.DecisionMaker] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.ai.DecisionMaker
{
var oOwner, sOwner, aDecisionList, bDebug, oCurrentDecision;
function DecisionMaker (_oOwner, _sOwner) {
oOwner = _oOwner;
sOwner = _sOwner;
clear();
}
function addDecision(_oDecision) {
_oDecision.setOwner(oOwner);
aDecisionList.push(_oDecision);
}
function addDecisionFirst(_oDecision) {
aDecisionList.unshift(_oDecision);
}
function removeDecision(_sType) {
var _local2 = aDecisionList.length - 1;
while (_local2 >= 0) {
if (aDecisionList[_local2].getType() == _sType) {
aDecisionList.splice(_local2, 1);
}
_local2--;
}
}
function makeDecision() {
var _local3;
if (bDebug) {
}
if (isEmpty()) {
if (bDebug) {
}
} else {
var _local2 = 0;
while (_local2 < aDecisionList.length) {
_local3 = aDecisionList[_local2];
if (_local3.make()) {
if (bDebug) {
}
break;
}
_local2++;
}
}
oCurrentDecision = _local3;
return(_local3.getType());
}
function isDecisionCompleted() {
var _local2 = true;
if (oCurrentDecision != undefined) {
_local2 = oCurrentDecision.isCompleted();
}
return(_local2);
}
function abortCurrentDecision() {
oCurrentDecision.abort();
}
function getCurrentDecision() {
return(oCurrentDecision);
}
function clear() {
aDecisionList = [];
}
function isEmpty() {
return(aDecisionList.length < 1);
}
function enableDebug() {
bDebug = true;
}
function disableDebug() {
bDebug = false;
}
function traceDecisionList() {
var _local3 = "";
_local3 = _local3 + (("Decision list for " + sOwner) + ": \n");
var _local2 = 0;
while (_local2 < aDecisionList.length) {
_local3 = _local3 + (("\t" + aDecisionList[_local2]) + newline);
_local2++;
}
}
}
Symbol 1928 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.ai.Decision] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var oOwner, bDecisionMade;
function Decision () {
}
function setOwner(_oOwner) {
oOwner = _oOwner;
}
function make() {
bDecisionMade = false;
checkConditions();
return(bDecisionMade);
}
function getType() {
return(TYPE);
}
function toString() {
return(("[Decision " + TYPE) + "]");
}
function isCompleted() {
return(true);
}
function abort() {
}
function checkConditions() {
}
var TYPE = "Decision";
}
Symbol 1929 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.characters.Ennemy] Frame 0
class com.disney.gem.games.kp_ice.elements.characters.Ennemy extends com.disney.gem.games.kp_ice.elements.characters.BaseEnnemy
{
var setLinkage, oDecisionMaker;
function Ennemy (_mc, _nType) {
super(_mc);
aAllEnnemies.push(this);
switch (_nType) {
case 0 :
setLinkage("mcEnnemy_1");
break;
case 1 :
setLinkage("mcEnnemy_2");
}
}
static function respawnAfter(_nX) {
var _local1 = 0;
while (_local1 <= (aAllEnnemies.length - 1)) {
if (com.disney.gem.games.kp_ice.elements.characters.Ennemy(aAllEnnemies[_local1]).getCoord().x > _nX) {
com.disney.gem.games.kp_ice.elements.characters.Ennemy(aAllEnnemies[_local1]).respawn();
} else {
com.disney.gem.games.kp_ice.elements.characters.Ennemy(aAllEnnemies[_local1]).initDie(true);
}
_local1++;
}
}
static function resetEnnemies() {
aAllEnnemies = new Array();
}
function setBehaviorDefensive() {
setBehaviorRegular();
}
function setBehaviorRegular() {
oDecisionMaker.abortCurrentDecision();
oDecisionMaker.clear();
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionLookTowardPlayer());
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionAttack(1));
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionWalkTowardPlayer(0.65));
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionWalkBackAndForth());
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionWait(0.1));
oDecisionMaker.addDecision(new com.disney.gem.games.kp_ice.decisions.DecisionIdle());
}
var nSPEED_RUN = 5;
static var aAllEnnemies = new Array();
}
Symbol 1930 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionLookTowardPlayer] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionLookTowardPlayer extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var nLastUse, bCompleted, oOwner, bDecisionMade;
function DecisionLookTowardPlayer () {
super();
nLastUse = 0;
}
function isCompleted() {
return(bCompleted);
}
function onTurnDone() {
bCompleted = true;
}
function checkConditions() {
if ((nLastUse <= (getTimer() - 1500)) && (oOwner.isFarFromPlayer(nMIN_FOR_TURN, true))) {
if (oOwner.isNearPlayer(nMAX_FOR_TURN, true)) {
if (oOwner.oPlayer != undefined) {
if (oOwner.isMoveAvailable() && (((oOwner.mc._x <= oOwner.oPlayer.mc._x) && (oOwner.nDirection != 1)) || ((oOwner.mc._x > oOwner.oPlayer.mc._x) && (oOwner.nDirection != -1)))) {
bDecisionMade = true;
nLastUse = getTimer();
bCompleted = false;
oOwner.initTurn(com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, onTurnDone));
}
}
}
}
}
var TYPE = "LookTowardPlayer";
static var nMIN_FOR_TURN = 30;
static var nMAX_FOR_TURN = 100;
}
Symbol 1931 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionAttack] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionAttack extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var nAttackChance, oOwner, nLastAttack, bDecisionMade;
function DecisionAttack (_nAttackChance) {
super();
nAttackChance = _nAttackChance;
}
function isCompleted() {
return(oOwner.stateIsNot(com.disney.gem.games.kp_ice.elements.characters.BaseEnnemy.sSTATE_ATTACK));
}
function checkConditions() {
if ((nLastAttack + 1500) >= getTimer()) {
oOwner.canAttack();
}
if (((((((nLastAttack + 1500) >= getTimer()) && (oOwner.isOnPlayerFloorOrNearJumping())) && (oOwner.canAttack())) && (oOwner.isLookingAtPlayer())) && (Math.random() <= nAttackChance)) && (oOwner.isActive())) {
oOwner.initAttack();
nLastAttack = getTimer();
bDecisionMade = true;
}
}
var TYPE = "Attack";
}
Symbol 1932 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionWalkTowardPlayer] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionWalkTowardPlayer extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var nWalkChance, nDistancePlayer, nTimeWalking, oOwner, bDecisionMade;
function DecisionWalkTowardPlayer (_nWalkChance, _nDistancePlayer) {
super();
nWalkChance = _nWalkChance;
if (_nDistancePlayer != undefined) {
nDistancePlayer = _nDistancePlayer;
} else {
nDistancePlayer = nDISTANCE_NEAR;
}
}
function isCompleted() {
nTimeWalking++;
return((((nTimeWalking >= 60) || (oOwner.isNearPlayer(nDISTANCE_CLOSE_TO))) || (!oOwner.isLookingAtPlayer())) || (oOwner.isOnFloorEgde(false, true)));
}
function onTurnComplete() {
oOwner.setState("runStart");
}
function checkConditions() {
var _local2 = Math.random();
if ((((_local2 <= nWalkChance) && (!oOwner.isNearPlayer(nDistancePlayer))) && (oOwner.isOnPlayerFloor())) && (!oOwner.isOnFloorEgde(false, true))) {
if (!oOwner.isLookingAtPlayer()) {
oOwner.initTurn(com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, onTurnComplete));
} else {
onTurnComplete();
}
nTimeWalking = 0;
bDecisionMade = true;
}
}
var TYPE = "WalkTowardPlayer";
var nDISTANCE_NEAR = 100;
var nDISTANCE_CLOSE_TO = 40;
}
Symbol 1933 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionWalkBackAndForth] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionWalkBackAndForth extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var nDistanceNear, n, nLastUse, nSwitchDelayCount, oOwner, bDecisionMade;
function DecisionWalkBackAndForth (_nDistanceNear) {
super();
if (_nDistanceNear != undefined) {
nDistanceNear = _nDistanceNear;
} else {
nDistanceNear = nDISTANCE_NEAR_ATTACK;
}
n = 0;
nLastUse = 0;
}
function isCompleted() {
nSwitchDelayCount++;
if ((oOwner.isHittingWall() != undefined) || ((oOwner.isOnPlayerFloor() && (oOwner.isNearPlayer(nDistanceNear))) && (Math.random() < nCHANCE_SIGHT))) {
return(true);
}
if (((nSwitchDelayCount >= nDELAY_MINIMUM_SWITCH) && (Math.random() < nCHANCE_DONE)) || (oOwner.isOnFloorEgde(false, true))) {
return(true);
}
}
function onTurnComplete() {
if (!oOwner.isOnFloorEgde(false, true)) {
oOwner.setState("runStart");
}
}
function checkConditions() {
if (((((((nLastUse <= (getTimer() - 1500)) && ((!oOwner.isLookingAtPlayer()) || (!oOwner.isNearPlayer(50)))) && (oOwner.isMoveAvailable())) && (oOwner.isNotTurning())) && (oOwner.nSpeedY == 0)) && (oOwner.isHittingWall() == undefined)) && (!oOwner.isOnFloorEgde(false, true))) {
nSwitchDelayCount = 0;
nLastUse = getTimer();
bDecisionMade = true;
if (!oOwner.isOnFloorEgde(true, false)) {
if ((!oOwner.isLookingAtPlayer()) || (!oOwner.isNearPlayer(50))) {
oOwner.initTurn(com.disney.gem.games.kp_ice.sarbakan.utils.Delegate.create(this, onTurnComplete));
}
} else {
bDecisionMade = false;
}
}
}
var TYPE = "WalkBackAndForth";
static var nDELAY_MINIMUM_SWITCH = 50;
static var nDISTANCE_NEAR_ATTACK = 200;
static var nCHANCE_DONE = 0.5;
static var nCHANCE_SIGHT = 0.1;
}
Symbol 1934 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionWait] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionWait extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var nChanceWait, nWaitDelay, oOwner, nWaitDelayCount, bDecisionMade;
function DecisionWait (_nChance, _nMinimumDelay) {
super();
nChanceWait = _nChance;
if (_nMinimumDelay != undefined) {
nWaitDelay = _nMinimumDelay;
} else {
nWaitDelay = nDELAY_MINIMUM_WAIT;
}
}
function isCompleted() {
if ((oOwner.isNearPlayer() && (oOwner.isLookingAtPlayer())) && (Math.random() < nCHANCE_SIGHT)) {
return(true);
}
if (((++nWaitDelayCount) >= nWaitDelay) && (Math.random() < nCHANCE_RESUME)) {
return(true);
}
}
function checkConditions() {
if (oOwner.isMoveAvailable() && (Math.random() < nChanceWait)) {
nWaitDelayCount = 0;
oOwner.setState("idle");
bDecisionMade = true;
}
}
var TYPE = "Wait";
static var nCHANCE_RESUME = 0.6;
static var nCHANCE_SIGHT = 0.8;
static var nDELAY_MINIMUM_WAIT = 30;
}
Symbol 1935 MovieClip [__Packages.com.disney.gem.games.kp_ice.decisions.DecisionIdle] Frame 0
class com.disney.gem.games.kp_ice.decisions.DecisionIdle extends com.disney.gem.games.kp_ice.sarbakan.ai.Decision
{
var bDontSwitchState, oOwner, bDecisionMade;
function DecisionIdle (_bDontSwitchState) {
super();
bDontSwitchState = _bDontSwitchState;
}
function isCompleted() {
return(true);
}
function checkConditions() {
if (oOwner.isMoveAvailable() && (!bDontSwitchState)) {
oOwner.setState("idle");
}
bDecisionMade = true;
}
var TYPE = "Idle";
}
Symbol 1936 MovieClip [__Packages.com.disney.gem.games.kp_ice.sarbakan.visual.activation.GridActivation] Frame 0
class com.disney.gem.games.kp_ice.sarbakan.visual.activation.GridActivation extends com.disney.gem.games.kp_ice.sarbakan.visual.activation.ActivationManager
{
var nZoneWidth, nZoneHeight, aDynamicElementsZone, aAlwaysActive, aStaticElementsZone, oCurrentZone, oElementZonesIndex, nCurrentX, nCurrentY, aVisibleZones;
function GridActivation () {
super();
}
function init(_nZoneWidth, _nZoneHeight) {
super.init();
nZoneWidth = _nZoneWidth;
nZoneHeight = _nZoneHeight;
aDynamicElementsZone = [];
aAlwaysActive = [];
aStaticElementsZone = [];
oCurrentZone = {x:-999999, y:-999999};
oElementZonesIndex = {};
}
function getActiveElements() {
var _local6 = {};
var _local2 = getSurroundingZones(oCurrentZone);
_local2.push(oCurrentZone);
var _local5 = _local2.length - 1;
while (_local5 >= 0) {
if (aDynamicElementsZone[_local2[_local5].x][_local2[_local5].y].length > 0) {
var _local3 = aDynamicElementsZone[_local2[_local5].x][_local2[_local5].y].length - 1;
while (_local3 >= 0) {
var _local4 = aDynamicElementsZone[_local2[_local5].x][_local2[_local5].y][_local3];
_local6[_local4.id] = _local4;
_local3--;
}
}
_local5--;
}
_local5 = aAlwaysActive.length - 1;
while (_local5 >= 0) {
_local6[aAlwaysActive[_local5].id] = aAlwaysActive[_local5];
_local5--;
}
return(_local6);
}
function addDynamicElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
addToActivationZones(aDynamicElementsZone, _oElement, _nX, _nY, _nWidth, _nHeight);
}
function removeDynamicElement(_oElement) {
for (var _local5 in oElementZonesIndex[_oElement.id]) {
var _local2 = oElementZonesIndex[_oElement.id][_local5];
var _local3 = aDynamicElementsZone[_local2.x][_local2.y].length - 1;
while (_local3 >= 0) {
if (aDynamicElementsZone[_local2.x][_local2.y][_local3] == _oElement) {
aDynamicElementsZone[_local2.x][_local2.y].splice(_local3, 1);
break;
}
_local3--;
}
}
delete oElementZonesIndex[_oElement.id];
}
function addStaticElement(_oElement, _nX, _nY, _nWidth, _nHeight) {
addToActivationZones(aStaticElementsZone, _oElement, _nX, _nY, _nWidth, _nHeight);
}
function removeStaticElement(_oElement) {
}
function addAlwaysActiveElement(_oElement) {
aAlwaysActive.push(_oElement);
}
function removeAlwaysActiveElement(_oElement) {
var _local2 = aAlwaysActive.length - 1;
while (_local2 >= 0) {
if (aAlwaysActive[_local2] == _oElement) {
aAlwaysActive.splice(Number(_local2), 1);
break;
}
_local2--;
}
}
function updateActivation(_nX, _nY, _bForceUpdate) {
nCurrentX = _nX;
nCurrentY = _nY;
var _local11 = getCurrentZone();
var _local8 = getSurroundingZones(_local11);
_local8.push(_local11);
if (((_bForceUpdate || (_local11.x != oCurrentZone.x)) || (_local11.y != oCurrentZone.y)) || (zoneChanged(_local8))) {
if ((_local11.x != oCurrentZone.x) || (_local11.y != oCurrentZone.y)) {
var _local10 = getActiveElements();
for (var _local12 in _local10) {
_local10[_local12].updatePosInActivation();
}
}
var _local9 = getSurroundingZones(oCurrentZone);
var _local4 = {};
var _local12 = _local9.length - 1;
while (_local12 >= 0) {
_nX = _local9[_local12].x;
_nY = _local9[_local12].y;
if (aDynamicElementsZone[_nX][_nY] != undefined) {
var _local5 = aDynamicElementsZone[_nX][_nY].length - 1;
while (_local5 >= 0) {
_local4[aDynamicElementsZone[_nX][_nY][_local5].id] = {element:aDynamicElementsZone[_nX][_nY][_local5], enabled:false};
_local5--;
}
}
if (aStaticElementsZone[_nX][_nY] != undefined) {
var _local5 = aStaticElementsZone[_nX][_nY].length - 1;
while (_local5 >= 0) {
_local4[aStaticElementsZone[_nX][_nY][_local5].id] = {element:aStaticElementsZone[_nX][_nY][_local5], enabled:false};
_local5--;
}
}
_local12--;
}
_local12 = _local8.length - 1;
while (_local12 >= 0) {
_nX = _local8[_local12].x;
_nY = _local8[_local12].y;
if (aDynamicElementsZone[_nX][_nY] != undefined) {
var _local5 = aDynamicElementsZone[_nX][_nY].length - 1;
while (_local5 >= 0) {
_local4[aDynamicElementsZone[_nX][_nY][_local5].id] = {element:aDynamicElementsZone[_nX][_nY][_local5], enabled:true};
_local5--;
}
}
if (aStaticElementsZone[_nX][_nY] != undefined) {
var _local5 = aStaticElementsZone[_nX][_nY].length - 1;
while (_local5 >= 0) {
_local4[aStaticElementsZone[_nX][_nY][_local5].id] = {element:aStaticElementsZone[_nX][_nY][_local5], enabled:true};
_local5--;
}
}
_local12--;
}
for (_local12 in _local4) {
if (_local4[_local12].enabled == true) {
_local4[_local12].element.enable();
} else {
_local4[_local12].element.disable();
}
}
}
oCurrentZone = _local11;
aVisibleZones = _local8;
}
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);
if (!oElementZonesIndex[_oElementToRegister.id]) {
oElementZonesIndex[_oElementToRegister.id] = [];
}
oElementZonesIndex[_oElementToRegister.id].push({x:_local2.x, y:_local2.y});
}
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) {
var _local2 = aVisibleZones.length - 1;
while (_local2 >= 0) {
if ((aVisibleZones[_local2].x != _oVisibleZones[_local2].x) || (aVisibleZones[_local2].y != _oVisibleZones[_local2].y)) {
return(true);
}
_local2--;
}
return(false);
}
function mustStayEnabled(_nX, _nY, _oVisibleZones) {
var _local4 = false;
var _local2 = aVisibleZones.length - 1;
while (_local2 >= 0) {
if ((_oVisibleZones[_local2].x == _nX) && (_oVisibleZones[_local2].y == _nY)) {
_local4 = true;
break;
}
_local2--;
}
return(_local4);
}
}
Symbol 1937 MovieClip [__Packages.com.disney.gem.games.kp_ice.screens.TitleScreen] Frame 0
class com.disney.gem.games.kp_ice.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.kp_ice.Controller(oController).showInstructions();
oController.playClickSound(true);
}
function onBtPlay() {
com.disney.gem.games.kp_ice.Controller(oController).startNewGame();
oController.playClickSound(true);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
mcRef.mcState.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
}
}
Symbol 1938 MovieClip [__Packages.com.disney.gem.games.kp_ice.screens.HelpScreen] Frame 0
class com.disney.gem.games.kp_ice.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
}
function onBtPlay() {
if (oController.getGamePhase() == com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING) {
oController.startNewGame();
} else {
oController.hideInstructions();
}
oController.playClickSound(true);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.stop();
mcRef.mcState.btNext.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNext);
mcRef.mcState.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
mcRef.mcState.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
mcRef.mcState.btNext.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
mcRef.mcState.btBack.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
}
function onBtNext() {
com.disney.gem.games.kp_ice.Controller.getInstance().oTransitionManager.playTransition(com.disney.gem.games.kp_ice.Controller.sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, changePage, 1));
oController.playClickSound(true);
oController.playTransitionSound();
}
function changePage(_nWay) {
mcRef.mcState.gotoAndStop(mcRef.mcState._currentframe + _nWay);
state_idle_init();
}
function onBtBack() {
oController.playClickSound(true);
com.disney.gem.games.kp_ice.Controller.getInstance().oTransitionManager.playTransition(com.disney.gem.games.kp_ice.Controller.sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, changePage, -1));
oController.playTransitionSound();
}
}
Symbol 1939 MovieClip [__Packages.com.disney.gem.games.kp_ice.popups.MenuPopup] Frame 0
class com.disney.gem.games.kp_ice.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, bDontReallowInstructions, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSounds() {
oController.toggleSound();
renderSoundStatus();
oController.playClickSound();
}
function onBtHelp() {
oController.allowInstructions();
com.disney.gem.games.kp_ice.Controller(oController).showInstructions();
hide();
oController.playClickSound();
}
function onBtQuit() {
hide();
var _local2 = com.disney.gem.games.kp_ice.Controller(oController);
_local2.showPopup(new com.disney.gem.games.kp_ice.popups.ConfirmPopup(_local2.mcTimeline.mcPopups.mcConfirm), true);
bDontReallowInstructions = true;
oController.playClickSound();
}
function onBtResume() {
com.disney.gem.games.kp_ice.Controller(oController).hideInGameMenu();
hide();
oController.playClickSound();
}
function state_in_init() {
super.state_in_init();
setButtons();
oController.disallowInstructions();
}
function state_idle_init() {
super.state_idle_init();
setButtons();
}
function state_idle() {
renderSoundStatus();
}
function state_out_init() {
super.state_out_init();
setButtons();
if (!bDontReallowInstructions) {
oController.allowInstructions();
}
}
function setButtons() {
mcRef.mcState.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
mcRef.mcState.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.btQuit.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
mcRef.mcState.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
mcRef.mcState.btResume.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
renderSoundStatus();
}
function renderSoundStatus() {
var _local2;
if (oController.bSoundMuted) {
_local2 = "Off";
} else {
_local2 = "On";
}
mcRef.mcState.mcSoundToggle.gotoAndStop(_local2);
mcRef.mcState.mcSoundToggle.btSound.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSounds);
mcRef.mcState.mcSoundToggle.btSound.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
}
}
Symbol 1940 MovieClip [__Packages.com.disney.gem.games.kp_ice.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.kp_ice.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, oController, hide, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
com.disney.gem.games.kp_ice.Controller(oController).hideInGameMenu();
hide();
oController.playClickSound();
}
function onBtYes() {
com.disney.gem.games.kp_ice.Controller(oController).quitGame();
hide();
oController.playClickSound();
}
function state_in_init() {
super.state_in_init();
setButtons();
oController.disallowInstructions();
}
function state_idle_init() {
super.state_idle_init();
setButtons();
}
function state_out_init() {
super.state_out_init();
setButtons();
oController.allowInstructions();
}
function setButtons() {
mcRef.mcState.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.btYes.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
mcRef.mcState.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
mcRef.mcState.btNo.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
}
}
Symbol 1941 MovieClip [__Packages.com.disney.gem.games.kp_ice.screens.EndScreen] Frame 0
class com.disney.gem.games.kp_ice.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
}
function onBtPlay() {
com.disney.gem.games.kp_ice.Controller(oController).startNewGame();
oController.playClickSound(true);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound, true);
mcRef.mcState.mcScore.txtScore.text = com.sarbakan.utils.Tools.getFormatedNumber(com.disney.gem.games.kp_ice.Controller(oController).getScore());
}
}
Symbol 1942 MovieClip [__Packages.com.disney.gem.games.kp_ice.popups.CompletePopup] Frame 0
class com.disney.gem.games.kp_ice.popups.CompletePopup extends com.sarbakan.utils.ScreenController
{
var nPreviousScore, hide, oController, mcRef;
function CompletePopup (_mcRef, _nPS) {
super(_mcRef);
nPreviousScore = _nPS;
}
function onBtOk() {
com.disney.gem.games.kp_ice.Controller(com.disney.gem.games.kp_ice.Controller.getInstance()).levelEndPopupOver();
hide();
}
function state_in_init() {
super.state_in_init();
setButtons();
oController.disallowInstructions();
}
function state_idle_init() {
super.state_idle_init();
setButtons();
}
function state_out_init() {
super.state_out_init();
setButtons();
oController.allowInstructions();
}
function setButtons() {
mcRef.mcState.mcContent.mcScore.txtLevel.text = com.sarbakan.utils.Tools.getFormatedNumber(com.disney.gem.games.kp_ice.Controller.getInstance().getScore() - nPreviousScore);
mcRef.mcState.mcContent.mcScore.txtTotal.text = com.sarbakan.utils.Tools.getFormatedNumber(com.disney.gem.games.kp_ice.Controller.getInstance().getScore());
mcRef.mcState.mcContent.btOk.onRelease = com.sarbakan.utils.Delegate.create(this, onBtOk);
mcRef.mcState.mcContent.btOk.onRollOver = com.sarbakan.utils.Delegate.create(oController, oController.playRollSound);
}
}
Symbol 1943 MovieClip [__Packages.com.disney.gem.games.kp_ice.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.kp_ice.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.kp_ice.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.kp_ice.Controller(oController).mcTimeline.getBytesTotal();
if (_local2 == 1) {
com.disney.gem.games.kp_ice.Controller(oController).onPreloadingDone();
}
var _local3 = Math.round(_local2 * 100);
mcRef.mcState.mcContent.txtLoading.text = _local3 + "%";
}
}
Symbol 1944 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.ScriptExecuter] Frame 0
class com.disney.gem.games.kp_ice.elements.ScriptExecuter extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, oScriptToExecute, removeReferenceMC, attachMC, mc, getElement, remove;
function ScriptExecuter (_mc) {
super("scriptExecuter" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcScriptExecuter");
setMC(_mc);
oScriptToExecute = _mc.oScriptToExecute;
}
function init() {
removeReferenceMC();
attachMC();
mc._visible = false;
}
function state_idle() {
if (!oScriptToExecute.disabled()) {
if (mc.hitTest(getElement("player").mc)) {
var _local2 = oScriptToExecute.execute();
if (!_local2) {
remove();
}
}
}
}
static var sSTATE_IDLE = "idle";
}
Symbol 1945 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.DeathZone] Frame 0
class com.disney.gem.games.kp_ice.elements.DeathZone extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, mc, getElement, collideWithElementCollider, oOwner;
function DeathZone (_mc) {
super("deathZone" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcDeathZone");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
drawCollider();
mc._visible = false;
}
function state_idle() {
var _local3 = getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.id);
if (collideWithElementCollider(_local3.id, "bottom") && (!_local3.isDieing())) {
getElement(_local3.id).die();
}
var _local2 = getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.id);
if (collideWithElementCollider(_local2.id, "bottom") && (!_local2.isDieing())) {
getElement(_local2.id).die();
}
}
function drawCollider() {
var _local2 = oOwner.getCollisionMap("floor");
_local2.drawRect(mc._x, mc._y + nFLOOR_OFFSET_Y, mc._width, mc._height);
}
static var nFLOOR_OFFSET_Y = 10;
static var sSTATE_IDLE = "idle";
}
Symbol 1946 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Radio] Frame 0
class com.disney.gem.games.kp_ice.elements.Radio extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, collideWithElement, getElement, setState, stateFinished, remove;
function Radio (_mc) {
super("radio" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcRadio");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
}
function state_idle() {
if (collideWithElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)) {
com.disney.gem.games.kp_ice.elements.characters.BasePlayer(getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)).gotRadio();
setState(sSTATE_PICK);
}
}
function state_pick() {
if (stateFinished()) {
remove();
}
}
static var sSTATE_IDLE = "idle";
static var sSTATE_PICK = "pick";
}
Symbol 1947 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.RespawnPoint] Frame 0
class com.disney.gem.games.kp_ice.elements.RespawnPoint extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, mc, collideWithElementBox, remove;
function RespawnPoint (_mc) {
super("respawnPoint" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcRespawnPoint");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
mc._visible = false;
}
function state_idle() {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id, mc)) {
if (com.disney.gem.games.kp_ice.elements.characters.BasePlayer.bRadioEnabled) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.setRespawnLocation(mc._x, mc._y);
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.setRespawnLocation(mc._x, mc._y);
} else {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.setRespawnLocation(mc._x, mc._y);
}
remove();
}
}
static var sSTATE_IDLE = "idle";
}
Symbol 1948 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.ActivationBoss] Frame 0
class com.disney.gem.games.kp_ice.elements.ActivationBoss extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, mc, collideWithElementBox, remove;
function ActivationBoss (_mc) {
super("activationBoss" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcRespawnPoint");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
mc._visible = false;
}
function state_idle() {
if (com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.mc._x > mc._x) {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id, mc)) {
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.activateBoss();
remove();
}
}
}
}
Symbol 1949 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Bonus] Frame 0
class com.disney.gem.games.kp_ice.elements.Bonus extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, collideWithElementBox, setState, stateFinished, remove;
function Bonus (_mc) {
super("bonus" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcBonus");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
}
function state_idle() {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)) {
setState(sSTATE_PICK);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sBONUS_BATTERY, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
}
function state_pick() {
if (stateFinished()) {
com.disney.gem.games.kp_ice.Controller.getInstance().increaseScore(com.disney.gem.games.kp_ice.GameData.nSCORE_POTION);
remove();
}
}
static var sSTATE_IDLE = "idle";
static var sSTATE_PICK = "pick";
static var nREGAIN = 100;
}
Symbol 1950 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Potion] Frame 0
class com.disney.gem.games.kp_ice.elements.Potion extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, collideWithElementBox, getElement, setState, stateFinished, remove;
function Potion (_mc) {
super("bonus" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcPotion");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
}
function state_idle() {
if (collideWithElementBox(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)) {
com.disney.gem.games.kp_ice.elements.characters.BasePlayer(getElement(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oActivePlayer.id)).regainEnergy(nREGAIN);
setState(sSTATE_PICK);
com.sarbakan.sound.SoundManager.doPlaySound(com.disney.gem.games.kp_ice.GameData.sBONUS_BATTERY, com.disney.gem.games.kp_ice.GameData.nVOLUME_SOUND);
}
}
function state_pick() {
if (stateFinished()) {
com.disney.gem.games.kp_ice.Controller.getInstance().increaseScore(com.disney.gem.games.kp_ice.GameData.nSCORE_POTION);
remove();
}
}
static var sSTATE_IDLE = "idle";
static var sSTATE_PICK = "pick";
static var nREGAIN = 100;
}
Symbol 1951 MovieClip [__Packages.com.disney.gem.games.kp_ice.elements.Checkpoint] Frame 0
class com.disney.gem.games.kp_ice.elements.Checkpoint extends com.disney.gem.games.kp_ice.sarbakan.visual.element.DynamicElement
{
var setLinkage, setMC, removeReferenceMC, attachMC, mc, mcWall, oOwner;
function Checkpoint (_mc) {
super("checkPoint" + com.disney.gem.games.kp_ice.sarbakan.visual.element.BaseElement.getNextID());
setLinkage("mcCheckPoint");
setMC(_mc);
}
function init() {
removeReferenceMC();
attachMC();
mc._visible = false;
}
function state_idle() {
if ((isInZone(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.mc) && (isInZone(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.mc))) || (mc._x < Math.max(com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer1.mc._x, com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oPlayer2.mc._x))) {
if (mcWall != undefined) {
mcWall.removeMovieClip();
mcWall = undefined;
}
} else if (mcWall == undefined) {
drawCollider();
}
}
function drawCollider() {
var _local2 = oOwner.getCollisionMap("wall");
mcWall = _local2.attachMC("mcCruncherZone", mc._x, mc._y - nBLOCKADE_HEIGTH, "doorZone" + com.disney.gem.games.kp_ice.elements.Door.nDOOR_ID);
com.disney.gem.games.kp_ice.elements.Door.nDOOR_ID++;
mcWall._width = nBLOCKADE_WIDTH;
mcWall._height = nBLOCKADE_HEIGTH;
}
function isInZone(_mcObject) {
if (((_mcObject._x < mc._x) && (_mcObject._x > (mc._x - mc._width))) && (Math.abs(mc._y - _mcObject._y) < nY_THRESHOLD)) {
return(true);
}
return(false);
}
static var nBLOCKADE_WIDTH = 50;
static var nBLOCKADE_HEIGTH = 200;
static var nY_THRESHOLD = 20;
static var sSTATE_IDLE = "idle";
}
Symbol 62 MovieClip Frame 1
_visible = false;
Symbol 145 MovieClip Frame 1
this._visible = false;
Symbol 556 MovieClip Frame 1
stop();
Symbol 1761 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.ScriptExecuter(this));
Symbol 1765 MovieClip Frame 1
Symbol 1767 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.DeathZone(this));
Symbol 1772 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Radio(this));
Symbol 1777 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Elevator(this, com.disney.gem.games.kp_ice.elements.Elevator.sDIRECTION_DOWN));
Symbol 1778 MovieClip Frame 1
com.disney.gem.games.kp_ice.elements.Elevator.addArrival(this);
Symbol 1781 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Laser(this, com.disney.gem.games.kp_ice.elements.Laser.nORIENTATION_CEIL, false));
Symbol 1784 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Laser(this, com.disney.gem.games.kp_ice.elements.Laser.nORIENTATION_FLOOR, false));
Symbol 1790 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.boss.Wire(this));
Symbol 1791 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.boss.Wire(this));
Symbol 1799 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.boss.Wire(this));
Symbol 1800 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.boss.Wire(this));
Symbol 1803 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.Ennemy(this, 0));
Symbol 1806 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.characters.Ennemy(this, 1));
Symbol 1808 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RespawnPoint(this));
Symbol 1810 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Elevator(this, com.disney.gem.games.kp_ice.elements.Elevator.sDIRECTION_UP));
Symbol 1812 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Door(this, com.disney.gem.games.kp_ice.elements.Door.nORIENTATION_FLOOR, false));
Symbol 1814 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Door(this, com.disney.gem.games.kp_ice.elements.Door.nORIENTATION_WALL, false));
Symbol 1816 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Door(this, com.disney.gem.games.kp_ice.elements.Door.nORIENTATION_WALL, true));
Symbol 1817 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Door(this, com.disney.gem.games.kp_ice.elements.Door.nORIENTATION_FLOOR, true));
Symbol 1821 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.ActivationBoss(this));
Symbol 1823 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Bonus(this));
Symbol 1825 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Potion(this));
Symbol 1829 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.CameraLock(this));
Symbol 1830 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Checkpoint(this));
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook4" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook5" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook6" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook9" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1765 MovieClip "hook8" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door4", hidden:true}, {id:"laser2", hidden:false}];
var _aActionON = [{id:"door4", hidden:false}, {id:"laser2", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook2" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook3" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door2", hidden:false}];
var _aActionON = [{id:"door2", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hook1" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator1", hidden:false}, {id:"door3", hidden:true}, {id:"laser1", hidden:false}];
var _aActionON = [{id:"elevator1", hidden:false}, {id:"door3", hidden:false}, {id:"laser1", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door5", hidden:true}, {id:"door53", hidden:false}];
var _aActionON = [{id:"door5", hidden:false}, {id:"door53", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door6", hidden:true}, {id:"door7", hidden:false}];
var _aActionON = [{id:"door6", hidden:false}, {id:"door7", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"hook2", hidden:true}];
var _aActionON = [{id:"hook2", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator2", hidden:true}];
var _aActionON = [{id:"elevator2", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door8", hidden:false}, {id:"hook3", hidden:true}];
var _aActionON = [{id:"door8", hidden:true}, {id:"hook3", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door10", hidden:false}];
var _aActionON = [{id:"door10", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door9", hidden:true}];
var _aActionON = [{id:"door9", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door11", hidden:false}];
var _aActionON = [{id:"door11", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door12", hidden:false}, {id:"door13", hidden:false}];
var _aActionON = [{id:"door12", hidden:true}, {id:"door13", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door18", hidden:false}];
var _aActionON = [{id:"door18", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door19", hidden:false}];
var _aActionON = [{id:"door19", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door15", hidden:false}, {id:"door18", hidden:true}, {id:"door19", hidden:true}];
var _aActionON = [{id:"door15", hidden:true}, {id:"door18", hidden:false}, {id:"door19", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door16", hidden:false}, {id:"door17", hidden:false}];
var _aActionON = [{id:"door16", hidden:true}, {id:"door17", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator3", hidden:true}, {id:"hook4", hidden:true}];
var _aActionON = [{id:"elevator3", hidden:false}, {id:"hook4", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door21", hidden:false}, {id:"laser3", hidden:false}];
var _aActionON = [{id:"door21", hidden:true}, {id:"laser3", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator5", hidden:true}];
var _aActionON = [{id:"elevator5", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door21", hidden:true}, {id:"hook5", hidden:true}];
var _aActionON = [{id:"door21", hidden:false}, {id:"hook5", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator4", hidden:true}];
var _aActionON = [{id:"elevator4", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door12", hidden:true}, {id:"door13", hidden:false}, {id:"door14", hidden:false}];
var _aActionON = [{id:"door12", hidden:false}, {id:"door13", hidden:true}, {id:"door14", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door22", hidden:true}, {id:"door23", hidden:true}, {id:"door24", hidden:false}];
var _aActionON = [{id:"door22", hidden:false}, {id:"door23", hidden:false}, {id:"door24", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"hook6", hidden:true}];
var _aActionON = [{id:"hook6", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door22", hidden:true}];
var _aActionON = [{id:"door22", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door25", hidden:false}];
var _aActionON = [{id:"door25", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door27", hidden:false}, {id:"door52", hidden:true}];
var _aActionON = [{id:"door27", hidden:true}, {id:"door52", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door26", hidden:false}];
var _aActionON = [{id:"door26", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door27", hidden:true}, {id:"door52", hidden:false}, {id:"hook8", hidden:true}];
var _aActionON = [{id:"door27", hidden:false}, {id:"door52", hidden:true}, {id:"hook8", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door29", hidden:true}, {id:"door28", hidden:false}];
var _aActionON = [{id:"door29", hidden:false}, {id:"door28", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door28", hidden:false}, {id:"door30", hidden:false}];
var _aActionON = [{id:"door28", hidden:true}, {id:"door30", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"hook9", hidden:true}];
var _aActionON = [{id:"hook9", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator6", hidden:true}];
var _aActionON = [{id:"elevator6", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door38", hidden:false}];
var _aActionON = [{id:"door38", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door32", hidden:false}];
var _aActionON = [{id:"door32", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door31", hidden:false}];
var _aActionON = [{id:"door31", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door39", hidden:false}];
var _aActionON = [{id:"door39", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door41", hidden:false}];
var _aActionON = [{id:"door41", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door40", hidden:false}];
var _aActionON = [{id:"door40", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door42", hidden:false}];
var _aActionON = [{id:"door42", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door43", hidden:false}, {id:"laser4", hidden:false}];
var _aActionON = [{id:"door43", hidden:true}, {id:"laser4", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door44", hidden:false}];
var _aActionON = [{id:"door44", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door45", hidden:false}, {id:"door48", hidden:false}];
var _aActionON = [{id:"door45", hidden:true}, {id:"door48", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door46", hidden:true}, {id:"door50", hidden:false}];
var _aActionON = [{id:"door46", hidden:false}, {id:"door50", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF));
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door49", hidden:false}, {id:"laser5", hidden:false}, {id:"laser6", hidden:false}];
var _aActionON = [{id:"door49", hidden:true}, {id:"laser5", hidden:true}, {id:"laser6", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door1", hidden:false}, {id:"hook1", hidden:true}];
var _aActionON = [{id:"door1", hidden:true}, {id:"hook1", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_DEPARTURE);
}
Instance of Symbol 1765 MovieClip "hookBoss" in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_HOOK);
}
Instance of Symbol 1763 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.getInstance().addGrapplingElement(this, com.disney.gem.games.kp_ice.scripts.GrapplingZoneManager.nGRAPPLING_ARRIVAL);
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door12", hidden:true}, {id:"door13", hidden:false}, {id:"door14", hidden:false}];
var _aActionON = [{id:"door12", hidden:false}, {id:"door13", hidden:true}, {id:"door14", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch1));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"elevator4", hidden:true}];
var _aActionON = [{id:"elevator4", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch2));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door22", hidden:true}];
var _aActionON = [{id:"door22", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch3));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door27", hidden:true}, {id:"door52", hidden:false}, {id:"hook8", hidden:true}];
var _aActionON = [{id:"door27", hidden:false}, {id:"door52", hidden:true}, {id:"hook8", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch4));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door28", hidden:false}, {id:"door30", hidden:false}];
var _aActionON = [{id:"door28", hidden:true}, {id:"door30", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch5));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door39", hidden:false}];
var _aActionON = [{id:"door39", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch6));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door46", hidden:true}, {id:"door50", hidden:false}];
var _aActionON = [{id:"door46", hidden:false}, {id:"door50", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch7));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"mcWire3", hidden:true}];
var _aActionON = [{id:"mcWire3", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1775 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"mcWire1", hidden:true}];
var _aActionON = [{id:"mcWire1", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_RIGHT));
}
Instance of Symbol 1786 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"mcWire4", hidden:true}];
var _aActionON = [{id:"mcWire4", hidden:false}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.RufusZones(this, _aActionON, _aActionOFF, this._parent.mcRufusSwitch8));
}
Instance of Symbol 1769 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"mcWire2", hidden:false}];
var _aActionON = [{id:"mcWire2", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_LEFT));
}
Instance of Symbol 1788 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().addZone(this, com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nGRAPPLING);
}
Instance of Symbol 1788 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().addZone(this, com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nSLIDING);
}
Instance of Symbol 1788 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().addZone(this, com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nDOUBLE_JUMP);
}
Instance of Symbol 1788 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().addZone(this, com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nRUFUS);
}
Instance of Symbol 1774 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
var _aActionOFF = [{id:"door20", hidden:false}];
var _aActionON = [{id:"door20", hidden:true}];
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.addDynamicElement(new com.disney.gem.games.kp_ice.elements.Switch(this, _aActionON, _aActionOFF, com.disney.gem.games.kp_ice.elements.Switch.sFACE_FRONT));
}
Instance of Symbol 1788 MovieClip in Symbol 1831 MovieClip Frame 1
onClipEvent (load) {
com.disney.gem.games.kp_ice.scripts.FirstUsesManager.getInstance().addZone(this, com.disney.gem.games.kp_ice.scripts.FirstUsesManager.nBOSS);
}
Symbol 1833 MovieClip Frame 1
com.disney.gem.games.kp_ice.Controller.getInstance().oGame.oCam.addViewZone(this);