Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var preProcess:Function;
public var setValue:Function;
public var getValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
var _local6:SpecialProperty;
if (!_inited){
init();
};
_local6 = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
_local5 = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local6 = (isNaN(_local5.time)) ? 0 : _local5.time;
_local7 = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
var _local5:SpecialPropertySplitter;
var _local6:Array;
var _local7:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
if (_specialPropertySplitterList[_args[_local4]]){
_local5 = _specialPropertySplitterList[_args[_local4]];
_local6 = _local5.splitValues(_arg1, null);
_local7 = 0;
while (_local7 < _local6.length) {
_local3.push(_local6[_local7].name);
_local7++;
};
} else {
_local3.push(_args[_local4]);
};
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
var _local3:Number;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local3 = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.74");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
updateFrame();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var cTime:Number;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e2:Error) {
handleError(tTweening, e2, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e3:Error) {
handleError(tTweening, e3, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e4:Error) {
handleError(tTweening, e4, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Object;
var _local12:Object;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
_local7 = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
_local10 = new Array();
_local11 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
_local12 = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && ((_local3.indexOf(_args[_local4]) == -1)))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:Boolean;
var _local3:String;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = true;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 9
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 10
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 11
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 12
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 13
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 14
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 15
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 16
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 17
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 18
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 19
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 20
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 21
//IRandGenerator (com.seld.util.IRandGenerator)
package com.seld.util {
public interface IRandGenerator {
function get ranged():uint;
function setRange(_arg1:uint, _arg2:uint):void;
function get float():Number;
function get int32():uint;
}
}//package com.seld.util
Section 22
//SeededRand (com.seld.util.SeededRand)
package com.seld.util {
public class SeededRand implements IRandGenerator {
protected var mag01:Array;
protected var rangeEnd:uint;// = 0
protected var mti:int;
protected var rangeStart:uint;// = 0
protected var mt:Array;
protected var s:uint;
protected static const MATRIX_A:uint = 2567483615;
protected static const LOWER_MASK:uint = 2147483647;
protected static const UPPER_MASK:uint = 2147483648;
protected static const M:int = 397;
protected static const N:int = 624;
public function SeededRand(_arg1:uint):void{
mt = new Array(N);
mti = (N + 1);
mag01 = [0, MATRIX_A];
rangeStart = 0;
rangeEnd = 0;
super();
initialize(_arg1);
s = _arg1;
}
public function get int32():uint{
var _local1:uint;
var _local2:int;
if (mti >= N){
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >> 18));
return (_local1);
}
protected function initialize(_arg1:uint):void{
mt[0] = (_arg1 & 4294967295);
mti = 1;
while (mti < N) {
mt[mti] = ((1812433253 * (mt[(mti - 1)] ^ (mt[(mti - 1)] >> 30))) + mti);
mt[mti] = (mt[mti] & 4294967295);
mti++;
};
}
public function get ranged():uint{
return ((rangeStart + (float * rangeEnd)));
}
public function get float():Number{
return ((int32 / 2147483647));
}
public function get seed():uint{
return (s);
}
public function setRange(_arg1:uint, _arg2:uint):void{
if (_arg1 >= _arg2){
throw (new Error("min can not be greater or equal to max"));
};
rangeStart = _arg1;
rangeEnd = ((_arg2 - _arg1) + 1);
}
}
}//package com.seld.util
Section 23
//BATTLEWON_93 (darklegion2_fla.BATTLEWON_93)
package darklegion2_fla {
import flash.display.*;
public dynamic class BATTLEWON_93 extends MovieClip {
public function BATTLEWON_93(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 24
//btn_fair_204 (darklegion2_fla.btn_fair_204)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_fair_204 extends MovieClip {
public function btn_fair_204(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 25
//btn_howtoplay_205 (darklegion2_fla.btn_howtoplay_205)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_howtoplay_205 extends MovieClip {
public function btn_howtoplay_205(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 26
//btn_loadgame_207 (darklegion2_fla.btn_loadgame_207)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_loadgame_207 extends MovieClip {
public function btn_loadgame_207(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 27
//btn_mastery_231 (darklegion2_fla.btn_mastery_231)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_mastery_231 extends MovieClip {
public function btn_mastery_231(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 28
//BTN_MUTE_6 (darklegion2_fla.BTN_MUTE_6)
package darklegion2_fla {
import flash.display.*;
public dynamic class BTN_MUTE_6 extends MovieClip {
public function BTN_MUTE_6(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package darklegion2_fla
Section 29
//btn_ratio_completion_235 (darklegion2_fla.btn_ratio_completion_235)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_ratio_completion_235 extends MovieClip {
public function btn_ratio_completion_235(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 30
//btn_scores_206 (darklegion2_fla.btn_scores_206)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_scores_206 extends MovieClip {
public function btn_scores_206(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 31
//btn_survival_229 (darklegion2_fla.btn_survival_229)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_survival_229 extends MovieClip {
public function btn_survival_229(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 32
//btn_time_233 (darklegion2_fla.btn_time_233)
package darklegion2_fla {
import flash.display.*;
public dynamic class btn_time_233 extends MovieClip {
public function btn_time_233(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 33
//btnStart_196 (darklegion2_fla.btnStart_196)
package darklegion2_fla {
import flash.display.*;
public dynamic class btnStart_196 extends MovieClip {
public function btnStart_196(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 34
//buildingMap_95 (darklegion2_fla.buildingMap_95)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class buildingMap_95 extends MovieClip {
public var tf_name:TextField;
public var loading:MovieClip;
public var tf_desc:TextField;
public var haveGreen:TextField;
public var haveWhite:TextField;
public var tf_life:TextField;
public var haveOrange:TextField;
public var btn_start:MovieClip;
public var chars:MovieClip;
public var haveBlue:TextField;
public function buildingMap_95(){
addFrameScript(0, frame1);
}
function frame1(){
btn_start.addEventListener(MouseEvent.CLICK, battleLoaded);
btn_start.buttonMode = true;
}
public function battleLoaded(_arg1:MouseEvent):void{
MovieClip(root).startGame();
}
}
}//package darklegion2_fla
Section 35
//c1_1_217 (darklegion2_fla.c1_1_217)
package darklegion2_fla {
import flash.display.*;
public dynamic class c1_1_217 extends MovieClip {
public function c1_1_217(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package darklegion2_fla
Section 36
//c7_7_224 (darklegion2_fla.c7_7_224)
package darklegion2_fla {
import flash.display.*;
public dynamic class c7_7_224 extends MovieClip {
public function c7_7_224(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package darklegion2_fla
Section 37
//challnge_modes_227 (darklegion2_fla.challnge_modes_227)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class challnge_modes_227 extends MovieClip {
public var btn_mastery:MovieClip;
public var info:TextField;
public var btn_survival:MovieClip;
public var btn_time:MovieClip;
public var btn_back:MovieClip;
public function challnge_modes_227(){
addFrameScript(0, frame1, 1, frame2);
}
public function rollMe(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
if (_arg1.target.name == "btn_survival"){
info.text = "Beat as many monsters as you can in one row! You have the same spells and life as enemy!";
} else {
if (_arg1.target.name == "btn_mastery"){
info.text = "Beat as many monsters as you can in one row! You have no magic, you can use just your axe and your life is 100!";
} else {
info.text = "You have all magics and 300 seconds to show your battle and magic skills! Score equals to damage you will do to enemy!";
};
};
}
public function rollMeOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
info.text = "";
}
public function backToMenu(_arg1:MouseEvent):void{
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame2(){
btn_survival.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_mastery.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_time.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_survival.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_mastery.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_time.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_survival.addEventListener(MouseEvent.CLICK, startMe);
btn_mastery.addEventListener(MouseEvent.CLICK, startMe);
btn_time.addEventListener(MouseEvent.CLICK, startMe);
btn_survival.buttonMode = true;
btn_mastery.buttonMode = true;
btn_time.buttonMode = true;
btn_survival.mouseChildren = false;
btn_mastery.mouseChildren = false;
btn_time.mouseChildren = false;
btn_back.addEventListener(MouseEvent.CLICK, backToMenu);
btn_back.buttonMode = true;
}
public function startMe(_arg1:MouseEvent):void{
if (_arg1.target.name == "btn_mastery"){
MovieClip(root).mastery_mode = true;
MovieClip(root).time_challenge = false;
MovieClip(root).survival_mode = false;
} else {
if (_arg1.target.name == "btn_time"){
MovieClip(root).mastery_mode = false;
MovieClip(root).time_challenge = true;
MovieClip(root).survival_mode = false;
} else {
MovieClip(root).mastery_mode = false;
MovieClip(root).time_challenge = false;
MovieClip(root).survival_mode = true;
};
};
MovieClip(root).startChallenges();
gotoAndStop(1);
}
}
}//package darklegion2_fla
Section 38
//chars_98 (darklegion2_fla.chars_98)
package darklegion2_fla {
import flash.display.*;
public dynamic class chars_98 extends MovieClip {
public function chars_98(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 39
//efekt_146 (darklegion2_fla.efekt_146)
package darklegion2_fla {
import flash.display.*;
public dynamic class efekt_146 extends MovieClip {
public function efekt_146(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
stop();
}
function frame24(){
stop();
}
}
}//package darklegion2_fla
Section 40
//effectBtn_92 (darklegion2_fla.effectBtn_92)
package darklegion2_fla {
import flash.display.*;
public dynamic class effectBtn_92 extends MovieClip {
public function effectBtn_92(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package darklegion2_fla
Section 41
//explode_110 (darklegion2_fla.explode_110)
package darklegion2_fla {
import flash.display.*;
public dynamic class explode_110 extends MovieClip {
public function explode_110(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 42
//extra_mc_29 (darklegion2_fla.extra_mc_29)
package darklegion2_fla {
import flash.display.*;
public dynamic class extra_mc_29 extends MovieClip {
public function extra_mc_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 43
//flashing_mc_96 (darklegion2_fla.flashing_mc_96)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class flashing_mc_96 extends MovieClip {
public var info:TextField;
}
}//package darklegion2_fla
Section 44
//helpp_3 (darklegion2_fla.helpp_3)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class helpp_3 extends MovieClip {
public var infoHelp:TextField;
}
}//package darklegion2_fla
Section 45
//hero_16 (darklegion2_fla.hero_16)
package darklegion2_fla {
import flash.display.*;
public dynamic class hero_16 extends MovieClip {
public function hero_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 46
//heroMC_143 (darklegion2_fla.heroMC_143)
package darklegion2_fla {
import flash.display.*;
public dynamic class heroMC_143 extends MovieClip {
public function heroMC_143(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 47
//herooutro_163 (darklegion2_fla.herooutro_163)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class herooutro_163 extends MovieClip {
public function herooutro_163(){
addFrameScript(102, frame103, 522, frame523);
}
function frame103(){
MovieClip(this.parent).mordeson.visible = false;
}
function frame523(){
stop();
this.parent.visible = false;
}
}
}//package darklegion2_fla
Section 48
//highscores_mc_234 (darklegion2_fla.highscores_mc_234)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class highscores_mc_234 extends MovieClip {
public var btn_mastery:MovieClip;
public var btn_completion:MovieClip;
public var btn_survival:MovieClip;
public var btn_time:MovieClip;
public var btn_back:MovieClip;
public function highscores_mc_234(){
addFrameScript(0, frame1, 1, frame2);
}
public function rollMe(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
public function rollMeOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
public function backToMenu(_arg1:MouseEvent):void{
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame2(){
btn_survival.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_mastery.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_time.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_survival.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_mastery.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_time.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_survival.addEventListener(MouseEvent.CLICK, startMe);
btn_mastery.addEventListener(MouseEvent.CLICK, startMe);
btn_time.addEventListener(MouseEvent.CLICK, startMe);
btn_survival.buttonMode = true;
btn_mastery.buttonMode = true;
btn_time.buttonMode = true;
btn_survival.mouseChildren = false;
btn_mastery.mouseChildren = false;
btn_time.mouseChildren = false;
btn_completion.addEventListener(MouseEvent.ROLL_OVER, rollMe);
btn_completion.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
btn_completion.addEventListener(MouseEvent.CLICK, startMe);
btn_completion.buttonMode = true;
btn_completion.mouseChildren = false;
btn_back.addEventListener(MouseEvent.CLICK, backToMenu);
btn_back.buttonMode = true;
}
public function startMe(_arg1:MouseEvent):void{
if (_arg1.target.name == "btn_survival"){
MovieClip(root).showHighScores_survival();
} else {
if (_arg1.target.name == "btn_mastery"){
MovieClip(root).showHighScores_mastery();
} else {
if (_arg1.target.name == "btn_time"){
MovieClip(root).showHighScores_max();
} else {
if (_arg1.target.name == "btn_completion"){
MovieClip(root).showHighScores_80();
};
};
};
};
}
}
}//package darklegion2_fla
Section 49
//how_mc_209 (darklegion2_fla.how_mc_209)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class how_mc_209 extends MovieClip {
public var effectsBtn:MovieClip;
public var roll4:MovieClip;
public var roll1:MovieClip;
public var roll3:MovieClip;
public var info_txt:TextField;
public var roll9:MovieClip;
public var roll7:MovieClip;
public var roll8:MovieClip;
public var roll2:MovieClip;
public var roll5:MovieClip;
public var roll6:MovieClip;
public var tutorial:MovieClip;
public var infoName:TextField;
public var btn_gameplay:MovieClip;
public var i:Number;
public var infoSet:MovieClip;
public var btn_tutorial:MovieClip;
public var btn_back:MovieClip;
public function how_mc_209(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function gameplay(_arg1:MouseEvent):void{
_arg1.target.parent.gotoAndStop(2);
}
function frame3(){
stop();
btn_back.addEventListener(MouseEvent.CLICK, goBack);
btn_back.buttonMode = true;
btn_gameplay.addEventListener(MouseEvent.CLICK, gameplay);
btn_gameplay.buttonMode = true;
}
function frame1(){
stop();
btn_tutorial.addEventListener(MouseEvent.CLICK, showTutorial);
btn_tutorial.buttonMode = true;
btn_gameplay.addEventListener(MouseEvent.CLICK, gameplay);
btn_gameplay.buttonMode = true;
}
public function showInfo(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "roll1":
info_txt.text = "Shows your spells! There are three spells states - locked, disabled, enabled. The spell is locked if you dont have 100% experience to use the spell. Your current experience is displayed next to the lock. You can collect experience by beating the enemies. Once you have 100% spell experience, the spell is unlocked but disabled. It becomes enabled whenever you have all neccessary mana for spell! Once the spell is enabled, you can use the spell by clicking it! Locked state is displayed by LOCK, disabled state is displayed by not fully visible spell. Enabled spell is displayed by fully visible spell! In this case first spell in unlocked but disabled.";
infoName.text = "Spells Table";
break;
case "roll2":
info_txt.text = "Here you can collect the gems for using the mana and killing enemy.";
infoName.text = "Battlefield";
break;
case "roll3":
info_txt.text = "Shows information about total battles and battle ratio!";
infoName.text = "Statistics";
break;
case "roll4":
info_txt.text = "Each meter shows current status of mana, important information for using the spells.";
infoName.text = "Mana meters";
break;
case "roll5":
info_txt.text = "Shows what you can win in current battle!";
infoName.text = "Awards table";
break;
case "roll6":
info_txt.text = "Shows the spell description + mana you need for spell (on the left).";
infoName.text = "Spell description";
break;
case "roll7":
info_txt.text = "Shows additional awards.";
infoName.text = "Extra awards and spells";
break;
case "roll8":
info_txt.text = "Shows your current life.";
infoName.text = "Current Life";
break;
case "roll9":
info_txt.text = "Mutes all sounds and turns off explosions effects (for smoother gameplay if neccessary).";
infoName.text = "Other Settings";
break;
};
}
function frame2(){
stop();
btn_back.addEventListener(MouseEvent.CLICK, goBack);
btn_back.buttonMode = true;
btn_tutorial.addEventListener(MouseEvent.CLICK, showTutorial);
btn_tutorial.buttonMode = true;
i = 1;
while (i <= 9) {
this[("roll" + i)].addEventListener(MouseEvent.ROLL_OVER, showInfo);
this[("roll" + i)].buttonMode = true;
i++;
};
}
public function showTutorial(_arg1:MouseEvent):void{
_arg1.target.parent.gotoAndStop(3);
}
public function goBack(_arg1:MouseEvent):void{
_arg1.target.parent.gotoAndStop(1);
}
}
}//package darklegion2_fla
Section 50
//illegalmove_144 (darklegion2_fla.illegalmove_144)
package darklegion2_fla {
import flash.display.*;
public dynamic class illegalmove_144 extends MovieClip {
public function illegalmove_144(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 51
//info_2 (darklegion2_fla.info_2)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class info_2 extends MovieClip {
public var txt:TextField;
public var txt1:TextField;
public var txt2:TextField;
public var txt3:TextField;
public var txt5:TextField;
public var txt4:TextField;
}
}//package darklegion2_fla
Section 52
//infoset_86 (darklegion2_fla.infoset_86)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class infoset_86 extends MovieClip {
public var txt1:TextField;
public var txt2:TextField;
public var txt3:TextField;
public var txt4:TextField;
}
}//package darklegion2_fla
Section 53
//kosar_141 (darklegion2_fla.kosar_141)
package darklegion2_fla {
import flash.display.*;
public dynamic class kosar_141 extends MovieClip {
public function kosar_141(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 54
//lastMonster_140 (darklegion2_fla.lastMonster_140)
package darklegion2_fla {
import flash.display.*;
public dynamic class lastMonster_140 extends MovieClip {
public function lastMonster_140(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 55
//lbpBc_238 (darklegion2_fla.lbpBc_238)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class lbpBc_238 extends MovieClip {
public var bc:MovieClip;
public function lbpBc_238(){
addFrameScript(0, frame1, 103, frame104);
}
public function openLBP(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.littlebigplay.com"), "_blank");
}
function frame1(){
bc.addEventListener(MouseEvent.CLICK, openLBP);
bc.buttonMode = true;
bc.mouseChildren = false;
}
function frame104(){
stop();
MovieClip(parent).play();
}
}
}//package darklegion2_fla
Section 56
//MainTimeline (darklegion2_fla.MainTimeline)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
import com.kongregate.as3.client.*;
import mochi.as3.*;
import com.seld.util.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var hero:MovieClip;
public var timeChallenge:Timer;
public var challengeWon_mc:MovieClip;
public var monster_magic1:MovieClip;
public var monster_magic3:MovieClip;
public var monster_magic4:MovieClip;
public var monster_magic5:MovieClip;
public var monster_magic6:MovieClip;
public var monster_magic2:MovieClip;
public var monster_magic7:MovieClip;
public var monster_magic8:MovieClip;
public var monster_magic9:MovieClip;
public var moving:Boolean;
public var removed:Number;
public var j:Number;
public var k:Number;
public var i;
public var blur:BlurFilter;
public var em2:c4;
public var em3:c3;
public var em4:c2;
public var em5:c5;
public var magic10:MovieClip;
public var countForMagic:Number;
public var posX:Number;
public var choose_mc:MovieClip;
public var infoSet:MovieClip;
public var group10:Array;
public var creatingNEWone:Boolean;
public var group12:Array;
public var group13:Array;
public var group17:Array;
public var group11:Array;
public var group19:Array;
public var illegalMoveCount:Number;
public var storm:MovieClip;
public var group15:Array;
public var group16:Array;
public var group18:Array;
public var group14:Array;
public var story:String;
public var group20:Array;
public var group21:Array;
public var group22:Array;
public var group23:Array;
public var group24:Array;
public var group25:Array;
public var group27:Array;
public var power:Number;
public var group29:Array;
public var group28:Array;
public var group26:Array;
public var visible_arr:Array;
public var group30:Array;
public var group34:Array;
public var group36:Array;
public var group37:Array;
public var group32:Array;
public var group35:Array;
public var group38:Array;
public var group31:Array;
public var group33:Array;
public var group39:Array;
public var group40:Array;
public var scale:Number;
public var battleLoading:String;
public var player1:MovieClip;
public var player2:MovieClip;
public var row10:Array;
public var row11:Array;
public var glowBtn:GlowFilter;
public var group2:Array;
public var group4:Array;
public var row1:Array;
public var row3:Array;
public var row4:Array;
public var row5:Array;
public var row6:Array;
public var row7:Array;
public var row8:Array;
public var row2:Array;
public var group8:Array;
public var group1:Array;
public var group3:Array;
public var row0:Array;
public var row9:Array;
public var group7:Array;
public var group9:Array;
public var magic:Boolean;
public var group5:Array;
public var group6:Array;
public var kongregate:KongregateAPI;
public var totalGames:Number;
public var haveBlue:Number;
public var monsterHighlight:GlowFilter;
public var lostGames:Number;
public var perc1:MovieClip;
public var perc2:MovieClip;
public var perc3:MovieClip;
public var perc4:MovieClip;
public var perc5:MovieClip;
public var perc6:MovieClip;
public var perc8:MovieClip;
public var perc9:MovieClip;
public var perc7:MovieClip;
public var haveMagic10:Object;
public var testing:Boolean;
public var arrm:Array;
public var meduzasMagic:String;
public var infoBox:TextField;
public var award:TextField;
public var arr:Array;
public var urlLoader:Loader;
public var mapkaNum:Number;
public var howManyRemoved:Number;
public var typ:Number;
public var meter_hero_2:MovieClip;
public var meter_hero_3:MovieClip;
public var meter_hero_4:MovieClip;
public var meter_hero_5:MovieClip;
public var mag10:TextField;
public var amountStealed:Number;
public var battleLoaded:String;
public var player:String;
public var monstersLifeStart:Number;
public var total_txt:TextField;
public var chosen1:MovieClip;
public var chosen2:MovieClip;
public var level_txt:TextField;
public var meter_monster_txt_2:TextField;
public var meter_monster_txt_3:TextField;
public var meter_monster_txt_4:TextField;
public var meter_monster_txt_5:TextField;
public var infoMonster:MovieClip;
public var heroMc:MovieClip;
public var meter_monster_txt_6:TextField;
public var magicCount:Number;
public var illegal:MovieClip;
public var level:Number;
public var perc_mons1:MovieClip;
public var perc_mons2:MovieClip;
public var perc_mons3:MovieClip;
public var perc_mons4:MovieClip;
public var perc_mons5:MovieClip;
public var perc_mons7:MovieClip;
public var perc_mons8:MovieClip;
public var perc_mons9:MovieClip;
public var monster4:MovieClip;
public var monster5:MovieClip;
public var monster6:MovieClip;
public var monster7:MovieClip;
public var monster8:MovieClip;
public var monster9:MovieClip;
public var monster3:MovieClip;
public var haveWhite:Number;
public var perc_mons6:MovieClip;
public var monster1:MovieClip;
public var monster2:MovieClip;
public var click1:Number;
public var click2:Number;
public var haveMagic1:Object;
public var haveMagic2:Object;
public var haveMagic3:Object;
public var haveMagic4:Object;
public var haveMagic5:Object;
public var haveMagic6:Object;
public var mapka:MovieClip;
public var haveMagic8:Object;
public var haveMagic7:Object;
public var limit:Number;
public var desc1:String;
public var desc2:String;
public var desc3:String;
public var desc4:String;
public var desc5:String;
public var desc6:String;
public var desc7:String;
public var desc8:String;
public var desc9:String;
public var time_limit:TextField;
public var haveMagic9:Object;
public var monster_name:TextField;
public var audio:Number;
public var meter_monster_2:MovieClip;
public var meter_monster_4:MovieClip;
public var meter_monster_5:MovieClip;
public var meter_monster_6:MovieClip;
public var meter_monster_3:MovieClip;
public var gameOver:Boolean;
public var gameMap:Array;
public var meter_hero_txt_2:TextField;
public var meter_hero_txt_3:TextField;
public var meter_hero_txt_5:TextField;
public var meter_hero_txt_4:TextField;
public var meter_hero_txt_6:TextField;
public var magic1:MovieClip;
public var magic2:MovieClip;
public var magic3:MovieClip;
public var magic4:MovieClip;
public var magic5:MovieClip;
public var magic6:MovieClip;
public var magic7:MovieClip;
public var magic8:MovieClip;
public var gameParams:Object;
public var magic9:MovieClip;
public var extra_mc:MovieClip;
public var aw:MovieClip;
public var lastPosX:Number;
public var lastPosY:Number;
public var death1:String;
public var death2:String;
public var death3:String;
public var death4:String;
public var death5:String;
public var death6:String;
public var ratio_txt:TextField;
public var death8:String;
public var death9:String;
public var death7:String;
public var efekt:MovieClip;
public var challenge:Boolean;
public var MindJoltAPI:Object;
public var monsterMagic1:Boolean;
public var extra_round;
public var monsterMagic3:Boolean;
public var monsterMagic4:Boolean;
public var monsterMagic6:Boolean;
public var monster_10:Array;
public var monster_11:Array;
public var monster_12:Array;
public var monster_13:Array;
public var monster_14:Array;
public var monster_15:Array;
public var monster_16:Array;
public var monster_17:Array;
public var monster_18:Array;
public var monster_19:Array;
public var info:MovieClip;
public var monsterMagic5:Boolean;
public var monsterMagic7:Boolean;
public var monsterMagic9:Boolean;
public var monsterMagic2:Boolean;
public var monster_20:Array;
public var monster_21:Array;
public var monster_22:Array;
public var monster_23:Array;
public var monster_24:Array;
public var monster_25:Array;
public var monster_26:Array;
public var monster_27:Array;
public var monster_28:Array;
public var monster_29:Array;
public var monsterMagic8:Boolean;
public var monster_30:Array;
public var monster_31:Array;
public var monster_32:Array;
public var monster_33:Array;
public var monster_34:Array;
public var monster_35:Array;
public var monster_36:Array;
public var monster_37:Array;
public var monster_38:Array;
public var monster_39:Array;
public var monster_40:Array;
public var monster_41:Array;
public var monster_42:Array;
public var monster_43:Array;
public var monster_44:Array;
public var monster_45:Array;
public var build_mc:MovieClip;
public var monster_47:Array;
public var monster_48:Array;
public var monster_49:Array;
public var monster_2:Array;
public var monster_3:Array;
public var monster_4:Array;
public var monster_5:Array;
public var monster_6:Array;
public var monster_7:Array;
public var monster_1:Array;
public var monster_9:Array;
public var monster_8:Array;
public var monster_46:Array;
public var monster_50:Array;
public var monster_51:Array;
public var monster_52:Array;
public var monster_53:Array;
public var monster_55:Array;
public var monster_56:Array;
public var monster_magic10:MovieClip;
public var monster_58:Array;
public var monster_54:Array;
public var totalCountMap6:Number;
public var totalCountMap7:Number;
public var monster_57:Array;
public var totalCountMap1:Number;
public var monster_59:Array;
public var introMc:MovieClip;
public var totalCountMap4:Number;
public var totalCountMap5:Number;
public var totalCountMap8:Number;
public var totalCountMap9:Number;
public var totalCountMap2:Number;
public var score_count:Number;
public var mag1:TextField;
public var mag2:TextField;
public var mag3:TextField;
public var mag4:TextField;
public var mag5:TextField;
public var mag6:TextField;
public var mag7:TextField;
public var mag8:TextField;
public var monster_68:Array;
public var monster_63:Array;
public var monster_65:Array;
public var mag9:TextField;
public var monster_60:Array;
public var monster_69:Array;
public var monster_62:Array;
public var monster_64:Array;
public var monster_66:Array;
public var monster_67:Array;
public var _mochiads_game_id:String;
public var monster_61:Array;
public var monster_70:Array;
public var monster_71:Array;
public var monster_73:Array;
public var monster_74:Array;
public var monster_75:Array;
public var m2:c4;
public var m3:c3;
public var m4:c2;
public var m5:c5;
public var monster_76:Array;
public var monster_77:Array;
public var monster_78:Array;
public var mochiConnected:Boolean;
public var monster_72:Array;
public var time_challenge:Boolean;
public var monster_79:Array;
public var monster_80:Array;
public var mc_next_level:MovieClip;
public var totalCountMap3:Number;
public var smrt1:MovieClip;
public var smrt2:MovieClip;
public var btnExit:MovieClip;
public var glow:GlowFilter;
public var readyToRemove:Number;
public var holder:holder_mc;
public var haveOrange:Number;
public var btnHighlight:GlowFilter;
public var checking:Boolean;
public var monsterLife:TextField;
public var effectsBtn:MovieClip;
public var enemyOptions:Array;
public var howManyIChanged:Number;
public var survival_mode:Boolean;
public var monsters_beaten:Array;
public var buildingMap:Boolean;
public var heroLife:TextField;
public var shield_mc:MovieClip;
public var totalGroups:Number;
public var smrt_monster1:MovieClip;
public var smrt_monster2:MovieClip;
public var so;
public var toBeRemoved:Array;
public var howManyEnemyChanged:Number;
public var magicType:String;
public var haveGreen:Number;
public var mastery_mode:Boolean;
public var couplesFound:Array;
public var score:TextField;
public var btnMute:MovieClip;
public var perc_mons10:MovieClip;
public var lost_txt:TextField;
public var challenge_mc:MovieClip;
public var life:Number;
public var computer:MovieClip;
public var poisonHero:Boolean;
public var totalMonsters:Number;
public var toBeCheckedAgain:Number;
public var max0:Number;
public var max1:Number;
public var max2:Number;
public var max3:Number;
public var max4:Number;
public var max7:Number;
public var help_mc:MovieClip;
public var max9:Number;
public var monsterMagic10:Boolean;
public var hand_mc:MovieClip;
public var shield:Boolean;
public var max6:Number;
public var max8:Number;
public var monster_chosen:Number;
public var perc10:MovieClip;
public var konec_mc:MovieClip;
public var max5:Number;
public var MonsterShield_mc:MovieClip;
public var poisonMonster:Boolean;
public var skullsShield:MovieClip;
public var MonsterShield:Boolean;
public var heart_sound:hearth;
public var monster:MovieClip;
public var eff:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function startTimer():void{
limit = 300;
timeChallenge = new Timer(1000);
timeChallenge.addEventListener("timer", showTimeLimit);
timeChallenge.start();
}
public function checkPoints():void{
var _local1:uint;
var _local2:uint;
var _local3:*;
var _local4:Timer;
howManyRemoved = 0;
removed = 0;
toBeCheckedAgain = 0;
toBeRemoved = new Array();
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < (gameMap.length - 2)) {
if ((((gameMap[_local1][_local3].type == gameMap[_local1][(_local3 + 1)].type)) && ((gameMap[_local1][_local3].type == gameMap[_local1][(_local3 + 2)].type)))){
if (contain(gameMap[_local1][_local3], toBeRemoved) != 1){
toBeRemoved.push(gameMap[_local1][_local3]);
howManyRemoved++;
};
if (contain(gameMap[_local1][(_local3 + 1)], toBeRemoved) != 1){
toBeRemoved.push(gameMap[_local1][(_local3 + 1)]);
howManyRemoved++;
};
if (contain(gameMap[_local1][(_local3 + 2)], toBeRemoved) != 1){
toBeRemoved.push(gameMap[_local1][(_local3 + 2)]);
howManyRemoved++;
};
};
if ((((gameMap[_local3][_local1].type == gameMap[(_local3 + 1)][_local1].type)) && ((gameMap[(_local3 + 1)][_local1].type == gameMap[(_local3 + 2)][_local1].type)))){
if (contain(gameMap[_local3][_local1], toBeRemoved) != 1){
toBeRemoved.push(gameMap[_local3][_local1]);
howManyRemoved++;
};
if (contain(gameMap[(_local3 + 1)][_local1], toBeRemoved) != 1){
toBeRemoved.push(gameMap[(_local3 + 1)][_local1]);
howManyRemoved++;
};
if (contain(gameMap[(_local3 + 2)][_local1], toBeRemoved) != 1){
toBeRemoved.push(gameMap[(_local3 + 2)][_local1]);
howManyRemoved++;
};
};
_local3++;
};
_local2++;
};
_local1++;
};
if (toBeRemoved.length > 0){
checkExtraRound();
_local3 = 0;
while (_local3 < toBeRemoved.length) {
replaceInArray(toBeRemoved[_local3].name);
_local3++;
};
explosion_sound();
} else {
if (buildingMap == true){
build_mc.btn_start.visible = true;
SoundMixer.stopAll();
build_mc.loading.info.text = battleLoaded;
} else {
if (creatingNEWone == true){
storm.y = 487;
storm.gotoAndStop(1);
if (player == "2"){
_local4 = new Timer(1500, 1);
_local4.addEventListener("timer", letEnemyPlay);
_local4.start();
} else {
if (player == "1"){
creatingNEWone = false;
};
};
};
};
};
}
public function deleteX():void{
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:MovieClip;
var _local8:*;
_local1 = 0;
while (_local1 <= 9) {
_local2 = 1;
while (_local2 <= this[("max" + _local1)]) {
_local3 = r();
if (_local3 == 1){
_local7 = new c1();
_local7.type = 1;
};
if (_local3 == 2){
_local7 = new c2();
_local7.type = 2;
};
if (_local3 == 3){
_local7 = new c3();
_local7.type = 3;
};
if (_local3 == 4){
_local7 = new c4();
_local7.type = 4;
};
if (_local3 == 5){
_local7 = new c5();
_local7.type = 5;
};
if (_local3 == 6){
_local7 = new c6();
_local7.type = 6;
};
if (_local3 == 7){
_local7 = new c7();
_local7.type = 7;
};
_local4 = (_local1 * 32);
_local5 = (-(_local2) * 32);
_local7.cacheAsBitmap = true;
_local7.x = (_local1 * 32);
_local7.y = (-(((this[("max" + _local1)] - _local2) + 1)) * 32);
holder.addChild(_local7);
_local6 = 0;
while (_local6 < gameMap.length) {
_local8 = 0;
while (_local8 < gameMap.length) {
if (gameMap[_local6][_local8].name == "X"){
if (creatingNEWone == false){
decreaseIncrease(gameMap[_local6][_local8].type);
};
holder.removeChild(gameMap[_local6][_local8]);
gameMap[_local6][_local8] = _local7;
gameMap[_local6][_local8].type = _local7.type;
gameMap[_local6][_local8].removeEventListener(MouseEvent.MOUSE_UP, clickMe);
break;
};
_local8++;
};
_local6++;
};
Tweener.addTween(_local7, {y:((_local2 - 1) * 32), time:0.6, onComplete:checkAgain, onCompleteParams:[_local7]});
_local7.addEventListener(MouseEvent.MOUSE_UP, clickMe);
removed++;
_local2++;
};
_local1++;
};
if (removed == howManyRemoved){
};
}
public function buildMap(){
var _local1:uint;
var _local2:uint;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:MovieClip;
var _local7:MovieClip;
var _local8:MovieClip;
var _local9:MovieClip;
var _local10:MovieClip;
CreateRandomArray();
_local1 = 0;
while (_local1 < arr.length) {
_local2 = 0;
while (_local2 < arr.length) {
if (arr[_local1][_local2] == 1){
_local4 = new c1();
holder.addChild(_local4);
_local4.x = (_local2 * posX);
_local4.y = (_local1 * posX);
_local3 = _local4;
};
if (arr[_local1][_local2] == 2){
_local5 = new c2();
holder.addChild(_local5);
_local5.x = (_local2 * posX);
_local5.y = (_local1 * posX);
_local3 = _local5;
};
if (arr[_local1][_local2] == 3){
_local6 = new c3();
holder.addChild(_local6);
_local6.x = (_local2 * posX);
_local6.y = (_local1 * posX);
_local3 = _local6;
};
if (arr[_local1][_local2] == 4){
_local7 = new c4();
holder.addChild(_local7);
_local7.x = (_local2 * posX);
_local7.y = (_local1 * posX);
_local3 = _local7;
};
if (arr[_local1][_local2] == 5){
_local8 = new c5();
holder.addChild(_local8);
_local8.x = (_local2 * posX);
_local8.y = (_local1 * posX);
_local3 = _local8;
};
if (arr[_local1][_local2] == 6){
_local9 = new c6();
holder.addChild(_local9);
_local9.x = (_local2 * posX);
_local9.y = (_local1 * posX);
_local3 = _local9;
};
if (arr[_local1][_local2] == 7){
_local10 = new c7();
holder.addChild(_local10);
_local10.x = (_local2 * posX);
_local10.y = (_local1 * posX);
_local3 = _local10;
};
_local3.cacheAsBitmap = true;
_local3.name = ((("t_" + _local1) + "_") + _local2);
_local3.addEventListener(MouseEvent.MOUSE_UP, clickMe);
_local3.type = arr[_local1][_local2];
this[("row" + _local1)].push(_local3);
_local2++;
};
gameMap.push(this[("row" + _local1)]);
_local1++;
};
checkPoints();
}
public function rollMeOut(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
_arg1.target.gotoAndStop(1);
};
}
public function showHighScores_80():void{
}
public function initButtons():void{
introMc.btn_start.buttonMode = true;
introMc.btn_how.buttonMode = true;
introMc.btn_load.buttonMode = true;
introMc.btn_fairPlay.buttonMode = true;
introMc.btn_score.buttonMode = true;
introMc.btn_prequel.buttonMode = true;
introMc.btn_start.mouseChildren = false;
introMc.btn_how.mouseChildren = false;
introMc.btn_load.mouseChildren = false;
introMc.btn_fairPlay.mouseChildren = false;
introMc.btn_score.mouseChildren = false;
introMc.btn_prequel.mouseChildren = false;
introMc.btn_start.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_how.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_load.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_fairPlay.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_score.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_prequel.addEventListener(MouseEvent.ROLL_OVER, rollMe);
introMc.btn_start.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_how.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_load.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_fairPlay.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_score.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_prequel.addEventListener(MouseEvent.ROLL_OUT, rollMeOut);
introMc.btn_start.addEventListener(MouseEvent.CLICK, clickOption);
introMc.btn_how.addEventListener(MouseEvent.CLICK, clickOption);
introMc.btn_load.addEventListener(MouseEvent.CLICK, clickOption);
introMc.btn_fairPlay.addEventListener(MouseEvent.CLICK, clickOption);
introMc.btn_score.addEventListener(MouseEvent.CLICK, clickOption);
introMc.btn_prequel.addEventListener(MouseEvent.CLICK, clickOption);
introMc.how_mc.btn_back.addEventListener(MouseEvent.CLICK, returnToMenu);
introMc.how_mc.btn_back.buttonMode = true;
btnMute.addEventListener(MouseEvent.CLICK, mute);
btnMute.buttonMode = true;
btnExit.addEventListener(MouseEvent.CLICK, exit);
btnExit.buttonMode = true;
effectsBtn.addEventListener(MouseEvent.CLICK, turnEffects);
effectsBtn.buttonMode = true;
}
public function checkTypes(_arg1:Number):Number{
var _local2:*;
var _local3:uint;
var _local4:uint;
_local2 = 0;
_local3 = 0;
while (_local3 < gameMap.length) {
_local4 = 0;
while (_local4 < gameMap.length) {
if (gameMap[_local3][_local4].type == _arg1){
_local2++;
};
_local4++;
};
_local3++;
};
return (_local2);
}
public function r():Number{
var _local1:Number;
_local1 = returnRealRandom();
switch (_local1){
case 8:
_local1 = 1;
break;
case 9:
_local1 = 2;
break;
case 10:
_local1 = 3;
break;
case 11:
_local1 = 4;
break;
case 12:
_local1 = 5;
break;
case 13:
_local1 = 6;
break;
case 14:
_local1 = 1;
break;
case 15:
_local1 = 2;
break;
case 16:
_local1 = 3;
break;
case 17:
_local1 = 4;
break;
case 18:
_local1 = 5;
break;
case 19:
_local1 = 6;
break;
case 20:
_local1 = 1;
break;
case 21:
_local1 = 2;
break;
case 22:
_local1 = 3;
break;
case 23:
_local1 = 4;
break;
case 24:
_local1 = 5;
break;
case 25:
_local1 = 6;
break;
case 26:
_local1 = 7;
break;
case 27:
_local1 = 1;
break;
};
return (_local1);
}
public function doMagic1(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
choose_mc.gotoAndStop(2);
click_sound();
};
}
public function doMagic2(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
dontAllowPlaying();
destroyAllSkulls();
decreaseMagic(7, 0, 20, 0, "meter_hero");
};
}
public function doMagic4(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
decreaseMagic(0, 10, 20, 7, "meter_hero");
heal();
checkSpells();
checkExtraTurn();
};
}
public function doMagic6(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
directAttack();
decreaseMagic(0, 0, 30, 0, "meter_hero");
};
}
public function doMagic7(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
checkExtraTurnAfterDarkRain();
doDarkRain();
decreaseMagic(0, 12, 8, 20, "meter_hero");
checkSpells();
};
}
public function doMagic8(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
poisonMonster = true;
decreaseMagic(40, 20, 20, 0, "meter_hero");
poison();
};
}
public function doMagic9(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
destroyAllSkullsAndAxes();
decreaseMagic(0, 0, 50, 0, "meter_hero");
};
}
public function doMagic3(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
stealMagic();
decreaseMagic(0, 0, 0, 20, "meter_hero");
};
}
public function do_heal_sound():void{
var _local1:breathing;
var _local2:*;
var _local3:SoundTransform;
_local1 = new breathing();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.6;
_local2.soundTransform = _local3;
}
public function CreateRandomArray():void{
buildingMap = true;
arr = new Array([r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()], [r(), r(), r(), r(), r(), r(), r(), r(), r(), r()]);
}
public function die_sound():void{
var _local1:die;
var _local2:*;
var _local3:SoundTransform;
if (buildingMap == false){
_local1 = new die();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.1;
_local2.soundTransform = _local3;
};
}
public function doMagic5(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
freezeSkulls();
decreaseMagic(10, 0, 0, 10, "meter_hero");
};
}
public function changePos(_arg1:MovieClip, _arg2:MovieClip):void{
var _local3:Number;
var _local4:Number;
if (_arg1.type == _arg2.type){
setInfo("cant change two same types!");
click1 = 0;
click2 = 0;
chosen1 = null;
chosen2 = null;
} else {
switch_sound();
howManyIChanged = 0;
_local3 = _arg1.x;
_local4 = _arg1.y;
Tweener.addTween(_arg1, {x:_arg2.x, y:_arg2.y, time:0.5, onComplete:changingFinished, onCompleteParams:[_arg1, _local3, _local4, _arg2, _arg2.x, _arg2.y]});
Tweener.addTween(_arg2, {x:_local3, y:_local4, time:0.5, onComplete:changingFinished, onCompleteParams:[_arg2, _arg2.x, _arg2.y, _arg1, _local3, _local4]});
};
}
public function setAwards():void{
var _local1:String;
var _local2:Number;
SoundMixer.stopAll();
monsters_beaten.push(monster_chosen);
if ((((challenge == false)) && ((level == 80)))){
} else {
fanfare_sound();
};
Tweener.removeAllTweens();
mc_next_level.status.award.htmlText = award.text;
mc_next_level.status.totalGames.text = totalGames;
mc_next_level.status.wonGames.text = (totalGames - lostGames);
mc_next_level.status.lostGames.text = lostGames;
mc_next_level.status.percentage.text = (Math.floor((((totalGames - lostGames) / totalGames) * 100)) + "%");
ratio_txt.text = mc_next_level.status.percentage.text.split("%").join("");
sendToDB();
life = (life + this[("monster_" + monster_chosen)].life_to_give);
mc_next_level.status.totalLife.text = life;
_local1 = this[("monster_" + monster_chosen)][0][0];
_local2 = this[("monster_" + monster_chosen)][0][1];
if (_local1 != "0"){
this[("haveMagic" + _local1)].have = (this[("haveMagic" + _local1)].have + _local2);
if (this[("haveMagic" + _local1)].have > 100){
this[("haveMagic" + _local1)].have = 100;
};
};
if (((!((this[("monster_" + monster_chosen)].gives_shield == undefined))) && ((challenge == false)))){
shield = true;
};
if (((((((!((this[("monster_" + monster_chosen)].haveExtra == ""))) && ((challenge == false)))) && (!((this[("monster_" + monster_chosen)].haveExtraToGive == undefined))))) || (((((!((this[("monster_" + monster_chosen)].haveExtra == ""))) && ((challenge == false)))) && (!((this[("monster_" + monster_chosen)].haveExtraToGive == 0))))))){
this[this[("monster_" + monster_chosen)].haveExtra] = (this[this[("monster_" + monster_chosen)].haveExtra] + this[("monster_" + monster_chosen)].haveExtraToGive);
};
if (monsters_beaten.length < 80){
saveGame();
};
}
public function sendMax():void{
MindJoltAPI.service.submitScore(score_count, "max mode");
trace(("send max" + score_count));
}
public function checkThePair(_arg1:MovieClip, _arg2:MovieClip):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Boolean;
var _local8:*;
_local3 = findRow(_arg1);
_local4 = findCollumn(_arg1);
_local5 = findRow(_arg2);
_local6 = findCollumn(_arg2);
_local7 = false;
if (_local5 == 0){
if ((((gameMap[_local3][_local4] == gameMap[(_local5 + 1)][_local6])) && (!((gameMap[(_local5 + 1)][_local6] == undefined))))){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
} else {
if ((((_local5 > 0)) && ((_local5 < (gameMap.length - 1))))){
if ((((gameMap[_local3][_local4] == gameMap[(_local5 + 1)][_local6])) && (!((gameMap[(_local5 + 1)][_local6] == undefined))))){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
} else {
if ((((gameMap[_local3][_local4] == gameMap[(_local5 - 1)][_local6])) && (!((gameMap[(_local5 - 1)][_local6] == undefined))))){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
};
} else {
if (_local5 == (gameMap.length - 1)){
if ((((gameMap[_local3][_local4] == gameMap[(_local5 - 1)][_local6])) && (!((gameMap[_local5][_local6] == undefined))))){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
};
};
};
if (_local4 == 0){
if (gameMap[_local3][_local4] == gameMap[_local5][(_local6 - 1)]){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
} else {
if ((((_local4 > 0)) && ((_local4 < (gameMap.length - 1))))){
if (gameMap[_local3][_local4] == gameMap[_local5][(_local6 + 1)]){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
} else {
if (gameMap[_local3][_local4] == gameMap[_local5][(_local6 - 1)]){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
};
} else {
if (_local4 == (gameMap.length - 1)){
if (gameMap[_local3][_local4] == gameMap[_local5][(_local6 + 1)]){
_local8 = gameMap[_local3][_local4];
gameMap[_local3][_local4] = gameMap[_local5][_local6];
gameMap[_local5][_local6] = _local8;
changePos(_arg1, _arg2);
_local7 = true;
};
};
};
};
if (_local7 != true){
click1 = 0;
click2 = 0;
chosen1 = null;
chosen2 = null;
setInfo("cant change two same types!");
};
}
public function deleteTxt():void{
introMc.txt1.text = "";
introMc.txt2.text = "";
introMc.txt3.text = "";
introMc.txt4.text = "";
}
public function destroyStealed(_arg1:MovieClip, _arg2:Object):void{
var _local3:Number;
amountStealed++;
removeChild(_arg1);
if (amountStealed == 34){
if (player == "1"){
_local3 = 2;
while (_local3 <= 5) {
this[("meter_hero_txt_" + _local3)].text = (parseInt(this[("meter_hero_txt_" + _local3)].text) + _arg2[("amount" + _local3)]);
if (parseInt(this[("meter_hero_txt_" + _local3)].text) >= 50){
this[("meter_hero_txt_" + _local3)].text = "50";
};
Tweener.addTween(this[("meter_hero_" + _local3)].maskmc, {scaleX:(this[("meter_hero_txt_" + _local3)].text / 50), time:1});
_local3++;
};
} else {
_local3 = 2;
while (_local3 <= 5) {
this[("meter_monster_txt_" + _local3)].text = (parseInt(this[("meter_monster_txt_" + _local3)].text) + _arg2[("amount" + _local3)]);
if (parseInt(this[("meter_monster_txt_" + _local3)].text) >= 50){
this[("meter_monster_txt_" + _local3)].text = "50";
};
Tweener.addTween(this[("meter_monster_" + _local3)].maskmc, {scaleX:(this[("meter_monster_txt_" + _local3)].text / 50), time:1});
_local3++;
};
};
switchThePlayers();
amountStealed = 0;
};
}
public function steal_magic_sound():void{
var _local1:Mouche;
var _local2:*;
var _local3:SoundTransform;
_local1 = new Mouche();
_local2 = _local1.play(0);
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
}
public function fanfare_sound():void{
var _local1:fanfare;
var _local2:*;
var _local3:SoundTransform;
if (buildingMap == false){
_local1 = new fanfare();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.03;
_local2.soundTransform = _local3;
};
}
public function exit(_arg1:MouseEvent):void{
if (time_challenge == true){
time_challenge = false;
timeChallenge.removeEventListener("timer", showTimeLimit);
};
deleteAll();
build_mc.y = 0;
addIntro();
if (challenge == true){
if (challenge_mc){
removeChild(challenge_mc);
};
} else {
if (mc_next_level){
removeChild(mc_next_level);
};
};
challenge = false;
mastery_mode = false;
survival_mode = false;
}
public function showDestructEffect(_arg1:MovieClip):void{
var _local2:*;
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
if (eff){
_local2 = 0;
while (_local2 < 10) {
_local3 = new effectOrange();
_local3.x = generujNahodneCislo((_arg1.x - 10), (_arg1.x + 10));
_local3.y = generujNahodneCislo((_arg1.y - 10), (_arg1.y + 10));
_local3.gotoAndStop(_arg1.type);
holder.addChild(_local3);
_local3.alpha = 1;
_local4 = generujNahodneCislo((_local3.x - 50), (_local3.x + 50));
_local5 = generujNahodneCislo((_local3.y - 50), (_local3.y + 50));
Tweener.addTween(_local3, {x:_local4, y:_local5, time:0.7, alpha:0.5, transition:"linear", onComplete:removeEffect, onCompleteParams:[_local3]});
_local2++;
};
};
}
public function setupMagics():void{
var _local1:*;
_local1 = 2;
while (_local1 <= 5) {
if (testing){
this[("meter_hero_" + _local1)].maskmc.scaleX = 1;
this[("meter_hero_txt_" + _local1)].text = 50;
} else {
this[("meter_hero_" + _local1)].maskmc.scaleX = 0;
this[("meter_hero_txt_" + _local1)].text = 0;
};
this[("meter_monster_" + _local1)].maskmc.scaleX = 0;
this[("meter_monster_txt_" + _local1)].text = 0;
this[("m" + _local1)].visible = false;
this[("em" + _local1)].visible = false;
_local1++;
};
if (haveBlue > 0){
this[("meter_hero_txt_" + 2)].text = haveBlue;
Tweener.addTween(this[("meter_hero_" + 2)].maskmc, {scaleX:(this[("meter_hero_txt_" + 2)].text / 50), time:1});
m4.visible = true;
};
if (haveGreen > 0){
this[("meter_hero_txt_" + 3)].text = haveGreen;
Tweener.addTween(this[("meter_hero_" + 3)].maskmc, {scaleX:(this[("meter_hero_txt_" + 3)].text / 50), time:1});
m3.visible = true;
};
if (haveOrange > 0){
this[("meter_hero_txt_" + 4)].text = haveOrange;
Tweener.addTween(this[("meter_hero_" + 4)].maskmc, {scaleX:(this[("meter_hero_txt_" + 4)].text / 50), time:1});
m2.visible = true;
};
if (haveWhite > 0){
this[("meter_hero_txt_" + 5)].text = haveWhite;
Tweener.addTween(this[("meter_hero_" + 5)].maskmc, {scaleX:(this[("meter_hero_txt_" + 5)].text / 50), time:1});
m5.visible = true;
};
if (challenge == false){
if (this[("monster_" + monster_chosen)].haveExtra != undefined){
if (this[("monster_" + monster_chosen)].haveBlue > 0){
this[("meter_monster_txt_" + 2)].text = this[("monster_" + monster_chosen)].haveBlue;
Tweener.addTween(this[("meter_monster_" + 2)].maskmc, {scaleX:(this[("meter_monster_txt_" + 2)].text / 50), time:1});
em4.visible = true;
};
if (this[("monster_" + monster_chosen)].haveGreen > 0){
this[("meter_monster_txt_" + 3)].text = this[("monster_" + monster_chosen)].haveGreen;
Tweener.addTween(this[("meter_monster_" + 3)].maskmc, {scaleX:(this[("meter_monster_txt_" + 3)].text / 50), time:1});
em3.visible = true;
};
if (this[("monster_" + monster_chosen)].haveOrange > 0){
this[("meter_monster_txt_" + 4)].text = this[("monster_" + monster_chosen)].haveOrange;
Tweener.addTween(this[("meter_monster_" + 4)].maskmc, {scaleX:(this[("meter_monster_txt_" + 4)].text / 50), time:1});
em2.visible = true;
};
if (this[("monster_" + monster_chosen)].haveWhite > 0){
this[("meter_monster_txt_" + 5)].text = this[("monster_" + monster_chosen)].haveWhite;
Tweener.addTween(this[("meter_monster_" + 5)].maskmc, {scaleX:(this[("meter_monster_txt_" + 5)].text / 50), time:1});
em5.visible = true;
};
};
} else {
em2.visible = false;
em3.visible = false;
em4.visible = false;
em5.visible = false;
};
}
public function showHighScores_survival():void{
}
public function returnRealRandom():Number{
var _local1:SeededRand;
_local1 = new SeededRand((Math.random() * 2000));
_local1.setRange(1, 27);
return (_local1.ranged);
}
public function play_bc_music():void{
var _local1:bc_music;
var _local2:*;
var _local3:SoundTransform;
setupMagics();
_local1 = new bc_music();
_local2 = _local1.play(0, 999);
_local3 = _local2.soundTransform;
_local3.volume = 0.1;
_local2.soundTransform = _local3;
}
public function doMagic10(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
destroyAllMagic();
decreaseMagic(0, 0, 20, 40, "meter_hero");
};
}
public function sendMastery():void{
MindJoltAPI.service.submitScore(totalGames, "mastery mode");
trace(("send mastery" + totalGames));
}
public function stealMagic():void{
var _local1:Number;
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:MovieClip;
var _local7:Number;
var _local8:Number;
if (player == "2"){
decreaseMagic(0, 0, 0, 20, "meter_monster");
};
book_sound();
_local2 = new Object();
if (player == "1"){
_local5 = 2;
while (_local5 <= 5) {
_local1 = 0;
if (this[("meter_monster_txt_" + _local5)].text >= 8){
_local1 = 8;
} else {
_local1 = this[("meter_monster_txt_" + _local5)].text;
};
_local2[("amount" + _local5)] = _local1;
this[("meter_monster_txt_" + _local5)].text = (parseInt(this[("meter_monster_txt_" + _local5)].text) - _local1);
this[("meter_monster_" + _local5)].maskmc.scaleX = (this[("meter_monster_txt_" + _local5)].text / 50);
_local5++;
};
} else {
_local5 = 2;
while (_local5 <= 5) {
if (this[("meter_hero_txt_" + _local5)].text >= 8){
_local1 = 8;
} else {
_local1 = this[("meter_hero_txt_" + _local5)].text;
};
_local2[("amount" + _local5)] = _local1;
this[("meter_hero_txt_" + _local5)].text = (parseInt(this[("meter_hero_txt_" + _local5)].text) - _local1);
this[("meter_hero_" + _local5)].maskmc.scaleX = (this[("meter_hero_txt_" + _local5)].text / 50);
_local5++;
};
};
_local3 = 0;
while (_local3 < 18) {
_local6 = new stealing();
addChild(_local6);
_local6.x = generujNahodneCislo((this[("meter_monster_" + 3)].x - 30), (this[("meter_monster_" + 3)].x - 50));
_local6.y = generujNahodneCislo((this[("meter_monster_" + 3)].y - 30), (this[("meter_monster_" + 3)].y + 30));
_local6.gotoAndStop((Math.random() * 7));
_local6.alpha = 1;
_local6.scaleX = 3;
_local6.scaleY = 3;
_local7 = generujNahodneCislo((_local6.x - 80), (_local6.x + 80));
_local8 = generujNahodneCislo((_local6.y - 80), (_local6.y + 80));
Tweener.addTween(_local6, {x:_local7, y:_local8, time:1, alpha:0.5, transition:"linear", onComplete:destroyStealed, onCompleteParams:[_local6, _local2], transition:"linear"});
_local3++;
};
_local4 = 0;
while (_local4 < 18) {
_local6 = new stealing();
addChild(_local6);
_local6.x = generujNahodneCislo((this[("meter_hero_" + 3)].x + 30), (this[("meter_hero_" + 3)].x + 50));
_local6.y = generujNahodneCislo((this[("meter_hero_" + 3)].y - 30), (this[("meter_hero_" + 3)].y + 30));
_local6.gotoAndStop((Math.random() * 7));
_local6.alpha = 1;
_local6.scaleX = 3;
_local6.scaleY = 3;
_local7 = generujNahodneCislo((_local6.x - 80), (_local6.x + 80));
_local8 = generujNahodneCislo((_local6.y - 80), (_local6.y + 80));
Tweener.addTween(_local6, {x:_local7, y:_local8, time:1, alpha:0.5, transition:"linear", onComplete:destroyStealed, onCompleteParams:[_local6, _local2], transition:"linear"});
_local4++;
};
}
public function chooseMonster(_arg1:MouseEvent):void{
var _local2:Number;
if (moving == false){
click_monster_sound();
switch_sound();
moving = true;
lastPosX = heroMc.x;
lastPosY = heroMc.y;
_local2 = Math.abs(heroMc.scaleX);
monster_chosen = Number(_arg1.target.name.substr(5, _arg1.target.name.length));
if (heroMc.x > mapka[("monst" + monster_chosen)].x){
heroMc.scaleX = -(_local2);
} else {
heroMc.scaleX = _local2;
};
Tweener.addTween(heroMc, {x:(mapka[("monst" + monster_chosen)].x - 10), y:mapka[("monst" + monster_chosen)].y, time:2, onComplete:beginBattle});
mapka[("monst" + monster_chosen)].filters = [monsterHighlight];
};
}
public function turnEffects(_arg1:MouseEvent):void{
if (_arg1.target.currentFrame == 1){
_arg1.target.gotoAndStop(2);
eff = false;
} else {
_arg1.target.gotoAndStop(1);
eff = true;
};
}
public function doDarkRain():void{
var _local1:uint;
var _local2:Timer;
var _local3:uint;
var _local4:MovieClip;
if (player == "2"){
decreaseMagic(0, 12, 8, 20, "meter_monster");
};
play_dark_rain();
showEffect("darkRain");
dontAllowPlaying();
countForMagic = 0;
_local1 = 0;
while (_local1 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if (gameMap[_local1][_local3].type == 3){
countForMagic++;
_local4 = new c7();
_local4.type = 7;
_local4.x = gameMap[_local1][_local3].x;
_local4.y = gameMap[_local1][_local3].y;
holder.addChild(_local4);
holder.removeChild(gameMap[_local1][_local3]);
gameMap[_local1][_local3] = _local4;
gameMap[_local1][_local3].type = _local4.type;
gameMap[_local1][_local3].removeEventListener(MouseEvent.MOUSE_UP, clickMe);
_local4.addEventListener(MouseEvent.MOUSE_UP, clickMe);
};
_local3++;
};
_local1++;
};
_local2 = new Timer(1000, 1);
_local2.addEventListener("timer", checkAfterMagic);
_local2.start();
}
public function enemyChangePos(_arg1:MovieClip, _arg2:String, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:MovieClip;
switch_sound();
howManyEnemyChanged = 0;
_local4 = findRow(_arg1);
_local5 = findCollumn(_arg1);
_local6 = _arg1.x;
_local7 = _arg1.y;
_local8 = _arg3;
if (_arg2 == "upRight"){
_local9 = gameMap[(_local4 + 1)][_local5];
gameMap[(_local4 + 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "upLeft"){
_local9 = gameMap[(_local4 + 1)][_local5];
gameMap[(_local4 + 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "downRight"){
_local9 = gameMap[(_local4 - 1)][_local5];
gameMap[(_local4 - 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "downLeft"){
_local9 = gameMap[(_local4 - 1)][_local5];
gameMap[(_local4 - 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "left"){
_local9 = gameMap[_local4][(_local5 + 1)];
gameMap[_local4][(_local5 + 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "right"){
_local9 = gameMap[_local4][(_local5 - 1)];
gameMap[_local4][(_local5 - 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "VertUpRight"){
_local9 = gameMap[_local4][(_local5 - 1)];
gameMap[_local4][(_local5 - 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "VertUpLeft"){
_local9 = gameMap[_local4][(_local5 + 1)];
gameMap[_local4][(_local5 + 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "VertDownLeft"){
_local9 = gameMap[_local4][(_local5 + 1)];
gameMap[_local4][(_local5 + 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "VertDownRight"){
_local9 = gameMap[_local4][(_local5 - 1)];
gameMap[_local4][(_local5 - 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "Up"){
_local9 = gameMap[(_local4 + 1)][_local5];
gameMap[(_local4 + 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "Down"){
_local9 = gameMap[(_local4 - 1)][_local5];
gameMap[(_local4 - 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "MiddleHorizontalUp"){
_local9 = gameMap[(_local4 + 1)][_local5];
gameMap[(_local4 + 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "MiddleHorizontalDown"){
_local9 = gameMap[(_local4 - 1)][_local5];
gameMap[(_local4 - 1)][_local5] = gameMap[_local4][_local5];
};
if (_arg2 == "MiddleVerticalLeft"){
_local9 = gameMap[_local4][(_local5 + 1)];
gameMap[_local4][(_local5 + 1)] = gameMap[_local4][_local5];
};
if (_arg2 == "MiddleVerticalRight"){
_local9 = gameMap[_local4][(_local5 - 1)];
gameMap[_local4][(_local5 - 1)] = gameMap[_local4][_local5];
};
gameMap[_local4][_local5] = _local9;
Tweener.addTween(_arg1, {x:_local9.x, y:_local9.y, time:0.5, onComplete:enemyHits});
Tweener.addTween(_local9, {x:_local6, y:_local7, time:0.5, onComplete:enemyHits});
}
public function nextBattleSurvival(_arg1:TimerEvent):void{
deleteAll();
initSettings();
}
public function click_monster_sound():void{
var _local1:click_monster_snd;
var _local2:*;
var _local3:SoundTransform;
_local1 = new click_monster_snd();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.1;
_local2.soundTransform = _local3;
}
public function allowComp():void{
var _local1:Timer;
illegalMoveCount++;
if ((((toBeRemoved.length == 0)) && ((illegalMoveCount == 2)))){
player1.gotoAndStop(2);
player2.gotoAndStop(1);
playerswitch_sound();
player = "2";
setTheNames();
_local1 = new Timer(1500, 1);
_local1.addEventListener("timer", letEnemyPlay);
_local1.start();
};
}
public function loadGame(){
var _local1:Number;
var _local2:*;
play_map_music();
challenge = false;
mastery_mode = false;
time_challenge = false;
survival_mode = false;
level = (so.data.Level + 1);
if (level >= 80){
level = 80;
};
life = so.data.Life;
haveMagic1.have = so.data.magic1;
haveMagic2.have = so.data.magic2;
haveMagic3.have = so.data.magic3;
haveMagic4.have = so.data.magic4;
haveMagic5.have = so.data.magic5;
haveMagic6.have = so.data.magic6;
haveMagic7.have = so.data.magic7;
haveMagic8.have = so.data.magic8;
haveMagic9.have = so.data.magic9;
haveMagic10.have = so.data.magic10;
totalGames = so.data.TotalGames;
lostGames = so.data.LostGames;
shield = so.data.Shield;
haveOrange = so.data.HaveOrange;
haveBlue = so.data.HaveBlue;
haveGreen = so.data.HaveGreen;
haveWhite = so.data.HaveWhite;
total_txt.text = String(totalGames);
_local1 = (((totalGames - lostGames) / totalGames) * 100);
ratio_txt.text = String(Math.floor(_local1));
mapkaNum = so.data.mapkaNum;
_local2 = so.data.Monsters;
monsters_beaten = _local2.split(",");
setMonsters();
setMapka();
setShield();
heroMc.x = so.data.lastX;
heroMc.y = so.data.lastY;
removeChild(introMc);
}
public function found_sound():void{
var _local1:found_snd;
var _local2:*;
var _local3:SoundTransform;
_local1 = new found_snd();
_local2 = _local1.play(1200);
_local3 = _local2.soundTransform;
_local3.volume = 0.05;
_local2.soundTransform = _local3;
}
public function letCompPlay():void{
var _local1:uint;
var _local2:uint;
var _local3:*;
if (gameOver == false){
couplesFound = new Array();
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < (gameMap.length - 1)) {
if (gameMap[_local1][_local3].type == gameMap[_local1][(_local3 + 1)].type){
couplesFound.push([gameMap[_local1][_local3], gameMap[_local1][_local3].type, "horizontal"]);
};
if (gameMap[_local3][_local1].type == gameMap[(_local3 + 1)][_local1].type){
couplesFound.push([gameMap[_local3][_local1], gameMap[_local3][_local1].type, "vertical"]);
};
_local3++;
};
_local3 = 0;
while (_local3 < (gameMap.length - 2)) {
if (gameMap[_local1][_local3].type == gameMap[_local1][(_local3 + 2)].type){
couplesFound.push([gameMap[_local1][_local3], gameMap[_local1][_local3].type, "middleHorizontal"]);
};
if (gameMap[_local3][_local1].type == gameMap[(_local3 + 2)][_local1].type){
couplesFound.push([gameMap[_local3][_local1], gameMap[_local3][_local1].type, "middleVertical"]);
};
_local3++;
};
_local2++;
};
_local1++;
};
enemyFoundCouples();
};
}
public function mute(_arg1:MouseEvent):void{
if (audio == 1){
audio = 0;
_arg1.target.gotoAndStop(2);
SoundMixer.soundTransform = new SoundTransform(0);
} else {
audio = 1;
_arg1.target.gotoAndStop(1);
SoundMixer.soundTransform = new SoundTransform(1);
};
}
public function addIntro():void{
var _local1:intro_sound;
var _local2:*;
var _local3:SoundTransform;
SoundMixer.stopAll();
addChild(introMc);
_local1 = new intro_sound();
_local2 = _local1.play(0, 999);
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
}
public function initVariables():void{
player = "1";
power = 1;
countForMagic = 0;
magic = false;
magicType = "";
posX = 32;
click1 = 0;
click2 = 0;
row0 = new Array();
row1 = new Array();
row2 = new Array();
row3 = new Array();
row4 = new Array();
row5 = new Array();
row6 = new Array();
row7 = new Array();
row8 = new Array();
row9 = new Array();
row10 = new Array();
row11 = new Array();
gameMap = new Array();
couplesFound = new Array();
enemyOptions = new Array();
howManyRemoved = 0;
removed = 0;
monsterMagic1 = false;
monsterMagic2 = false;
monsterMagic3 = false;
monsterMagic4 = false;
monsterMagic5 = false;
monsterMagic6 = false;
monsterMagic7 = false;
monsterMagic8 = false;
monsterMagic9 = false;
monsterMagic10 = false;
}
public function switchThePlayers():void{
var _local1:Timer;
if ((((creatingNEWone == false)) && ((gameOver == false)))){
checkLife();
if (extra_round != "0"){
if (extra_round == "1"){
click1 = 0;
click2 = 0;
chosen1 = null;
chosen2 = null;
checkSpells();
};
if (extra_round == "2"){
_local1 = new Timer(400, 1);
_local1.addEventListener("timer", letEnemyPlay);
_local1.start();
};
extra_round = "0";
} else {
magic = false;
playerswitch_sound();
if (player1.currentFrame == 1){
if (magicType == "freeze_2"){
magicType = "";
resetFreeze();
};
disableSpells();
player1.gotoAndStop(2);
player2.gotoAndStop(1);
player = "2";
_local1 = new Timer(1000, 1);
_local1.addEventListener("timer", letEnemyPlay);
_local1.start();
dontAllowPlaying();
} else {
if (magicType == "freeze_1"){
magicType = "";
resetFreeze();
};
checkSpells();
hand_mc.y = 500;
checkMagicAvailability();
player = "1";
letCompPlay();
player1.gotoAndStop(1);
player2.gotoAndStop(2);
click1 = 0;
click2 = 0;
chosen1 = null;
chosen2 = null;
};
};
};
}
public function setMonsters():void{
var _local1:Number;
var _local2:*;
var _local3:Number;
var _local4:Boolean;
var _local5:*;
_local1 = 1;
while (_local1 <= totalMonsters) {
if (mapka[("monst" + _local1)].currentFrame == 1){
removeTheMonster(_local1);
};
_local1++;
};
_local1 = 1;
while (_local1 <= totalGroups) {
_local2 = this[("group" + _local1)].length;
_local3 = 0;
while (_local3 <= _local2) {
trace(("level" + monsters_beaten.length));
if ((monsters_beaten.length + 1) == this[("group" + _local1)][_local3]){
_local4 = false;
_local5 = 0;
while (_local5 < _local2) {
if (!isBeaten(this[("group" + _local1)][_local5])){
if (mapka[("monst" + this[("group" + _local1)][_local5])].currentFrame == 1){
mapka[("monst" + this[("group" + _local1)][_local5])].gotoAndPlay(2);
};
mapka[("monst" + this[("group" + _local1)][_local5])].visible = true;
mapka[("monst" + this[("group" + _local1)][_local5])].enabled = true;
_local4 = true;
};
_local5++;
};
if (_local4 == false){
showNewMonsters((_local1 + 1));
break;
};
};
_local3++;
};
_local1++;
};
}
public function setMagic(_arg1:Number):void{
if (player == "1"){
this[("meter_hero_txt_" + _arg1)].text = (parseInt(this[("meter_hero_txt_" + _arg1)].text) + 2);
Tweener.addTween(this[("meter_hero_" + _arg1)].maskmc, {scaleX:(this[("meter_hero_txt_" + _arg1)].text / 50), time:1});
if (this[("meter_hero_" + _arg1)].maskmc.scaleX >= 1){
this[("meter_hero_" + _arg1)].maskmc.scaleX = 1;
};
if (this[("meter_hero_txt_" + _arg1)].text >= 50){
this[("meter_hero_txt_" + _arg1)].text = 50;
};
} else {
if (player == "2"){
this[("meter_monster_txt_" + _arg1)].text = (parseInt(this[("meter_monster_txt_" + _arg1)].text) + 2);
Tweener.addTween(this[("meter_monster_" + _arg1)].maskmc, {scaleX:(this[("meter_monster_txt_" + _arg1)].text / 50), time:1});
if (this[("meter_monster_" + _arg1)].maskmc.scaleX >= 1){
this[("meter_monster_" + _arg1)].maskmc.scaleX = 1;
};
if (this[("meter_monster_txt_" + _arg1)].text >= 50){
this[("meter_monster_txt_" + _arg1)].text = 50;
};
};
};
}
public function showTimeLimit(_arg1:TimerEvent){
time_limit.text = ("| limit: " + String(limit--));
if (limit <= 0){
timeChallenge.removeEventListener("timer", showTimeLimit);
setLost();
};
}
public function shownames(_arg1:MouseEvent):void{
infoSet.txt1.text = "xx";
infoSet.txt2.text = "xx";
infoSet.txt3.text = "xx";
infoSet.txt4.text = "xx";
switch (_arg1.target.name){
case "perc2":
help_mc.infoHelp.htmlText = haveMagic2.name;
break;
case "perc3":
help_mc.infoHelp.htmlText = haveMagic3.name;
break;
case "perc4":
help_mc.infoHelp.htmlText = haveMagic4.name;
break;
case "perc5":
help_mc.infoHelp.htmlText = haveMagic5.name;
break;
case "perc6":
help_mc.infoHelp.htmlText = haveMagic6.name;
break;
case "perc7":
help_mc.infoHelp.htmlText = haveMagic7.name;
break;
case "perc8":
help_mc.infoHelp.htmlText = haveMagic8.name;
break;
case "perc9":
help_mc.infoHelp.htmlText = haveMagic9.name;
break;
case "perc10":
help_mc.infoHelp.htmlText = haveMagic10.name;
break;
};
}
public function enemyFoundCouples():void{
var _local1:*;
var _local2:Number;
var _local3:Number;
enemyOptions = new Array();
if (couplesFound.length > 0){
_local1 = 0;
while (_local1 < couplesFound.length) {
_local2 = findRow(couplesFound[_local1][0]);
_local3 = findCollumn(couplesFound[_local1][0]);
if (couplesFound[_local1][2] == "horizontal"){
if ((((_local2 > 0)) && ((_local2 < (gameMap.length - 1))))){
if (_local3 < (gameMap.length - 2)){
if (gameMap[(_local2 - 1)][(_local3 + 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 2)], couplesFound[_local1][0].type, "upRight"]);
};
};
if (_local3 < (gameMap.length - 3)){
if ((((gameMap[(_local2 - 1)][(_local3 + 2)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 2)], couplesFound[_local1][0].type, "upRight", "TRIPLE"]);
};
};
if ((_local3 - 1) >= 0){
if (gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "upLeft"]);
};
};
if ((_local3 - 2) >= 0){
if ((((gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[_local2][(_local3 - 2)].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "upLeft", "TRIPLE"]);
};
};
if (_local3 < (gameMap.length - 2)){
if (gameMap[(_local2 + 1)][(_local3 + 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 2)], couplesFound[_local1][0].type, "downRight"]);
};
};
if (_local3 < (gameMap.length - 3)){
if ((((gameMap[(_local2 + 1)][(_local3 + 2)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 2)], couplesFound[_local1][0].type, "downRight", "TRIPLE"]);
};
};
if ((_local3 - 1) >= 0){
if (gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "downLeft"]);
};
};
if ((_local3 - 2) >= 0){
if ((((gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 - 2)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "downLeft", "TRIPLES"]);
};
};
if ((_local3 - 2) >= 0){
if (gameMap[_local2][(_local3 - 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 - 2)], couplesFound[_local1][0].type, "left"]);
};
};
if ((_local3 + 3) < gameMap.length){
if (gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 + 3)], couplesFound[_local1][0].type, "right"]);
};
};
};
if (_local2 == 0){
if (_local3 < (gameMap.length - 2)){
if (gameMap[(_local2 + 1)][(_local3 + 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 2)], couplesFound[_local1][0].type, "downRight"]);
};
};
if (_local3 < (gameMap.length - 3)){
if ((((gameMap[(_local2 + 1)][(_local3 + 2)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 2)], couplesFound[_local1][0].type, "downRight", "TRIPLE"]);
};
};
if ((_local3 - 1) >= 0){
if (gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "downLeft"]);
};
};
if ((_local3 - 2) >= 0){
if ((((gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 - 2)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "downLeft", "TRIPLES"]);
};
};
if ((_local3 - 2) >= 0){
if (gameMap[_local2][(_local3 - 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 - 2)], couplesFound[_local1][0].type, "left"]);
};
};
if ((_local3 + 3) < gameMap.length){
if (gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 + 3)], couplesFound[_local1][0].type, "right"]);
};
};
};
if (_local2 == (gameMap.length - 1)){
if ((_local3 - 2) >= 0){
if (gameMap[_local2][(_local3 - 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 - 2)], couplesFound[_local1][0].type, "left"]);
};
};
if ((_local3 + 3) < gameMap.length){
if (gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[_local2][(_local3 + 3)], couplesFound[_local1][0].type, "right"]);
break;
};
};
if (_local3 < (gameMap.length - 2)){
if (gameMap[(_local2 - 1)][(_local3 + 2)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 2)], couplesFound[_local1][0].type, "upRight"]);
};
};
if (_local3 < (gameMap.length - 3)){
if ((((gameMap[(_local2 - 1)][(_local3 + 2)].type == couplesFound[_local1][0].type)) && ((gameMap[_local2][(_local3 + 3)].type == couplesFound[_local1][0].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 2)], couplesFound[_local1][0].type, "upRight", "TRIPLE"]);
};
};
if ((_local3 - 1) >= 0){
if (gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "upLeft"]);
};
};
if ((_local3 - 2) >= 0){
if ((((gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[_local2][(_local3 - 2)].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "upLeft", "TRIPLE"]);
};
};
};
};
if (couplesFound[_local1][2] == "middleVertical"){
if ((((((_local3 > 0)) && ((_local3 < (gameMap.length - 1))))) && ((_local2 < (gameMap.length - 1))))){
if (gameMap[(_local2 + 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleVerticalRight"]);
};
if (gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "MiddleVerticalLeft"]);
};
};
if ((((_local3 == 0)) && ((_local2 < (gameMap.length - 1))))){
if (gameMap[(_local2 + 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleVerticalRight"]);
};
};
if ((((_local3 == (gameMap.length - 1))) && ((_local2 < (gameMap.length - 1))))){
if (gameMap[(_local2 + 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 - 1)], couplesFound[_local1][0].type, "MiddleVerticalLeft"]);
};
};
};
if (couplesFound[_local1][2] == "middleHorizontal"){
if ((((_local2 > 0)) && ((_local2 < (gameMap.length - 1))))){
if (gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleHorizontalUp"]);
};
if (gameMap[(_local2 + 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleHorizontalDown"]);
};
};
if (_local2 == 0){
if (gameMap[(_local2 + 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleHorizontalDown"]);
};
};
if (_local2 == (gameMap.length - 1)){
if (gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "MiddleHorizontalUp"]);
};
};
};
if (couplesFound[_local1][2] == "vertical"){
if ((((_local3 > 0)) && ((_local3 < (gameMap.length - 1))))){
if ((((_local2 < (gameMap.length - 1))) && (!((_local2 == 0))))){
if (gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "VertUpRight"]);
};
};
if ((((_local2 < (gameMap.length - 2))) && ((_local2 >= 2)))){
if ((((gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 - 2)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "VertUpRight", "TRIPLE"]);
};
};
if ((_local2 - 1) >= 0){
if (gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "VertUpLeft"]);
};
};
if ((_local2 - 2) >= 0){
if ((((gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 - 2)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "VertUpLeft", "TRIPLE"]);
};
};
if (_local2 < (gameMap.length - 2)){
if (gameMap[(_local2 + 2)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 + 1)], couplesFound[_local1][0].type, "VertDownRight"]);
};
};
if (_local2 < (gameMap.length - 3)){
if ((((gameMap[(_local2 + 2)][(_local3 + 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 + 3)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 + 1)], couplesFound[_local1][0].type, "VertDownRight", "TRIPLE"]);
};
};
if ((_local2 + 2) < gameMap.length){
if (gameMap[(_local2 + 2)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 - 1)], couplesFound[_local1][0].type, "VertDownLeft"]);
};
};
if ((_local2 + 3) < gameMap.length){
if ((((gameMap[(_local2 + 2)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 + 3)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 - 1)], couplesFound[_local1][0].type, "VertDownLeft", "TRIPLE"]);
};
};
if ((_local2 - 2) >= 0){
if (gameMap[(_local2 - 2)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 2)][_local3], couplesFound[_local1][0].type, "Up"]);
};
};
if ((_local2 + 3) < gameMap.length){
if (gameMap[(_local2 + 3)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 3)][_local3], couplesFound[_local1][0].type, "Down"]);
};
};
};
if (_local3 == 0){
if ((_local2 - 2) >= 0){
if (gameMap[(_local2 - 2)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 2)][_local3], couplesFound[_local1][0].type, "Up"]);
};
};
if ((_local2 + 3) < gameMap.length){
if (gameMap[(_local2 + 3)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 3)][_local3], couplesFound[_local1][0].type, "Down"]);
};
};
if (_local2 < (gameMap.length - 2)){
if (gameMap[(_local2 + 2)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 + 1)], couplesFound[_local1][0].type, "VertDownRight"]);
};
};
if (_local2 < (gameMap.length - 3)){
if ((((gameMap[(_local2 + 2)][(_local3 + 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 + 3)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 + 1)], couplesFound[_local1][0].type, "VertDownRight", "TRIPLE"]);
};
};
if ((((_local2 < (gameMap.length - 1))) && (!((_local2 == 0))))){
if (gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "VertUpRight"]);
};
};
if ((((_local2 < (gameMap.length - 2))) && ((_local2 >= 2)))){
if ((((gameMap[(_local2 - 1)][(_local3 + 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 - 2)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 + 1)], couplesFound[_local1][0].type, "VertUpRight", "TRIPLE"]);
};
};
};
if (_local3 == (gameMap.length - 1)){
if ((_local2 - 2) >= 0){
if (gameMap[(_local2 - 2)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 2)][_local3], couplesFound[_local1][0].type, "Up"]);
};
};
if ((_local2 + 3) < gameMap.length){
if (gameMap[(_local2 + 3)][_local3].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 3)][_local3], couplesFound[_local1][0].type, "Down"]);
};
};
if ((_local2 + 2) < gameMap.length){
if (gameMap[(_local2 + 2)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 - 1)], couplesFound[_local1][0].type, "VertDownLeft"]);
};
};
if ((_local2 + 3) < gameMap.length){
if ((((gameMap[(_local2 + 2)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 + 3)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 + 2)][(_local3 - 1)], couplesFound[_local1][0].type, "VertDownLeft", "TRIPLE"]);
};
};
if ((_local2 - 1) >= 0){
if (gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "VertUpLeft"]);
};
};
if ((_local2 - 2) >= 0){
if ((((gameMap[(_local2 - 1)][(_local3 - 1)].type == couplesFound[_local1][0].type)) && ((couplesFound[_local1][0].type == gameMap[(_local2 - 2)][_local3].type)))){
enemyOptions.push([gameMap[(_local2 - 1)][(_local3 - 1)], couplesFound[_local1][0].type, "VertUpLeft", "TRIPLE"]);
};
};
};
};
_local1++;
};
};
if (enemyOptions.length > 0){
enemyOptions.sort(randomlySort);
if (player == "2"){
decideWhichToUse();
};
} else {
createNewArray();
};
}
public function destroyMonster(_arg1:TimerEvent):void{
var _local2:Timer;
mapka[("monst" + monster_chosen)].gotoAndStop("death");
mapka[("monst" + monster_chosen)].removeEventListener(MouseEvent.CLICK, chooseMonster);
mapka[("monst" + monster_chosen)].buttonMode = false;
explode_monster();
_local2 = new Timer(800, 1);
_local2.addEventListener("timer", finalyRemove);
_local2.start();
}
public function retry():void{
var _local1:Number;
removeChild(mc_next_level);
play_map_music();
level++;
setMapka();
level--;
_local1 = 1;
while (_local1 <= 8) {
mapka[("exitMc" + _local1)].visible = false;
_local1++;
};
Tweener.addTween(heroMc, {x:lastPosX, y:lastPosY, time:2, onComplete:saveAfterLost});
mapka[("monst" + monster_chosen)].filters = [];
heroMc.filters = [];
}
public function setInGameAwardsText():void{
var _local1:String;
var _local2:String;
award.htmlText = "";
if (this[("monster_" + monster_chosen)][0][1] != 0){
award.htmlText = ((this[("monster_" + monster_chosen)][0][1] + "% ") + this[("haveMagic" + this[("monster_" + monster_chosen)][0][0])].name);
};
if (this[("monster_" + monster_chosen)].life_to_give != 0){
if (award.htmlText != ""){
award.htmlText = (award.htmlText + " | ");
};
award.htmlText = (award.htmlText + (("+" + this[("monster_" + monster_chosen)].life_to_give) + " life points"));
};
if (this[("monster_" + monster_chosen)].haveExtraToGive != undefined){
if (this[("monster_" + monster_chosen)].haveExtraToGive != 0){
_local1 = this[("monster_" + monster_chosen)].haveExtra;
if (_local1 == "haveGreen"){
_local2 = "Green Mana";
} else {
if (_local1 == "haveOrange"){
_local2 = "Orange Mana";
} else {
if (_local1 == "haveWhite"){
_local2 = "White Mana";
} else {
if (_local1 == "haveBlue"){
_local2 = "Blue Mana";
};
};
};
};
if (award.htmlText != ""){
award.htmlText = (award.htmlText + " | ");
};
award.htmlText = (award.htmlText + ((this[("monster_" + monster_chosen)].haveExtraToGive + " ") + _local2));
};
};
if (this[("monster_" + monster_chosen)].gives_shield == 1){
if (award.htmlText != ""){
award.htmlText = (award.htmlText + " | ");
};
award.htmlText = (award.htmlText + "Shield of Death");
};
}
public function playHeartSound():void{
var _local1:*;
var _local2:SoundTransform;
_local1 = heart_sound.play();
_local2 = _local1.soundTransform;
_local2.volume = 0.1;
_local1.soundTransform = _local2;
}
public function beginBattle():void{
var _local1:Number;
moving = false;
mapka.x = 800;
mapka.y = 800;
_local1 = Math.abs(heroMc.scaleX);
if (heroMc.x > mapka[("monst" + monster_chosen)].x){
heroMc.scaleX = -(_local1);
} else {
heroMc.scaleX = _local1;
};
initSettings();
}
public function setAllMagic():void{
var _local1:*;
if (player == "1"){
_local1 = 2;
while (_local1 <= 5) {
this[("meter_hero_txt_" + _local1)].text = (parseInt(this[("meter_hero_txt_" + _local1)].text) + 1);
Tweener.addTween(this[("meter_hero_" + _local1)].maskmc, {scaleX:(this[("meter_hero_txt_" + _local1)].text / 50), time:1});
if (this[("meter_hero_" + _local1)].maskmc.scaleX >= 1){
this[("meter_hero_" + _local1)].maskmc.scaleX = 1;
};
if (this[("meter_hero_txt_" + _local1)].text >= 50){
this[("meter_hero_txt_" + _local1)].text = 50;
};
_local1++;
};
} else {
if (player == "2"){
_local1 = 2;
while (_local1 <= 5) {
this[("meter_monster_txt_" + _local1)].text = (parseInt(this[("meter_monster_txt_" + _local1)].text) + 1);
Tweener.addTween(this[("meter_monster_" + _local1)].maskmc, {scaleX:(this[("meter_monster_txt_" + _local1)].text / 50), time:1});
if (this[("meter_monster_" + _local1)].maskmc.scaleX >= 1){
this[("meter_monster_" + _local1)].maskmc.scaleX = 1;
};
if (this[("meter_monster_txt_" + _local1)].text >= 50){
this[("meter_monster_txt_" + _local1)].text = 50;
};
_local1++;
};
};
};
}
public function saveGame(){
if (level >= 80){
level = 79;
};
so.data.Monsters = monsters_beaten.toString();
so.data.Life = life;
so.data.Level = level;
so.data.magic1 = haveMagic1.have;
so.data.magic2 = haveMagic2.have;
so.data.magic3 = haveMagic3.have;
so.data.magic4 = haveMagic4.have;
so.data.magic5 = haveMagic5.have;
so.data.magic6 = haveMagic6.have;
so.data.magic7 = haveMagic7.have;
so.data.magic8 = haveMagic8.have;
so.data.magic9 = haveMagic9.have;
so.data.magic10 = haveMagic10.have;
so.data.TotalGames = totalGames;
so.data.LostGames = lostGames;
so.data.Shield = shield;
so.data.HaveOrange = haveOrange;
so.data.HaveBlue = haveBlue;
so.data.HaveGreen = haveGreen;
so.data.HaveWhite = haveWhite;
so.data.lastX = heroMc.x;
so.data.lastY = heroMc.y;
so.data.mapkaNum = mapkaNum;
so.flush();
}
public function wrong_move():void{
var _local1:wrong;
var _local2:*;
var _local3:SoundTransform;
_local1 = new wrong();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
}
public function sendToDBChallenges():void{
if ((((time_challenge == false)) && ((mastery_mode == false)))){
trace("sending survival results");
} else {
if (mastery_mode == true){
trace("sending mastery results");
} else {
if (time_challenge == true){
trace("sending maxdamage results");
};
};
};
}
public function deleteHolder():void{
var _local1:uint;
_local1 = 0;
while (_local1 < holder.numChildren) {
holder.removeChild(holder.getChildAt(_local1));
_local1++;
};
if (holder.numChildren > 0){
deleteHolder();
};
}
public function checkAgain(_arg1:MovieClip):void{
toBeCheckedAgain++;
if (toBeCheckedAgain == howManyRemoved){
setTheNames();
checkPoints();
if ((((toBeRemoved.length == 0)) && ((buildingMap == true)))){
switchThePlayers();
build_mc.btn_start.visible = true;
SoundMixer.stopAll();
build_mc.loading.info.text = battleLoaded;
} else {
if ((((toBeRemoved.length == 0)) && ((buildingMap == false)))){
if (creatingNEWone == false){
switchThePlayers();
};
};
};
};
}
public function meduzas_sound():void{
var _local1:meduzas;
var _local2:*;
var _local3:SoundTransform;
_local1 = new meduzas();
_local2 = _local1.play(0);
_local3 = _local2.soundTransform;
_local3.volume = 0.3;
_local2.soundTransform = _local3;
}
public function removeEffect(_arg1:MovieClip):void{
holder.removeChild(_arg1);
}
public function destroyFlame(_arg1:MovieClip):void{
if (player == "1"){
monsterLife.text = (parseInt(monsterLife.text) - 15).toString();
setScore();
} else {
heroLife.text = (parseInt(heroLife.text) - 15).toString();
};
switchThePlayers();
removeChild(_arg1);
}
public function explosion_sound():void{
var _local1:explosion;
var _local2:*;
var _local3:SoundTransform;
if ((((buildingMap == false)) && ((creatingNEWone == false)))){
_local1 = new explosion();
_local2 = _local1.play();
_local3 = _local2.soundTransform;
_local3.volume = 0.1;
_local2.soundTransform = _local3;
};
}
public function play_dark_rain():void{
var _local1:dark_rain_sound;
var _local2:*;
var _local3:SoundTransform;
_local1 = new dark_rain_sound();
_local2 = _local1.play(0);
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
}
public function startGame(){
build_mc.btn_start.visible = false;
SoundMixer.stopAll();
found_sound();
setupMagics();
player1.gotoAndStop(1);
player2.gotoAndStop(2);
click1 = 0;
click2 = 0;
hero.gotoAndStop(1);
monster.gotoAndStop(1);
build_mc.stop();
Tweener.addTween(build_mc, {y:-414, time:2, transition:"linear", onComplete:play_bc_music});
score.text = "";
time_limit.text = "";
if (challenge == false){
monsterLife.text = this[("monster_" + monster_chosen)].life;
heroLife.text = life.toString();
} else {
monsterLife.text = this[("monster_" + level)].life;
heroLife.text = monsterLife.text;
if (mastery_mode == true){
heroLife.text = "100";
};
if (time_challenge == true){
monsterLife.text = "10000";
score_count = 0;
score.text = ("score: " + String(score_count));
startTimer();
};
};
buildingMap = false;
disableSpells();
}
public function loadFinished(_arg1:Event):void{
MindJoltAPI = _arg1.currentTarget.content;
if (MindJoltAPI != null){
MindJoltAPI.service.connect(postMindJoltAPIConnect);
trace("[MindJoltAPI] service successfully loaded");
} else {
trace("[MindJoltAPI] failed to load");
};
}
public function checkMagicAvailability():void{
var _local1:*;
_local1 = 1;
while (_local1 <= magicCount) {
this[("monsterMagic" + _local1)] = false;
this[("monster_magic" + _local1)].alpha = 0.4;
_local1++;
};
if (((monster_magic1.visible) && ((parseInt(meter_monster_txt_5.text) >= 15)))){
monsterMagic1 = true;
monster_magic1.alpha = 1;
};
if (((((monster_magic2.visible) && ((parseInt(meter_monster_txt_2.text) >= 7)))) && ((parseInt(meter_monster_txt_4.text) >= 20)))){
monsterMagic2 = true;
monster_magic2.alpha = 1;
};
if (((monster_magic3.visible) && ((parseInt(meter_monster_txt_5.text) >= 20)))){
monsterMagic3 = true;
monster_magic3.alpha = 1;
};
if (((((((((monster_magic4.visible) && ((parseInt(meter_monster_txt_3.text) >= 10)))) && ((parseInt(meter_monster_txt_4.text) >= 20)))) && ((parseInt(meter_monster_txt_5.text) >= 7)))) && ((poisonMonster == false)))){
monsterMagic4 = true;
monster_magic4.alpha = 1;
};
if (((((monster_magic5.visible) && ((parseInt(meter_monster_txt_2.text) >= 10)))) && ((parseInt(meter_monster_txt_5.text) >= 10)))){
monsterMagic5 = true;
monster_magic5.alpha = 1;
};
if (((monster_magic6.visible) && ((parseInt(meter_monster_txt_4.text) >= 30)))){
monsterMagic6 = true;
monster_magic6.alpha = 1;
};
if (((((((monster_magic7.visible) && ((parseInt(meter_monster_txt_3.text) >= 12)))) && ((parseInt(meter_monster_txt_4.text) >= 8)))) && ((parseInt(meter_monster_txt_5.text) >= 20)))){
monsterMagic7 = true;
monster_magic7.alpha = 1;
};
if (((((((monster_magic8.visible) && ((parseInt(meter_monster_txt_2.text) >= 40)))) && ((parseInt(meter_monster_txt_3.text) >= 20)))) && ((parseInt(meter_monster_txt_4.text) >= 20)))){
monsterMagic8 = true;
monster_magic8.alpha = 1;
};
if (((monster_magic9.visible) && ((parseInt(meter_monster_txt_4.text) >= 50)))){
monsterMagic9 = true;
monster_magic9.alpha = 1;
};
if (((((monster_magic10.visible) && ((parseInt(meter_monster_txt_4.text) >= 20)))) && ((parseInt(meter_monster_txt_5.text) >= 40)))){
monsterMagic10 = true;
monster_magic10.alpha = 1;
};
}
public function setMySpells():void{
var _local1:*;
if (challenge == false){
_local1 = 1;
while (_local1 <= magicCount) {
if (this[("haveMagic" + _local1)].have == 100){
this[("magic" + _local1)].visible = true;
} else {
if (testing){
} else {
this[("magic" + _local1)].visible = false;
};
};
_local1++;
};
} else {
_local1 = 1;
while (_local1 <= magicCount) {
if ((((this[("monster_magic" + _local1)].visible == true)) && ((mastery_mode == false)))){
this[("magic" + _local1)].visible = true;
} else {
this[("magic" + _local1)].visible = false;
};
if (time_challenge == true){
this[("magic" + _local1)].visible = true;
};
_local1++;
};
if (mastery_mode == true){
this[("magic" + 6)].visible = true;
};
};
}
public function directAttack():void{
var _local1:Timer;
dontAllowPlaying();
if (player == "1"){
hero.gotoAndPlay(2);
} else {
monster.gotoAndPlay(2);
decreaseMagic(0, 0, 30, 0, "meter_monster");
};
_local1 = new Timer(200, 1);
_local1.addEventListener("timer", showDirectAttack);
_local1.start();
}
public function decreaseMagic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String):void{
var _local6:*;
this[((_arg5 + "_txt_") + 2)].text = (parseInt(this[((_arg5 + "_txt_") + 2)].text) - _arg1);
this[((_arg5 + "_") + 2)].maskmc.scaleX = (this[((_arg5 + "_txt_") + 2)].text / 50);
this[((_arg5 + "_txt_") + 3)].text = (parseInt(this[((_arg5 + "_txt_") + 3)].text) - _arg2);
this[((_arg5 + "_") + 3)].maskmc.scaleX = (this[((_arg5 + "_txt_") + 3)].text / 50);
this[((_arg5 + "_txt_") + 4)].text = (parseInt(this[((_arg5 + "_txt_") + 4)].text) - _arg3);
this[((_arg5 + "_") + 4)].maskmc.scaleX = (this[((_arg5 + "_txt_") + 4)].text / 50);
this[((_arg5 + "_txt_") + 5)].text = (parseInt(this[((_arg5 + "_txt_") + 5)].text) - _arg4);
this[((_arg5 + "_") + 5)].maskmc.scaleX = (this[((_arg5 + "_txt_") + 5)].text / 50);
_local6 = 2;
while (_local6 <= 5) {
if (this[((_arg5 + "_") + _local6)].maskmc.scaleX <= 0){
this[((_arg5 + "_") + _local6)].maskmc.scaleX = 0;
};
_local6++;
};
_local6 = 2;
while (_local6 <= 5) {
if (this[((_arg5 + "_txt_") + _local6)].text <= 0){
this[((_arg5 + "_txt_") + _local6)].text = 0;
};
_local6++;
};
}
public function setInfoAboutMonster():void{
if (challenge == false){
build_mc.tf_name.text = this[("monster_" + monster_chosen)].name;
build_mc.tf_life.text = this[("monster_" + monster_chosen)].life;
build_mc.tf_desc.text = this[("monster_" + monster_chosen)].desc;
build_mc.chars.gotoAndStop(this[("monster_" + monster_chosen)].type);
build_mc["haveBlue"].text = this[("monster_" + monster_chosen)].haveBlue;
build_mc["haveGreen"].text = this[("monster_" + monster_chosen)].haveGreen;
build_mc["haveOrange"].text = this[("monster_" + monster_chosen)].haveOrange;
build_mc["haveWhite"].text = this[("monster_" + monster_chosen)].haveWhite;
} else {
build_mc.tf_name.text = this[("monster_" + level)].name;
build_mc.tf_life.text = this[("monster_" + level)].life;
build_mc.tf_desc.text = this[("monster_" + level)].desc;
build_mc.chars.gotoAndStop(this[("monster_" + level)].type);
build_mc["haveBlue"].text = 0;
build_mc["haveGreen"].text = 0;
build_mc["haveOrange"].text = 0;
build_mc["haveWhite"].text = 0;
if (time_challenge == true){
build_mc.tf_life.text = "-";
};
};
}
public function click_sound():void{
var _local1:clicks;
var _local2:*;
var _local3:SoundTransform;
_local1 = new clicks();
_local2 = _local1.play();
_local3 = _local2.soundTransform;
_local3.volume = 0.5;
_local2.soundTransform = _local3;
}
public function setTheNames():void{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:*;
row0 = new Array();
row1 = new Array();
row2 = new Array();
row3 = new Array();
row4 = new Array();
row5 = new Array();
row6 = new Array();
row7 = new Array();
row8 = new Array();
row9 = new Array();
row10 = new Array();
gameMap = new Array();
_local1 = 0;
_local2 = 0;
while (_local2 < 10) {
_local4 = 0;
while (_local4 < 10) {
_local3 = 0;
while (_local3 < holder.numChildren) {
if ((((holder.getChildAt(_local3).x == (_local4 * 32))) && ((holder.getChildAt(_local3).y == (_local2 * 32))))){
this[("row" + _local2)].push(MovieClip(holder.getChildAt(_local3)));
};
_local3++;
};
_local4++;
};
gameMap.push(this[("row" + _local2)]);
_local2++;
};
_local3 = 0;
while (_local3 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
gameMap[_local3][_local2].name = ((("t_" + _local3) + "_") + _local2);
_local2++;
};
_local3++;
};
}
public function sendToDB():void{
var _local1:Number;
_local1 = (((totalGames - lostGames) / totalGames) * 100);
if (monsters_beaten.length == 5){
};
if (monsters_beaten.length == 10){
};
if (monsters_beaten.length == 30){
};
if (monsters_beaten.length == 50){
};
}
public function sendScore(_arg1:MouseEvent):void{
if (MovieClip(root).mastery_mode == true){
MovieClip(root).sendMastery();
trace("1");
} else {
if (MovieClip(root).survival_mode == true){
MovieClip(root).sendSurvival();
trace("2");
} else {
if (MovieClip(root).time_challenge == true){
MovieClip(root).sendMax();
trace("3");
};
};
};
}
public function changingFinished(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:MovieClip, _arg5:Number, _arg6:Number):void{
howManyIChanged++;
if (howManyIChanged == 2){
setTheNames();
checkPoints();
};
illegalMoveCount = 0;
if ((((toBeRemoved.length == 0)) && ((howManyIChanged == 2)))){
wrong_move();
illegal.gotoAndPlay(2);
heroLife.text = (parseInt(heroLife.text) - 2).toString();
checkLife();
Tweener.addTween(_arg1, {x:_arg2, y:_arg3, time:0.5, onComplete:allowComp});
Tweener.addTween(_arg4, {x:_arg5, y:_arg6, time:0.5, onComplete:allowComp});
setTheNames();
};
}
public function moveDown():void{
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
if (gameMap[_local1][_local2].count != undefined){
Tweener.addTween(gameMap[_local1][_local2], {y:(gameMap[_local1][_local2].y + (gameMap[_local1][_local2].count * 32)), time:0.6});
gameMap[_local1][_local2].count = 0;
};
_local2++;
};
_local1++;
};
deleteX();
}
public function monster_scream():void{
var _local1:monsterScream;
var _local2:*;
var _local3:SoundTransform;
if (buildingMap == false){
_local1 = new monsterScream();
_local2 = _local1.play(200);
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
};
}
public function finalyRemove(_arg1:TimerEvent):void{
setMonsters();
}
public function clickOption(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
if (_arg1.target.enabled){
if (_arg1.target.name == "btn_start"){
play_map_music();
removeChild(introMc);
level = 1;
totalGames = 0;
lostGames = 0;
life = 80;
haveMagic1.have = 100;
haveMagic2.have = 0;
haveMagic3.have = 0;
haveMagic4.have = 0;
haveMagic5.have = 0;
haveMagic6.have = 0;
haveMagic7.have = 0;
haveMagic8.have = 0;
haveMagic9.have = 0;
haveMagic10.have = 0;
monsters_beaten = new Array();
challenge = false;
mastery_mode = false;
time_challenge = false;
survival_mode = false;
shield = false;
haveOrange = 0;
haveBlue = 0;
haveGreen = 0;
haveWhite = 0;
setMonsters();
efekt.gotoAndPlay(2);
setMapka();
} else {
if (_arg1.target.name == "btn_how"){
Tweener.addTween(introMc.how_mc, {y:0, time:2});
switch_sound();
} else {
if (_arg1.target.name == "btn_load"){
loadGame();
} else {
if (_arg1.target.name == "btn_fairPlay"){
introMc.challenges.alpha = 0;
introMc.challenges.gotoAndStop(2);
Tweener.addTween(introMc.challenges, {alpha:1, time:1});
} else {
if (_arg1.target.name == "btn_score"){
introMc.highscores.alpha = 0;
introMc.highscores.gotoAndStop(2);
Tweener.addTween(introMc.highscores, {alpha:1, time:1});
} else {
if (_arg1.target.name == "btn_prequel"){
_local2 = "http://www.littlebigplay.com/game/296";
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
};
};
};
};
};
};
};
}
public function setInfo(_arg1:String):void{
infoBox.text = _arg1;
}
public function extra_sound():void{
var _local1:extra;
var _local2:*;
var _local3:SoundTransform;
if ((((buildingMap == false)) && ((creatingNEWone == false)))){
if (extra_mc.currentFrame == 1){
extra_mc.gotoAndPlay(2);
_local1 = new extra();
_local2 = _local1.play(300);
_local3 = _local2.soundTransform;
_local3.volume = 0.4;
_local2.soundTransform = _local3;
};
};
}
public function book_sound():void{
var _local1:book;
var _local2:*;
var _local3:SoundTransform;
_local1 = new book();
_local2 = _local1.play(500);
_local3 = _local2.soundTransform;
_local3.volume = 0.3;
_local2.soundTransform = _local3;
}
public function checkLife():void{
var _local1:Timer;
if (gameOver == false){
if (parseInt(heroLife.text) <= 0){
if (challenge == false){
addChild(mc_next_level);
mc_next_level.gotoAndStop("lost");
lostGames++;
};
gameOver = true;
deleteAll();
setLost();
};
if ((((parseInt(monsterLife.text) <= 0)) && ((buildingMap == false)))){
if (challenge == false){
if (monsters_beaten.length == 79){
gameOver = true;
deleteAll();
SoundMixer.stopAll();
konec_mc = new konec();
addChild(mc_next_level);
mc_next_level.gotoAndStop("win");
addChild(konec_mc);
mc_next_level.btn_continue.visible = false;
mc_next_level.btn_last_exit.addEventListener(MouseEvent.CLICK, exit);
mc_next_level.btn_last_exit.buttonMode = true;
mc_next_level.btn_last_exit.visible = true;
mc_next_level.btn_submitFinal.addEventListener(MouseEvent.CLICK, sendFinal);
mc_next_level.btn_submitFinal.buttonMode = true;
mc_next_level.btn_submitFinal.visible = true;
if (mochiConnected == false){
mc_next_level.btn_submitFinal.visible = false;
mc_next_level.btn_submitFinal.enabled = false;
};
mapka[("monst" + monster_chosen)].filters = [];
heroMc.filters = [];
Tweener.removeAllTweens();
mc_next_level.status.totalGames.text = totalGames;
mc_next_level.status.wonGames.text = (totalGames - lostGames);
mc_next_level.status.lostGames.text = lostGames;
mc_next_level.status.percentage.text = (Math.floor((((totalGames - lostGames) / totalGames) * 100)) + "%");
ratio_txt.text = mc_next_level.status.percentage.text.split("%").join("");
mc_next_level.status.award.htmlText = "Congratulations! You have killed Mordeson!!!";
} else {
addChild(mc_next_level);
mc_next_level.gotoAndStop("win");
setAwards();
gameOver = true;
deleteAll();
};
} else {
gameOver = true;
challengeWon_mc.gotoAndPlay(2);
_local1 = new Timer(1000, 1);
_local1.addEventListener("timer", nextBattleSurvival);
_local1.start();
};
};
};
}
public function showSnake(_arg1:TimerEvent):void{
var _local2:MovieClip;
do_snake_sound();
_local2 = new snakeMc();
addChild(_local2);
_local2.scaleX = 1.5;
_local2.scaleY = 1.5;
if (player == "1"){
_local2.scaleX = -1;
_local2.x = (this["hero"].x + 120);
_local2.y = (this["hero"].y + 30);
Tweener.addTween(_local2, {x:(this["monster"].x - 50), time:1, onComplete:destroySnake, onCompleteParams:[_local2], transition:"linear"});
} else {
_local2.scaleX = 1;
_local2.x = (this["monster"].x - 50);
_local2.y = (this["monster"].y + 30);
Tweener.addTween(_local2, {x:(this["hero"].x + 70), time:1, onComplete:destroySnake, onCompleteParams:[_local2], transition:"linear"});
};
}
public function switch_sound():void{
var _local1:switchs;
_local1 = new switchs();
_local1.play(200);
}
public function do_devil_sound():void{
var _local1:devil_laugh;
var _local2:*;
var _local3:SoundTransform;
_local1 = new devil_laugh();
_local2 = _local1.play(0);
_local3 = _local2.soundTransform;
_local3.volume = 0.5;
_local2.soundTransform = _local3;
}
public function checkAfterMagic(_arg1:TimerEvent):void{
setTheNames();
checkPoints();
if (howManyRemoved == 0){
switchThePlayers();
};
}
public function showHighScores_mastery():void{
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"a2b9a8bde2b9fa62", res:"400x400"});
}
function frame2(){
stop();
mochiConnected = true;
story = "It has been 10 years since Lucius of the Northern wastes, the son of the Dark Lord Mortus, was defeated. With the legions of foul creatures all but wiped out, Lord Mortus lay dormant. But as peace was slowly returning to the land of Haradan, another evil began to stir. Lucius has a twin brother, Mordeson, who was banished to the Southern wastes over 40 years ago by Lord Mortus. With the armies of Lucius dead, Mordeson has seen his chance to take revenge on his father by marching north with a new Dark Legion, and taking his fathers land for his own. But as the peaceful lands of Haradan lie between, Mordeson will wipe out all in his path on his march north. You have no choice but to try and stop Mordeson, as even if he defeated his farther Lord Mortus, Mordeson would become a new and stronger Dark Lord.";
desc1 = "A long time ago, Corps were peaceful and harmless creatures that lived on the Southern borderlands. But as Mordeson gained power in the south, he gave these creatures the power to rule storms and turned them to his own will. Now they are part of Mordeson's legion.";
desc2 = "Giant rats are the 'hounds' of Mordeson's army. Trained by unknown methods, they do his bidding. With enough mana power, they can cause massive damage by destroying every skull in play. ";
desc3 = "When he was banished, Mordeson stole many of his fathers secrets. Among them, the power to raise the dead as skeletal warriors. They have the power of the Death Shield, when attacked they deal back 1 damage. They can also turn all green gems in play to skulls.";
desc4 = "Vampire, fast and deadly. They have gained the power to heal themselves and can steal your mana.";
desc5 = "A scorpions sting will render your healing magic useless. They can also heal themselves and destroy all skulls in play.";
desc6 = "Hagogs, barbarian type savages of the frozen wastes, are masters in throwing the axe and deal 15 points of damage. Due to their short life span of 30 years, Mordeson game them the ability to heal.";
desc7 = "From the result of experimenting with monsters, Mordeson mutated a Hagog and created a four-armed creature called Eloctopus. These are Mordesons strongest monsters. They can destroy all skulls and axes and have the best battle defence skills. They can also freeze axes, so you can't use them. ";
desc8 = "Pendragon, the evil Magician lord is responsible for giving Mordesons army their spells. He owns the dark Book of Magic that gives him the power to gain magic from any gem. ";
desc9 = "Mordeson, twin brother of Lucius, banished to the Southern wastes for plotting against his father Mortus. You can have him before he could finish creating his Dark Legion and march on the world. Defeat him and destroy his evil once and for all. ";
death1 = "Corp killed you.";
death2 = "Giant rat killed you.";
death3 = "Skeleton killed you.";
death4 = "Vampire killed you.";
death5 = "Scorpion killed you.";
death6 = "Hagog killed you.";
death7 = "Eloctopus killed you.";
death8 = "Pendragon killed you.";
death9 = "Dark Mordeson killed you.";
typ = 1;
monster_1 = new Array(["1", 0]);
this[("monster_" + typ)].life = 50;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 2;
monster_2 = new Array(["1", 0]);
this[("monster_" + typ)].life = 50;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 3;
monster_3 = new Array(["2", 25], ["3", 0]);
this[("monster_" + typ)].life = 60;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 3;
this[("monster_" + typ)].haveGreen = 3;
this[("monster_" + typ)].haveOrange = 3;
this[("monster_" + typ)].haveWhite = 3;
this[("monster_" + typ)].beaten = death2;
typ = 4;
monster_4 = new Array(["1", 0]);
this[("monster_" + typ)].life = 50;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 5;
monster_5 = new Array(["1", 0]);
this[("monster_" + typ)].life = 60;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 6;
monster_6 = new Array(["2", 25], ["3", 0]);
this[("monster_" + typ)].life = 70;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 5;
this[("monster_" + typ)].haveOrange = 5;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 7;
monster_7 = new Array(["1", 0]);
this[("monster_" + typ)].life = 70;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 8;
monster_8 = new Array(["1", 0]);
this[("monster_" + typ)].life = 70;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 9;
monster_9 = new Array(["3", 15], ["2", 0]);
this[("monster_" + typ)].life = 70;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 10;
monster_10 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 11;
monster_11 = new Array(["6", 25], ["4", 0]);
this[("monster_" + typ)].life = 100;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 12;
monster_12 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 13;
monster_13 = new Array(["8", 20], ["10", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 105;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "haveGreen";
this[("monster_" + typ)].haveExtraToGive = 10;
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 10;
this[("monster_" + typ)].beaten = death8;
typ = 14;
monster_14 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 15;
monster_15 = new Array(["2", 50], ["3", 0]);
this[("monster_" + typ)].life = 70;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 6;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 6;
this[("monster_" + typ)].beaten = death2;
typ = 16;
monster_16 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 100;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 4;
this[("monster_" + typ)].haveGreen = 4;
this[("monster_" + typ)].haveOrange = 4;
this[("monster_" + typ)].haveWhite = 4;
this[("monster_" + typ)].beaten = death2;
typ = 17;
monster_17 = new Array(["7", 25], ["6", 0]);
this[("monster_" + typ)].life = 100;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 18;
monster_18 = new Array(["1", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 19;
monster_19 = new Array(["6", 0], ["4", 0]);
this[("monster_" + typ)].life = 110;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 20;
monster_20 = new Array(["3", 25], ["2", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 6;
this[("monster_" + typ)].haveGreen = 6;
this[("monster_" + typ)].haveOrange = 6;
this[("monster_" + typ)].haveWhite = 6;
this[("monster_" + typ)].beaten = death2;
typ = 21;
monster_21 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 4;
this[("monster_" + typ)].haveGreen = 8;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 22;
monster_22 = new Array(["1", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 23;
monster_23 = new Array(["6", 15], ["7", 0]);
this[("monster_" + typ)].life = 100;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 24;
monster_24 = new Array(["7", 15], ["6", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 25;
monster_25 = new Array(["3", 40], ["4", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 115;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 20;
this[("monster_" + typ)].beaten = death4;
typ = 26;
monster_26 = new Array(["4", 25], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 115;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 27;
monster_27 = new Array(["8", 0], ["4", 0], ["2", 0]);
this[("monster_" + typ)].life = 105;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 3;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death5;
typ = 28;
monster_28 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 29;
monster_29 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 100;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 30;
monster_30 = new Array(["3", 20], ["2", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 8;
this[("monster_" + typ)].haveGreen = 8;
this[("monster_" + typ)].haveOrange = 8;
this[("monster_" + typ)].haveWhite = 8;
this[("monster_" + typ)].beaten = death2;
typ = 31;
monster_31 = new Array(["4", 50], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 115;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 6;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 20;
this[("monster_" + typ)].beaten = death4;
typ = 32;
monster_32 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 33;
monster_33 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 34;
monster_34 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 115;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 35;
monster_35 = new Array(["4", 25], ["8", 0], ["2", 0]);
this[("monster_" + typ)].life = 105;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 8;
this[("monster_" + typ)].haveGreen = 8;
this[("monster_" + typ)].haveOrange = 8;
this[("monster_" + typ)].haveWhite = 8;
this[("monster_" + typ)].beaten = death5;
typ = 36;
monster_36 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 37;
monster_37 = new Array(["8", 40], ["4", 0], ["2", 0]);
this[("monster_" + typ)].life = 105;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 20;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death5;
typ = 38;
monster_38 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 115;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 4;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 16;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 39;
monster_39 = new Array(["1", 0]);
this[("monster_" + typ)].life = 80;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 40;
monster_40 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 135;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 16;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 41;
monster_41 = new Array(["10", 25], ["8", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 130;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "haveOrange";
this[("monster_" + typ)].haveExtraToGive = 10;
this[("monster_" + typ)].haveBlue = 15;
this[("monster_" + typ)].haveGreen = 15;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 15;
this[("monster_" + typ)].beaten = death8;
typ = 42;
monster_42 = new Array(["8", 0], ["4", 0], ["2", 0]);
this[("monster_" + typ)].life = 150;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 4;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 8;
this[("monster_" + typ)].haveOrange = 8;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death5;
typ = 43;
monster_43 = new Array(["6", 10], ["7", 0]);
this[("monster_" + typ)].life = 155;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 44;
monster_44 = new Array(["1", 0]);
this[("monster_" + typ)].life = 90;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 45;
monster_45 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 165;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 46;
monster_46 = new Array(["7", 25], ["6", 0]);
this[("monster_" + typ)].life = 160;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 20;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 47;
monster_47 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 8;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 48;
monster_48 = new Array(["10", 50], ["8", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 165;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "haveWhite";
this[("monster_" + typ)].haveExtraToGive = 8;
this[("monster_" + typ)].haveBlue = 18;
this[("monster_" + typ)].haveGreen = 18;
this[("monster_" + typ)].haveOrange = 18;
this[("monster_" + typ)].haveWhite = 18;
this[("monster_" + typ)].beaten = death8;
typ = 49;
monster_49 = new Array(["6", 50], ["4", 0]);
this[("monster_" + typ)].life = 170;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 20;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 50;
monster_50 = new Array(["1", 0]);
this[("monster_" + typ)].life = 95;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 51;
monster_51 = new Array(["2", 0], ["3", 0]);
this[("monster_" + typ)].life = 175;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 20;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death2;
typ = 52;
monster_52 = new Array(["8", 40], ["4", 0], ["2", 0]);
this[("monster_" + typ)].life = 145;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death5;
typ = 53;
monster_53 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 180;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 4;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 5;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 54;
monster_54 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 150;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 3;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 55;
monster_55 = new Array(["6", 0], ["4", 0]);
this[("monster_" + typ)].life = 165;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 56;
monster_56 = new Array(["5", 50], ["4", 0], ["6", 0], ["9", 0], ["2", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc7;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Eloctopus";
this[("monster_" + typ)].type = 7;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death7;
typ = 57;
monster_57 = new Array(["8", 0], ["10", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 160;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].gives_shield = 1;
this[("monster_" + typ)].haveExtra = "haveBlue";
this[("monster_" + typ)].haveExtraToGive = 12;
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 15;
this[("monster_" + typ)].haveOrange = 30;
this[("monster_" + typ)].haveWhite = 15;
this[("monster_" + typ)].beaten = death8;
typ = 58;
monster_58 = new Array(["9", 50], ["5", 0], ["4", 0], ["6", 0], ["2", 0]);
this[("monster_" + typ)].life = 180;
this[("monster_" + typ)].desc = desc7;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Eloctopus";
this[("monster_" + typ)].type = 7;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 15;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death7;
typ = 59;
monster_59 = new Array(["7", 35], ["6", 0]);
this[("monster_" + typ)].life = 160;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 60;
monster_60 = new Array(["5", 50], ["4", 0], ["6", 0], ["9", 0], ["2", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc7;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Eloctopus";
this[("monster_" + typ)].type = 7;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death7;
typ = 61;
monster_61 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 155;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death4;
typ = 62;
monster_62 = new Array(["1", 0]);
this[("monster_" + typ)].life = 120;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 63;
monster_63 = new Array(["8", 0], ["4", 0], ["2", 0]);
this[("monster_" + typ)].life = 175;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 3;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 14;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death5;
typ = 64;
monster_64 = new Array(["6", 0], ["4", 0]);
this[("monster_" + typ)].life = 185;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 14;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 65;
monster_65 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 3;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 66;
monster_66 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 170;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 4;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 10;
this[("monster_" + typ)].beaten = death4;
typ = 67;
monster_67 = new Array(["6", 0], ["4", 0]);
this[("monster_" + typ)].life = 180;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 5;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 15;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 68;
monster_68 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 15;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 69;
monster_69 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 3;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 10;
this[("monster_" + typ)].haveWhite = 10;
this[("monster_" + typ)].beaten = death3;
typ = 70;
monster_70 = new Array(["8", 0], ["10", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 200;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "haveOrange";
this[("monster_" + typ)].haveExtraToGive = 8;
this[("monster_" + typ)].haveBlue = 20;
this[("monster_" + typ)].haveGreen = 20;
this[("monster_" + typ)].haveOrange = 20;
this[("monster_" + typ)].haveWhite = 20;
this[("monster_" + typ)].beaten = death8;
typ = 71;
monster_71 = new Array(["9", 50], ["5", 0], ["4", 0], ["6", 0], ["2", 0]);
this[("monster_" + typ)].life = 205;
this[("monster_" + typ)].desc = desc7;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Eloctopus";
this[("monster_" + typ)].type = 7;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 25;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death7;
typ = 72;
monster_72 = new Array(["4", 0], ["3", 0], ["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 185;
this[("monster_" + typ)].desc = desc4;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Vampire";
this[("monster_" + typ)].type = 4;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 8;
this[("monster_" + typ)].haveGreen = 8;
this[("monster_" + typ)].haveOrange = 8;
this[("monster_" + typ)].haveWhite = 8;
this[("monster_" + typ)].beaten = death4;
typ = 73;
monster_73 = new Array(["6", 0], ["4", 0]);
this[("monster_" + typ)].life = 190;
this[("monster_" + typ)].desc = desc6;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Magog";
this[("monster_" + typ)].type = 6;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 25;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 25;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death6;
typ = 74;
monster_74 = new Array(["1", 0]);
this[("monster_" + typ)].life = 110;
this[("monster_" + typ)].desc = desc1;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Corp";
this[("monster_" + typ)].type = 1;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 0;
this[("monster_" + typ)].haveOrange = 0;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 75;
monster_75 = new Array(["7", 0], ["6", 0]);
this[("monster_" + typ)].life = 195;
this[("monster_" + typ)].desc = desc3;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 1;
this[("monster_" + typ)].name = "Skeleton";
this[("monster_" + typ)].type = 3;
this[("monster_" + typ)].shield = 1;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 0;
this[("monster_" + typ)].haveGreen = 10;
this[("monster_" + typ)].haveOrange = 20;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death3;
typ = 76;
monster_76 = new Array(["10", 25], ["8", 0], ["7", 0], ["4", 0], ["3", 0], ["9", 0]);
this[("monster_" + typ)].life = 210;
this[("monster_" + typ)].desc = desc8;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Pendragon";
this[("monster_" + typ)].type = 8;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "haveWhite";
this[("monster_" + typ)].haveExtraToGive = 8;
this[("monster_" + typ)].haveBlue = 20;
this[("monster_" + typ)].haveGreen = 20;
this[("monster_" + typ)].haveOrange = 30;
this[("monster_" + typ)].haveWhite = 20;
this[("monster_" + typ)].beaten = death8;
typ = 77;
monster_77 = new Array(["1", 0], ["2", 0]);
this[("monster_" + typ)].life = 180;
this[("monster_" + typ)].desc = desc2;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Giant Rat";
this[("monster_" + typ)].type = 2;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 10;
this[("monster_" + typ)].haveGreen = 6;
this[("monster_" + typ)].haveOrange = 6;
this[("monster_" + typ)].haveWhite = 0;
this[("monster_" + typ)].beaten = death1;
typ = 78;
monster_78 = new Array(["8", 0], ["4", 0], ["2", 0], ["1", 0]);
this[("monster_" + typ)].life = 200;
this[("monster_" + typ)].desc = desc5;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 4;
this[("monster_" + typ)].name = "Scorpion";
this[("monster_" + typ)].type = 5;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 15;
this[("monster_" + typ)].haveGreen = 15;
this[("monster_" + typ)].haveOrange = 15;
this[("monster_" + typ)].haveWhite = 15;
this[("monster_" + typ)].beaten = death5;
typ = 79;
monster_79 = new Array(["5", 0], ["4", 0], ["6", 0], ["9", 0], ["2", 0]);
this[("monster_" + typ)].life = 225;
this[("monster_" + typ)].desc = desc7;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 2;
this[("monster_" + typ)].name = "Eloctopus";
this[("monster_" + typ)].type = 7;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 18;
this[("monster_" + typ)].haveGreen = 18;
this[("monster_" + typ)].haveOrange = 25;
this[("monster_" + typ)].haveWhite = 10;
this[("monster_" + typ)].beaten = death7;
typ = 80;
monster_80 = new Array(["1", 0], ["2", 0], ["3", 0], ["4", 0], ["5", 0], ["6", 0], ["7", 0], ["8", 0], ["9", 0], ["10", 0]);
this[("monster_" + typ)].life = 270;
this[("monster_" + typ)].desc = desc9;
this[("monster_" + typ)].award = "";
this[("monster_" + typ)].life_to_give = 0;
this[("monster_" + typ)].name = "Dark Mordeson";
this[("monster_" + typ)].type = 9;
this[("monster_" + typ)].shield = 0;
this[("monster_" + typ)].haveExtra = "";
this[("monster_" + typ)].haveBlue = 30;
this[("monster_" + typ)].haveGreen = 30;
this[("monster_" + typ)].haveOrange = 30;
this[("monster_" + typ)].haveWhite = 30;
this[("monster_" + typ)].beaten = death9;
if (MindJoltAPI == null){
Security.allowDomain("static.mindjolt.com");
gameParams = LoaderInfo(root.loaderInfo).parameters;
urlLoader = new Loader();
urlLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadFinished);
urlLoader.load(new URLRequest(((gameParams.mjPath) || ("http://static.mindjolt.com/api/as3/api_as3_local.swf"))));
this.addChild(urlLoader);
};
_mochiads_game_id = "22083ebc07edfc68";
so = SharedObject.getLocal("darklegion4");
testing = false;
totalGames = 0;
lostGames = 0;
gameOver = false;
buildingMap = true;
meduzasMagic = "0";
extra_round = "0";
challenge = false;
mastery_mode = false;
time_challenge = false;
survival_mode = false;
magicCount = 10;
heart_sound = new hearth();
poisonHero = false;
poisonMonster = false;
haveMagic1 = new Object();
haveMagic1.have = 100;
haveMagic1.name = "Thunder Storm";
haveMagic2 = new Object();
haveMagic2.have = 0;
haveMagic2.name = "Skulls Dust";
haveMagic3 = new Object();
haveMagic3.have = 0;
haveMagic3.name = "Mana Thief";
haveMagic4 = new Object();
haveMagic4.have = 0;
haveMagic4.name = "Heal Me";
haveMagic5 = new Object();
haveMagic5.have = 0;
haveMagic5.name = "Frost";
haveMagic6 = new Object();
haveMagic6.have = 0;
haveMagic6.name = "Axe Throw";
haveMagic7 = new Object();
haveMagic7.have = 0;
haveMagic7.name = "Dark Rain";
haveMagic8 = new Object();
haveMagic8.have = 0;
haveMagic8.name = "Scorpions bite";
haveMagic9 = new Object();
haveMagic9.have = 0;
haveMagic9.name = "Evil Cry";
haveMagic10 = new Object();
haveMagic10.have = 0;
haveMagic10.name = "Book of Magic";
introMc = new Intro();
creatingNEWone = false;
addIntro();
kongregate = KongregateAPI.getInstance();
shield = false;
MonsterShield = false;
initButtons();
eff = true;
limit = 300;
mc_next_level = new nextLevel();
blur = new BlurFilter();
blur.blurX = 3;
blur.blurY = 3;
blur.quality = BitmapFilterQuality.MEDIUM;
glow = new GlowFilter();
glow.color = 0xFF9900;
glow.alpha = 1;
glow.blurX = 25;
glow.blurY = 25;
glow.quality = BitmapFilterQuality.MEDIUM;
btnHighlight = new GlowFilter();
btnHighlight.color = 0xFFFFFF;
btnHighlight.alpha = 1;
btnHighlight.blurX = 25;
btnHighlight.blurY = 25;
btnHighlight.quality = BitmapFilterQuality.MEDIUM;
monsterHighlight = new GlowFilter();
monsterHighlight.color = 0xFF0000;
monsterHighlight.alpha = 1;
monsterHighlight.blurX = 25;
monsterHighlight.blurY = 25;
monsterHighlight.quality = BitmapFilterQuality.MEDIUM;
glowBtn = new GlowFilter();
glowBtn.color = 0xFF9900;
glowBtn.alpha = 1;
glowBtn.blurX = 5;
glowBtn.blurY = 5;
glowBtn.quality = BitmapFilterQuality.MEDIUM;
checking = false;
toBeRemoved = new Array();
scale = 1;
readyToRemove = 0;
build_mc.btn_start.visible = false;
battleLoaded = "Battlefield ready!";
battleLoading = "Building battlefield!";
toBeCheckedAgain = 0;
score_count = 0;
illegalMoveCount = 0;
magic1.addEventListener(MouseEvent.CLICK, doMagic1);
magic1.buttonMode = true;
magic1.mouseChildren = false;
magic2.addEventListener(MouseEvent.CLICK, doMagic2);
magic2.buttonMode = true;
magic2.mouseChildren = false;
magic3.addEventListener(MouseEvent.CLICK, doMagic3);
magic3.buttonMode = true;
magic3.mouseChildren = false;
magic4.addEventListener(MouseEvent.CLICK, doMagic4);
magic4.buttonMode = true;
magic4.mouseChildren = false;
magic5.addEventListener(MouseEvent.CLICK, doMagic5);
magic5.buttonMode = true;
magic5.mouseChildren = false;
magic6.addEventListener(MouseEvent.CLICK, doMagic6);
magic6.buttonMode = true;
magic6.mouseChildren = false;
magic7.addEventListener(MouseEvent.CLICK, doMagic7);
magic7.buttonMode = true;
magic7.mouseChildren = false;
magic8.addEventListener(MouseEvent.CLICK, doMagic8);
magic8.buttonMode = true;
magic8.mouseChildren = false;
magic9.addEventListener(MouseEvent.CLICK, doMagic9);
magic9.buttonMode = true;
magic9.mouseChildren = false;
magic10.addEventListener(MouseEvent.CLICK, doMagic10);
magic10.buttonMode = true;
magic10.mouseChildren = false;
magic1.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic2.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic3.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic4.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic5.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic6.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic7.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic8.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic9.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic10.addEventListener(MouseEvent.ROLL_OVER, showInfo);
magic1.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic2.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic3.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic4.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic5.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic6.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic7.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic8.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic9.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
magic10.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic1.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic2.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic3.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic4.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic5.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic6.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic7.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic8.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic9.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic10.addEventListener(MouseEvent.ROLL_OVER, showInfo);
monster_magic1.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic2.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic3.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic4.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic5.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic6.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic7.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic8.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic9.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
monster_magic10.addEventListener(MouseEvent.ROLL_OUT, hideInfo);
amountStealed = 0;
j = 2;
while (j <= 10) {
j++;
};
help_mc.infoHelp.htmlText = "";
challenge_mc = new challengeMode();
haveOrange = 0;
haveBlue = 0;
haveGreen = 0;
haveWhite = 0;
audio = 1;
arrm = new Array();
setMapka();
totalMonsters = 80;
totalGroups = 40;
group1 = new Array("1", "2");
group2 = new Array("3");
group3 = new Array("4", "5");
group4 = new Array("6", "7", "8");
group5 = new Array("9", "10", "11");
group6 = new Array("12");
group7 = new Array("13", "14", "15");
group8 = new Array("16", "17", "18", "19");
group9 = new Array("20", "21", "22");
group10 = new Array("23", "24");
group11 = new Array("25", "26");
group12 = new Array("27", "28", "29");
group13 = new Array("30", "31", "32", "33");
group14 = new Array("34", "35");
group15 = new Array("36", "37", "38");
group16 = new Array("39", "40");
group17 = new Array("41");
group18 = new Array("42", "43");
group19 = new Array("44", "45");
group20 = new Array("46");
group21 = new Array("47");
group22 = new Array("48");
group23 = new Array("49");
group24 = new Array("50");
group25 = new Array("51");
group26 = new Array("52");
group27 = new Array("53");
group28 = new Array("54");
group29 = new Array("55");
group30 = new Array("56");
group31 = new Array("57");
group32 = new Array("58");
group33 = new Array("59", "60", "61", "62", "63");
group34 = new Array("64", "65");
group35 = new Array("66", "67");
group36 = new Array("68", "69");
group37 = new Array("70");
group38 = new Array("71");
group39 = new Array("72", "73", "74", "75", "76", "77", "78", "79");
group40 = new Array("80");
totalCountMap1 = 5;
totalCountMap2 = 15;
totalCountMap3 = 24;
totalCountMap4 = 35;
totalCountMap5 = 45;
totalCountMap6 = 56;
totalCountMap7 = 65;
totalCountMap8 = 71;
totalCountMap9 = 79;
i = 1;
while (i <= totalMonsters) {
mapka[("monst" + i)].addEventListener(MouseEvent.CLICK, chooseMonster);
mapka[("monst" + i)].buttonMode = true;
mapka[("monst" + i)].mouseChildren = false;
i++;
};
monster_chosen = 0;
monsters_beaten = new Array();
moving = false;
visible_arr = new Array();
mapkaNum = 1;
k = 1;
while (k <= 8) {
mapka[("exitMc" + k)].addEventListener(MouseEvent.CLICK, this[("goExit" + k)]);
mapka[("exitMc" + k)].buttonMode = true;
mapka[("exitMc" + k)].visible = false;
mapka[("exitMc" + k)].mouseChildren = false;
k++;
};
}
public function do_direct_sound():void{
var _local1:meduzas;
var _local2:*;
var _local3:SoundTransform;
_local1 = new meduzas();
_local2 = _local1.play(100);
_local3 = _local2.soundTransform;
_local3.volume = 0.3;
_local2.soundTransform = _local3;
}
public function setNewMapka():void{
setMapka();
}
public function setMapka():void{
var _local1:Number;
_local1 = 0;
if (monsters_beaten != null){
_local1 = monsters_beaten.length;
} else {
_local1 = null;
};
if (_local1 == 0){
mapka.help.text = "Choose and click the monster to start the battle!";
} else {
mapka.help.text = "";
};
if (_local1 == totalCountMap1){
mapka.exitMc1.visible = true;
};
if (_local1 == totalCountMap2){
mapka.exitMc2.visible = true;
};
if (_local1 == totalCountMap3){
mapka.exitMc3.visible = true;
};
if (_local1 == totalCountMap4){
mapka.exitMc4.visible = true;
};
if (_local1 == totalCountMap5){
mapka.exitMc5.visible = true;
};
if (_local1 == totalCountMap6){
mapka.exitMc6.visible = true;
};
if (_local1 == totalCountMap7){
mapka.exitMc7.visible = true;
};
if (_local1 == totalCountMap8){
mapka.exitMc8.visible = true;
};
if (mapkaNum == 1){
mapka.x = 0;
mapka.y = 0;
heroMc = mapka.heroMc1;
} else {
if (mapkaNum == 2){
mapka.x = -600;
mapka.y = 0;
heroMc = mapka.heroMc2;
} else {
if (mapkaNum == 3){
mapka.x = -1200;
mapka.y = 0;
heroMc = mapka.heroMc3;
} else {
if (mapkaNum == 4){
mapka.x = 0;
mapka.y = -400;
heroMc = mapka.heroMc4;
} else {
if (mapkaNum == 5){
mapka.x = -600;
mapka.y = -400;
heroMc = mapka.heroMc5;
} else {
if (mapkaNum == 6){
mapka.x = -1200;
mapka.y = -400;
heroMc = mapka.heroMc6;
} else {
if (mapkaNum == 7){
mapka.x = 0;
mapka.y = -800;
heroMc = mapka.heroMc7;
} else {
if (mapkaNum == 8){
mapka.x = -600;
mapka.y = -800;
heroMc = mapka.heroMc8;
} else {
if (mapkaNum == 9){
mapka.x = -1200;
mapka.y = -800;
heroMc = mapka.heroMc9;
};
};
};
};
};
};
};
};
};
}
public function checkExtraTurn():void{
if ((((player == "1")) && ((parseInt(meter_hero_txt_2.text) >= 25)))){
extra_round = "1";
extra_sound();
} else {
if ((((player == "2")) && ((parseInt(meter_monster_txt_2.text) >= 25)))){
extra_round = "2";
extra_sound();
} else {
extra_round = "0";
};
};
switchThePlayers();
}
public function postMindJoltAPIConnect(_arg1:Boolean){
trace("[MindJoltAPI] service successfully loaded");
}
public function setText(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String):void{
help_mc.infoHelp.htmlText = _arg5;
infoSet.txt1.text = _arg1;
infoSet.txt2.text = _arg2;
infoSet.txt3.text = _arg3;
infoSet.txt4.text = _arg4;
}
public function isBeaten(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:*;
_local3 = 0;
while (_local3 < monsters_beaten.length) {
trace(monsters_beaten[_local3]);
if (monsters_beaten[_local3] == _arg1){
_local2 = true;
break;
} else {
_local2 = false;
};
_local3++;
};
return (_local2);
}
public function resetFreeze():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
gameMap[_local1][_local2].gotoAndPlay("10");
_local2++;
};
_local1++;
};
}
public function doThunderEffect():void{
var _local1:MovieClip;
_local1 = new thunderEffect();
addChild(_local1);
_local1.x = 114;
_local1.y = 0;
}
public function contain(_arg1, _arg2){
var _local3:*;
var _local4:*;
_local3 = -1;
_local4 = 0;
while (_local4 < 100) {
if (_arg2[_local4] == _arg1){
_local3 = 1;
return (_local3);
};
_local4++;
};
}
public function decreaseIncrease(_arg1:String){
switch (_arg1){
case "1":
setLife(1);
break;
case "2":
setMagic(2);
break;
case "3":
setMagic(3);
break;
case "4":
setMagic(4);
break;
case "5":
setMagic(5);
break;
case "6":
setAllMagic();
break;
case "7":
setLife(7);
break;
};
}
public function hideInfo(_arg1:MouseEvent):void{
help_mc.infoHelp.htmlText = "";
infoSet.txt1.text = "xx";
infoSet.txt2.text = "xx";
infoSet.txt3.text = "xx";
infoSet.txt4.text = "xx";
}
public function disableSpells():void{
var _local1:uint;
_local1 = 1;
while (_local1 <= magicCount) {
if (testing == false){
this[("magic" + _local1)].enabled = false;
this[("magic" + _local1)].alpha = 0.4;
};
_local1++;
};
}
public function containCouples(_arg1, _arg2){
var _local3:*;
var _local4:*;
_local3 = -1;
_local4 = 0;
while (_local4 < _arg2.length) {
if (_arg2[_local4][0] == _arg1){
_local3 = 1;
return (_local3);
};
_local4++;
};
}
public function showInfo(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "magic1":
setText(0, 0, 0, 15, "Destroys collumn or row! Each gem destroyed = mana or damage!");
break;
case "monster_magic1":
setText(0, 0, 0, 15, "Destroys collumn or row! Each gem destroyed = mana or damage!");
break;
case "magic2":
setText(7, 0, 20, 0, "Destroys all skulls! Does 2 damage to enemy for each skull!");
break;
case "monster_magic2":
setText(7, 0, 20, 0, "Destroys all skulls! Does 2 damage to enemy for each skull!");
break;
case "magic3":
setText(0, 0, 0, 20, "Steals 8 points of each mana from enemy!");
break;
case "monster_magic3":
setText(0, 0, 0, 20, "Steals 8 points of each mana from enemy!");
break;
case "magic4":
setText(0, 10, 20, 7, "Gives 10 lifepoints! Turn does not end if blue mana >= 25.");
break;
case "monster_magic4":
setText(0, 10, 20, 7, "Gives 10 lifepoints! Turn does not end if blue mana >= 25.");
break;
case "magic5":
setText(10, 0, 0, 10, "Freezes all skulls and axes! Enemy can't usem them!");
break;
case "monster_magic5":
setText(10, 0, 0, 10, "Freezes all skulls and axes! Enemy can't usem them!");
break;
case "magic6":
setText(0, 0, 30, 0, "Does 15 damage to enemy!");
break;
case "monster_magic6":
setText(0, 0, 30, 0, "Does 15 damage to enemy!");
break;
case "magic7":
setText(0, 12, 8, 20, "Changes all green gems to skulls! Turn does not end if green mana>=30!");
break;
case "monster_magic7":
setText(0, 12, 8, 20, "Changes all green gems to skulls! Turn does not end if green mana>=30!");
break;
case "magic8":
setText(40, 20, 20, 0, "Poisons the enemy! Enemy can not use Healing magic!");
break;
case "monster_magic8":
setText(40, 20, 20, 0, "Poisons the enemy! Enemy can not use Healing magic!");
break;
case "magic9":
setText(0, 0, 50, 0, "Destroys all axes and skulls! Does 1 damage for axe and 2 for skull!");
break;
case "monster_magic9":
setText(0, 0, 50, 0, "Destroys all axes and skulls! Does 1 damage for axe and 2 for skull!");
break;
case "magic10":
setText(0, 0, 20, 40, "Destroys all magic gems! 2 mana points for each destroyed gem!");
break;
case "monster_magic10":
setText(0, 0, 20, 40, "Destroys all magic gems! 2 mana points for each destroyed gem!");
break;
};
}
public function hideInfo2(_arg1:MouseEvent):void{
infoMonster.visible = false;
}
public function destroyRandom(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:uint;
if (player == "2"){
decreaseMagic(0, 0, 0, 15, "meter_monster");
} else {
if (player == "1"){
decreaseMagic(0, 0, 0, 15, "meter_hero");
};
};
do_thunder_sound();
dontAllowPlaying();
readyToRemove = 0;
_local3 = 0;
_local4 = Math.ceil((Math.random() * 2));
_local5 = Math.ceil((Math.random() * (gameMap.length - 1)));
if (player == "1"){
_local4 = _arg2;
_local5 = (_arg1 - 1);
};
if (_local4 == 1){
_local6 = 0;
while (_local6 < gameMap.length) {
howManyRemoved++;
gameMap[_local6][_local5].name = "X";
gameMap[_local6][_local5].filters = [blur, glow];
Tweener.addTween(gameMap[_local6][_local5], {scaleX:1.5, scaleY:1.5, time:0.4, transition:"linear", onComplete:destroy});
_local6++;
};
} else {
if (_local4 == 2){
_local6 = 0;
while (_local6 < gameMap.length) {
trace(_local5, _local6);
howManyRemoved++;
gameMap[_local5][_local6].name = "X";
gameMap[_local5][_local6].filters = [blur, glow];
Tweener.addTween(gameMap[_local5][_local6], {scaleX:1.5, scaleY:1.5, time:0.4, transition:"linear", onComplete:destroy});
_local6++;
};
};
};
}
public function findRow(_arg1:MovieClip):Number{
return (Math.floor((_arg1.y / 32)));
}
public function destroySnake(_arg1:MovieClip):void{
if (player == "1"){
poisonMonster = true;
} else {
poisonHero = true;
};
switchThePlayers();
removeChild(_arg1);
}
public function clickMe(_arg1:MouseEvent):void{
if (player == "1"){
if ((((click1 == 1)) && ((_arg1.target == chosen1)))){
setInfo("dont click the same, asshole!");
click1 = 0;
click2 = 0;
_arg1.target.filters = [];
chosen1 = null;
chosen2 = null;
click_sound();
} else {
if ((((click2 == 0)) && ((click1 == 1)))){
chosen2 = (_arg1.target as MovieClip);
if ((((_arg1.target.parent.parent.type == 1)) && ((magicType == "freeze_2")))){
chosen2 = null;
} else {
click2 = 2;
click1 = 2;
_arg1.target.filters = [blur];
};
};
if ((((click1 == 0)) && ((click2 == 0)))){
chosen1 = (_arg1.target as MovieClip);
if ((((((_arg1.target.parent.type == 1)) || ((_arg1.target.parent.type == 7)))) && ((magicType == "freeze_2")))){
chosen1 = null;
} else {
click1 = 1;
_arg1.target.filters = [glow];
};
click_sound();
};
if ((((click1 == 2)) && ((click2 == 2)))){
chosen1.filters = [];
chosen2.filters = [];
checkThePair(chosen1, chosen2);
chosen1 = null;
chosen2 = null;
click_sound();
};
};
};
}
public function nextBattle():void{
var _local1:Timer;
if (challenge == false){
level++;
removeChild(mc_next_level);
setMapka();
play_map_music();
heroMc.gotoAndPlay(2);
mapka[("monst" + monster_chosen)].filters = [];
_local1 = new Timer(400, 1);
_local1.addEventListener("timer", destroyMonster);
_local1.start();
} else {
level = Math.ceil((Math.random() * 70));
initSettings();
};
}
public function initSettings():void{
var _local1:*;
var _local2:Number;
choose_mc.gotoAndStop(1);
extra_mc.gotoAndStop(1);
skullsShield.gotoAndStop(1);
setShield();
poisonMonster = false;
poisonHero = false;
if (challenge == true){
level = Math.ceil((Math.random() * 70));
};
build_mc.x = 0;
build_mc.y = 0;
setInfoAboutMonster();
build_mc.loading.info.text = battleLoading;
build_mc.play();
SoundMixer.stopAll();
playHeartSound();
gameOver = false;
_local1 = 1;
while (_local1 <= 9) {
this[("monster" + _local1)].visible = false;
trace(this[("monster" + _local1)].visible);
_local1++;
};
if (challenge == true){
_local2 = this[("monster_" + level)].type;
monster = this[("monster" + _local2)];
monster.visible = true;
monsterLife.text = this[("monster_" + level)].life;
monster_name.text = this[("monster_" + level)].name;
} else {
_local2 = this[("monster_" + monster_chosen)].type;
monster = this[("monster" + _local2)];
monster.visible = true;
monsterLife.text = this[("monster_" + monster_chosen)].life;
monster_name.text = this[("monster_" + monster_chosen)].name;
};
monstersLifeStart = parseInt(monsterLife.text);
hand_mc.y = 500;
deleteAll();
initVariables();
buildMap();
hero.gotoAndStop(1);
monster.gotoAndStop(1);
player1.gotoAndStop(2);
player2.gotoAndStop(2);
heroLife.text = life.toString();
setupMagics();
_local1 = 1;
while (_local1 <= magicCount) {
this[("monster_magic" + _local1)].visible = false;
this[("perc_mons" + _local1)].visible = true;
_local1++;
};
if (challenge == true){
_local1 = 0;
while (_local1 < this[("monster_" + level)].length) {
this[("monster_magic" + this[("monster_" + level)][_local1][0])].visible = true;
this[("monster_magic" + this[("monster_" + level)][_local1][0])].alpha = 0.4;
this[("perc_mons" + this[("monster_" + level)][_local1][0])].visible = false;
_local1++;
};
MonsterShield = false;
MonsterShield_mc.visible = false;
} else {
_local1 = 0;
while (_local1 < this[("monster_" + monster_chosen)].length) {
this[("monster_magic" + this[("monster_" + monster_chosen)][_local1][0])].visible = true;
this[("monster_magic" + this[("monster_" + monster_chosen)][_local1][0])].alpha = 0.4;
this[("perc_mons" + this[("monster_" + monster_chosen)][_local1][0])].visible = false;
_local1++;
};
if ((((this[("monster_" + monster_chosen)].shield == 1)) && ((challenge == false)))){
MonsterShield = true;
MonsterShield_mc.visible = true;
} else {
MonsterShield = false;
MonsterShield_mc.visible = false;
};
};
totalGames++;
award.htmlText = "";
if (challenge == false){
setInGameAwardsText();
} else {
if (time_challenge == false){
award.htmlText = (("<b>BATTLE " + totalGames) + "</B>");
};
};
info.visible = false;
infoMonster.visible = false;
setMySpells();
disableSpells();
setTF();
}
public function checkExtraTurnAfterDarkRain():void{
if ((((player == "1")) && ((parseInt(meter_hero_txt_3.text) >= 30)))){
extra_sound();
extra_round = "1";
} else {
if ((((player == "2")) && ((parseInt(meter_monster_txt_3.text) >= 30)))){
extra_sound();
extra_round = "2";
};
};
}
public function playerswitch_sound():void{
var _local1:playerswitch;
if ((((buildingMap == false)) && ((creatingNEWone == false)))){
_local1 = new playerswitch();
_local1.play(200);
};
}
public function do_thunder_sound():void{
var _local1:thunder;
var _local2:*;
var _local3:SoundTransform;
_local1 = new thunder();
_local2 = _local1.play(400);
_local3 = _local2.soundTransform;
_local3.volume = 0.3;
_local2.soundTransform = _local3;
doThunderEffect();
}
public function createNewArray():void{
var _local1:uint;
var _local2:uint;
creatingNEWone = true;
storm.y = 28;
storm.gotoAndPlay(2);
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
howManyRemoved++;
gameMap[_local1][_local2].name = "X";
gameMap[_local1][_local2].filters = [blur, glow];
Tweener.addTween(gameMap[_local1][_local2], {scaleX:0, scaleY:0, time:0.4, transition:"linear", onComplete:destroy});
_local2++;
};
_local1++;
};
}
public function removeTheMonster(_arg1):void{
mapka[("monst" + _arg1)].visible = false;
mapka[("monst" + _arg1)].enabled = false;
}
public function heal():void{
do_heal_sound();
if (player == "1"){
heroLife.text = (parseInt(heroLife.text) + 10).toString();
if (parseInt(heroLife.text) > life){
heroLife.text = life.toString();
};
} else {
decreaseMagic(0, 10, 20, 7, "meter_monster");
checkExtraTurn();
monsterLife.text = (parseInt(monsterLife.text) + 10).toString();
};
}
public function saveAfterLost():void{
saveGame();
}
public function freezeSkulls():void{
var _local1:uint;
var _local2:Timer;
var _local3:uint;
if (player == "2"){
decreaseMagic(10, 0, 0, 10, "meter_monster");
};
frozen_sound();
showEffect("freeze");
dontAllowPlaying();
countForMagic = 0;
_local1 = 0;
while (_local1 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if ((((gameMap[_local1][_local3].type == 1)) || ((gameMap[_local1][_local3].type == 7)))){
howManyRemoved++;
countForMagic++;
gameMap[_local1][_local3].gotoAndPlay("freeze");
if (player == "1"){
magicType = "freeze_1";
} else {
magicType = "freeze_2";
};
};
_local3++;
};
_local1++;
};
_local2 = new Timer(1000, 1);
_local2.addEventListener("timer", checkAfterMagic);
_local2.start();
}
public function play_map_music():void{
var _local1:map_music;
var _local2:*;
var _local3:SoundTransform;
SoundMixer.stopAll();
_local1 = new map_music();
_local2 = _local1.play(0, 999);
_local3 = _local2.soundTransform;
_local3.volume = 0.6;
_local2.soundTransform = _local3;
}
public function setTF():void{
var _local1:Number;
if (challenge == false){
level_txt.text = level.toString();
total_txt.text = totalGames.toString();
lost_txt.text = lostGames.toString();
_local1 = 1;
while (_local1 <= 10) {
if (this[("haveMagic" + _local1)].have != 100){
this[("mag" + _local1)].text = this[("haveMagic" + _local1)].have;
this[("perc" + _local1)].visible = true;
} else {
this[("mag" + _local1)].text = "";
this[("perc" + _local1)].visible = false;
};
_local1++;
};
} else {
level_txt.text = "";
total_txt.text = totalGames.toString();
_local1 = 1;
while (_local1 <= 10) {
this[("mag" + _local1)].text = "";
this[("perc" + _local1)].visible = false;
_local1++;
};
};
}
public function setShield():void{
if (shield == true){
shield_mc.visible = true;
} else {
shield_mc.visible = false;
};
}
public function findCollumn(_arg1:MovieClip):Number{
return (Math.floor((_arg1.x / 32)));
}
public function startChallenges():void{
level = Math.ceil((Math.random() * 70));
totalGames = 0;
lostGames = 0;
haveMagic1.have = 0;
haveMagic2.have = 0;
haveMagic3.have = 0;
haveMagic4.have = 0;
haveMagic5.have = 0;
haveMagic6.have = 0;
haveMagic7.have = 0;
haveMagic8.have = 0;
haveMagic9.have = 0;
haveMagic10.have = 0;
haveOrange = 0;
haveBlue = 0;
haveGreen = 0;
haveWhite = 0;
shield = 0;
removeChild(introMc);
challenge = true;
initSettings();
}
public function showNewMonsters(_arg1:Number):void{
var _local2:*;
_local2 = 0;
while (_local2 < this[("group" + _arg1)].length) {
mapka[("monst" + this[("group" + _arg1)][_local2])].visible = true;
mapka[("monst" + this[("group" + _arg1)][_local2])].enabled = true;
_local2++;
};
}
public function decideWhichToUse():void{
var _local1:Boolean;
var _local2:uint;
_local1 = false;
checkMagicAvailability();
if (_local1 == false){
_local2 = 0;
while (_local2 < enemyOptions.length) {
if (enemyOptions[_local2][3] != undefined){
if ((((((enemyOptions[_local2][1] == 1)) || ((enemyOptions[_local2][1] == 7)))) && ((magicType == "freeze_1")))){
} else {
_local1 = true;
enemyChangePos(enemyOptions[_local2][0], enemyOptions[_local2][2], enemyOptions[_local2][1]);
monster.gotoAndPlay(2);
break;
};
};
_local2++;
};
};
if (_local1 == false){
if (((monsterMagic6) && ((parseInt(heroLife.text) <= 15)))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic6.y, x:monster_magic6.x, time:2, onComplete:directAttack});
} else {
if (((((((monsterMagic9) && ((checkTypes(1) >= 4)))) && ((checkTypes(7) >= 4)))) && (!((magicType == "freeze_1"))))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic9.y, x:monster_magic9.x, time:2, onComplete:destroyAllSkullsAndAxes});
} else {
if (((((((monsterMagic2) && ((checkTypes(7) >= 0)))) && (!((magicType == "freeze_1"))))) && ((parseInt(heroLife.text) <= (checkTypes(7) * 2))))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic2.y, x:monster_magic2.x, time:2, onComplete:destroyAllSkulls});
} else {
if (((((monsterMagic10) && ((parseInt(meter_monster_txt_2.text) < 30)))) && ((parseInt(meter_monster_txt_3.text) < 30)))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic10.y, x:monster_magic10.x, time:2, onComplete:destroyAllMagic});
} else {
if (((monsterMagic8) && ((poisonHero == false)))){
poisonHero = true;
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic8.y, x:monster_magic8.x, time:2, onComplete:poison});
} else {
if (((((monsterMagic4) && ((parseInt(monsterLife.text) < (monstersLifeStart - 40))))) && ((poisonMonster == false)))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic4.y, x:monster_magic4.x, time:2, onComplete:heal});
} else {
if (((((((((((((monsterMagic5) && ((checkTypes(1) > 3)))) && ((checkTypes(7) > 4)))) && ((parseInt(monsterLife.text) < 30)))) && ((parseInt(heroLife.text) > 30)))) && (!((magicType == "freeze_1"))))) && ((magicType == "freeze_2")))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic5.y, x:monster_magic5.x, time:2, onComplete:freezeSkulls});
} else {
if (((((monsterMagic2) && ((checkTypes(7) >= 5)))) && (!((magicType == "freeze_1"))))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic2.y, x:monster_magic2.x, time:2, onComplete:destroyAllSkulls});
} else {
if (monsterMagic6){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic6.y, x:monster_magic6.x, time:2, onComplete:directAttack});
} else {
if (((monsterMagic7) && ((checkTypes(3) >= 15)))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic7.y, x:monster_magic7.x, time:2, onComplete:doDarkRain});
checkExtraTurnAfterDarkRain();
} else {
if (((((monsterMagic3) && ((parseInt(this[("meter_hero_txt_" + 4)].text) >= 10)))) && ((parseInt(this[("meter_monster_txt_" + 4)].text) < 10)))){
_local1 = true;
Tweener.addTween(hand_mc, {y:monster_magic3.y, x:monster_magic3.x, time:2, onComplete:stealMagic});
};
};
};
};
};
};
};
};
};
};
};
};
if (_local1 == false){
_local2 = 0;
while (_local2 < enemyOptions.length) {
if ((((((enemyOptions[_local2][1] == 1)) || ((enemyOptions[_local2][1] == 7)))) && (!((magicType == "freeze_1"))))){
_local1 = true;
enemyChangePos(enemyOptions[_local2][0], enemyOptions[_local2][2], enemyOptions[_local2][1]);
monster.gotoAndPlay(2);
break;
};
_local2++;
};
};
if (_local1 == false){
_local2 = 0;
while (_local2 < enemyOptions.length) {
if (((((!((enemyOptions[_local2][1] == 1))) && ((magicType == "freeze_1")))) && (!((enemyOptions[_local2][1] == 7))))){
_local1 = true;
enemyChangePos(enemyOptions[_local2][0], enemyOptions[_local2][2], enemyOptions[_local2][1]);
break;
};
_local2++;
};
};
if (_local1 == false){
_local2 = 0;
while (_local2 < enemyOptions.length) {
if (magicType != "freeze_1"){
_local1 = true;
enemyChangePos(enemyOptions[0][0], enemyOptions[0][2], enemyOptions[0][1]);
break;
};
_local2++;
};
};
if (_local1 == false){
if (monsterMagic1){
Tweener.addTween(hand_mc, {y:monster_magic1.y, x:monster_magic1.x, time:2, onComplete:destroyRandom(1, 1)});
_local1 = true;
} else {
createNewArray();
};
};
}
public function explode_monster():void{
var _local1:monster_explode;
var _local2:*;
var _local3:SoundTransform;
if ((((buildingMap == false)) && ((creatingNEWone == false)))){
_local1 = new monster_explode();
_local2 = _local1.play();
_local3 = _local2.soundTransform;
_local3.volume = 0.2;
_local2.soundTransform = _local3;
};
}
public function setLife(_arg1:Number):void{
var _local2:Number;
if (_arg1 == 1){
_local2 = 2;
} else {
if (_arg1 == 7){
_local2 = 3;
};
};
if (player == "2"){
heroLife.text = (parseInt(heroLife.text) - _local2).toString();
if ((((shield == true)) && ((_arg1 == 7)))){
monsterLife.text = (parseInt(monsterLife.text) - 1).toString();
skullsShield.gotoAndPlay("fromHero");
shield_mc.gotoAndPlay(2);
};
} else {
if (player == "1"){
monsterLife.text = (parseInt(monsterLife.text) - _local2).toString();
if ((((MonsterShield == true)) && ((_arg1 == 7)))){
heroLife.text = (parseInt(heroLife.text) - 1).toString();
skullsShield.gotoAndPlay("fromMonster");
MonsterShield_mc.gotoAndPlay(2);
};
if (time_challenge == true){
setScore();
};
};
};
checkLife();
}
public function checkExtraRound(){
var _local1:*;
_local1 = 0;
while (_local1 < (toBeRemoved.length - 3)) {
if ((((((toBeRemoved[_local1].type == toBeRemoved[(_local1 + 1)].type)) && ((toBeRemoved[_local1].type == toBeRemoved[(_local1 + 2)].type)))) && ((toBeRemoved[_local1].type == toBeRemoved[(_local1 + 3)].type)))){
if (creatingNEWone == false){
extra_sound();
};
if (player == "1"){
extra_round = "1";
} else {
if (player == "2"){
extra_round = "2";
};
};
};
_local1++;
};
}
public function destroyAllMagic():void{
var _local1:*;
var _local2:uint;
var _local3:uint;
if (player == "2"){
decreaseMagic(0, 0, 20, 40, "meter_monster");
};
book_sound();
dontAllowPlaying();
readyToRemove = 0;
_local1 = 0;
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if (((!((gameMap[_local2][_local3].type == 1))) && (!((gameMap[_local2][_local3].type == 7))))){
howManyRemoved++;
_local1++;
gameMap[_local2][_local3].name = "X";
gameMap[_local2][_local3].filters = [blur, glow];
Tweener.addTween(gameMap[_local2][_local3], {scaleX:1.5, scaleY:1.5, time:0.3, transition:"linear", onComplete:destroy});
};
_local3++;
};
_local2++;
};
if (_local1 == 0){
switchThePlayers();
};
}
public function frozen_sound():void{
var _local1:frozen;
var _local2:*;
var _local3:SoundTransform;
_local1 = new frozen();
_local2 = _local1.play(600);
_local3 = _local2.soundTransform;
_local3.volume = 0.05;
_local2.soundTransform = _local3;
}
public function setLost():void{
if (challenge == false){
SoundMixer.stopAll();
die_sound();
Tweener.removeAllTweens();
mc_next_level.status.award.htmlText = this[("monster_" + monster_chosen)].beaten;
mc_next_level.status.totalGames.text = totalGames;
mc_next_level.status.wonGames.text = (totalGames - lostGames);
mc_next_level.status.lostGames.text = lostGames;
mc_next_level.status.percentage.text = (Math.floor((((totalGames - lostGames) / totalGames) * 100)) + "%");
ratio_txt.text = mc_next_level.status.percentage.text.split("%").join("");
mc_next_level.status.totalLife.text = life;
} else {
SoundMixer.stopAll();
die_sound();
addChild(challenge_mc);
totalGames--;
if (totalGames == 1){
challenge_mc.totalGames.text = (("You have killed " + totalGames) + " monster!");
} else {
challenge_mc.totalGames.text = (("You have killed " + totalGames) + " monsters!");
};
if (time_challenge == true){
challenge_mc.totalGames.text = ("Your score: " + String(score_count));
};
challenge_mc.btn_last_exit.addEventListener(MouseEvent.CLICK, exit);
challenge_mc.btn_last_exit.buttonMode = true;
challenge_mc.btn_submit_score.addEventListener(MouseEvent.CLICK, sendScore);
challenge_mc.btn_submit_score.buttonMode = true;
};
}
public function onConnectError(_arg1:String):void{
mochiConnected = false;
}
public function goExit1(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc1.x, y:mapka.exitMc1.y, time:2, onComplete:setNewMapka});
}
public function goExit3(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc3.x, y:mapka.exitMc3.y, time:2, onComplete:setNewMapka});
}
public function sendFinal(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = parseInt(ratio_txt.text);
MindJoltAPI.service.submitScore(_local2, "final ratio");
trace(("send final" + _local2));
}
public function goExit5(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc5.x, y:mapka.exitMc5.y, time:2, onComplete:setNewMapka});
}
public function goExit6(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc6.x, y:mapka.exitMc6.y, time:2, onComplete:setNewMapka});
}
public function goExit7(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc7.x, y:mapka.exitMc7.y, time:2, onComplete:setNewMapka});
}
public function goExit2(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc2.x, y:mapka.exitMc2.y, time:2, onComplete:setNewMapka});
}
public function dontAllowPlaying():void{
disableSpells();
if (chosen1 != null){
chosen1.filters = [];
};
if (chosen2 != null){
chosen2.filters = [];
};
click1 = 2;
click2 = 2;
chosen1 = null;
chosen2 = null;
magic = true;
}
public function goExit8(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc8.x, y:mapka.exitMc8.y, time:2, onComplete:setNewMapka});
}
public function destroyAllSkulls():void{
var _local1:*;
var _local2:uint;
var _local3:uint;
if (player == "2"){
decreaseMagic(7, 0, 20, 0, "meter_monster");
};
do_devil_sound();
dontAllowPlaying();
readyToRemove = 0;
_local1 = 0;
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if (gameMap[_local2][_local3].type == 7){
howManyRemoved++;
_local1++;
gameMap[_local2][_local3].name = "X";
gameMap[_local2][_local3].filters = [blur, glow];
Tweener.addTween(gameMap[_local2][_local3], {scaleX:1.5, scaleY:1.5, time:0.3, transition:"linear", onComplete:destroy});
};
_local3++;
};
_local2++;
};
if (_local1 == 0){
switchThePlayers();
};
}
public function replaceInArray(_arg1:String):void{
var _local2:uint;
var _local3:uint;
readyToRemove = 0;
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if (gameMap[_local2][_local3].name == _arg1){
gameMap[_local2][_local3].name = "X";
gameMap[_local2][_local3].filters = [blur, glow];
Tweener.addTween(gameMap[_local2][_local3], {scaleX:1.5, scaleY:1.5, time:0.3, transition:"linear", onComplete:destroy});
showDestructEffect(gameMap[_local2][_local3]);
if ((((player == "2")) && ((creatingNEWone == false)))){
if ((((gameMap[_local2][_local3].type == 1)) && ((smrt1.currentFrame == 1)))){
smrt1.gotoAndPlay(2);
monster_scream();
} else {
if ((((gameMap[_local2][_local3].type == 7)) && ((smrt2.currentFrame == 1)))){
smrt2.gotoAndPlay(2);
monster_scream();
};
};
};
if ((((player == "1")) && ((creatingNEWone == false)))){
if ((((gameMap[_local2][_local3].type == 1)) && ((smrt_monster1.currentFrame == 1)))){
smrt_monster1.gotoAndPlay(2);
monster_scream();
} else {
if ((((gameMap[_local2][_local3].type == 7)) && ((smrt_monster2.currentFrame == 1)))){
smrt_monster2.gotoAndPlay(2);
monster_scream();
};
};
};
if (gameMap[_local2][_local3].type == 1){
if (player == "1"){
if ((((hero.currentFrame == 1)) && ((creatingNEWone == false)))){
hero.gotoAndPlay(2);
};
};
if (player == "2"){
if ((((monster.currentFrame == 1)) && ((creatingNEWone == false)))){
monster.gotoAndPlay(2);
};
};
};
};
_local3++;
};
_local2++;
};
}
public function sendSurvival():void{
MindJoltAPI.service.submitScore(totalGames, "survival");
trace(("send survival" + totalGames));
}
public function enemyHits():void{
howManyEnemyChanged++;
if (howManyEnemyChanged == 2){
setTheNames();
checkPoints();
if (howManyRemoved == 0){
switchThePlayers();
};
};
}
public function showEffect(_arg1:String):void{
var _local2:*;
var _local3:MovieClip;
_local2 = 0;
while (_local2 < 100) {
if (_arg1 == "freeze"){
_local3 = new snow();
} else {
if (_arg1 == "darkRain"){
_local3 = new darkRainEffect();
};
};
addChild(_local3);
_local3.y = -200;
_local3.x = generujNahodneCislo(118, 470);
_local3.scaleX = (Math.random() * 3);
_local3.scaleY = _local3.scaleX;
Tweener.addTween(_local3, {y:500, time:(Math.random() * 1), transition:"linear"});
_local2++;
};
}
public function goExit4(_arg1:MouseEvent):void{
mapkaNum++;
Tweener.addTween(heroMc, {x:mapka.exitMc4.x, y:mapka.exitMc4.y, time:2, onComplete:setNewMapka});
}
public function rollMe(_arg1:MouseEvent):void{
if (_arg1.target.enabled){
_arg1.target.gotoAndStop(2);
};
}
public function letEnemyPlay(_arg1:TimerEvent):void{
if (creatingNEWone == true){
creatingNEWone = false;
letCompPlay();
} else {
letCompPlay();
};
}
public function poison(){
var _local1:Timer;
if (player == "2"){
decreaseMagic(40, 20, 20, 0, "meter_monster");
};
dontAllowPlaying();
_local1 = new Timer(200, 1);
_local1.addEventListener("timer", showSnake);
_local1.start();
}
public function generujNahodneCislo(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public function showDirectAttack(_arg1:TimerEvent):void{
var _local2:MovieClip;
do_direct_sound();
_local2 = new flame();
addChild(_local2);
_local2.scaleX = 1.5;
_local2.scaleY = 1.5;
if (player == "1"){
_local2.x = (this["hero"].x + 100);
_local2.y = (this["hero"].y + 30);
Tweener.addTween(_local2, {x:(this["monster"].x - 100), time:1, onComplete:destroyFlame, onCompleteParams:[_local2], transition:"linear"});
} else {
_local2.scaleX = -1;
_local2.x = 500;
_local2.y = 50;
Tweener.addTween(_local2, {x:(this["hero"].x + 100), time:1, onComplete:destroyFlame, onCompleteParams:[_local2], transition:"linear"});
};
}
public function setScore():void{
if (time_challenge == true){
score_count = (10000 - parseInt(monsterLife.text));
score.text = ("score: " + score_count.toString());
};
}
public function randomlySort(_arg1:Object, _arg2:Object):Number{
return (((Math.random())<0.5) ? -1 : 1);
}
public function checkSpells():void{
disableSpells();
if (parseInt(meter_hero_txt_5.text) >= 15){
magic1.enabled = true;
magic1.alpha = 1;
};
if ((((((parseInt(meter_hero_txt_2.text) >= 7)) && ((parseInt(meter_hero_txt_4.text) >= 20)))) && (!((magicType == "freeze_2"))))){
magic2.enabled = true;
magic2.alpha = 1;
};
if (parseInt(meter_hero_txt_5.text) >= 20){
magic3.enabled = true;
magic3.alpha = 1;
};
if ((((((((parseInt(meter_hero_txt_3.text) >= 10)) && ((parseInt(meter_hero_txt_4.text) >= 20)))) && ((parseInt(meter_hero_txt_5.text) >= 7)))) && ((poisonHero == false)))){
magic4.enabled = true;
magic4.alpha = 1;
};
if ((((((parseInt(meter_hero_txt_2.text) >= 10)) && ((parseInt(meter_hero_txt_5.text) >= 10)))) && (!((magicType == "freeze_2"))))){
magic5.enabled = true;
magic5.alpha = 1;
};
if (parseInt(meter_hero_txt_4.text) >= 30){
magic6.enabled = true;
magic6.alpha = 1;
};
if ((((((parseInt(meter_hero_txt_3.text) >= 12)) && ((parseInt(meter_hero_txt_4.text) >= 8)))) && ((parseInt(meter_hero_txt_5.text) >= 20)))){
magic7.enabled = true;
magic7.alpha = 1;
};
if ((((((parseInt(meter_hero_txt_2.text) >= 40)) && ((parseInt(meter_hero_txt_3.text) >= 20)))) && ((parseInt(meter_hero_txt_4.text) >= 20)))){
magic8.enabled = true;
magic8.alpha = 1;
};
if ((((parseInt(meter_hero_txt_4.text) >= 50)) && (!((magicType == "freeze_2"))))){
magic9.enabled = true;
magic9.alpha = 1;
};
if ((((parseInt(meter_hero_txt_4.text) >= 20)) && ((parseInt(meter_hero_txt_5.text) >= 35)))){
magic10.enabled = true;
magic10.alpha = 1;
};
}
public function do_snake_sound():void{
var _local1:snakeSound;
var _local2:*;
var _local3:SoundTransform;
_local1 = new snakeSound();
_local2 = _local1.play(400);
_local3 = _local2.soundTransform;
_local3.volume = 0.15;
_local2.soundTransform = _local3;
}
public function returnToMenu(_arg1:MouseEvent):void{
Tweener.addTween(introMc.how_mc, {y:415, time:2});
}
public function sortMe():void{
var _local1:*;
var _local2:*;
var _local3:*;
max0 = 0;
max1 = 0;
max2 = 0;
max3 = 0;
max4 = 0;
max5 = 0;
max6 = 0;
max7 = 0;
max8 = 0;
max9 = 0;
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
if (gameMap[_local1][_local2].name != "X"){
gameMap[_local1][_local2].count = 0;
_local3 = _local1;
while (_local3 < (gameMap.length - 1)) {
if (gameMap[(_local3 + 1)][_local2].name == "X"){
gameMap[_local1][_local2].count++;
};
_local3++;
};
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < gameMap.length) {
_local2 = 0;
while (_local2 < gameMap.length) {
if (gameMap[_local2][_local1].count != undefined){
if (gameMap[_local2][_local1].count > this[("max" + _local1)]){
this[("max" + _local1)] = gameMap[_local2][_local1].count;
};
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 <= 9) {
if ((((((((((((((((((((gameMap[9][_local1].name == "X")) && ((gameMap[8][_local1].name == "X")))) && ((gameMap[7][_local1].name == "X")))) && ((gameMap[6][_local1].name == "X")))) && ((gameMap[5][_local1].name == "X")))) && ((gameMap[4][_local1].name == "X")))) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 10);
} else {
if ((((((((((((((((((gameMap[8][_local1].name == "X")) && ((gameMap[7][_local1].name == "X")))) && ((gameMap[6][_local1].name == "X")))) && ((gameMap[5][_local1].name == "X")))) && ((gameMap[4][_local1].name == "X")))) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 9);
} else {
if ((((((((((((((((gameMap[7][_local1].name == "X")) && ((gameMap[6][_local1].name == "X")))) && ((gameMap[5][_local1].name == "X")))) && ((gameMap[4][_local1].name == "X")))) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 8);
} else {
if ((((((((((((((gameMap[6][_local1].name == "X")) && ((gameMap[5][_local1].name == "X")))) && ((gameMap[4][_local1].name == "X")))) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 7);
} else {
if ((((((((((((gameMap[5][_local1].name == "X")) && ((gameMap[4][_local1].name == "X")))) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 6);
} else {
if ((((((((((gameMap[4][_local1].name == "X")) && ((gameMap[3][_local1].name == "X")))) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 5);
} else {
if ((((((((gameMap[3][_local1].name == "X")) && ((gameMap[2][_local1].name == "X")))) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 4);
} else {
if ((((((gameMap[2][_local1].name == "X")) && ((gameMap[1][_local1].name == "X")))) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 3);
} else {
if ((((gameMap[1][_local1].name == "X")) && ((gameMap[0][_local1].name == "X")))){
this[("max" + _local1)] = (this[("max" + _local1)] + 2);
} else {
if (gameMap[0][_local1].name == "X"){
this[("max" + _local1)] = (this[("max" + _local1)] + 1);
};
};
};
};
};
};
};
};
};
};
_local1++;
};
moveDown();
}
public function showHighScores_max():void{
}
public function destroy():void{
readyToRemove++;
if ((((readyToRemove == howManyRemoved)) && ((creatingNEWone == false)))){
sortMe();
} else {
if ((((readyToRemove == howManyRemoved)) && ((creatingNEWone == true)))){
sortMe();
};
};
}
public function deleteAll():void{
Tweener.removeAllTweens();
deleteHolder();
}
public function destroyAllSkullsAndAxes():void{
var _local1:*;
var _local2:uint;
var _local3:uint;
if (player == "2"){
decreaseMagic(0, 0, 50, 0, "meter_monster");
};
do_devil_sound();
dontAllowPlaying();
readyToRemove = 0;
_local1 = 0;
_local2 = 0;
while (_local2 < gameMap.length) {
_local3 = 0;
while (_local3 < gameMap.length) {
if ((((gameMap[_local2][_local3].type == 1)) || ((gameMap[_local2][_local3].type == 7)))){
howManyRemoved++;
_local1++;
gameMap[_local2][_local3].name = "X";
gameMap[_local2][_local3].filters = [blur, glow];
Tweener.addTween(gameMap[_local2][_local3], {scaleX:1.5, scaleY:1.5, time:0.3, transition:"linear", onComplete:destroy});
showDestructEffect(gameMap[_local2][_local3]);
};
_local3++;
};
_local2++;
};
if (_local1 == 0){
switchThePlayers();
};
}
}
}//package darklegion2_fla
Section 57
//mapka_100 (darklegion2_fla.mapka_100)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mapka_100 extends MovieClip {
public var monst70:MovieClip;
public var monst71:MovieClip;
public var monst72:MovieClip;
public var monst73:MovieClip;
public var monst74:MovieClip;
public var monst75:MovieClip;
public var monst77:MovieClip;
public var monst79:MovieClip;
public var monst76:MovieClip;
public var monst78:MovieClip;
public var monst80:MovieClip;
public var heroMc1:MovieClip;
public var heroMc4:MovieClip;
public var heroMc5:MovieClip;
public var heroMc6:MovieClip;
public var heroMc8:MovieClip;
public var heroMc9:MovieClip;
public var heroMc7:MovieClip;
public var heroMc3:MovieClip;
public var heroMc2:MovieClip;
public var help:TextField;
public var monst10:MovieClip;
public var monst11:MovieClip;
public var monst12:MovieClip;
public var monst13:MovieClip;
public var monst14:MovieClip;
public var monst17:MovieClip;
public var monst19:MovieClip;
public var monst18:MovieClip;
public var exitMc1:MovieClip;
public var exitMc3:MovieClip;
public var monst3:MovieClip;
public var monst15:MovieClip;
public var monst16:MovieClip;
public var monst8:MovieClip;
public var exitMc2:MovieClip;
public var monst23:MovieClip;
public var exitMc5:MovieClip;
public var exitMc6:MovieClip;
public var monst20:MovieClip;
public var monst9:MovieClip;
public var monst24:MovieClip;
public var monst25:MovieClip;
public var exitMc4:MovieClip;
public var monst27:MovieClip;
public var monst28:MovieClip;
public var monst21:MovieClip;
public var monst22:MovieClip;
public var monst2:MovieClip;
public var monst4:MovieClip;
public var monst6:MovieClip;
public var monst7:MovieClip;
public var monst29:MovieClip;
public var exitMc7:MovieClip;
public var monst26:MovieClip;
public var monst30:MovieClip;
public var monst31:MovieClip;
public var monst34:MovieClip;
public var monst35:MovieClip;
public var monst1:MovieClip;
public var monst39:MovieClip;
public var monst5:MovieClip;
public var monst36:MovieClip;
public var monst38:MovieClip;
public var monst32:MovieClip;
public var monst40:MovieClip;
public var monst41:MovieClip;
public var monst44:MovieClip;
public var monst46:MovieClip;
public var monst47:MovieClip;
public var monst48:MovieClip;
public var monst42:MovieClip;
public var monst43:MovieClip;
public var monst45:MovieClip;
public var monst49:MovieClip;
public var monst33:MovieClip;
public var monst37:MovieClip;
public var monst50:MovieClip;
public var monst51:MovieClip;
public var monst52:MovieClip;
public var monst54:MovieClip;
public var monst55:MovieClip;
public var monst57:MovieClip;
public var monst59:MovieClip;
public var monst53:MovieClip;
public var monst56:MovieClip;
public var monst58:MovieClip;
public var monst60:MovieClip;
public var monst61:MovieClip;
public var monst62:MovieClip;
public var monst64:MovieClip;
public var monst65:MovieClip;
public var monst66:MovieClip;
public var monst67:MovieClip;
public var monst68:MovieClip;
public var monst63:MovieClip;
public var monst69:MovieClip;
public var exitMc8:MovieClip;
}
}//package darklegion2_fla
Section 58
//meter1_24 (darklegion2_fla.meter1_24)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter1_24 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 59
//meter1new_81 (darklegion2_fla.meter1new_81)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter1new_81 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 60
//meter2_21 (darklegion2_fla.meter2_21)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter2_21 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 61
//meter2new_83 (darklegion2_fla.meter2new_83)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter2new_83 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 62
//meter3_23 (darklegion2_fla.meter3_23)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter3_23 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 63
//meter3new_84 (darklegion2_fla.meter3new_84)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter3new_84 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 64
//meter4new_85 (darklegion2_fla.meter4new_85)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter4new_85 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 65
//meter5_25 (darklegion2_fla.meter5_25)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter5_25 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 66
//meter6_26 (darklegion2_fla.meter6_26)
package darklegion2_fla {
import flash.display.*;
public dynamic class meter6_26 extends MovieClip {
public var maskmc:MovieClip;
}
}//package darklegion2_fla
Section 67
//monst1_107 (darklegion2_fla.monst1_107)
package darklegion2_fla {
import flash.display.*;
public dynamic class monst1_107 extends MovieClip {
public function monst1_107(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package darklegion2_fla
Section 68
//monst7_41 (darklegion2_fla.monst7_41)
package darklegion2_fla {
import flash.display.*;
public dynamic class monst7_41 extends MovieClip {
public function monst7_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 69
//monster2_34 (darklegion2_fla.monster2_34)
package darklegion2_fla {
import flash.display.*;
public dynamic class monster2_34 extends MovieClip {
public function monster2_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 70
//monster3_35 (darklegion2_fla.monster3_35)
package darklegion2_fla {
import flash.display.*;
public dynamic class monster3_35 extends MovieClip {
public function monster3_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 71
//monster4_40 (darklegion2_fla.monster4_40)
package darklegion2_fla {
import flash.display.*;
public dynamic class monster4_40 extends MovieClip {
public function monster4_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 72
//monster5_36 (darklegion2_fla.monster5_36)
package darklegion2_fla {
import flash.display.*;
public dynamic class monster5_36 extends MovieClip {
public function monster5_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 73
//monster7_37 (darklegion2_fla.monster7_37)
package darklegion2_fla {
import flash.display.*;
public dynamic class monster7_37 extends MovieClip {
public function monster7_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 74
//new_monster0_32 (darklegion2_fla.new_monster0_32)
package darklegion2_fla {
import flash.display.*;
public dynamic class new_monster0_32 extends MovieClip {
public function new_monster0_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 75
//new_monster1_43 (darklegion2_fla.new_monster1_43)
package darklegion2_fla {
import flash.display.*;
public dynamic class new_monster1_43 extends MovieClip {
public function new_monster1_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 76
//new_monster2_42 (darklegion2_fla.new_monster2_42)
package darklegion2_fla {
import flash.display.*;
public dynamic class new_monster2_42 extends MovieClip {
public function new_monster2_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 77
//new_monster4_33 (darklegion2_fla.new_monster4_33)
package darklegion2_fla {
import flash.display.*;
public dynamic class new_monster4_33 extends MovieClip {
public function new_monster4_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 78
//newMagic1_67 (darklegion2_fla.newMagic1_67)
package darklegion2_fla {
import flash.display.*;
public dynamic class newMagic1_67 extends MovieClip {
public function newMagic1_67(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 79
//newMagic4_70 (darklegion2_fla.newMagic4_70)
package darklegion2_fla {
import flash.display.*;
public dynamic class newMagic4_70 extends MovieClip {
public function newMagic4_70(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 80
//ohen_105 (darklegion2_fla.ohen_105)
package darklegion2_fla {
import flash.display.*;
public dynamic class ohen_105 extends MovieClip {
public function ohen_105(){
addFrameScript(21, frame22);
}
function frame22(){
gotoAndPlay(1);
}
}
}//package darklegion2_fla
Section 81
//players_9 (darklegion2_fla.players_9)
package darklegion2_fla {
import flash.display.*;
public dynamic class players_9 extends MovieClip {
public function players_9(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package darklegion2_fla
Section 82
//prequel_208 (darklegion2_fla.prequel_208)
package darklegion2_fla {
import flash.display.*;
public dynamic class prequel_208 extends MovieClip {
public function prequel_208(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 83
//scorpio_129 (darklegion2_fla.scorpio_129)
package darklegion2_fla {
import flash.display.*;
public dynamic class scorpio_129 extends MovieClip {
public function scorpio_129(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 84
//shield_54 (darklegion2_fla.shield_54)
package darklegion2_fla {
import flash.display.*;
public dynamic class shield_54 extends MovieClip {
public function shield_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 85
//showMe_216 (darklegion2_fla.showMe_216)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
import flash.text.*;
import flash.filters.*;
public dynamic class showMe_216 extends MovieClip {
public var btn_show:MovieClip;
public var symb2:MovieClip;
public var symb1:MovieClip;
public var symb3:MovieClip;
public var symb4:MovieClip;
public var helpmc:TextField;
public var glow:GlowFilter;
public var glow_red:GlowFilter;
public function showMe_216(){
addFrameScript(0, frame1);
}
public function showMeAction(_arg1:MouseEvent){
btn_show.enabled = false;
btn_show.visible = false;
helpmc.htmlText = "2. As you can see, by switching the <b>highlighted symbol</b> with symbol above you can get the <b>three</b> same types of symbols! At first click the highligted symbol.<br><br><b>Note:</b> you will not see the highlight in the game.";
symb1.addEventListener(MouseEvent.CLICK, switch1);
symb1.filters = [glow_red];
}
function frame1(){
btn_show.addEventListener(MouseEvent.CLICK, showMeAction);
btn_show.buttonMode = true;
glow = new GlowFilter();
glow.color = 0xFF9900;
glow.alpha = 1;
glow.blurX = 25;
glow.blurY = 25;
glow.quality = BitmapFilterQuality.MEDIUM;
glow_red = new GlowFilter();
glow_red.color = 0xFF0000;
glow_red.alpha = 1;
glow_red.blurX = 25;
glow_red.blurY = 25;
glow_red.quality = BitmapFilterQuality.MEDIUM;
}
public function switchThem(_arg1:MouseEvent):void{
symb1.filters = [];
symb2.filters = [];
symb2.removeEventListener(MouseEvent.CLICK, switchThem);
Tweener.addTween(symb1, {y:symb2.y, time:1, onComplete:finale});
Tweener.addTween(symb2, {y:symb1.y, time:1});
}
public function switch1(_arg1:MouseEvent):void{
symb1.filters = [glow];
symb2.filters = [glow_red];
symb2.addEventListener(MouseEvent.CLICK, switchThem);
helpmc.htmlText = "3. You have just selected the symbol you want to play with. In a gameplay the symbol is highlighted in the same way as now you can see here. Now click the symbol highlighted in red to switch the symbols.<br><br><b>Note:</b> you will not see this highlight in the game.";
symb1.removeEventListener(MouseEvent.CLICK, switch1);
}
public function finale():void{
helpmc.htmlText = "5. Now you switched the two symbols to get the three same types of symbols. This will give you 3x2 points of mana, that you can use for various spells (when you reach enough experience to use them)!<br><br><b>Please remember:</b><ul><li>you can switch just symbols that are placed next to each other (horizontally, vertically)</li><li>if you collect 4 same types of symbols, it gives you <b>extra turn</b>!</li><li>if you try to switch symbols that dont lead to get three same types of symbols, you <b>loose the turn (illegal move)</b>.</li><li>if you want to <b>deselect</b> the symbol, just click the symbol again.</li></ul>";
symb1.filters = [glow];
symb3.filters = [glow];
symb4.filters = [glow];
}
}
}//package darklegion2_fla
Section 86
//skeleton_130 (darklegion2_fla.skeleton_130)
package darklegion2_fla {
import flash.display.*;
public dynamic class skeleton_130 extends MovieClip {
public function skeleton_130(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 87
//skullsShiled_50 (darklegion2_fla.skullsShiled_50)
package darklegion2_fla {
import flash.display.*;
public dynamic class skullsShiled_50 extends MovieClip {
public function skullsShiled_50(){
addFrameScript(0, frame1, 12, frame13, 23, frame24);
}
function frame1(){
stop();
}
function frame13(){
gotoAndStop(1);
}
function frame24(){
gotoAndStop(1);
}
}
}//package darklegion2_fla
Section 88
//smrt_45 (darklegion2_fla.smrt_45)
package darklegion2_fla {
import flash.display.*;
public dynamic class smrt_45 extends MovieClip {
public function smrt_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 89
//smrt_monster_47 (darklegion2_fla.smrt_monster_47)
package darklegion2_fla {
import flash.display.*;
public dynamic class smrt_monster_47 extends MovieClip {
public function smrt_monster_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package darklegion2_fla
Section 90
//spider_127 (darklegion2_fla.spider_127)
package darklegion2_fla {
import flash.display.*;
public dynamic class spider_127 extends MovieClip {
public function spider_127(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 91
//status_178 (darklegion2_fla.status_178)
package darklegion2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class status_178 extends MovieClip {
public var award:TextField;
public var totalLife:TextField;
public var percentage:TextField;
public var wonGames:TextField;
public var totalGames:TextField;
public var lostGames:TextField;
}
}//package darklegion2_fla
Section 92
//storm_80 (darklegion2_fla.storm_80)
package darklegion2_fla {
import flash.display.*;
public dynamic class storm_80 extends MovieClip {
public function storm_80(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
gotoAndPlay(2);
}
}
}//package darklegion2_fla
Section 93
//Symbol32_131 (darklegion2_fla.Symbol32_131)
package darklegion2_fla {
import flash.display.*;
public dynamic class Symbol32_131 extends MovieClip {
public function Symbol32_131(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 94
//Symbol33_132 (darklegion2_fla.Symbol33_132)
package darklegion2_fla {
import flash.display.*;
public dynamic class Symbol33_132 extends MovieClip {
public function Symbol33_132(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
stop();
}
}
}//package darklegion2_fla
Section 95
//Symbol48_88 (darklegion2_fla.Symbol48_88)
package darklegion2_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Symbol48_88 extends MovieClip {
public var row10:MovieClip;
public var row1:MovieClip;
public var row2:MovieClip;
public var row3:MovieClip;
public var row4:MovieClip;
public var row7:MovieClip;
public var col10:MovieClip;
public var row9:MovieClip;
public var block:MovieClip;
public var col1:MovieClip;
public var row5:MovieClip;
public var col5:MovieClip;
public var col7:MovieClip;
public var col9:MovieClip;
public var col3:MovieClip;
public var col4:MovieClip;
public var col6:MovieClip;
public var row6:MovieClip;
public var col2:MovieClip;
public var i:Number;
public var col8:MovieClip;
public var row8:MovieClip;
public function Symbol48_88(){
addFrameScript(0, frame1, 1, frame2);
}
public function blockMe(_arg1:MouseEvent):void{
}
function frame1(){
stop();
}
function frame2(){
stop();
i = 1;
while (i <= 10) {
this[("row" + i)].addEventListener(MouseEvent.CLICK, destroyThis);
this[("col" + i)].addEventListener(MouseEvent.CLICK, destroyThis);
this[("row" + i)].buttonMode = true;
this[("col" + i)].buttonMode = true;
this[("row" + i)].mouseChildren = false;
this[("col" + i)].mouseChildren = false;
i++;
};
block.addEventListener(MouseEvent.CLICK, blockMe);
}
public function destroyThis(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:String;
var _local4:Number;
_local2 = Number(_arg1.target.name.substr(3, _arg1.target.name.length));
_local3 = _arg1.target.name.substr(0, 1);
if (_local3 == "r"){
_local4 = 2;
} else {
if (_local3 == "c"){
_local4 = 1;
};
};
MovieClip(root).destroyRandom(_local2, _local4);
gotoAndStop(1);
}
}
}//package darklegion2_fla
Section 96
//Symbol50_139 (darklegion2_fla.Symbol50_139)
package darklegion2_fla {
import flash.display.*;
public dynamic class Symbol50_139 extends MovieClip {
public function Symbol50_139(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package darklegion2_fla
Section 97
//water_120 (darklegion2_fla.water_120)
package darklegion2_fla {
import flash.display.*;
public dynamic class water_120 extends MovieClip {
public function water_120(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package darklegion2_fla
Section 98
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_w:Number;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var progress:Number;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
bar_w = ((w - bar.x) - 10);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
progress = Math.min(1, options.progress_override(clip));
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Object;
var _local11:Number;
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local8 = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
_local9 = ((100 * _local3) / chk.ad_msec);
_local10 = this._mochiad_bar._inside;
_local11 = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 99
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 100
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 101
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 102
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.geom.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.3 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 103
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 104
//bc_music (bc_music)
package {
import flash.media.*;
public dynamic class bc_music extends Sound {
}
}//package
Section 105
//book (book)
package {
import flash.media.*;
public dynamic class book extends Sound {
}
}//package
Section 106
//breathing (breathing)
package {
import flash.media.*;
public dynamic class breathing extends Sound {
}
}//package
Section 107
//c1 (c1)
package {
import flash.display.*;
public dynamic class c1 extends MovieClip {
public function c1(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 108
//c2 (c2)
package {
import flash.display.*;
public dynamic class c2 extends MovieClip {
}
}//package
Section 109
//c3 (c3)
package {
import flash.display.*;
public dynamic class c3 extends MovieClip {
}
}//package
Section 110
//c4 (c4)
package {
import flash.display.*;
public dynamic class c4 extends MovieClip {
}
}//package
Section 111
//c5 (c5)
package {
import flash.display.*;
public dynamic class c5 extends MovieClip {
}
}//package
Section 112
//c6 (c6)
package {
import flash.display.*;
public dynamic class c6 extends MovieClip {
}
}//package
Section 113
//c7 (c7)
package {
import flash.display.*;
public dynamic class c7 extends MovieClip {
public function c7(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 114
//challengeMode (challengeMode)
package {
import flash.display.*;
import flash.text.*;
public dynamic class challengeMode extends MovieClip {
public var btn_last_exit:MovieClip;
public var btn_submit_score:MovieClip;
public var totalGames:TextField;
public function challengeMode(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 115
//click_monster_snd (click_monster_snd)
package {
import flash.media.*;
public dynamic class click_monster_snd extends Sound {
}
}//package
Section 116
//clicks (clicks)
package {
import flash.media.*;
public dynamic class clicks extends Sound {
}
}//package
Section 117
//dark_rain_sound (dark_rain_sound)
package {
import flash.media.*;
public dynamic class dark_rain_sound extends Sound {
}
}//package
Section 118
//darkRainEffect (darkRainEffect)
package {
import flash.display.*;
public dynamic class darkRainEffect extends MovieClip {
}
}//package
Section 119
//darkRainEffect2 (darkRainEffect2)
package {
import flash.display.*;
public dynamic class darkRainEffect2 extends MovieClip {
}
}//package
Section 120
//devil_laugh (devil_laugh)
package {
import flash.media.*;
public dynamic class devil_laugh extends Sound {
}
}//package
Section 121
//die (die)
package {
import flash.media.*;
public dynamic class die extends Sound {
}
}//package
Section 122
//directsnd (directsnd)
package {
import flash.media.*;
public dynamic class directsnd extends Sound {
}
}//package
Section 123
//effectOrange (effectOrange)
package {
import flash.display.*;
public dynamic class effectOrange extends MovieClip {
public function effectOrange(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 124
//explos (explos)
package {
import flash.display.*;
public dynamic class explos extends MovieClip {
}
}//package
Section 125
//explosion (explosion)
package {
import flash.media.*;
public dynamic class explosion extends Sound {
}
}//package
Section 126
//extra (extra)
package {
import flash.media.*;
public dynamic class extra extends Sound {
}
}//package
Section 127
//fanfare (fanfare)
package {
import flash.media.*;
public dynamic class fanfare extends Sound {
}
}//package
Section 128
//flame (flame)
package {
import flash.display.*;
public dynamic class flame extends MovieClip {
}
}//package
Section 129
//found_snd (found_snd)
package {
import flash.media.*;
public dynamic class found_snd extends Sound {
}
}//package
Section 130
//frozen (frozen)
package {
import flash.media.*;
public dynamic class frozen extends Sound {
}
}//package
Section 131
//hearth (hearth)
package {
import flash.media.*;
public dynamic class hearth extends Sound {
}
}//package
Section 132
//holder_mc (holder_mc)
package {
import flash.display.*;
public dynamic class holder_mc extends MovieClip {
}
}//package
Section 133
//Intro (Intro)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Intro extends MovieClip {
public var blocker:MovieClip;
public var btn_prequel:MovieClip;
public var highscores:MovieClip;
public var challenges:MovieClip;
public var btn_fairPlay:MovieClip;
public var skip_btn:MovieClip;
public var btn_start:MovieClip;
public var how_mc:MovieClip;
public var btn_load:MovieClip;
public var btn_how:MovieClip;
public var btn_score:MovieClip;
public function Intro(){
addFrameScript(0, frame1, 1, frame2, 1320, frame1321);
}
public function blockMe(_arg1:MouseEvent):void{
}
function frame1(){
stop();
}
public function skipMe(_arg1:MouseEvent):void{
gotoAndStop("menu");
}
function frame2(){
skip_btn.addEventListener(MouseEvent.CLICK, skipMe);
skip_btn.buttonMode = true;
blocker.addEventListener(MouseEvent.CLICK, blockMe);
}
function frame1321(){
stop();
if (MovieClip(root).mochiConnected == false){
btn_score.alpha = 0.3;
btn_score.enabled = false;
};
if (MovieClip(root).so.data.Level == undefined){
btn_load.alpha = 0.3;
btn_load.enabled = false;
};
}
}
}//package
Section 134
//intro_sound (intro_sound)
package {
import flash.media.*;
public dynamic class intro_sound extends Sound {
}
}//package
Section 135
//konec (konec)
package {
import flash.display.*;
public dynamic class konec extends MovieClip {
public var mordeson:MovieClip;
}
}//package
Section 136
//map_music (map_music)
package {
import flash.media.*;
public dynamic class map_music extends Sound {
}
}//package
Section 137
//meduzas (meduzas)
package {
import flash.media.*;
public dynamic class meduzas extends Sound {
}
}//package
Section 138
//monster_explode (monster_explode)
package {
import flash.media.*;
public dynamic class monster_explode extends Sound {
}
}//package
Section 139
//monsterScream (monsterScream)
package {
import flash.media.*;
public dynamic class monsterScream extends Sound {
}
}//package
Section 140
//Mouche (Mouche)
package {
import flash.media.*;
public dynamic class Mouche extends Sound {
}
}//package
Section 141
//nextLevel (nextLevel)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class nextLevel extends MovieClip {
public var btn_last_exit:MovieClip;
public var btn_continue:MovieClip;
public var btn_submitFinal:MovieClip;
public var btn_tryAgain:MovieClip;
public var status:MovieClip;
public function nextLevel(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
btn_continue.addEventListener(MouseEvent.CLICK, continuePlay);
btn_continue.buttonMode = true;
}
public function continuePlay(_arg1:MouseEvent){
_arg1.target.parent.parent.nextBattle();
}
function frame2(){
stop();
btn_tryAgain.addEventListener(MouseEvent.CLICK, playAgain);
btn_tryAgain.buttonMode = true;
}
public function playAgain(_arg1:MouseEvent){
_arg1.target.parent.parent.retry();
}
}
}//package
Section 142
//playerswitch (playerswitch)
package {
import flash.media.*;
public dynamic class playerswitch extends Sound {
}
}//package
Section 143
//podlaha1 (podlaha1)
package {
import flash.display.*;
public dynamic class podlaha1 extends BitmapData {
public function podlaha1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 144
//snakeMc (snakeMc)
package {
import flash.display.*;
public dynamic class snakeMc extends MovieClip {
}
}//package
Section 145
//snakeSound (snakeSound)
package {
import flash.media.*;
public dynamic class snakeSound extends Sound {
}
}//package
Section 146
//snow (snow)
package {
import flash.display.*;
public dynamic class snow extends MovieClip {
}
}//package
Section 147
//stealing (stealing)
package {
import flash.display.*;
public dynamic class stealing extends MovieClip {
}
}//package
Section 148
//stealOrangeMagic (stealOrangeMagic)
package {
import flash.display.*;
public dynamic class stealOrangeMagic extends MovieClip {
}
}//package
Section 149
//stromMC (stromMC)
package {
import flash.display.*;
public dynamic class stromMC extends MovieClip {
}
}//package
Section 150
//switchs (switchs)
package {
import flash.media.*;
public dynamic class switchs extends Sound {
}
}//package
Section 151
//Sword (Sword)
package {
import flash.media.*;
public dynamic class Sword extends Sound {
}
}//package
Section 152
//thunder (thunder)
package {
import flash.media.*;
public dynamic class thunder extends Sound {
}
}//package
Section 153
//thunderEffect (thunderEffect)
package {
import flash.display.*;
public dynamic class thunderEffect extends MovieClip {
public function thunderEffect(){
addFrameScript(3, frame4);
}
function frame4(){
stop();
this.y = (this.y + 2000);
}
}
}//package
Section 154
//wrong (wrong)
package {
import flash.media.*;
public dynamic class wrong extends Sound {
}
}//package
Section 155
//zombieMC (zombieMC)
package {
import flash.display.*;
public dynamic class zombieMC extends MovieClip {
public var pest:MovieClip;
}
}//package