Frame 1
function nextZ() {
return(topZ++);
}
function doBreak() {
var _local1 = 5;
}
function fsAll(str1, str2) {
trace((("fsAll:" + str1) + "-") + str2);
fscommand (str1, str2);
}
function fsMoney(str1, str2) {
trace((("fsMoney:" + str1) + "-") + str2);
fscommand (str1, str2);
}
Array.prototype.remove = function (obj) {
var _local2 = 0;
var _local3 = _local2 >= this.length;
while (!_local3) {
if (this[_local2] == obj) {
this.splice(_local2, 1);
} else {
_local2++;
}
_local3 = _local2 >= this.length;
}
};
Array.prototype.find = function (obj, reverse) {
if (reverse) {
var _local2 = this.length - 1;
while (_local2 > 0) {
if (this[_local2] == obj) {
return(_local2);
}
_local2--;
}
} else {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == obj) {
return(_local2);
}
_local2++;
}
}
return(-1);
};
Array.prototype.setNull = function (obj) {
if (obj) {
var _local2 = this.find(obj);
if (_local2 != -1) {
this[_local2] = null;
}
} else {
var _local2 = 0;
while (_local2 < this.length) {
this[_local2] = null;
_local2++;
}
}
};
Array.prototype.shiftRight = function (from) {
if (from == undefined) {
from = this.length - 1;
}
from = Math.min(this.length - 1, from);
var _local2 = from - 1;
while (_local2 >= 0) {
this[_local2 + 1] = this[_local2];
this[_local2] = null;
_local2--;
}
};
Array.prototype.append = function (arr) {
var _local2 = 0;
while (_local2 < arr.length) {
if (arr[_local2] != null) {
this.push(arr[_local2]);
}
_local2++;
}
};
Sound.prototype.fadeup = function (fadespeed, maxLevel) {
var SndIntervalID;
clearInterval(SndIntervalID);
SndIntervalID = setInterval(this, "upOne", fadespeed, maxLevel);
Sound.prototype.upOne = function (maxLevel) {
varSnd = this.getVolume();
if (varSnd < maxLevel) {
this.setVolume(varSnd + 1);
} else {
clearInterval(SndIntervalID);
}
updateAfterEvent();
};
};
Sound.prototype.fadedown = function (fadespeed, minLevel) {
var SndIntervalID;
clearInterval(SndIntervalID);
SndIntervalID = setInterval(this, "downOne", fadespeed, minLevel);
trace((("xxx:" + fadespeed) + "-") + minLevel);
Sound.prototype.downOne = function (minLevel) {
varSnd = this.getVolume();
if (varSnd > minLevel) {
this.setVolume(varSnd - 1);
} else {
clearInterval(SndIntervalID);
}
updateAfterEvent();
};
};
MovieClip.prototype.tween = (TextField.prototype.tween = function (prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2) {
if (timeSeconds < 0.001) {
timeSeconds = 2;
}
if ((animType == undefined) || (animType == "")) {
animType = "easeOutExpo";
}
if (delay == undefined) {
delay = 0;
}
if (typeof(prop) == "string") {
var _local9 = [prop];
var _local14 = [this[prop]];
var _local12 = [propDest];
} else {
var _local9 = [];
var _local14 = [];
var _local12 = [];
for (var _local32 in prop) {
_local14.push(this[prop[_local32]]);
}
for (var _local32 in prop) {
_local9.push(prop[_local32]);
}
for (var _local32 in propDest) {
_local12.push(propDest[_local32]);
}
}
var _local29 = false;
if (_root.__tweenController__ == undefined) {
var _local34 = _root.createEmptyMovieClip("__tweenController__", 123432);
_local34.$_tweenPropList = new Array();
_local34.$_tTime = getTimer();
_local34.onEnterFrame = function () {
var _local7 = (this.$_tTime = getTimer());
var _local5 = 0;
while (_local5 < this.$_tweenPropList.length) {
var _local4 = this.$_tweenPropList[_local5];
if ((_local4._timeStart + (_local4._delay * 1000)) <= _local7) {
if ((_local4._timeDest + (_local4._delay * 1000)) <= _local7) {
_local4._targ[_local4._prop] = _local4._propDest;
_root.game.activeLevel().unlock(_local4._targ);
this.$_tweenPropList.splice(_local5, 1);
_local5--;
_local4._targ.$_tweenCount--;
if (_local4._targ.$_tweenCount == 0) {
delete _local4._targ.$_tweenCount;
}
if (_local4._callback != undefined) {
if (_global.backwardCallbackTweening) {
var _local6 = _local4._targ.createEmptyMovieClip("__child__", 122344);
_local4._callback.apply(_local6, this.callbackargs);
_local6.removeMovieClip();
} else if (_local4._callback.context) {
_local4._callback.context[_local4._callback.method](_local4._callback.args);
}
}
if (this.$_tweenPropList.length == 0) {
this.removeMovieClip();
}
} else {
if (_local4._propStart == undefined) {
_local4._propStart = _local4._targ[_local4._prop];
}
_local4._targ[_local4._prop] = _global.findTweenValue(_local4._propStart, _local4._propDest, _local4._timeStart, _local7 - (_local4._delay * 1000), _local4._timeDest, _local4._animType, _local4._extra1, _local4._extra2);
if ((typeof(_local4._targ) != "movieclip") && (_local4._prop == "__special_text_b__")) {
_local4._targ.textColor = ((_local4._targ.__special_text_r__ << 16) + (_local4._targ.__special_text_g__ << 8)) + _local4._targ.__special_text_b__;
}
}
}
_local5++;
}
};
}
MovieClip.prototype.addArgs = (TextField.prototype.addArgs = function () {
this.callbackargs = arguments;
});
var _local7 = _root.__tweenController__.$_tweenPropList;
var _local10 = _root.__tweenController__.$_tTime;
for (var _local32 in _local14) {
if ((_local12[_local32] != undefined) && (!this.$_isTweenLocked)) {
if (this.$_tweenCount > 0) {
var _local6 = 0;
while (_local6 < _local7.length) {
if ((_local7[_local6]._targ == this) && (_local7[_local6]._prop == _local9[_local32])) {
if ((_local10 + (delay * 1000)) < _local7[_local6]._timeDest) {
_local7.splice(_local6, 1);
_local6--;
this.$_tweenCount--;
}
}
_local6++;
}
}
_local7.push({_prop:_local9[_local32], _targ:this, _propStart:undefined, _propDest:_local12[_local32], _timeStart:_local10, _timeDest:_local10 + (timeSeconds * 1000), _animType:animType, _extra1:extra1, _extra2:extra2, _delay:delay, _callback:callback});
this.$_tweenCount = ((this.$_tweenCount > 0) ? (this.$_tweenCount + 1) : 1);
_local29 = true;
}
}
ASSetPropFlags(this, "$_tweenCount", 1, 0);
});
ASSetPropFlags(MovieClip.prototype, "tween", 1, 0);
ASSetPropFlags(TextField.prototype, "tween", 1, 0);
MovieClip.prototype.lockTween = (TextField.prototype.lockTween = function () {
this.$_isTweenLocked = true;
ASSetPropFlags(this, "this.$_isTweenLocked", 1, 0);
});
ASSetPropFlags(MovieClip.prototype, "lockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "lockTween", 1, 0);
MovieClip.prototype.unlockTween = (TextField.prototype.unlockTween = function () {
delete this.$_isTweenLocked;
});
ASSetPropFlags(MovieClip.prototype, "unlockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "unlockTween", 1, 0);
MovieClip.prototype.getTweens = (TextField.prototype.getTweens = function () {
return(this.$_tweenCount);
});
ASSetPropFlags(MovieClip.prototype, "getTweens", 1, 0);
ASSetPropFlags(TextField.prototype, "getTweens", 1, 0);
MovieClip.prototype.isTweening = (TextField.prototype.isTweening = function () {
return(((this.$_tweenCount > 0) ? true : false));
});
ASSetPropFlags(MovieClip.prototype, "isTweening", 1, 0);
ASSetPropFlags(TextField.prototype, "isTweening", 1, 0);
MovieClip.prototype.stopTween = (TextField.prototype.stopTween = function (props) {
var _local3 = _root.__tweenController__.$_tweenPropList;
switch (typeof(props)) {
case "string" :
props = [props];
case "object" :
for (var _local6 in props) {
for (var _local5 in _local3) {
if ((_local3[_local5]._targ == this) && (_local3[_local5]._prop == props[_local6])) {
_local3.splice(_local5, 1);
}
}
}
this.$_tweenCount = 0;
for (var _local5 in _local3) {
if (_local3[_local5]._targ == this) {
this.$_tweenCount++;
}
}
if (this.$_tweenCount == 0) {
delete this.$_tweenCount;
}
break;
default :
for (var _local5 in _local3) {
if (_local3[_local5]._targ == this) {
_local3.splice(_local5, 1);
}
}
delete this.$_tweenCount;
}
if (_local3.length == 0) {
_root.__tweenController__.removeMovieClip();
this.__tweenController_ADVhelper__.removeMovieClip();
}
});
ASSetPropFlags(MovieClip.prototype, "stopTween", 1, 0);
ASSetPropFlags(TextField.prototype, "stopTween", 1, 0);
MovieClip.prototype.alphaTo = (TextField.prototype.alphaTo = function (propDest_a, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_alpha", propDest_a, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "alphaTo", 1, 0);
ASSetPropFlags(TextField.prototype, "alphaTo", 1, 0);
MovieClip.prototype.rotateTo = (TextField.prototype.rotateTo = function (propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_rotation", propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "rotateTo", 1, 0);
ASSetPropFlags(TextField.prototype, "rotateTo", 1, 0);
MovieClip.prototype.scaleTo = (TextField.prototype.scaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_xscale", "_yscale"], [propDest_scale, propDest_scale], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "scaleTo", 1, 0);
ASSetPropFlags(TextField.prototype, "scaleTo", 1, 0);
TextField.prototype.scrollTo = function (propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("scroll", propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(TextField.prototype, "scrollTo", 1, 0);
MovieClip.prototype.slideTo = (TextField.prototype.slideTo = function (propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_x", "_y"], [propDest_x, propDest_y], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "slideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "slideTo", 1, 0);
MovieClip.prototype.colorTo = (TextField.prototype.colorTo = function (propDest_color, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local2 = propDest_color >> 16;
var _local4 = (propDest_color & 65280) >> 8;
var _local3 = propDest_color & 255;
if (typeof(this) == "movieclip") {
this.colorTransformTo(0, _local2, 0, _local4, 0, _local3, undefined, undefined, timeSeconds, animType, delay, callback, extra1, extra2);
} else {
this.__special_text_r__ = this.textColor >> 16;
this.__special_text_g__ = (this.textColor & 65280) >> 8;
this.__special_text_b__ = this.textColor & 255;
this.tween(["__special_text_r__", "__special_text_g__", "__special_text_b__"], [_local2, _local4, _local3], timeSeconds, animType, delay, callback, extra1, extra2);
}
});
ASSetPropFlags(MovieClip.prototype, "colorTo", 1, 0);
ASSetPropFlags(TextField.prototype, "colorTo", 1, 0);
MovieClip.prototype.colorTransformTo = function (propDest_ra, propDest_rb, propDest_ga, propDest_gb, propDest_ba, propDest_bb, propDest_aa, propDest_ab, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local5 = new Color(this);
var _local3 = _local5.getTransform();
this.$_ADVsetter_ra = ((propDest_ra == undefined) ? undefined : (_local3.ra));
this.$_ADVsetter_rb = ((propDest_rb == undefined) ? undefined : (_local3.rb));
this.$_ADVsetter_ga = ((propDest_ga == undefined) ? undefined : (_local3.ga));
this.$_ADVsetter_gb = ((propDest_gb == undefined) ? undefined : (_local3.gb));
this.$_ADVsetter_ba = ((propDest_ba == undefined) ? undefined : (_local3.ba));
this.$_ADVsetter_bb = ((propDest_bb == undefined) ? undefined : (_local3.bb));
this.$_ADVsetter_aa = ((propDest_aa == undefined) ? undefined : (_local3.aa));
this.$_ADVsetter_ab = ((propDest_ab == undefined) ? undefined : (_local3.ab));
this.$_new_ra = propDest_ra;
this.$_new_rb = propDest_rb;
this.$_new_ga = propDest_ga;
this.$_new_gb = propDest_gb;
this.$_new_ba = propDest_ba;
this.$_new_bb = propDest_bb;
this.$_new_aa = propDest_aa;
this.$_new_ab = propDest_ab;
this.tween(["$_ADVsetter_ra", "$_ADVsetter_rb", "$_ADVsetter_ga", "$_ADVsetter_gb", "$_ADVsetter_ba", "$_ADVsetter_bb", "$_ADVsetter_aa", "$_ADVsetter_ab"], [this.$_new_ra, this.$_new_rb, this.$_new_ga, this.$_new_gb, this.$_new_ba, this.$_new_bb, this.$_new_aa, this.$_new_ab], timeSeconds, animType, delay, callback, extra1, extra2);
this.__tweenController_ADVhelper__.removeMovieClip();
this.createEmptyMovieClip("__tweenController_ADVhelper__", 123434);
this.__tweenController_ADVhelper__.onEnterFrame = function () {
var _local3 = new Color(this._parent);
var _local2 = {};
if (this._parent.$_ADVsetter_ra != undefined) {
_local2.ra = this._parent.$_ADVsetter_ra;
}
if (this._parent.$_ADVsetter_rb != undefined) {
_local2.rb = this._parent.$_ADVsetter_rb;
}
if (this._parent.$_ADVsetter_ga != undefined) {
_local2.ga = this._parent.$_ADVsetter_ga;
}
if (this._parent.$_ADVsetter_gb != undefined) {
_local2.gb = this._parent.$_ADVsetter_gb;
}
if (this._parent.$_ADVsetter_ba != undefined) {
_local2.ba = this._parent.$_ADVsetter_ba;
}
if (this._parent.$_ADVsetter_bb != undefined) {
_local2.bb = this._parent.$_ADVsetter_bb;
}
if (this._parent.$_ADVsetter_aa != undefined) {
_local2.aa = this._parent.$_ADVsetter_aa;
}
if (this._parent.$_ADVsetter_ab != undefined) {
_local2.ab = this._parent.$_ADVsetter_ab;
}
_local3.setTransform(_local2);
if (this.$_toDelete) {
delete this._parent.$_ADVsetter_ra;
delete this._parent.$_ADVsetter_rb;
delete this._parent.$_ADVsetter_ga;
delete this._parent.$_ADVsetter_gb;
delete this._parent.$_ADVsetter_ba;
delete this._parent.$_ADVsetter_bb;
delete this._parent.$_ADVsetter_aa;
delete this._parent.$_ADVsetter_ab;
delete this._parent.$_new_ra;
delete this._parent.$_new_rb;
delete this._parent.$_new_ga;
delete this._parent.$_new_gb;
delete this._parent.$_new_ba;
delete this._parent.$_new_bb;
delete this._parent.$_new_aa;
delete this._parent.$_new_ab;
this.removeMovieClip();
}
if (((((((((this._parent.$_ADVsetter_ra == this._parent.$_new_ra) || (this._parent.$_new_ra == undefined)) && ((this._parent.$_ADVsetter_rb == this._parent.$_new_rb) || (this._parent.$_new_rb == undefined))) && ((this._parent.$_ADVsetter_ga == this._parent.$_new_ga) || (this._parent.$_new_ga == undefined))) && ((this._parent.$_ADVsetter_gb == this._parent.$_new_gb) || (this._parent.$_new_gb == undefined))) && ((this._parent.$_ADVsetter_ba == this._parent.$_new_ba) || (this._parent.$_new_ba == undefined))) && ((this._parent.$_ADVsetter_bb == this._parent.$_new_bb) || (this._parent.$_new_bb == undefined))) && ((this._parent.$_ADVsetter_aa == this._parent.$_new_aa) || (this._parent.$_new_aa == undefined))) && ((this._parent.$_ADVsetter_ab == this._parent.$_new_ab) || (this._parent.$_new_ab == undefined))) {
this.$_toDelete = true;
}
};
};
ASSetPropFlags(MovieClip.prototype, "colorTransformTo", 1, 0);
_global.findTweenValue = function (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) {
var _local1 = _timeNow - _timeStart;
var _local3 = _propStart;
var _local2 = _propDest - _propStart;
var _local4 = _timeDest - _timeStart;
var _local7 = _extra1;
var _local6 = _extra2;
var _local5 = _extra1;
switch (_animType.toLowerCase()) {
case "linear" :
return(((_local2 * _local1) / _local4) + _local3);
case "easeinquad" :
_local1 = _local1 / _local4;
return(((_local2 * _local1) * _local1) + _local3);
case "easeoutquad" :
_local1 = _local1 / _local4;
return((((-_local2) * _local1) * (_local1 - 2)) + _local3);
case "easeinoutquad" :
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return((((_local2 / 2) * _local1) * _local1) + _local3);
}
_local1--;
return((((-_local2) / 2) * ((_local1 * (_local1 - 2)) - 1)) + _local3);
case "easeincubic" :
_local1 = _local1 / _local4;
return((((_local2 * _local1) * _local1) * _local1) + _local3);
case "easeoutcubic" :
_local1 = (_local1 / _local4) - 1;
return((_local2 * (((_local1 * _local1) * _local1) + 1)) + _local3);
case "easeinoutcubic" :
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return(((((_local2 / 2) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * _local1) + 2)) + _local3);
case "easeinquart" :
_local1 = _local1 / _local4;
return(((((_local2 * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquart" :
_local1 = (_local1 / _local4) - 1;
return(((-_local2) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + _local3);
case "easeinoutquart" :
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return((((-_local2) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + _local3);
case "easeinquint" :
_local1 = _local1 / _local4;
return((((((_local2 * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquint" :
_local1 = (_local1 / _local4) - 1;
return((_local2 * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + _local3);
case "easeinoutquint" :
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return(((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + _local3);
case "easeinsine" :
return((((-_local2) * Math.cos((_local1 / _local4) * (Math.PI/2))) + _local2) + _local3);
case "easeoutsine" :
return((_local2 * Math.sin((_local1 / _local4) * (Math.PI/2))) + _local3);
case "easeinoutsine" :
return((((-_local2) / 2) * (Math.cos((Math.PI * _local1) / _local4) - 1)) + _local3);
case "easeinexpo" :
return(((_local1 == 0) ? (_local3) : ((_local2 * Math.pow(2, 10 * ((_local1 / _local4) - 1))) + _local3)));
case "easeoutexpo" :
return(((_local1 == _local4) ? (_local3 + _local2) : ((_local2 * ((-Math.pow(2, (-10 * _local1) / _local4)) + 1)) + _local3)));
case "easeinoutexpo" :
if (_local1 == 0) {
return(_local3);
}
if (_local1 == _local4) {
return(_local3 + _local2);
}
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return(((_local2 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local3);
}
_local1--;
return(((_local2 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local3);
case "easeincirc" :
_local1 = _local1 / _local4;
return(((-_local2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
case "easeoutcirc" :
_local1 = (_local1 / _local4) - 1;
return((_local2 * Math.sqrt(1 - (_local1 * _local1))) + _local3);
case "easeinoutcirc" :
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
return((((-_local2) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + _local3);
case "easeinelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / _local4;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!_local6) {
_local6 = _local4 * 0.3;
}
if (_local7 < Math.abs(_local2)) {
_local7 = _local2;
_local5 = _local6 / 4;
} else {
_local5 = (_local6 / (Math.PI*2)) * Math.asin(_local2 / _local7);
}
_local1 = _local1 - 1;
return((-((_local7 * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * _local4) - _local5) * (Math.PI*2)) / _local6))) + _local3);
case "easeoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / _local4;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!_local6) {
_local6 = _local4 * 0.3;
}
if (_local7 < Math.abs(_local2)) {
_local7 = _local2;
_local5 = _local6 / 4;
} else {
_local5 = (_local6 / (Math.PI*2)) * Math.asin(_local2 / _local7);
}
return((((_local7 * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * _local4) - _local5) * (Math.PI*2)) / _local6)) + _local2) + _local3);
case "easeinoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / (_local4 / 2);
if (_local1 == 2) {
return(_local3 + _local2);
}
if (!_local6) {
_local6 = _local4 * 0.45;
}
if (_local7 < Math.abs(_local2)) {
_local7 = _local2;
_local5 = _local6 / 4;
} else {
_local5 = (_local6 / (Math.PI*2)) * Math.asin(_local2 / _local7);
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((_local7 * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * _local4) - _local5) * (Math.PI*2)) / _local6))) + _local3);
}
_local1 = _local1 - 1;
return(((((_local7 * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * _local4) - _local5) * (Math.PI*2)) / _local6)) * 0.5) + _local2) + _local3);
case "easeinback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = _local1 / _local4;
return((((_local2 * _local1) * _local1) * (((_local5 + 1) * _local1) - _local5)) + _local3);
case "easeoutback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = (_local1 / _local4) - 1;
return((_local2 * (((_local1 * _local1) * (((_local5 + 1) * _local1) + _local5)) + 1)) + _local3);
case "easeinoutback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = _local1 / (_local4 / 2);
if (_local1 < 1) {
_local5 = _local5 * 1.525;
return(((_local2 / 2) * ((_local1 * _local1) * (((_local5 + 1) * _local1) - _local5))) + _local3);
}
_local1 = _local1 - 2;
_local5 = _local5 * 1.525;
return(((_local2 / 2) * (((_local1 * _local1) * (((_local5 + 1) * _local1) + _local5)) + 2)) + _local3);
case "easeinbounce" :
return((_local2 - findTweenValue(0, _local2, 0, _local4 - _local1, _local4, "easeOutBounce")) + _local3);
case "easeoutbounce" :
_local1 = _local1 / _local4;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
case "easeinoutbounce" :
if (_local1 < (_local4 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local4, "easeInBounce") * 0.5) + _local3);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local4, _local4, "easeOutBounce") * 0.5) + (_local2 * 0.5)) + _local3);
}
};
ASSetPropFlags(_global, "findTweenValue", 1, 0);
if (!initDone) {
var game = new AceSol();
var sounds = (new util.SoundManager());
initDone = true;
var topZ = 100;
}
Instance of Symbol 181 MovieClip [card] "mcDeck" in Frame 1
on (press) {
_root.game.activeLevel().hitDeck();
}
Instance of Symbol 53 MovieClip "mcAbort" in Frame 1
on (press) {
_root.game.abortGame();
}
Symbol 29 MovieClip [sign_end] Frame 31
stop();
_root.game.displayLevelScores();
Symbol 39 MovieClip [sign] Frame 1
stop();
Symbol 39 MovieClip [sign] Frame 20
_root.game.displayInstructionsText();
Symbol 39 MovieClip [sign] Frame 27
if (!goOn) {
stop();
} else {
nextFrame();
}
Symbol 39 MovieClip [sign] Frame 28
play();
Symbol 39 MovieClip [sign] Frame 45
_root.game.start();
Symbol 43 MovieClip [scorePop4] Frame 1
if (!bonus) {
stop();
}
Symbol 43 MovieClip [scorePop4] Frame 15
gotoAndPlay (1);
Symbol 47 MovieClip [scorePop3] Frame 1
if (!bonus) {
stop();
}
Symbol 47 MovieClip [scorePop3] Frame 15
gotoAndPlay (1);
Symbol 51 MovieClip [scorePop2] Frame 1
if (!bonus) {
stop();
}
Symbol 51 MovieClip [scorePop2] Frame 4
gotoAndPlay (1);
Symbol 57 MovieClip [nomoves] Frame 15
stop();
Symbol 61 MovieClip Frame 30
stop();
Symbol 65 MovieClip Frame 30
stop();
Symbol 70 MovieClip Frame 23
stop();
_root.game.activeLevel().hardLock = false;
_root.game.nextLevel();
Symbol 71 MovieClip [level_clear] Frame 40
stop();
Symbol 181 MovieClip [card] Frame 1
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
play();
Symbol 245 MovieClip Frame 9
stop();
Symbol 245 MovieClip Frame 10
play();
Symbol 245 MovieClip Frame 20
stop();
Symbol 249 MovieClip [__Packages.util.SoundManager] Frame 0
class util.SoundManager
{
function SoundManager () {
_root.createEmptyMovieClip("soundMCs", 79564);
}
function playLoop(soundName, id, volume) {
play(soundName, id, volume, true);
}
function play(soundName, id, volume, loop) {
if (id == null) {
id = soundName;
}
if (_root.soundMCs[id] != undefined) {
return(undefined);
}
var _local4 = _root.soundMCs.createEmptyMovieClip(id, depth++);
var _local3 = new Sound(_local4);
_local4.snd = _local3;
_local3.onSoundComplete = function () {
_root.sounds.removeMc(this);
};
_local3.attachSound(soundName);
if (volume) {
_local3.setVolume(volume);
}
if (turnOffSound) {
_local4.originalVolume = _local3.getVolume();
_local3.setVolume(0);
}
if (loop) {
_local3.start(0, 10000);
} else {
_local3.start(0, 1);
}
}
function playing(id) {
return(_root.soundMCs[id].playing);
}
function restart(id) {
var _local2 = _root.soundMCs[id];
_local2.stop();
_local2.start(0, 1);
}
function stop(id) {
_root.soundMCs[id].snd.stop();
_root.soundMCs[id].removeMovieClip();
}
function fadeup(id, duration) {
var _local2 = _root.soundMCs[id].snd;
var _local3 = (_local2.originalVolume ? (_local2.originalVolume) : 100);
_local2.fadeup(duration, _local3);
}
function fadedown(id, duration) {
var _local2 = _root.soundMCs[id].snd;
trace("foo:" + (_local2 == undefined));
_local2.originalVolume = _local2.getVolume();
_local2.fadedown(duration, 0);
}
function stopAll() {
for (var _local2 in _root.soundMCs) {
_root.soundMCs[_local2].snd.stop();
_root.soundMCs[_local2].removeMovieClip();
}
}
function removeMc(sound) {
for (var _local3 in _root.soundMCs) {
var _local2 = _root.soundMCs[_local3];
if (_local2.snd == sound) {
_local2.removeMovieClip();
break;
}
}
}
function soundOff() {
if (turnOffSound) {
return(undefined);
}
turnOffSound = true;
for (var _local4 in _root.soundMCs) {
var _local3 = _root.soundMCs[_local4];
_local3.originalVolume = _local3.snd.getVolume();
_local3.snd.setVolume(0);
}
}
function soundOn() {
turnOffSound = false;
for (var _local4 in _root.soundMCs) {
var _local3 = _root.soundMCs[_local4];
_local3.snd.setVolume(_local3.originalVolume);
}
}
function toggleSound() {
if (turnOffSound) {
soundOn();
} else {
soundOff();
}
}
var depth = 1;
var turnOffSound = false;
}
Symbol 250 MovieClip [__Packages.AceSol] Frame 0
class AceSol
{
var activeLevelIndex, levels, texts, xml, score, pauseTime;
function AceSol () {
if (!DEBUG) {
util.Logger.state = util.Logger.QUIET;
}
util.Logger.log("creating game");
activeLevelIndex = 0;
levels = new Array();
texts = new Array();
xml = new XML();
xml.ignoreWhite = true;
if (DEBUG) {
xml.onLoad = function () {
_root.game.gameDataReceived();
};
xml.load("gamedata.xml");
} else {
intervalID = setInterval(this, "waitForGameData", 50);
}
score = 0;
_root.attachMovie("sign", "mcSign", 1111111);
_root.mcSign._x = 477;
_root.mcSign._y = 20;
}
function generateRandomCards() {
var _local3 = new Array("C", "S", "H", "D");
var _local4 = "";
var _local2 = 0;
while (_local2 < 40) {
_local4 = _local4 + ((_local3[randRange(0, _local3.length - 1)] + randRange(1, 10)) + " ");
_local2++;
}
trace(_local4);
}
function randRange(min, max) {
var _local1 = Math.round(Math.random() * (max - min)) + min;
return(_local1);
}
function readLayout(mc) {
var _local1 = 1;
var _local3 = "";
while (mc["" + _local1] != undefined) {
_local3 = _local3 + (((mc["" + _local1]._x + ",") + mc["" + _local1]._y) + ",");
_local1++;
}
trace(_local3);
}
function waitForGameData() {
if (_root.gameData != undefined) {
clearInterval(intervalID);
xml.parseXML(_root.gameData);
gameDataReceived();
}
}
function updateScore(deltaScore) {
activeLevel().levelScore = activeLevel().levelScore + deltaScore;
score = score + deltaScore;
score = Math.max(0, score);
var _local5 = "" + score;
var _local4 = 1;
var _local3 = _local5.length - 1;
while (_local3 >= 0) {
_root["mcScoreNum" + _local4].gotoAndStop(Number(_local5.charAt(_local3)) + 1);
_local4++;
_local3--;
}
}
function gameDataReceived() {
util.Logger.log("gameDataReceived()");
if (xml.status) {
util.Logger.log("Error occured parsing xml: " + xml.status);
}
_global.shortGameMode = new String(xml.firstChild.attributes.mode) == "short";
_global.relaxMode = xml.firstChild.attributes.relaxMode == "true";
_root.timeHider._visible = _global.relaxMode;
timeLimit = Number(xml.firstChild.attributes.timelimit);
var _local5 = 0;
while (_local5 < xml.firstChild.childNodes.length) {
var _local4 = xml.firstChild.childNodes[_local5];
if (_local4.nodeName == "level") {
levels.push(createLevel(_local4));
} else if (_local4.nodeName == "text") {
texts[_local4.attributes.id] = _local4.childNodes[0].nodeValue;
}
_local5++;
}
setGameTexts();
displayInstructions();
}
function pauseClock() {
pauseTime = getTimer();
clearInterval(intervalID);
}
function startClock() {
if (_global.relaxMode) {
_root.mcTimeNum1._visible = false;
_root.mcTimeNum2._visible = false;
_root.mcTimeNum3._visible = false;
return(undefined);
}
if (startTime) {
startTime = startTime + (getTimer() - pauseTime);
} else {
startTime = getTimer();
}
intervalID = setInterval(this, "handleTime", 250);
}
function setGameTexts() {
_root.timeLeft.text = getText("time_left");
_root.score.text = getText("score");
_root.round.text = getText("round");
_root.nextround.text = getText("next_round");
_root.endgame.text = getText("end_game");
}
function abortGame() {
if ((!activeLevel().interactionAllowed()) || (gameAborted)) {
return(undefined);
}
util.Logger.log("abortGame()");
if (!gameStarted) {
return(undefined);
}
pauseClock();
gameAborted = true;
activeLevel().stop();
gameOver();
}
function intro() {
util.Logger.log("intro()");
displayInstructions();
}
function displayInstructions() {
util.Logger.log("displayInstructions()");
_root.sounds.play("introSound", "intro");
_root.mcSign.play();
}
function displayInstructionsText() {
util.Logger.log("displayInstructionsText()");
_root.mcSign.txtHeadline.text = getText("instruction_headline");
if (_global.relaxMode) {
var _local4 = 1;
while (_local4 <= 3) {
_root.mcSign["txt" + _local4].text = getText("instruction_text_" + _local4);
_local4++;
}
_root.mcSign.txt4.text = "";
} else {
var _local4 = 1;
while (_local4 <= 4) {
_root.mcSign["txt" + _local4].text = getText("instruction_text_" + _local4);
_local4++;
}
}
_root.mcSign.onPress = function () {
clearInterval(_root.game.intervalID);
this.onPress = null;
this.goOn = true;
this.play();
_root.sounds.fadedown("intro", 0.5);
};
intervalID = setInterval(this, "startInXSecs", 1000);
_root.mcSign.start_in.text = getText("start_in");
_root.mcSign.txtNumSecs.text = 5;
}
function startInXSecs() {
if (!_root.mcSign.txtNumSecs) {
clearInterval(intervalID);
return(undefined);
}
var _local3 = Number(_root.mcSign.txtNumSecs.text);
_local3--;
if (_local3 != -1) {
_root.mcSign.txtNumSecs.text = _local3;
} else {
clearInterval(intervalID);
_root.mcSign.onPress = null;
_root.mcSign.goOn = true;
_root.mcSign.play();
_root.sounds.fadedown("intro", 0.5);
}
}
function start() {
util.Logger.log("startGame()");
clearInterval(intervalID);
_root.mcSign.gotoAndStop(1);
_root.mcSign.onPress = undefined;
_root.mcDeck._alpha = 100;
_root.fsAll("gameStart", "");
gameStarted = true;
updateScore(0);
_root.mcSign.removeMovieClip();
activeLevel().start();
_root.mcNextRound.onPress = function () {
_root.game.nextLevel();
};
}
function handleTime() {
var _local3 = timeLimit - Math.floor(getTime() / 1000);
_root.mcTimeNum1.gotoAndStop(1 + (_local3 % 10));
_root.mcTimeNum2.gotoAndStop(1 + Math.floor((_local3 % 60) / 10));
_root.mcTimeNum3.gotoAndStop(1 + Math.floor(_local3 / 60));
if (_local3 <= 0) {
clearInterval(intervalID);
activeLevel().stop();
gameOver();
} else if ((_local3 <= 5) && (!playingTickTock)) {
_root.sounds.playLoop("clock", "clockSound");
playingTickTock = true;
}
}
function getTime() {
return(getTimer() - startTime);
}
function createLevel(levelNode) {
var _local7 = 0;
var _local8 = Number(levelNode.attributes.timelimit);
var _local6 = new LevelObject(layouts[_local7], _local8);
var _local3 = splitSymbols(new String(levelNode.attributes.cards));
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = _local3[_local2].charAt(0);
var _local5 = Number(_local3[_local2].substr(1));
_local6.addCard(new Card(_local5, _local4, _local2));
_local2++;
}
return(_local6);
}
function splitSymbols(symbols) {
var _local4 = new Array();
var _local2 = "";
var _local1 = 0;
while (_local1 < symbols.length) {
if (symbols.charAt(_local1) != " ") {
_local2 = _local2 + symbols.charAt(_local1);
} else if (_local2.length > 0) {
_local4.push(_local2);
_local2 = "";
}
_local1++;
}
if (_local2.length > 0) {
_local4.push(_local2);
}
return(_local4);
}
function lastLevel() {
if (_global.shortGameMode) {
return(activeLevelIndex == 1);
}
return(activeLevelIndex == levels.length);
}
function nextLevel() {
if ((!activeLevel().interactionAllowed()) || (gameAborted)) {
return(undefined);
}
trace("next level");
_root.fsMoney("playData", "23,0=0");
pauseClock();
if (!activeLevel().clearedLayout()) {
_root.sounds.play("scenbyte", "scenbyte");
}
activeLevel().stop();
activeLevelIndex++;
_root.mcRoundNum.nextFrame();
if (lastLevel()) {
gameOver();
} else {
if (activeLevelIndex == (levels.length - 1)) {
_root.nextround.text = getText("end_game");
}
activeLevel().start();
}
}
function gameOver() {
util.Logger.log("gameOver()");
_root.mcNextRound.onPress = null;
_root.mcAbort.onPress = null;
_root.sounds.stop("clockSound");
_root.mcSign.removeMovieClip();
_root.attachMovie("sign_end", "mcSign", 1111111);
_root.mcSign._x = 477;
_root.mcSign._y = 20;
_root.mcSign.play();
clearInterval(intervalID);
}
function displayLevelScores() {
_root.mcSign.game_over.text = getText("game_over");
_root.mcSign.round1.text = getText("round_1_score");
_root.mcSign.round2.text = getText("round_2_score");
_root.mcSign.round3.text = getText("round_3_score");
_root.mcSign.total.text = getText("total_score");
_root.mcSign.round1score.text = levels[0].levelScore;
_root.mcSign.round2score.text = levels[1].levelScore;
_root.mcSign.round3score.text = levels[2].levelScore;
_root.mcSign.totalScore.text = score;
if (gameAborted) {
_root.fsAll("playData", "458=" + score);
}
_root.fsAll("gameOver", "" + score);
}
function activeLevel() {
if (activeLevelIndex < levels.length) {
return(levels[activeLevelIndex]);
}
return(null);
}
function getText(key) {
return(texts[key]);
}
function fscmd(str1, str2) {
fscommand (str1, str2);
}
var gameStarted = false;
var gameAborted = false;
var startTime = 0;
var timeLimit = 0;
var playingTickTock = false;
static var DEBUG = false;
var intervalID = 0;
static var RESPONSE_TIMEOUT = 15;
static var layouts = new Array(new Array(63.1, 0, 180.1, 0, 303.1, 0, 30.05, 31, 90.1, 31, 150.05, 31, 210.1, 31, 270, 31, 330, 31, 0, 64.05, 60.05, 62, 120.05, 64, 182.15, 62, 240.1, 64, 300, 62, 360.1, 62, 30.05, 93, 90.05, 93, 270, 93, 330, 93, 64.1, 129, 304.05, 129), new Array(63.1, 0, 180.1, 0, 303.1, 0, 30.05, 31, 90.1, 31, 150.05, 31, 210.1, 31, 270, 31, 330, 31, 0, 64.05, 60.05, 62, 120.05, 64, 182.15, 62, 240.1, 64, 300, 62, 360.1, 62, 30.05, 93, 90.05, 93, 270, 93, 330, 93, 64.1, 129, 304.05, 129));
}
Symbol 251 MovieClip [__Packages.util.Logger] Frame 0
class util.Logger
{
function Logger () {
}
static function log(text) {
if (state == QUIET) {
return(undefined);
}
if (state == TRACE) {
trace(text);
} else if (state == WEB) {
fscommand ("flashdebug", text);
} else if (state == TEXTFIELD) {
_root.txtDebug.text = _root.txtDebug.text + (text + newline);
}
}
static var QUIET = 100;
static var TRACE = 101;
static var WEB = 102;
static var TEXTFIELD = 103;
static var state = TRACE;
}
Symbol 252 MovieClip [__Packages.LevelObject] Frame 0
class LevelObject
{
var timeLimit, layoutPositions, cards, layout, deck, playableCards, selectedCards, hand, locks, clearedPercentage, levelScore, initCards, hardLock, rowYs, lastComboTime, intervalID, stopped, mcScorePop;
function LevelObject (positions, timeLimit) {
this.timeLimit = timeLimit;
layoutPositions = positions;
cards = new Array();
layout = new Array();
deck = new Array();
playableCards = new Array();
selectedCards = new Array();
hand = new Array();
var _local2 = 0;
while (_local2 < HAND_SIZE) {
hand[_local2] = null;
_local2++;
}
locks = new Array();
layout = layout;
clearedPercentage = 0;
levelScore = 0;
initCards = true;
hardLock = true;
createRowYs();
}
function createRowYs() {
rowYs = new Array();
rowYs[0] = layoutPositions[1];
var _local2 = 3;
while (_local2 < layoutPositions.length) {
if (Math.abs(rowYs[rowYs.length - 1] - layoutPositions[_local2]) > rowYDelta) {
rowYs.push(layoutPositions[_local2]);
}
_local2 = _local2 + 2;
}
_local2 = 0;
while (_local2 < rowYs.length) {
rowYs[_local2] = rowYs[_local2] + LVL_Y_OFFSET;
_local2++;
}
}
function getRow(y) {
var _local2 = 0;
while (_local2 < rowYs.length) {
if (Math.abs(y - rowYs[_local2]) <= rowYDelta) {
return(_local2);
}
_local2++;
}
return(-1);
}
function addCard(card) {
cards.push(card);
if (layout.length < (layoutPositions.length / 2)) {
layout.push(card);
} else {
deck.push(card);
}
}
function setLayoutPos(pos) {
layout[pos].pos = pos;
layout[pos].mc.pos = pos;
layout[pos].covered = false;
layout[pos].setPos(getLayoutPosX(pos), getLayoutPosY(pos));
}
function getLayoutPosX(pos) {
return(layoutPositions[pos * 2] + LVL_X_OFFSET);
}
function getLayoutPosY(pos) {
return(layoutPositions[(pos * 2) + 1] + LVL_Y_OFFSET);
}
function start() {
trace("level start");
var _local3 = 0;
while (_local3 < cards.length) {
cards[_local3].init();
_local3++;
}
_local3 = 0;
while (_local3 < layout.length) {
layout[_local3].covered = true;
layout[_local3]._visible = true;
layout[_local3].setPos(450, 540);
layout[_local3].flyTo(getLayoutPosX(_local3), getLayoutPosY(_local3));
_local3++;
}
layout[12].covered = false;
layout[20].covered = false;
layout[21].covered = false;
_root.sounds.play("cards_opened", "cards_opened");
_root.mcDeck._visible = true;
_root.mcDeck.hilite._visible = false;
displayNumCardsInDeck();
}
function handleComboTime() {
var _local3 = Math.max(0, COMBO_BONUS_LIMIT - (getTimer() - lastComboTime), 0);
_root.mcCombo.gotoAndStop(Math.floor(2 + ((1 - (_local3 / COMBO_BONUS_LIMIT)) * 12)));
if (_local3 == 0) {
clearInterval(intervalID);
}
}
function stop() {
util.Logger.log("stop()");
_root.mcNoMoves.removeMovieClip();
_root.mcClear.removeMovieClip();
clearInterval(intervalID);
_root.mcCombo.gotoAndStop(1);
if (stopped) {
return(undefined);
}
stopped = true;
if (clearedLayout()) {
var _local3 = addClearBonus();
}
cleanup();
}
function addClearBonus() {
var _local4 = deck.length;
var _local3 = 0;
while (_local3 < hand.length) {
if (hand[_local3] != null) {
_local4++;
}
_local3++;
}
var _local5 = _local4 * 600;
_root.game.updateScore(_local5);
_root.fsMoney("playData", (("4978," + _local4) + "=") + _local5);
return(_local5);
}
function cleanup() {
var _local2 = 0;
while (_local2 < cards.length) {
cards[_local2].cleanup();
cards[_local2] = null;
_local2++;
}
}
function select(pos) {
if (!interactionAllowed()) {
return(undefined);
}
if (!selectionAllowed(pos)) {
return(undefined);
}
_root.sounds.play("click", "click");
if (cards[pos].selected) {
cards[pos].unselect();
selectedCards.remove(cards[pos]);
} else {
if ((cards[pos].rank + selectedRank()) > TARGET_RANK) {
return(undefined);
}
cards[pos].select();
selectedCards.push(cards[pos]);
if (selectedRank() == TARGET_RANK) {
handleCombo(cards[pos].mc);
intervalID = setInterval(this, "handleComboTime", 250);
removeSelection();
_root.sounds.play("combo", "combo");
selectedCards = new Array();
if (clearedLayout()) {
showClearAnimation();
} else {
setCovers();
playableCards.append(hand);
if ((deck.length == 0) && (!movesLeft())) {
displayNoMovesLeft();
}
}
}
}
}
function showClearAnimation() {
_root.sounds.play("cleared", "cleared");
hardLock = true;
var _local3 = _root.attachMovie("level_clear", "mcClear", _root.nextZ());
_local3.top.t.text = _root.game.getText("congrats");
_local3.bottom.t.text = _root.game.getText("all_clear");
_local3._x = 330;
_local3._y = 160;
}
function setCovers() {
playableCards = new Array();
i = 0;
var i = 0;
while (i < layout.length) {
var _local3 = layout[i];
if (_local3 == null) {
} else {
_local3.covered = false;
var _local4 = i + 1;
while (_local4 < layout.length) {
var _local2 = layout[_local4];
if (_local2 == null) {
} else if (collision(_local3.mc, _local2.mc) && (_local3.mc.getDepth() < _local2.mc.getDepth())) {
_local3.covered = true;
break;
}
_local4++;
}
}
i++;
}
var i = 0;
while (i < layout.length) {
if ((layout[i] != null) && (!layout[i].covered)) {
playableCards.push(layout[i]);
}
i++;
}
}
function displayScorePopup(score, bonus, hitMc) {
var _local3;
if (score < 100) {
_local3 = 2;
} else if (score < 1000) {
_local3 = 3;
} else {
_local3 = 4;
}
mcScorePop = _root.attachMovie("scorePop" + _local3, "mcScorePopup", _root.nextZ());
mcScorePop._x = hitMc._x;
mcScorePop._y = hitMc._y;
mcScorePop.slideTo(mcScorePop._x, mcScorePop._y - 30, 1.5, "easeincubic", 0.3, {context:mcScorePop, method:"removeMovieClip"});
mcScorePop.bonus = bonus;
mcScorePop.score.text = score;
}
function clearedLayout() {
var _local2 = 0;
while (_local2 < layout.length) {
if (layout[_local2] != null) {
return(false);
}
_local2++;
}
return(true);
}
function getPlayDataPos(pos) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < hand.length) {
if (hand[_local2].pos == pos) {
_local3 = _local2 + 1;
}
_local2++;
}
if (_local3 == 0) {
_local3 = pos + 3;
}
return(_local3);
}
function handleCombo(hitMc) {
var _local5 = 0;
var _local8 = 0;
var _local4 = 50;
var _local3 = 0;
while (_local3 < selectedCards.length) {
var _local6 = getRow(selectedCards[_local3].y);
if (_local6 != -1) {
_local6 = rowYs.length - _local6;
_local5 = _local5 + (_local6 * 100);
_local4 = Math.max(_local4, _local6 * 100);
}
_local3++;
}
_local3 = 0;
while (_local3 < selectedCards.length) {
var _local6 = getRow(selectedCards[_local3].y);
if (_local6 == -1) {
_local5 = _local5 + _local4;
}
_local3++;
}
var _local9 = getTimer();
if (lastComboTime) {
var _local10 = Math.max(0, COMBO_BONUS_LIMIT - (_local9 - lastComboTime), 0);
_local8 = Math.floor((_local10 * 100) / COMBO_BONUS_LIMIT);
}
_local5 = _local5 + _local8;
_root.game.updateScore(_local5);
lastComboTime = _local9;
var _local7 = "357," + _local9;
_local3 = 0;
while (_local3 < selectedCards.length) {
_local7 = _local7 + (" " + getPlayDataPos(selectedCards[_local3].pos));
_local3++;
}
_local7 = _local7 + ("=" + _local5);
_root.fsMoney("playData", _local7);
displayScorePopup(_local5, _local8 > 0, hitMc);
}
function selectedRank(pos) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < selectedCards.length) {
_local3 = _local3 + selectedCards[_local2].rank;
_local2++;
}
return(_local3);
}
function removeSelection() {
var _local3 = 0;
while (_local3 < selectedCards.length) {
var _local2 = selectedCards[_local3];
_local2.getLost();
layout.setNull(_local2);
hand.setNull(_local2);
_local3++;
}
}
function selectionAllowed(pos) {
if (pos >= layout.length) {
return(true);
}
return(!cards[pos].covered);
}
function clearSelection() {
var _local2 = 0;
while (_local2 < selectedCards.length) {
selectedCards[_local2].unselect();
_local2++;
}
selectedCards = new Array();
}
function hitDeck() {
if (!interactionAllowed()) {
return(undefined);
}
_root.sounds.play("new_deck", "new_deck");
var _local4 = deck.shift();
_root.fsMoney("playData", "12,0=0");
if (deck.length == 0) {
_root.mcDeck._visible = false;
}
clearSelection();
var _local6 = hand.find(null);
if (_local6 != -1) {
hand.shiftRight(_local6);
hand[0] = _local4;
} else {
var _local3 = layout.find(null);
if (_local3 != -1) {
layout[_local3] = hand[hand.length - 1];
cards[_local3] = hand[hand.length - 1];
setLayoutPos(_local3);
setCovers();
} else {
var _local5 = hand[hand.length - 1];
selectedCards.remove(_local5);
_local5.cleanup();
}
hand[hand.length - 1] = null;
hand.shiftRight();
hand[0] = _local4;
}
setHandPositions();
displayNumCardsInDeck();
if (deck.length == 0) {
setCovers();
playableCards.append(hand);
if (!movesLeft()) {
displayNoMovesLeft();
}
}
}
function setHandPositions() {
var _local3 = 0;
while (_local3 < hand.length) {
var _local4 = _root["mcHand" + (_local3 + 1)];
hand[_local3].setPos(_local4._x, _local4._y);
_local3++;
}
}
function displayNumCardsInDeck() {
if (deck.length != 0) {
_root.mcCardNum1._visible = (_root.mcCardNum2._visible = true);
_root.mcCardNum1.gotoAndStop((deck.length % 10) + 1);
_root.mcCardNum2.gotoAndStop(Math.floor(deck.length / 10) + 1);
} else {
_root.mcCardNum1._visible = (_root.mcCardNum2._visible = false);
}
}
function displayNoMovesLeft() {
var _local2 = _root.attachMovie("nomoves", "mcNoMoves", 99);
_local2.play();
_local2.nomoves.text = _root.game.getText("no_more_moves");
_local2._x = 280;
_local2._y = 275;
}
function collision(mc1, mc2) {
var _local2 = 5;
var _local1 = mc1.getBounds(mc1);
var _local3 = mc2.getBounds(mc1);
return(((_local1.xMin + _local2) <= _local3.xMax) && ((_local1.xMax - _local2) >= _local3.xMin));
}
function collisionOLD(mc1, mc2) {
var _local2 = 5;
var _local1 = mc1.getBounds(mc1);
var _local3 = mc2.getBounds(mc1);
return(((((_local1.xMin + _local2) <= _local3.xMax) && ((_local1.xMax - _local2) >= _local3.xMin)) && ((_local1.yMin + _local2) <= _local3.yMax)) && ((_local1.yMax - _local2) >= _local3.yMin));
}
function movesLeft() {
var _local8 = playableCards.length;
var _local3 = 0;
var _local7 = false;
var _local5 = 1;
var _local4 = 1;
while (_local4 < Math.pow(2, _local8)) {
_local3 = 0;
_local5 = 1;
var _local6 = "cards:";
var _local2 = 0;
while (_local2 < _local8) {
if (_local4 & _local5) {
_local6 = _local6 + (" " + playableCards[_local2].rank);
_local3 = _local3 + playableCards[_local2].rank;
if (_local3 > TARGET_RANK) {
break;
}
if (_local3 == TARGET_RANK) {
_local7 = true;
break;
}
}
_local5 = _local5 * 2;
_local2++;
}
trace((((_local4 + " ") + _local6) + "=") + _local3);
if (_local7) {
break;
}
_local4++;
}
return(_local7);
}
function lock(lock) {
if (locks.find(lock) == -1) {
locks.push(lock);
}
}
function unlock(lock) {
if (lock) {
locks.remove(lock);
if (initCards && (locks.length == 0)) {
_root.game.startClock();
initCards = false;
lastComboTime = getTimer();
_root.fsMoney("playData", ((("328," + lastComboTime) + " ") + _root.game.activeLevelIndex) + "=0");
intervalID = setInterval(this, "handleComboTime", 250);
hardLock = false;
}
}
}
function interactionAllowed() {
return((locks.length == 0) && (!hardLock));
}
var rowYDelta = 5;
var COMBO_BONUS_LIMIT = 10000;
var HAND_SIZE = 2;
var TARGET_RANK = 11;
static var LVL_X_OFFSET = 252;
static var LVL_Y_OFFSET = 95;
}
Symbol 253 MovieClip [__Packages.Card] Frame 0
class Card
{
var covered, selected;
function Card (rank, suit, pos) {
this.rank = rank;
this.suit = suit;
this.pos = pos;
covered = (selected = false);
}
function init() {
mc = _root.attachMovie("card", (("mcCard" + _root.game.activeLevelIndex) + "_") + pos, _root.nextZ());
mc.hilite._visible = false;
mc.onPress = function () {
_root.game.activeLevel().select(this.pos);
};
mc.stop();
mc.pos = pos;
mc._x = -100;
}
function getFrame(suit, rank) {
var _local1;
switch (suit.toUpperCase()) {
case "C" :
_local1 = 2;
break;
case "S" :
_local1 = 41;
break;
case "H" :
_local1 = 28;
break;
case "D" :
_local1 = 15;
}
return((_local1 + rank) - 1);
}
function display() {
mc._x = x;
mc._y = y;
mc.gotoAndStop(getFrame(suit, rank));
}
function setPos(x, y) {
this.x = x;
this.y = y;
display();
}
function select() {
selected = true;
mc.hilite._visible = true;
}
function unselect() {
selected = false;
mc.hilite._visible = false;
}
function getLost() {
mc.hilite._visible = false;
_root.game.activeLevel().lock(mc);
mc.slideTo(430, -80, 0.5, "easeincubic", 0, {context:mc, method:"removeMovieClip"});
}
function flyTo(toX, toY) {
_root.game.activeLevel().lock(mc);
mc.slideTo(toX, toY, 0.8, "easeoutexpo", 0.5 + (pos * 0.08));
x = toX;
y = toY;
}
function info() {
return(suit + rank);
}
function cleanup() {
mc.removeMovieClip();
}
var rank = 0;
var suit = "";
var pos = 0;
var x = 0;
var y = 0;
var mc = null;
}