[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (20.42 KiB) ● ● ●
function submitScore() {
_level0.playerScore = score;
DOGE.loadMovie(_level0.fsd);
DOGE._visible = true;
btnCover._visible = true;
btnCover.useHandCursor = false;
gotoAndStop ("submitScore");
}
Array.prototype.indexOf = function (v, iStart) {
var _local3 = this;
var _local2 = _local3.length;
var _local1 = Math.max(0, iStart);
while (_local1 < _local2) {
if (_local3[_local1] == v) {
return(_local1);
}
_local1++;
}
return(-1);
};
Array.prototype.lastIndexOf = function (v, iStart) {
var _local2 = this;
var _local3 = v;
var _local1 = Math.min(_local2.length, iStart);
while (_local1 > 0) {
if (_local2[_local1] == _local3) {
return(_local1);
}
_local1--;
}
return(-1);
};
Array.prototype.remove = function (v) {
var _local2 = this;
var _local3 = _local2.length - 1;
var _local1 = _local3;
while (_local1 >= 0) {
if (_local2[_local1] == v) {
_local2.splice(_local1, 1);
}
_local1--;
}
};
Array.prototype.swap = function (iA, iB) {
var _local1 = this;
var _local2 = _local1[iA];
_local1[iA] = _local1[iB];
_local1[iB] = _local2;
};
Array.prototype.highLow = function (a, b) {
if (a == b) {
return(0);
}
return(((a < b) ? -1 : 1));
};
Array.prototype.sortNumbers = function () {
this.sort(this.highLow);
};
Array.prototype.bubbleSortOn = function (sProp) {
var _local2 = this;
if (sProp == null) {
return(null);
}
var _local3 = _local2.length - 1;
while (_local3 >= 0) {
var _local1 = 0;
while (_local1 < _local3) {
if (_local2[_local1][sProp] > _local2[_local1 + 1][sProp]) {
_local2.swap(_local1, _local1 + 1);
}
_local1++;
}
_local3--;
}
return(undefined);
};
Array.prototype.findOn = function (sName, vValue, iFrom) {
var _local2 = iFrom;
var _local3 = this;
trace("asd");
var _local1 = ((_local2 != null) ? (_local2) : 0);
while (_local1 < _local3.length) {
if (_local3[_local1][sName] == vValue) {
return(_local1);
}
_local1++;
}
return(-1);
};
if (Array.prototype.oldSortOn == null) {
Array.prototype.oldSortOn = Array.prototype.sortOn;
Array.prototype.sortOn = function (sField) {
var _local1 = this;
if (getPublishFormat() == 5) {
_level0.__tmp = sField;
_local1.sort(_local1.F5sortOn);
delete _level0.__tmp;
} else {
_local1.oldSortOn(sField);
}
};
Array.prototype.F5sortOn = function (oA, oB) {
var _local2 = oB;
var _local3 = oA;
var _local1 = _level0.__tmp;
if (_local3[_local1] != null) {
if (_local3[_local1] < _local2[_local1]) {
return(-1);
}
if (_local3[_local1] > _local2[_local1]) {
return(1);
}
return(0);
}
if (_local2[_local1] != null) {
return(1);
}
return(0);
};
}
Object.prototype.addListener = function (oRef) {
var _local1 = this;
var _local2 = oRef;
if (_local1._listeners == null) {
_local1._listeners = [_local2];
} else if (_local1._listeners.indexOf(_local2) == -1) {
_local1._listeners.push(_local2);
}
};
Object.prototype.removeListener = function (oRef) {
var _local1 = this;
_local1._listeners.remove(oRef);
if (_local1._listeners.length == 0) {
delete _local1._listeners;
}
};
Object.prototype.removeAllListeners = function () {
delete this._listeners;
};
Object.prototype.sendEvent = function (sEventName) {
var _local3 = this;
var _local1 = arguments;
var _local2 = _local3._listeners.length - 1;
while (_local2 >= 0) {
_local3._listeners[_local2][sEventName](_local1[1], _local1[2], _local1[3], _local1[4], _local1[5], _local1[6], _local1[7], _local1[8], _local1[9], _local1[10], _local1[11], _local1[12], _local1[13], _local1[14], _local1[15]);
_local2--;
}
};
MCP = MovieClip.prototype;
if (MCP.__FXMCX == null) {
MCP.__FXMCX = 1;
MCP.oldAttachMovie = attachMovie;
MCP.attachMovie = function (sLinkageID, sInstanceName, iDepth) {
this.oldAttachMovie(sLinkageID, sInstanceName, iDepth);
return(this[sInstanceName]);
};
MCP.oldCreateEmptyMovieClip = createEmptyMovieClip;
MCP.createEmptyMovieClip = function (sInstanceName, iDepth) {
this.oldCreateEmptyMovieClip(sInstanceName, iDepth);
return(this[sInstanceName]);
};
MCP.oldRemoveMovie = removeMovieClip;
MCP.removeMovieClip = function (mc) {
var _local1 = mc;
if (typeof(_local1) != "movieclip") {
_local1 == this;
}
_local1.swapDepths(-466);
_local1.oldRemoveMovie();
};
}
var _waiting = false;
var _waitUntil = 0;
MovieClip.prototype.CallStackClass = function (iInterval) {
var _local1 = this;
_local1.list = [];
_local1.waiting = false;
_local1.waitUntil = 0;
_local1.interval = Math.max(1, ((iInterval == null) ? 10 : (iInterval)));
_local1.maxLoops = 5;
};
_p = CallStackClass.prototype;
_p.interval = 10;
_p.maxLoops = 5;
_p.append = function (fn) {
this.list.push(arguments);
};
_p.clear = function () {
this.list = [];
};
_p.start = function (fnCallBack, iInterval) {
var _local1 = this;
var _local2 = fnCallBack;
var _local3 = iInterval;
trace("start");
_local1.notify = _local2;
_local1.index = 0;
_local1.loops = 0;
_local1.count = 0;
_local1.active = true;
_local1.lastTime = getTimer();
if ((typeof(_local3) == "number") && (!isNaN(_local3))) {
_local1.interval = _local3;
}
_local1.intervalID = setInterval(function (cs) {
cs.update();
}, _local1.interval, _local1);
if (_local2) {
_local1.onFinish = _local2;
}
};
_p.wait = function (iMilliseconds) {
this.waitFor = iMilliseconds;
this.waiting = true;
return(false);
};
_p.update = function () {
var _local2 = this;
var currentTime = getTimer();
var elapsed = (currentTime - _local2.lastTime);
_local2.lastTime = currentTime;
if (!_local2.active) {
return(null);
}
if (_local2.waiting) {
_local2.waitFor = _local2.waitFor - elapsed;
if (_local2.waitFor > 0) {
return(null);
}
_local2.waiting = false;
_local2.index++;
}
count++;
var i = 0;
var maxTime = (currentTime + _local2.interval);
if ((i < _local2.maxLoops) || (maxTime > getTimer())) {
loops++;
i++;
var _local1 = _local2.list[_local2.index];
if (_local1 == null) {
if (_local2.index == _local2.list.length) {
_local2.end();
}
} else {
if (_local1[0] == _local2.wait) {
_local2.wait(_local1[1]);
}
var _local3 = _local1[0](_local1[1], _local1[2], _local1[3], _local1[4], _local1[5], _local1[6], _local1[7], _local1[8], _local1[9], _local1[10]);
if (_local3 || (_local3 == null)) {
_local2.index++;
if (_local2.index == _local2.list.length) {
_local2.end();
updateAfterEvent();
return(true);
}
// unexpected jump
}
}
}
updateAfterEvent();
return(false);
};
_p.end = function () {
var _local1 = this;
clearInterval(_local1.intervalID);
_local1.intervalID = null;
_local1.onFinish(_local1);
};
delete _p;
MovieClip.prototype.addTweenToStack = function (CS) {
T = new TweenClass();
CS.append(T.start, T);
CS.append(T.update, T);
return(t);
};
MovieClip.prototype.TweenClass = function () {
this.list = [];
this.auto = false;
};
_p = TweenClass.prototype;
_p.createNewTween = function (mc) {
var _local2 = this;
var _local1 = new _local2.TweenObject(_local2, mc);
_local2.list.push(_local1);
return(_local1);
};
_p.start = function (oRef) {
if (oRef != null) {
return(oRef.start());
}
var listEntry;
var mc;
var time;
this.lastTime = getTimer() * 0.001;
this.running = true;
};
_p.update = function (v0) {
switch (typeof(v0)) {
case "object" :
return(v0.update());
case "number" :
var _local2 = v0;
break;
default :
_local2 = Math.min((-this.lastTime) + ((this.lastTime = getTimer() * 0.001)), 0.1);
}
var _local1;
var mc;
var _local3 = this.list.length - 1;
while (_local3 >= 0) {
_local1 = this.list[_local3];
mc = _local1.target;
if (_local1.positionTween) {
_local1.updatePosition(_local2);
}
if (_local1.scaleTween) {
_local1.updateScale(_local2);
}
if (_local1.rotTween) {
_local1.updateRotation(_local2);
}
if (_local1.colorTween) {
_local1.updateColor(_local2);
}
if (_local1.offsetTween || (_local1.percentTween)) {
_local1.updateTint(_local2);
}
if (_local1.alphaTween) {
_local1.updateAlpha(_local2);
}
if (_local1.isDone()) {
this.list.splice(_local3, 1);
}
_local3--;
}
if (this.list.length <= 0) {
this.onDone();
return(true);
}
return(false);
};
_p.skip = function () {
var _local2 = this;
trace("SKIP");
var _local1 = 0;
while (_local1 < _local2.list.length) {
_local2.list[_local1].end();
_local1++;
}
_local2.update();
};
_p.TweenObject = function (oTween, mc) {
this.tween = oTween;
this.target = mc;
};
_p.TweenObject.prototype.addPosition = function (fSec, iDestX, iDestY) {
var _local1 = this;
var _local2 = arguments;
var _local3 = fSec;
_local1.positionTime = _local3;
_local1.positionTween = true;
switch (typeof(_local2[3])) {
case "number" :
var startX = _local2[3];
var startY = _local2[4];
_local1.onPositionDone = _local2[5];
break;
case "function" :
default :
_local1.onPositionDone = _local2[3];
var startX = _local1.target._x;
var startY = _local1.target._y;
}
_local1.velX = (iDestX - startX) / _local3;
_local1.velY = (iDestY - startY) / _local3;
_local1.destX = iDestX;
_local1.destY = iDestY;
};
_p.TweenObject.prototype.updatePosition = function (fElapsed) {
var _local1 = this;
var _local3 = fElapsed;
var _local2 = _local1.target;
_local1.positionTime = _local1.positionTime - _local3;
_local1.positionTween = _local1.positionTime > 0;
if (!_local1.positionTween) {
_local1.onPositionDone();
_local2._x = _local1.destX;
_local2._y = _local1.destY;
} else {
_local2._x = _local2._x + (_local3 * _local1.velX);
_local2._y = _local2._y + (_local3 * _local1.velY);
}
};
_p.TweenObject.prototype.addScale = function (fSec, iScaleX, iScaleY, fnOnScaleDone) {
var _local1 = this;
var _local2 = fSec;
var _local3 = iScaleX;
_local1.scaleTime = _local2;
_local1.scaleTween = true;
_local1.scaleX = (_local3 - _local1.target._xscale) / _local2;
_local1.scaleY = (_local3 - _local1.target._xscale) / _local2;
_local1.destScaleX = _local3;
_local1.destScaleY = iScaleY;
_local1.startScaleX = _local1.target._xscale;
_local1.startScaleY = _local1.target._yscale;
_local1.onScaleDone = fnOnScaleDone;
};
_p.TweenObject.prototype.updateScale = function (fElapsed) {
var _local1 = this;
var _local3 = Math.min(fElapsed, _local1.scaleTime);
var _local2 = _local1.target;
_local1.scaleTime = _local1.scaleTime - _local3;
_local1.scaleTween = _local1.scaleTime > 0;
if (!_local1.scaleTween) {
_local1.onScaleDone();
_local2._xscale = _local1.destScaleX;
_local2._yscale = _local1.destScaleY;
} else {
_local2._xscale = _local2._xscale + (_local3 * _local1.scaleX);
_local2._yscale = _local2._yscale + (_local3 * _local1.scaleY);
}
};
_p.TweenObject.prototype.addRotation = function (fSec, iRot, fnOnRotDone) {
var _local1 = this;
_local1.rotTime = fSec;
_local1.rotTween = true;
_local1.rot = (iRot - _local1.target._rotation) / fSec;
_local1.startRotation = _local1.target._rotation;
_local1.onRotDone = fnOnRotDone;
_local1.destRotation = iRot;
};
_p.TweenObject.prototype.updateRotation = function (fElapsed) {
var _local1 = this;
var _local3 = Math.min(fElapsed, _local1.rotTime);
var _local2 = _local1.target;
_local1.rotTime = _local1.rotTime - _local3;
_local1.rotTween = _local1.rotTime > 0;
if (!_local1.rotTween) {
_local1.onRotDone();
_local2._rotation = _local1.destRotation;
} else {
_local2._rotation = _local2._rotation + (_local3 * _local1.rot);
}
};
_p.TweenObject.prototype.addAlpha = function (fSec, iAlpha, iStartAlpha, fnOnAlphaDone) {
var _local1 = this;
_local1.alphaTime = fSec;
_local1.alphaTween = true;
_local1.startAlpha = ((iStartAlpha == null) ? (_local1.target._alpha) : (iStartAlpha));
_local1.alpha = (iAlpha - _local1.startAlpha) / fSec;
trace(_local1.alpha);
_local1.onAlphaDone = fnOnAlphaDone;
_local1.destAlpha = iAlpha;
};
_p.TweenObject.prototype.updateAlpha = function (fElapsed) {
var _local1 = this;
var _local2 = Math.min(fElapsed, _local1.alphaTime);
var _local3 = _local1.target;
_local1.alphaTime = _local1.alphaTime - _local2;
_local1.alphaTween = _local1.alphaTime > 0;
trace(_local2 * _local1.alpha);
if (!_local1.alphaTween) {
_local1.onAlphaDone();
_local3._alpha = _local1.destAlpha;
} else {
_local3._alpha = int((_local1.startAlpha = _local1.startAlpha + (_local2 * _local1.alpha)));
}
};
_p.TweenObject.prototype.addColor = function (fSec, iStartColor, iEndColor) {
var _local1 = this;
var _local2 = iStartColor;
_local1.colorTime = fSec;
_local1.colorTween = true;
if (_local1.target.colorObj != null) {
_local1.colorObj = _local1.target.colorObj;
if (_local2 == null) {
_local2 = _local1.colorObj.getRGB();
}
} else {
_local1.target.colorObj = (_local1.colorObj = new Color(_local1.target));
}
_local1.colorObj.setRGB(_local2);
var iStartR = ((_local1.currentR = _local2 >> 16));
var iStartG = ((_local1.currentG = (_local2 >> 8) - (iStartR << 8)));
var iStartB = ((_local1.currentB = ((_local2 >> 0) - (iStartG << 8)) - (iStartR << 16)));
var _local3 = (_local1.destR = iEndColor >> 16);
var iEndG = ((_local1.destG = (iEndColor >> 8) - (_local3 << 8)));
var iEndB = ((_local1.destB = ((iEndColor >> 0) - (iEndG << 8)) - (_local3 << 16)));
_local1.colorR = (_local3 - iStartR) / fSec;
_local1.colorG = (iEndG - iStartG) / fSec;
_local1.colorB = (iEndB - iStartB) / fSec;
};
_p.TweenObject.prototype.updateColor = function (fElapsed) {
var _local1 = this;
var _local2 = Math.min(fElapsed, _local1.colorTime);
var mc = _local1.target;
_local1.colorTime = _local1.colorTime - _local2;
_local1.colorTween = _local1.colorTime > 0;
if (!_local1.colorTween) {
_local1.onColorDone();
_local1.currentR = _local1.destR;
_local1.currentG = _local1.destG;
_local1.currentB = _local1.destB;
} else {
_local1.currentR = _local1.currentR + (_local1.colorR * _local2);
_local1.currentG = _local1.currentG + (_local1.colorG * _local2);
_local1.currentB = _local1.currentB + (_local1.colorB * _local2);
}
_local1.colorObj.setRGB(Math.round(((_local1.currentR << 16) + (_local1.currentG << 8)) + _local1.currentB));
};
_p.TweenObject.prototype.addOffsetTint = function (fSec, iStartR, iStartG, iStartB, iStartA, iEndR, iEndG, iEndB, iEndA, fnOnOffsetDone) {
var _local1 = this;
var _local3 = fSec;
_local1.offsetTime = _local3;
_local1.offsetTween = true;
if (_local1.target.colorObj != null) {
_local1.colorObj = _local1.target.colorObj;
} else {
_local1.target.colorObj = (_local1.colorObj = new Color(_local1.target));
}
if (_local1.currentTint == null) {
_local1.currentTint = _local1.colorObj.getTransform();
}
var _local2 = _local1.currentTint;
_local2.rb = ((iStartR != null) ? (iStartR) : (_local2.rb));
_local2.gb = ((iStartG != null) ? (iStartG) : (_local2.gb));
_local2.bb = ((iStartB != null) ? (iStartB) : (_local2.bb));
_local2.ab = ((iStartA != null) ? (iStartA) : (_local2.ab));
_local1.offsetR = (iEndR - iStartR) / _local3;
_local1.offsetG = (iEndG - iStartG) / _local3;
_local1.offsetB = (iEndB - iStartB) / _local3;
_local1.offsetA = (iEndA - iStartA) / _local3;
_local1.destOffsetR = iEndR;
_local1.destOffsetG = iEndG;
_local1.destOFfsetB = iEndB;
_local1.destOffsetA = iEndA;
_local1.onOffsetDone = fnOnOffsetDone;
};
_p.TweenObject.prototype.updateOffsetTint = function (fElapsed) {
var _local1 = this;
var _local3 = Math.min(fElapsed, _local1.offsetTime);
var mc = _local1.target;
var _local2 = _local1.currentTint;
_local1.offsetTime = _local1.offsetTime - _local3;
_local1.offsetTween = _local1.offsetTime > 0;
if (!_local1.offsetTween) {
_local1.onOffsetDone();
_local2.rb = _local1.destOffsetR;
_local2.gb = _local1.destOffsetG;
_local2.bb = _local1.destOffsetB;
_local2.ab = _local1.destOffsetA;
} else {
_local2.rb = _local2.rb + (_local1.offsetR * _local3);
_local2.gb = _local2.gb + (_local1.offsetG * _local3);
_local2.bb = _local2.bb + (_local1.offsetB * _local3);
_local2.ab = _local2.ab + (_local1.offsetA * _local3);
}
};
_p.TweenObject.prototype.addPercentTint = function (fSec, iStartR, iStartG, iStartB, iStartA, iEndR, iEndG, iEndB, iEndA, fnOnPercentDone) {
var _local1 = this;
var _local3 = fSec;
_local1.percentTime = _local3;
_local1.percentTween = true;
if (_local1.target.colorObj != null) {
_local1.colorObj = _local1.target.colorObj;
} else {
_local1.target.colorObj = (_local1.colorObj = new Color(_local1.target));
}
if (_local1.currentTint == null) {
_local1.currentTint = _local1.colorObj.getTransform();
}
var _local2 = _local1.currentTint;
_local2.ra = ((iStartR != null) ? (iStartR) : (_local2.ra));
_local2.ga = ((iStartG != null) ? (iStartG) : (_local2.ga));
_local2.ba = ((iStartB != null) ? (iStartB) : (_local2.ba));
_local2.aa = ((iStartA != null) ? (iStartA) : (_local2.aa));
_local1.percentR = (iEndR - iStartR) / _local3;
_local1.percentG = (iEndG - iStartG) / _local3;
_local1.percentB = (iEndB - iStartB) / _local3;
_local1.percentA = (iEndA - iStartA) / _local3;
_local1.destPercentR = iEndR;
_local1.destPercentG = iEndG;
_local1.destPercentB = iEndB;
_local1.destPercentA = iEndA;
_local1.onPercentDone = fnOnPercentDone;
};
_p.TweenObject.prototype.updatePercentTint = function (fElapsed) {
var _local1 = this;
var _local3 = Math.min(fElapsed, _local1.percentTime);
var mc = _local1.target;
var _local2 = _local1.currentTint;
_local1.percentTime = _local1.percentTime - _local3;
_local1.percentTween = _local1.percentTime > 0;
if (!_local1.percentTween) {
_local1.onOffsetDone();
_local2.ra = _local1.destPercentR;
_local2.ga = _local1.destPercentG;
_local2.ba = _local1.destPercentB;
_local2.aa = _local1.destPercentA;
} else {
_local2.ra = _local2.ra + (_local1.percentR * _local3);
_local2.ga = _local2.ga + (_local1.percentG * _local3);
_local2.ba = _local2.ba + (_local1.percentB * _local3);
_local2.aa = _local2.aa + (_local1.percentA * _local3);
}
};
_p.TweenObject.prototype.updateTint = function (fElapsed) {
var _local1 = this;
if (_local1.offsetTween) {
_local1.updateOffsetTint(fElapsed);
}
if (_local1.percentTween) {
_local1.updatePercentTint(fElapsed);
}
_local1.colorObj.setTransform(_local1.currentTint);
};
_p.TweenObject.prototype.isDone = function () {
var _local1 = this;
return(((((((!_local1.positionTween) && (!_local1.scaleTween)) && (!_local1.rotTween)) && (!_local1.alphaTween)) && (!_local1.colorTween)) && (!_local1.offsetTween)) && (!_local1.percentTween));
};
_p.TweenObject.prototype.end = function () {
var _local1 = this;
_local1.positionTime = 0;
_local1.scaleTime = 0;
_local1.rotTime = 0;
_local1.alphaTime = 0;
_local1.colorTime = 0;
_local1.percentTime = 0;
_local1.offsetTime = 0;
};
delete _p;
MovieClip.prototype.setTimeout = function (fn, iMilli) {
arguments.id = setInterval(____FLASHMX____onTimeout, iMilli, arguments);
};
MovieClip.prototype.____FLASHMX____onTimeout = function (a) {
var _local1 = a;
_local1[0](_local1[2], _local1[3], _local1[4], _local1[5], _local1[6], _local1[7], _local1[8], _local1[9], _local1[10], _local1[11], _local1[12], _local1[13], _local1[14], _local1[15], _local1[16], _local1[17], _local1[18], _local1[19], _local1[20], _local1[21]);
clearInterval(_local1.id);
};
_level0.eventID = "dc_tsrmm_2657";
_level0.subject = "That's So Raven - Money Maze";
createEmptyMovieClip("DOGE", 10000);
DOGE._x = (DOGE._y = -500);
DOGE._visible = false;
DOGE.loadMovie(_level0.fsd);
btnCover._visible = false;
btnCover.useHandCursor = false;
fsdLoaderInt = setInterval(function () {
DOGE._visible = false;
if ((DOGE.getBytesLoaded() < 100) || (DOGE.getBytesLoaded() < DOGE.getBytesTotal())) {
return(null);
}
DOGE.unloadMovie();
DOGE._x = 97.5;
DOGE._y = 95;
_level0.DOGE = DOGE;
clearInterval(fsdLoaderInt);
}, 10);
_level0.gameRef = this;
_level0.fsdPlayAgain = function () {
_level0.gameRef.DOGE._visible = false;
_level0.gameRef.btnCover._visible = false;
_level0.gameRef.gotoAndStop("game");
};
Frame 10 (8 B)
stop();
Frame 20 (19 B)
gameScore = score;
Frame 25 (34 B)
trace(score);
gameScore = score;
Frame 35 (8 B)
stop();
Symbol 10 MovieClip [_ITEM_COIN] Frame 1 (32 B)
registerElement("token", this);
Symbol 55 MovieClip [charMom] Frame 1 (8 B)
stop();
Symbol 100 MovieClip [charDad] Frame 1 (8 B)
stop();
Symbol 140 MovieClip Frame 8 (17 B)
gotoAndPlay (1);
Symbol 141 MovieClip [charRaven] Frame 1 (8 B)
stop();
Symbol 144 MovieClip Frame 1 (32 B)
registerElement("Floor", this);
Symbol 145 MovieClip Frame 1 (31 B)
registerElement("wall", this);
Symbol 146 MovieClip Frame 1 (33 B)
registerElement("Stairs", this);
Symbol 149 MovieClip Frame 1 (37 B)
registerElement("spawnPoint", this);
Symbol 159 MovieClip Frame 1 (8 B)
stop();
Symbol 159 MovieClip Frame 19 (8 B)
stop();
Symbol 162 MovieClip Frame 1 (8 B)
stop();
Symbol 162 MovieClip Frame 19 (8 B)
stop();
Symbol 163 MovieClip Frame 1 (62 B)
gotoAndStop(id + 1);
registerElement("door", this);
stop();
Symbol 177 MovieClip Frame 1 (8 B)
stop();
Symbol 177 MovieClip Frame 6 (8 B)
play();
Symbol 177 MovieClip Frame 15 (17 B)
gotoAndStop (1);
Symbol 178 MovieClip Frame 1 (31 B)
registerElement("safe", this);
Symbol 192 MovieClip Frame 1 (41 B)
stop();
registerElement("trap", this);
Symbol 192 MovieClip Frame 5 (8 B)
stop();
Symbol 192 MovieClip Frame 9 (8 B)
play();
Symbol 192 MovieClip Frame 13 (8 B)
stop();
Symbol 192 MovieClip Frame 18 (8 B)
play();
Symbol 192 MovieClip Frame 22 (21 B)
gotoAndStop ("off");
Instance of Symbol 163 MovieClip in Symbol 193 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 193 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 212 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 212 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 213 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 213 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 0;
}
Instance of Symbol 163 MovieClip in Symbol 213 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 1;
}
Instance of Symbol 163 MovieClip in Symbol 213 MovieClip Frame 1 (60 B)
//component parameters
onClipEvent (initialize) {
id = 1;
}
Symbol 214 MovieClip [levels] Frame 1 (8 B)
stop();
Symbol 220 MovieClip [mainChar] Frame 1 (8 B)
stop();
Symbol 266 MovieClip Frame 1 (8 B)
stop();
Symbol 273 Button (30 B)
on (release) {
nextFrame();
}
Symbol 286 Button (39 B)
on (release) {
gotoAndStop ("game");
}
Symbol 289 Button (30 B)
on (release) {
prevFrame();
}
Symbol 320 Button (32 B)
on (release) {
submitScore();
}
Symbol 323 Button (39 B)
on (release) {
gotoAndStop ("game");
}
Symbol 340 MovieClip Frame 1 (8 B)
stop();
Symbol 351 MovieClip Frame 1 (8 B)
stop();
Symbol 357 MovieClip Frame 1 (8 B)
stop();
Symbol 371 MovieClip Frame 1 (8 B)
stop();
Symbol 371 MovieClip Frame 5 (8 B)
play();
Symbol 371 MovieClip Frame 47 (30 B)
stop();
gotoAndStop ("off");
Symbol 380 Button (29 B)
on (release) {
showQuit();
}
Symbol 385 Button (29 B)
on (release) {
showHelp();
}
Symbol 395 Button (59 B)
on (release) {
hideDialog();
_parent._parent.unpause();
}
Symbol 407 Button (65 B)
on (release) {
hideDialog();
_parent._parent.gotoNextLevel();
}
Symbol 412 Button (53 B)
on (release) {
_root.submitScore();
hideDialog();
}
Symbol 415 Button (64 B)
on (release) {
_parent._parent.startNewGame();
hideDialog();
}
Symbol 418 MovieClip Frame 1 (143 B)
function showDialog(s) {
gotoAndStop(s);
_visible = true;
}
function hideDialog() {
_visible = false;
gotoAndStop (1);
}
stop();
Symbol 418 MovieClip Frame 6 (21 B)
bonusAmmount = "$0";
Symbol 418 MovieClip Frame 15 (81 B)
setTimeOut(function () {
hideDialog();
_parent._parent.unpause();
}, 2000);
Symbol 418 MovieClip Frame 20 (28 B)
score = _parent.getScore();
Symbol 420 MovieClip Frame 1 (694 B)
function setCaught(bState) {
if (bState) {
mcCory.gotoAndPlay("on");
mcTrapped.gotoAndStop("on");
} else {
mcTrapped.gotoAndStop("off");
}
}
function setTrapsActive(bState) {
if (bState) {
mcTrapsActive.gotoAndStop("on");
} else {
mcTrapsActive.gotoAndStop("off");
}
}
function setScore(iScore) {
if (iScore != score) {
score = Math.ceil(iScore);
MovieClip.prototype.score = score;
}
}
function getScore() {
return(score);
}
function appendScore(iScore) {
setScore(score + Number(iScore));
}
function showQuit() {
mcDialog.showDialog("quit");
_parent.pause();
}
function showHelp() {
_parent.pause();
mcDialog.showDialog("help");
}
Instance of Symbol 418 MovieClip "mcDialog" in Symbol 420 MovieClip Frame 1 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 421 MovieClip Frame 1 (32.78 KiB) ● ● ● ●
function loadSoundFromLib(sName, sVolume) {
MCCreated++;
var _local2 = createEmptyMovieClip("mc" + MCCreated, MCCreated);
var _local1 = new Sound(_local2);
_local1.attachSound(sName);
_local1.setVolume(sVolume);
return(_local1);
}
function playSound(oSoundObj, iRepeat) {
oSoundObj.start(0, Number(iRepeat));
}
function MazeClass(mc, sLinkID, iLevelFrame) {
var _local1 = this;
_local1.rows = [];
_local1.objects = [];
_local1.allFlags = [];
_local1.displayList = [];
_local1.doors = [];
_local1.target = mc;
_local1.level = mc.attachMovie(sLinkID, "mcLevel", 10);
_local1.level.gotoAndStop(iLevelFrame + 5);
_local1.level.mc._visible = false;
_local1.viewPort = new _local1.ViewPortClass(_local1, ScreenWidth, ScreenHeight);
}
function OpponentClass(sChar) {
var _local1 = this;
_local1.speed = 150;
_local1.width = 50;
_local1.height = 60;
_local1.state = 0;
_local1.linkageID = sChar;
_local1.canBeTrapped = true;
_local1.keyUp = (_local1.keyDown = false);
}
function MainCharClass() {
var _local1 = this;
_local1.speed = 300;
_local1.width = 50;
_local1.height = 60;
_local1.state = 0;
_local1.canUseSafe = true;
_local1.canCollectTokens = true;
}
function createObject(oGame, mc) {
var _local1 = mc;
var _local2 = oGame;
_local1._visible = false;
switch (_local1.type) {
case "floor" :
return(null);
case "wall" :
_local2.addWall(_local1._x, _local1._y);
return(undefined);
case "stairs" :
var o = {x:_local1._x + 1, y:0};
_local1.localToGlobal(o);
var _local3 = o.x;
var o = {x:_local1._x, y:0};
_local2.addStairs(_local1._x, _local1._y, _local1.mc._rotation + 90, _local3 < o.x);
return(undefined);
case "safe" :
_local2.addSafe(_local1);
return(undefined);
case "spawnpoint" :
_local2.addSpawnPoint(_local1._x, _local1._y);
return(undefined);
case "door" :
_local1._visible = true;
_local2.addDoor(_local1);
return(undefined);
case "trap" :
_local2.addTrap(_local1);
return(undefined);
default :
_local1._visible = true;
}
return(undefined);
}
function checkTrap(oFlag) {
var _local1 = oFlag;
var _local2 = this;
if ((!_local2.canBeTrapped) || (!_local1.active)) {
return(null);
}
_local2.trapped = _local1;
mcInterface.setCaught(true);
_local1.mc.gotoAndPlay("catch");
_local1.active = false;
_local2.wait = 3;
return(undefined);
}
function collectRemote(oFlag) {
var _local1 = oFlag;
if ((this.canCollectTokens && (!_local1.disabled)) && (this.layer == 0)) {
_local1.disabled = true;
_local1.target._visible = false;
setTrapState(true, 10000);
}
}
function collectToken(oFlag) {
var _local1 = oFlag;
if ((this.canCollectTokens && (_local1.target._visible == true)) && (this.layer == 0)) {
tokensRemaining--;
tokensCollected++;
_local1.disabled = true;
_local1.target._visible = false;
onTokenCollected(_local1.value);
}
}
function checkIfInDoor(oFlag) {
var _local1 = oFlag;
var _local2 = this;
if (Math.abs(_local1.mc._x - _local2.x) < _local1.hWidth) {
_local2.currentDoor = _local1.mc;
} else {
_local2.currentDoor = null;
}
}
function enterSafe(oFlag) {
this.currentSafe = oFlag.mc;
}
function exitSafe(oFlag) {
this.currentSafe = null;
}
function useSafe(o, oFlag) {
if (tokensCollected <= 0) {
return(0);
}
__totalBank = tokensBanked + tokensCollected;
var _local1 = new CallStackClass(gameUpdateInterval);
_local1.append(playMovieClip, oFlag.mcSafe, "open");
_local1.append(depositMoney, Math.ceil(tokensCollected * 0.01));
_local1.append(setObjectProp, o, "state", 0);
_local1.start();
o.state = 1;
return(undefined);
}
function depositMoney(iPerStep) {
var _local1 = Math.min(tokensCollected, iPerStep);
tokensBanked = tokensBanked + _local1;
tokensCollected = tokensCollected - _local1;
onDepositCash(iPerStep);
updateInterface();
if (tokensCollected > 0) {
return(false);
}
tokensCollected = 0;
tokensBanked = __totalBank;
return(true);
}
function setTrapState(bActive, iMsTime) {
var _local2 = bActive;
var _local3 = iMsTime;
var _local1 = 0;
while (_local1 < Game.traps.length) {
Game.traps[_local1].active = _local2;
Game.traps[_local1].mc.gotoAndStop((_local2 ? "on" : "off"));
if (_local2) {
TrapTimeRemaining = _local3;
} else {
TrapTimeRemaining = 0;
}
CollectedMoney = !_local2;
_local1++;
}
mcInterface.setTrapsActive(_local2);
}
function alignRightOfFlag(oFlag) {
var _local1 = this;
_local1.moveTo((oFlag.x + _local1.halfWidth) + 0.01, _local1.y);
}
function alignLeftOfFlag(oFlag) {
var _local1 = this;
_local1.moveTo((oFlag.x - _local1.halfWidth) - 0.01, _local1.y);
}
function goUpStairs(oFlag) {
var _local1 = this;
if (_local1.vDir <= 0) {
return(null);
}
orientToFlag(_local1, oFlag);
_local1.setLayer(1);
return(undefined);
}
function goDownStairs(oFlag) {
var _local1 = this;
if (_local1.vDir >= 0) {
return(null);
}
orientToFlag(_local1, oFlag);
_local1.setLayer(1);
return(undefined);
}
function getOffStairs(oFlag) {
var _local1 = this;
_local1.upX = 0;
_local1.upY = 1;
_local1.rightX = 1;
_local1.rightY = 0;
_local1.setLayer(0);
_local1.moveTo(_local1.x, oFlag.y);
}
function orientToFlag(oRef, oFlag) {
var _local1 = oRef;
var _local2 = oFlag;
_local1.upX = _local2.upX;
_local1.upY = _local2.upY;
_local1.rightX = _local2.rightX;
_local1.rightY = _local2.rightY;
var _local3 = _local1.x - _local2.x;
_local1.x = _local2.x;
_local1.y = _local2.y;
_local1.moveBy(_local3 * _local1.rightX, _local3 * _local1.rightY);
}
function isBetween(iNum, i0, i1) {
var _local1 = iNum;
var _local2 = i1;
var _local3 = i0;
if (_local3 < _local2) {
return((_local1 >= _local3) && (_local1 < _local2));
}
return((_local1 > _local2) && (_local1 <= _local3));
}
function goThruDoor(o, oDoor) {
var _local3;
var _local1 = 0;
while (_local1 < Game.doors.length) {
_local3 = Game.doors[_local1];
if ((_local3.id == oDoor.id) && (oDoor != _local3)) {
var targetDoor = ((o.currentDoor = Game.doors[_local1]));
break;
}
_local1++;
}
var T;
var _local2 = new CallStackClass(gameUpdateInterval);
_local2.append(playMovieClip, oDoor.mcDoor, "open");
_local2.append(_local2.wait, 300);
T = addTweenToStack(_local2).createNewTween(o.target);
T.addPosition(0.1, oDoor._x, oDoor._y);
T = addTweenToStack(_local2).createNewTween(o.target);
T.addOffsetTint(0.1, 0, 0, 0, 0, -255, -255, -255, -255);
_local2.append(playMovieClip, oDoor.mcDoor, "close");
_local2.append(_local2.wait, 150);
_local2.append(moveObject, o, targetDoor._x, targetDoor._y);
_local2.append(_local2.wait, 100);
_local2.append(playMovieClip, targetDoor.mcDoor, "open");
_local2.append(_local2.wait, 500);
T = addTweenToStack(_local2).createNewTween(o.target);
T.addOffsetTint(0.1, -255, -255, -255, -255, 0, 0, 0, 0);
_local2.append(setObjectProp, o, "state", 0);
_local2.append(playMovieClip, targetDoor.mcDoor, "close");
_local2.start();
o.state = 1;
}
function playMovieClip(mc, sFrame) {
mc.gotoAndPlay(sFrame);
}
function moveObject(o, iX, iY) {
o.moveTo(iX, iY);
}
function setObjectProp(o, sProp, vValue) {
o[sProp] = vValue;
}
function waitForElements() {
if (Game.prep == null) {
return(false);
}
Game.setupElements();
return(true);
}
function gotoLevel(iLevel) {
Game.mcLevel._visible = false;
currentLevel = iLevel;
var _local1 = new CallStackClass(32);
if (Game != null) {
_local1.append(removeCurrentGame);
}
_local1.append(createNewMaze, iLevel);
_local1.append(waitForElements);
_local1.append(setupLevel);
_local1.append(beginGame);
_local1.start();
}
function createNewMaze(iLevel) {
var _local1 = createEmptyMovieClip("mcStage", 0);
Game = new MazeClass(_local1, "levels", iLevel);
tokensCollected = 0;
tokensBanked = 0;
}
function beginGame() {
updateInterface();
if (MovieClip.prototype._gameIntervalID != null) {
clearInterval(MovieClip.prototype._gameIntervalID);
}
MovieClip.prototype._gameIntervalID = setInterval(updateGame, gameUpdateInterval);
Game.level.mc._visible = true;
lastTime = getTimer() * 0.001;
active = true;
unpause();
MainChar.moveCharacter(0.01, false, false, true, false);
updateGame();
}
function updateGame() {
var _local1 = Math.min(0.04, (-lastTime) + ((lastTime = getTimer() * 0.001)));
if (paused || (!active)) {
return(null);
}
checkTraps(_local1);
Game.step(_local1, 2);
updateAfterEvent();
return(undefined);
}
function checkTraps(elapsed) {
if (TrapTimeRemaining <= 0) {
return(null);
}
TrapTimeRemaining = TrapTimeRemaining - elapsed;
if (TrapTimeRemaining <= 0) {
setTrapState(false);
}
}
function endGame() {
}
function setupLevel() {
var _local1;
var _local2 = (mainChar = Game.createObject(MainCharClass));
_local2.alignTo(Game.entryPoint[0]);
Game.Viewport.addWatch(_local2);
switch (currentLevel % 3) {
case 0 :
_local1 = "charRaven";
break;
case 1 :
_local1 = "charMom";
break;
case 2 :
_local1 = "charDad";
}
_local2 = Game.createObject(OpponentClass, _local1);
_local2.alignTo(Game.entryPoint[1]);
CreateTokens("_ITEM_COIN");
i = 0;
while (i < Game.rows.length) {
Game.rows[i].flags.bubbleSortOn("x");
i++;
}
setTrapState(false);
}
function pause() {
if (active) {
paused = true;
}
}
function unpause() {
paused = false;
}
function loseLife() {
lives--;
pause();
if (lives <= 0) {
_root.gotoAndStop("GameLose");
} else {
mcInterface.mcDialog.showDialog("loseLife");
updateInterface();
}
}
function createTokens(sIdentifier) {
var a;
var r;
var _local2;
var tokens;
var xSpace;
var xSpan;
var _local3;
var _local1;
var remoteUsed;
tokensRemaining = 0;
var i = 0;
while (i < Game.rows.length) {
remoteUsed = false;
r = Game.rows[i];
a = r.flags;
_local2 = [];
_local1 = 0;
while (_local1 < a.length) {
_local2.push(a[_local1].x);
_local1++;
}
_local2.sortNumbers();
xSpan = _local2[_local2.length - 1] - _local2[0];
tokens = Math.floor(xSpan / tokenWidth);
xSpace = xSpan / tokens;
_local3 = _local2[0];
_local1 = 0;
while (_local1 < (tokens - 1)) {
_local3 = _local3 + xSpace;
if ((!remoteUsed) && (random(tokens - 4) == 0)) {
Game.addRemote(_local3, r.y, "remote");
remoteUsed = true;
} else {
tokensTotal = tokensRemaining++;
Game.addToken(_local3, r.y, sIdentifier, Number(random(4) == 0));
}
_local1++;
}
i++;
}
trace(tokensTotal);
}
function startNewGame() {
lives = 3;
mcInterface.setScore(0);
gotoLevel(1);
}
function addBonus(iAmmount) {
bonusAmmount = bonusAmmount + iAmmount;
playSound(sndBank);
mcInterface.appendScore(iAmmount);
mcInterface.mcDialog.bonusAmmount = "$" + bonusAmmount;
}
function endLevel() {
bonusAmmount = 0;
mcInterface.mcDialog.bonusAmmount = "$0";
active = false;
var _local1 = new CallStackClass(10);
_local1.append(mcInterface.mcDialog.showDialog, "bonus");
_local1.append(_local1.wait, 1000);
if (lives >= 1) {
_local1.append(addBonus, 1000);
_local1.append(_local1.wait, 300);
}
if (lives >= 2) {
_local1.append(addBonus, 4000);
_local1.append(_local1.wait, 300);
}
if (lives >= 3) {
_local1.append(addBonus, 5000);
_local1.append(_local1.wait, 300);
}
_local1.append(_local1.wait, 700);
if (currentLevel == 3) {
_local1.append(setTimeOut, gotoEnd, 100);
} else {
_local1.append(mcInterface.mcDialog.showDialog, "endLevel");
_local1.append(endGame);
}
_local1.start();
}
function gotoEnd() {
_root.gotoAndStop("gameWin");
}
function gotoNextLevel() {
currentLevel++;
if (currentLevel > 3) {
_root.gotoAndStop("gameWin");
} else {
gotoLevel(currentLevel);
}
}
function onTokenCollected(iValue) {
playSound(sndCollectCash, 0);
mcInterface.appendScore((iValue * 50) + 50);
}
function onDepositCash(fNumber) {
mcInterface.appendScore(50 * fNumber);
if ((tokensCollected == 0) && (tokensBanked >= tokensTotal)) {
endLevel();
}
}
function onCollision(oA, oB) {
var _local1 = oB;
var _local2 = oA;
if ((!_local1.trapped) && (!_local2.trapped)) {
_local2.alignTo(Game.entryPoint[0]);
_local1.alignTo(Game.entryPoint[1]);
_local2.resetVector();
_local1.resetVector();
_local2.layer = (_local1.layer = 0);
pause();
loseLife();
} else {
if (CollectedMoney) {
return(null);
}
playSound(sndBank, 0);
mcInterface.appendScore(5000);
CollectedMoney = true;
}
return(undefined);
}
function onObjectsUpdate(oGame) {
var _local3 = oGame;
var _local1;
var _local2 = 1;
while (_local2 < _local3.objects.length) {
_local1 = _local3.objects[_local2];
if (((MainChar.row != _local1.row) || (MainChar.state == 1)) || (_local1.state == 1)) {
} else if (MainChar.layer != _local1.layer) {
} else if ((Math.abs(MainChar.x - _local1.x) > MainChar.halfWidth) || (Math.abs(MainChar.y - _local1.y) > 20)) {
} else {
onCollision(MainChar, _local1);
return;
}
_local2++;
}
}
function updateInterface() {
var _local1 = int(tokensCollected);
var _local2 = int(tokensBanked);
if (_local1 != mcInterface.tokensCollected) {
mcInterface.tokensCollected = _local1;
}
if (_local2 != mcInterface.tokensBanked) {
mcInterface.tokensBanked = _local2;
}
if (lives != 0) {
mcInterface.mcLives.gotoAndStop(lives);
}
}
mcInterface.swapDepths(10000);
rowAdjust = 20;
gameUpdateInterval = 10;
active = false;
ScreenWidth = 595;
ScreenHeight = 440;
tokenWidth = 40;
currentLevel = 1;
wallThickness = 10;
paused = false;
FLAG_AXIS = 1;
FLAG_BOUNDS = 2;
FLAG_LEFT_BOUNDS = 3;
FLAG_RIGHT_BOUNDS = 4;
MovieClip.prototype.registerElement = function (sType, mc) {
Game.elementToPrep(sType, mc);
};
MovieClip.prototype.drawLine = function (sX, sY, eX, eY) {
moveTo(sX, sY);
lineStyle(1, 0, 100);
lineTo(eX, eY);
};
sndCollectCash = loadSoundFromLib("CollectMoney", 50);
sndBank = loadSoundFromLib("Money", 500);
MCP = MazeClass.prototype;
MCP.ViewPortClass = function (oWorld, iWidth, iHeight) {
var _local1 = this;
var _local2 = oWorld;
_local1.width = iWidth;
_local1.height = iHeight;
var hWidth = ((_local1.hWidth = iWidth * 0.5));
var _local3 = (_local1.hHieght = iHeight * 0.5);
_local1.levelWidth = _local2.target._width - (_local3 * 0.25);
_local1.levelHeight = _local2.target._height;
_local1.world = _local2;
_local1.watch = [];
};
VCP = MCP.ViewPortClass.prototype;
VCP.addWatch = function (oRef) {
if (this.watch.indexOf(oRef) == -1) {
this.watch.push(oRef);
}
};
VCP.removeWatch = function (oRef) {
this.watch.remove(oRef);
};
VCP.update = function () {
var _local3 = this;
var _local1;
if (_local3.watch.length == 1) {
_local1 = _local3.watch[0];
_local3.x = _local1.x;
_local3.y = _local1.y;
} else {
var L = oWorld.target._width;
var R = 0;
var T = oWorld.target._height;
var B = 0;
var _local2 = 0;
while (_local2 < _local3.watch.length) {
_local1 = _local3.watch[_local2];
L = Math.min(L, _local1.x);
R = Math.max(R, _local1.x);
T = Math.min(T, _local1.y);
B = Math.max(B, _local1.y);
_local2++;
}
}
var xspan = ((-(_local3.x - _local3.hWidth)) - _local3.world.target._x);
var xDir = ((xspan > 0) ? 1 : -1);
if (Math.abs(xspan) > (_local3.hwidth * 0.4)) {
var x = ((-_local3.x) + ((xDir * _local3.hWidth) * 0.3));
x = (-Math.min(Math.max(_local3.hWidth, -x), _local3.levelWidth)) + _local3.hWidth;
if (_local3.world.target._x != x) {
_local3.world.target._x = x;
}
}
};
MCP.RowClass = function (iY) {
this.y = iY;
this.flags = [];
};
RCP = MCP.RowClass.prototype;
RCP.addFlag = function (o) {
this.flags.push(o);
};
MCP.FlagClass = function (iType, iX, iY, fnLtR, fnRtL) {
var _local1 = this;
_local1.x = iX;
_local1.y = iY;
_local1.disabled = false;
_local1.type = iType;
_local1.leftToRight = fnLtR;
_local1.rightToLeft = fnRtL;
};
MCP.findRowNumber = function (iY) {
var _local2 = this;
var _local3 = iY;
var _local1 = 0;
while (_local1 < _local2.rows.length) {
if (_local3 < (_local2.rows[_local1].y + RowAdjust)) {
return(_local1);
}
_local1++;
}
return(0);
};
MCP.elementToPrep = function (sType, mc) {
var _local1 = this;
var _local2 = mc;
var _local3 = sType;
if (_local1.prep == null) {
_local1.prep = {};
_local1.prep.all = [];
}
_local2.type = _local3.toLowerCase();
if (_local1.prep[_local3] == null) {
_local1.prep[_local3] = [_local2];
} else {
_local1.prep[_local3].push(_local2);
}
_local1.prep.all.push(_local2);
};
MCP.createFlag = function (iType, iX, iY, fnLtR, fnRtL, sName) {
var _local3 = this;
var _local2 = _local3.findRowNumber(iY);
var _local1 = new _local3.FlagClass(iType, iX, _local3.rows[_local2].y, fnLtR, fnRtL);
_local3.rows[_local2].addFlag(_local1);
_local1.name = sName;
return(_local1);
};
MCP.createObject = function (cn) {
var _local1 = arguments;
var _local2 = new cn(_local1[1], _local1[2], _local1[3], _local1[4]);
this.objects.push(_local2);
_local2.init(this);
return(_local2);
};
MCP.createRow = function (iY) {
var _local1 = new this.RowClass(iY);
this.rows.push(_local1);
};
MCP.setupElements = function () {
var _local2 = this;
var _local3 = _local2.prep.floor;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2.createRow(_local3[_local1]._y);
_local1++;
}
_local2.rows.sortOn("y");
var mc;
_local3 = _local2.prep.all;
_local1 = 0;
while (_local1 < _local3.length) {
createObject(_local2, _local3[_local1]);
_local1++;
}
var rooms = ((_local2.rooms = []));
_local1 = 0;
while (_local1 < _local2.rows.length) {
_local2.rows[_local1].flags.bubbleSortOn("x");
_local2.findRoomsOnRow(_local1);
_local1++;
}
};
MCP.findRoomsOnRow = function (iRow) {
var _local3;
var _local1;
a = this.rows[iRow].flags;
var i = 0;
while (i < (a.length - 1)) {
_local3 = a[i];
switch (_local3.name) {
case "wallright" :
_local1 = {};
_local1.branches = [];
_local1.left = _local3.x;
_local1.row = iRow;
break;
case "wallleft" :
if (_local1 == null) {
break;
}
_local1.right = _local3.x;
var _local2 = 0;
while (_local2 < _local1.branches.length) {
_local1.branches[_local2].flag.room = (_local1.branches[_local2].room = this.rooms.length);
_local2++;
}
_local1.id = this.rooms.length;
this.rooms.push(_local1);
_local1 = null;
break;
case "door" :
i++;
_local1.branches.push({flag:_local3, type:_local3.name, x:_local3.mc._x, row:iRow, id:_local3.id});
break;
case "stairsup" :
case "stairsdown" :
_local1.branches.push({flag:_local3, type:_local3.name, x:_local3.x, row:iRow});
}
i++;
}
};
MCP.addSpawnPoint = function (iX, iY) {
var _local1 = this;
var _local3 = _local1.findRowNumber(iY);
var _local2 = {x:iX, y:_local1.rows[_local3].y};
if (_local1.entryPoint == null) {
_local1.entrypoint = [_local2];
} else {
_local1.entryPoint.push(_local2);
}
};
MCP.addToken = function (iX, iY, sLinkage, iFrame) {
var _local2 = this.createFlag(FLAG_BOUNDS, iX, iY, collectToken, collectToken, "token");
var _local1 = (_local2.target = this.addMovieToLevel(sLinkage));
_local1._x = iX;
_local1._y = iY;
_local1.gotoAndStop(iFrame + 1);
_local2.value = iFrame;
};
MCP.addRemote = function (iX, iY, sLinkage) {
var _local2 = this.createFlag(FLAG_BOUNDS, iX, iY, collectRemote, collectRemote, "remote");
var _local1 = (_local2.target = this.addMovieToLevel(sLinkage));
_local1._x = iX;
_local1._y = iY;
_local1.gotoAndStop(iFrame + 1);
_local2.value = iFrame;
};
MCP.addTrap = function (mc) {
var _local1 = mc;
var _local2 = this;
_local1._visible = true;
var rowNum = _local2.findRowNumber(_local1._y);
var _local3 = _local2.createFlag(FLAG_AXIS, _local1._x, _local1._y, checkTrap, checkTrap, "trap");
_local3.mc = _local1;
if (_local2.traps == null) {
_local2.traps = [];
}
_local2.traps.push(_local3);
};
MCP.addWall = function (iX, iY) {
var _local1;
_local1 = this.createFlag(FLAG_LEFT_BOUNDS, iX + wallThickness, iY, null, alignRightOfFlag, "wallright");
_local1 = this.createFlag(FLAG_RIGHT_BOUNDS, iX, iY, alignLeftOfFlag, null, "wallleft");
};
MCP.addDoor = function (mc) {
var _local2 = mc;
var _local3 = this;
var rowNum = _local3.findRowNumber(_local2._y);
_local2._y = _local3.rows[rowNum];
var hWidth = (_local2._width * 0.5);
var lFlag = _local3.createFlag(FLAG_AXIS, _local2._x - hWidth, _local2._y, checkIfInDoor, checkIfInDoor, "door");
var rFlag = _local3.createFlag(FLAG_AXIS, _local2._x + hWidth, _local2._y, checkIfInDoor, checkIfInDoor, "door");
rFlag.mc = (lFlag.mc = _local2);
rFlag.mcDoor = (lFlag.mcDoor = _local2.mcDoor);
rFlag.id = (lFlag.id = _local2.id);
rFlag.hWidth = (lFlag.hWidth = hWidth);
_local2.lFlag = lFlag;
_local2.rFlag = rFlag;
var _local1 = 0;
while (_local1 < _local3.doors.length) {
if (_local3.doors[_local1].id == _local2.id) {
_local3.doors[_local1].lFlag.other = _local2.lFlag;
_local3.doors[_local1].rFlag.other = _local2.rFlag;
_local2.lFlag.other = _local3.doors[_local1].lFlag;
_local2.rFlag.other = _local3.doors[_local1].rFlag;
}
_local1++;
}
_local3.doors.push(_local2);
};
MCP.addSafe = function (mc) {
var _local1 = mc;
var _local2 = this;
var _local3 = _local2.findRowNumber(_local1._y);
_local1._y = _local2.rows[_local3].y;
_local1._visible = true;
var left = _local2.createFlag(FLAG_AXIS, _local1._x, _local1._y, enterSafe, exitSafe, "safe");
var right = _local2.createFlag(FLAG_AXIS, _local1._x + 50, _local1._y, exitSafe, enterSafe, "safe");
left.mc = (right.mc = _local1);
};
MCP.addStairs = function (iX, iY, iAngle, bFlipped) {
StairsCreated++;
var rowNum = this.findRowNumber(iY);
iY = this.rows[rowNum].y;
var fRad;
var vX;
var _local3;
var upX;
var upY;
var rightX;
var rightY;
var topX;
var topY;
fRad = ((iAngle - 180) / 180) * 3.1415;
vX = Math.sin(fRad);
_local3 = Math.cos(fRad);
upX = -_local3;
upY = vX;
var bLtR;
var bRtL;
var tLtR;
var tRtL;
if (bFlipped) {
bRtL = goUpStairs;
tLtR = goDownStairs;
bLtR = (tRtL = getOffStairs);
rightX = -upY;
rightY = upX;
} else {
bLtR = goUpStairs;
tRtL = goDownStairs;
bRtL = (tLtR = getOffStairs);
rightX = -upY;
rightY = -upX;
bFlipped = -1;
}
var spanY = (iY - this.rows[rowNum - 1].y);
var dist = (Math.abs(1 / _local3) * spanY);
topX = iX + ((vX * bFlipped) * dist);
topY = iY + (_local3 * dist);
var _local1 = this.createFlag(FLAG_AXIS, iX, iY, bLtR, bRtL, "stairsup");
var _local2 = this.createFlag(FLAG_AXIS, topX, topY, tLtR, tRtL, "stairsdown");
_local2.flipped = (_local1.flipped = bFlipped);
_local2.upX = (_local1.upX = upX);
_local2.upY = (_local1.upY = upY);
_local2.rightX = (_local1.rightX = rightX);
_local2.rightY = (_local1.rightY = rightY);
_local2.id = (_local1.id = StairsCreated);
_local2.other = _local1;
_local1.other = _local2;
};
MCP.step = function (fStepSize, iCount) {
var _local2 = iCount;
var _local3 = this;
_local2 = Math.max(_local2, 1);
fStepSize = fStepSize / _local2;
var _local1 = 0;
while (_local1 < _local2) {
_local3.updateObjects(fStepSize);
_local1++;
}
_local3.updateDisplay();
_local3.viewport.update();
};
MCP.updateObjects = function (fStepSize) {
var _local2 = this;
var _local3 = fStepSize;
var _local1 = 0;
while (_local1 < _local2.objects.length) {
_local2.objects[_local1].update(_local3);
_local1++;
}
onObjectsUpdate(_local2);
};
MCP.addMovieToLevel = function (sLinkageID) {
var _local1 = this;
_local1.movieClipsCreated++;
var _local2 = _local1.target.mcLevel.attachMovie(sLinkageID, "mc" + _local1.movieClipsCreated, _local1.movieClipsCreated - 1000);
return(_local2);
};
MCP.queueForDisplay = function (oRef) {
var _local1 = oRef;
if (_local1.queued) {
return(null);
}
_local1.queued = true;
this.displayList.push(_local1);
return(undefined);
};
MCP.updateDisplay = function () {
var _local2 = this;
if (_local2.displayList.length == 0) {
return(null);
}
var _local1 = 0;
while (_local1 < _local2.displayList.length) {
_local2.displayList[_local1].updateDisplay();
_local2.displayList[_local1].queued = false;
_local1++;
}
_local2.displayList = [];
return(undefined);
};
MCP.GenericObject = function (sLinkageID) {
var _local1 = this;
_local1.linkageID = sLinkageID;
_local1.upX = 0;
_local1.upY = 1;
_local1.rightX = 1;
_local1.rightY = 0;
_local1.setLayer(0);
};
GOP = MCP.GenericObject.prototype;
GOP.moveTo = function (iX, iY) {
var _local1 = this;
var _local2 = _local1.x != ((_local1.x = iX));
_local2 = (_local1.y != ((_local1.y = iY))) || (_local2);
if (!_local2) {
return(null);
}
_local1.level.queueForDisplay(_local1);
return(undefined);
};
GOP.moveBy = function (iX, iY) {
var _local1 = this;
_local1.moveTo(_local1.x + iX, _local1.y + iY);
};
GOP.alignTo = function (oRef) {
this.moveTo(oRef.x, oRef.y);
};
GOP.init = function (oLevel) {
var _local1 = this;
_local1.halfWidth = _local1.width * 0.5;
_local1.level = oLevel;
_local1.target = oLevel.addMovieToLevel(_local1.linkageID);
};
GOP.setLayer = function (iLevel) {
this.layer = iLevel;
};
GOP.updateDisplay = function () {
var _local1 = this;
mc = _local1.target;
mc._x = _local1.x;
mc._y = _local1.y;
};
GOP.getCurrentRoom = function (iX, iRow) {
var _local3 = iX;
var _local2 = this.level.rooms;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].row == iRow) {
if ((_local3 < _local2[_local1].right) && (_local3 > _local2[_local1].left)) {
return(this.level.rooms[_local1]);
}
}
_local1++;
}
return(undefined);
};
GOP.findPath = function (iX, iRow) {
var _local1 = this;
_local1.row = _local1.level.findRowNumber(_local1.y);
if (iRow == null) {
return(null);
}
var _local2 = _local1.getCurrentRoom(iX, iRow);
var _local3 = _local1.getCurrentRoom(_local1.x, _local1.row);
_root.path = (_local1.path = _local1.testPathNode([], _local3, _local2, iX, _local1.x));
return(undefined);
};
GOP.testPathNode = function (aRoomsUsed, oRoom, oTarget, iTarX, iLastX) {
var _local3 = oRoom;
if (aRoomsUsed[_local3.id]) {
return(null);
}
aRoomsUsed[_local3.id] = true;
var v;
var path;
var branch;
var _local1;
var tmpX;
if (_local3.id == oTarget.id) {
return([{room:_local3.id, x:iTarX}]);
}
var _local2 = 0;
while (_local2 < _local3.branches.length) {
branch = _local3.branches[_local2];
v = this.testPathNode(aRoomsUsed, this.level.rooms[branch.flag.other.room], oTarget, iTarX, branch.flag.x);
if (v != null) {
_local1 = branch.flag;
v.unshift({room:_local3.id, x:((_local1.name == "door") ? (_local1.mc._x) : (_local1.x)), flag:_local1});
aRoomsUsed[_local3.id] = null;
return(v);
}
_local2++;
}
aRoomsUsed[_local3.id] = null;
return(undefined);
};
GOP.moveCharacter = function (fElapsed, bLeft, bUp, bRight, bDown) {
var _local2 = this;
var oldX = _local2.x;
var oldY = _local2.y;
_local2.hDir = bRight - bLeft;
_local2.vDir = bUp - bDown;
if (_local2.hDir != 0) {
_local2.fDir = _local2.hDir;
}
if (bUp) {
if (_local2.currentDoor != null) {
goThruDoor(_local2, _local2.currentDoor);
}
if (_local2.canUseSafe && (_local2.currentSafe != null)) {
useSafe(_local2, _local2.currentSafe);
}
}
if (!_local2.walk(_local2.hDir, fElapsed)) {
return(false);
}
var _local1;
var aFlags = _local2.level.rows[_local2.row].flags;
var oLX;
var oRX;
var nLX;
var nRX;
oLX = oldX - _local2.halfWidth;
oRX = oldX + _local2.halfWidth;
nLX = _local2.x - _local2.halfWidth;
nRX = _local2.x + _local2.halfWidth;
var iLeft = Math.min(oLX, nLX);
var iRight = Math.max(oRX, nRX);
var _local3 = 0;
while (_local3 < aFlags.length) {
_local1 = aFlags[_local3];
_local2.__tmpfnltr = _local1.leftToRight;
_local2.__tmpfnrtl = _local1.rightToLeft;
if (_local1.disabled) {
} else if (_local1.x < iLeft) {
} else {
if (_local1.x > iRight) {
return(undefined);
}
switch (_local1.type) {
case FLAG_AXIS :
if (isBetween(_local1.x, oldX, _local2.x)) {
if (_local2.hDir == 1) {
_local2.__tmpfnltr(_local1);
} else {
_local2.__tmpfnrtl(_local1);
}
}
break;
case FLAG_BOUNDS :
if (isBetween(_local1.x, oLX, nLX) || (isBetween(_local1.x, oRX, nRX))) {
if (_local2.hDir == 1) {
_local2.__tmpfnltr(_local1);
} else {
_local2.__tmpfnrtl(_local1);
}
}
break;
case FLAG_LEFT_BOUNDS :
if (isBetween(_local1.x, oLX, nLX)) {
if (_local2.hDir == 1) {
_local2.__tmpfnltr(_local1);
} else {
_local2.__tmpfnrtl(_local1);
}
}
break;
case FLAG_RIGHT_BOUNDS :
if (!isBetween(_local1.x, oRX, nRX)) {
break;
}
if (_local2.hDir == 1) {
_local2.__tmpfnltr(_local1);
} else {
_local2.__tmpfnrtl(_local1);
}
}
}
_local3++;
}
return(undefined);
};
GOP.walk = function (iDir, fElapsed) {
var _local1 = this;
if (iDir == 0) {
_local1.target.gotoAndStop(((_local1.fDir == 1) ? "stand_r" : "stand_l"));
return(false);
}
var _local2 = (iDir * fElapsed) * _local1.speed;
_local1.moveBy(_local2 * _local1.rightX, _local2 * _local1.rightY);
_local1.target.gotoAndStop(((_local1.fDir == 1) ? "walk_r" : "walk_l"));
_local1.row = _local1.level.findRowNumber(_local1.y);
return(true);
};
GOP.resetVector = function () {
var _local1 = this;
_local1.upX = 0;
_local1.upY = 1;
_local1.rightX = 1;
_local1.rightY = 0;
};
OpponentClass.prototype = new MCP.GenericObject();
OCP = OpponentClass.prototype;
OCP.findNewPath = function (bNotChar) {
var _local1;
var _local2;
var _local3;
if (((random(4) == 1) && (MainChar.row != null)) && (!bNotChar)) {
_local3 = MainChar.x;
_local2 = MainChar.row;
} else {
_local1 = this.level.rooms[random(this.level.rooms.length)];
_local3 = (_local1.left + random((_local1.right - _local1.left) - 200)) + 100;
_local2 = _local1.row;
}
this.findPath(_local3, _local2);
};
OCP.update = function (fElapsed) {
var _local1 = this;
var _local3 = fElapsed;
if (_local1.wait > 0) {
TrapTimeRemaining = 0;
_local1.trapped = true;
_local1.wait = _local1.wait - _local3;
if (_local1.wait <= 0) {
_local1.trapped = false;
_local1.trapped.mc.gotoAndPlay("release");
mcInterface.setCaught(false);
setTrapState(false);
}
return(null);
}
if ((_local1.state == 0) && (MainChar.state == 0)) {
if ((_local1.path.length == 0) || (_local1.path == null)) {
_local1.findNewPath();
} else {
var _local2 = _local1.path[0];
var distX = Math.abs(_local2.x - _local1.x);
_local1.reaction = _local1.reaction + _local3;
if ((_local1.layer == 0) && (_local1.reaction > 0.1)) {
_local1.reaction = 0;
var sNext = _local2.flag.name;
_local1.reaction = _local1.reaction + _local3;
_local1.keyLeft = _local2.x < _local1.x;
_local1.keyRight = _local2.x > _local1.x;
var changed = (_local1.zone != ((_local1.zone = Math.floor(_local1.x / 80))));
if (!changed) {
_local1.timeIn = _local1.timeIn + _local3;
} else {
_local1.timeIn = 0;
}
if (distX < 48) {
switch (sNext) {
case "stairsdown" :
_local1.keyDown = true;
goNext = true;
break;
case "stairsup" :
_local1.keyUp = true;
goNext = true;
break;
case "door" :
_local1.keyUp = true;
goNext = true;
break;
case undefined :
case null :
_local1.keyUp = (_local1.keyDown = (_local1.keyLeft = (_local1.keyRight = false)));
_local1.findNewPath();
}
} else {
_local1.keyUp = (_local1.keyDown = false);
}
}
if (_local1.timeIn > 0.25) {
_local1.findNewPath();
_local1.timeIn = 0;
}
_local1.moveCharacter(_local3, _local1.keyLeft, _local1.keyUp, _local1.keyRight, _local1.keyDown);
if (((_local1.layer == 1) || (_local1.state != 0)) && (goNext)) {
_local1.keyUp = (_local1.keyDown = false);
_local1.path.shift();
}
}
}
return(undefined);
};
MainCharClass.prototype = new MCP.GenericObject("mainChar");
MainCharClass.prototype.update = function (fElapsed) {
if (this.state == 0) {
this.moveCharacter(fElapsed, Key.isDown(37), Key.isDown(38), Key.isDown(39), Key.isDown(40));
}
};
Symbol 421 MovieClip Frame 2 (25 B)
startNewGame();
stop();