Frame 1
function urlChecker() {
if (urlCheckerOn == true) {
mainAd.gotoAndStop("ad");
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
pfixEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(pfixEnd, domain.length);
if (((domain == "armorgames.com") || (domain == "")) || (_url == "http://members.iinet.net.au/~ccondon/Game/archer.swf")) {
armorGamesVersion = true;
mainAd.gotoAndStop("hints");
mainAd.hintText.text = "HINT:\r" + hints[random(hints.length)];
}
if (((domain != "") && (domain != "armorgames.com")) && (_url != "http://members.iinet.net.au/~ccondon/Game/archer.swf")) {
securityImage._visible = true;
securityImage.domainName.text = _url;
preloaderPlayButton._x = -30000;
preloaderPlayButton._y = -30000;
} else {
securityImage._visible = false;
init();
}
} else {
securityImage._visible = false;
init();
}
}
function init() {
this.onEnterFrame = function () {
update();
};
}
function update() {
var _local3 = this.getBytesLoaded();
var _local4 = this.getBytesTotal();
var _local2 = Math.round((_local3 / _local4) * 100);
percentage = _local2 + "%";
preLoaderCombo.percentageTotal.text = percentage;
preLoaderCombo.preloader.loadBar._yscale = _local2;
if (_local2 >= 100) {
onLoadComplete();
delete this.onEnterFrame;
}
}
function onLoadComplete() {
playText.alphaTo(100, 2);
preloaderPlayButton.onRelease = function () {
_root.gotoAndStop("logo");
_root.removeAd();
};
preloaderPlayButton.onRollOver = function () {
};
preloaderPlayButton.onRollOut = function () {
};
}
stop();
var versionNumber = "v1.03";
_global.$createTweenController = function () {
var _local3 = _root.createEmptyMovieClip("__tweenController__", 123432);
_local3.$_tweenPropList = new Array();
_local3.$_tTime = getTimer();
_local3.onEnterFrame = _global.$updateTweens;
};
ASSetPropFlags(_global, "$createTweenController", 1, 0);
_global.$removeTweenController = function () {
delete _root.__tweenController__.$_tweenPropList;
delete _root.__tweenController__.$_tTime;
delete _root.__tweenController__.onEnterFrame;
_root.__tweenController__.removeMovieClip();
};
ASSetPropFlags(_global, "$removeTweenController", 1, 0);
_global.$addTween = function (mtarget, prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2, extras) {
if (timeSeconds == undefined) {
timeSeconds = 0;
}
if ((animType == undefined) || (animType == "")) {
animType = "easeOutExpo";
}
if (delay == undefined) {
delay = 0;
}
if (typeof(prop) == "string") {
var _local7 = [prop];
var _local11 = [mtarget[prop]];
var _local9 = [propDest];
} else {
var _local7 = [];
var _local11 = [];
var _local9 = [];
for (var _local32 in prop) {
_local11.push(mtarget[prop[_local32]]);
}
for (var _local32 in prop) {
_local7.push(prop[_local32]);
}
for (var _local32 in propDest) {
_local9.push(propDest[_local32]);
}
}
var _local12 = false;
if (_root.__tweenController__ == undefined) {
_global.$createTweenController();
}
var _local4 = _root.__tweenController__.$_tweenPropList;
var _local8 = _root.__tweenController__.$_tTime;
for (var _local32 in _local11) {
if ((_local9[_local32] != undefined) && (!mtarget.$_isTweenLocked)) {
if (mtarget.$_tweenCount > 0) {
var _local3 = 0;
while (_local3 < _local4.length) {
if ((_local4[_local3]._targ == mtarget) && (_local4[_local3]._prop == _local7[_local32])) {
if ((_local8 + (delay * 1000)) < _local4[_local3]._timeDest) {
_local4.splice(_local3, 1);
_local3--;
mtarget.$_tweenCount--;
}
}
_local3++;
}
}
_local4.push({_prop:_local7[_local32], _targ:mtarget, _propStart:undefined, _propDest:_local9[_local32], _timeStart:_local8, _timeDest:_local8 + (timeSeconds * 1000), _animType:animType, _extra1:extra1, _extra2:extra2, _extras:extras, _delay:delay, _isPaused:false, _timePaused:0, _callback:(_local12 ? undefined : (callback))});
mtarget.$_tweenCount = ((mtarget.$_tweenCount > 0) ? (mtarget.$_tweenCount + 1) : 1);
_local12 = true;
}
}
ASSetPropFlags(mtarget, "$_tweenCount", 1, 0);
};
ASSetPropFlags(_global, "$addTween", 1, 0);
_global.$updateTweens = function () {
var _local8 = (this.$_tTime = getTimer());
var _local6 = 0;
while (_local6 < this.$_tweenPropList.length) {
var _local3 = this.$_tweenPropList[_local6];
if (_local3._targ.toString() == undefined) {
this.$_tweenPropList.splice(_local6, 1);
_local6--;
} else if (((_local3._timeStart + (_local3._delay * 1000)) <= _local8) && (!_local3._isPaused)) {
if (_local3._propStart == undefined) {
if (_local3._prop.substr(0, 10) == "__special_") {
if (_local3._prop == "__special_mc_frame__") {
_local3._propStart = _local3._targ._currentframe;
} else if (_local3._prop == "__special_mc_ra__") {
_local3._propStart = new Color(_local3._targ).getTransform().ra;
} else if (_local3._prop == "__special_mc_rb__") {
_local3._propStart = new Color(_local3._targ).getTransform().rb;
} else if (_local3._prop == "__special_mc_ga__") {
_local3._propStart = new Color(_local3._targ).getTransform().ga;
} else if (_local3._prop == "__special_mc_gb__") {
_local3._propStart = new Color(_local3._targ).getTransform().gb;
} else if (_local3._prop == "__special_mc_ba__") {
_local3._propStart = new Color(_local3._targ).getTransform().ba;
} else if (_local3._prop == "__special_mc_bb__") {
_local3._propStart = new Color(_local3._targ).getTransform().bb;
} else if (_local3._prop == "__special_mc_aa__") {
_local3._propStart = new Color(_local3._targ).getTransform().aa;
} else if (_local3._prop == "__special_mc_ab__") {
_local3._propStart = new Color(_local3._targ).getTransform().ab;
} else if (_local3._prop == "__special_text_r__") {
_local3._propStart = _local3._targ.textColor >> 16;
} else if (_local3._prop == "__special_text_g__") {
_local3._propStart = (_local3._targ.textColor & 65280) >> 8;
} else if (_local3._prop == "__special_text_b__") {
_local3._propStart = _local3._targ.textColor & 255;
} else if (_local3._prop == "__special_sound_volume__") {
_local3._propStart = _local3._targ.getVolume();
} else if (_local3._prop == "__special_sound_pan__") {
_local3._propStart = _local3._targ.getPan();
} else if (_local3._prop == "__special_bst_t__") {
_local3._propStart = 0;
_local3._extras.__special_bst_ix__ = _local3._targ._x;
_local3._extras.__special_bst_iy__ = _local3._targ._y;
} else if (_local3._prop == "__special_blur_x__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BlurFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurX;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_blur_y__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BlurFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurY;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_glow_color__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.GlowFilter) {
_local3._propStart = _local3._targ.filters[_local5].color;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 16777215 /* 0xFFFFFF */;
}
} else if (_local3._prop == "__special_glow_alpha__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.GlowFilter) {
_local3._propStart = _local3._targ.filters[_local5].alpha;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 1;
}
} else if (_local3._prop == "__special_glow_blurX__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.GlowFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurX;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_glow_blurY__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.GlowFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurY;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_glow_strength__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.GlowFilter) {
_local3._propStart = _local3._targ.filters[_local5].strength;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 1;
}
} else if (_local3._prop == "__special_bevel_distance__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].distance;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_bevel_angle__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].angle;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 45;
}
} else if (_local3._prop == "__special_bevel_highlightColor__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].highlightColor;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 16777215 /* 0xFFFFFF */;
}
} else if (_local3._prop == "__special_bevel_highlightAlpha__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].highlightAlpha;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 1;
}
} else if (_local3._prop == "__special_bevel_shadowColor__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].shadowColor;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_bevel_shadowAlpha__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].shadowAlpha;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 1;
}
} else if (_local3._prop == "__special_bevel_blurX__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurX;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_bevel_blurY__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].blurY;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 0;
}
} else if (_local3._prop == "__special_bevel_strength__") {
var _local5 = 0;
while (_local5 < _local3._targ.filters.length) {
if (_local3._targ.filters[_local5] instanceof flash.filters.BevelFilter) {
_local3._propStart = _local3._targ.filters[_local5].strength;
}
_local5++;
}
if (_local3._propStart == undefined) {
_local3._propStart = 1;
}
} else {
_local3._propStart = _local3._targ[_local3._prop];
}
} else {
_local3._propStart = _local3._targ[_local3._prop];
}
}
var _local10 = _local3._timeDest + (_local3._delay * 1000);
if (_local10 <= _local8) {
var _local4 = _local3._propDest;
} else {
var _local4 = _global.findTweenValue(_local3._propStart, _local3._propDest, _local3._timeStart, _local8 - (_local3._delay * 1000), _local3._timeDest, _local3._animType, _local3._extra1, _local3._extra2);
}
_local3._targ[_local3._prop] = (_local3._extras.mustRound ? (Math.round(_local4)) : (_local4));
if (_local3._prop == "__special_mc_frame__") {
_local3._targ.gotoAndStop(Math.round(_local4));
} else if (_local3._prop == "__special_mc_ra__") {
new Color(_local3._targ).setTransform({ra:_local4});
} else if (_local3._prop == "__special_mc_rb__") {
new Color(_local3._targ).setTransform({rb:_local4});
} else if (_local3._prop == "__special_mc_ga__") {
new Color(_local3._targ).setTransform({ga:_local4});
} else if (_local3._prop == "__special_mc_gb__") {
new Color(_local3._targ).setTransform({gb:_local4});
} else if (_local3._prop == "__special_mc_ba__") {
new Color(_local3._targ).setTransform({ba:_local4});
} else if (_local3._prop == "__special_mc_bb__") {
new Color(_local3._targ).setTransform({bb:_local4});
} else if (_local3._prop == "__special_mc_aa__") {
new Color(_local3._targ).setTransform({aa:_local4});
} else if (_local3._prop == "__special_mc_ab__") {
new Color(_local3._targ).setTransform({ab:_local4});
}
if (_local3._prop == "__special_bst_t__") {
var _local7 = _local3._extras;
var _local9 = _global.findPointOnCurve(_local7.__special_bst_ix__, _local7.__special_bst_iy__, _local7.__special_bst_cx__, _local7.__special_bst_cy__, _local7.__special_bst_dx__, _local7.__special_bst_dy__, _local4);
if (_local3._extras.mustRound) {
_local3._targ._x = Math.round(_local9.x);
_local3._targ._y = Math.round(_local9.y);
} else {
_local3._targ._x = _local9.x;
_local3._targ._y = _local9.y;
}
}
if ((typeof(_local3._targ) != "movieclip") && (_local3._prop == "__special_text_b__")) {
_local3._targ.textColor = ((_local3._targ.__special_text_r__ << 16) + (_local3._targ.__special_text_g__ << 8)) + _local3._targ.__special_text_b__;
}
if (_local3._prop == "__special_sound_volume__") {
_local3._targ.setVolume(_local4);
}
if (_local3._prop == "__special_sound_pan__") {
_local3._targ.setPan(_local4);
}
if (_local3._prop == "__special_blur_x__") {
_global.$setFilterProperty(_local3._targ, "blur_blurX", _local4, _local3._extras);
}
if (_local3._prop == "__special_blur_y__") {
_global.$setFilterProperty(_local3._targ, "blur_blurY", _local4, _local3._extras);
}
if (_local3._prop == "__special_glow_color__") {
_global.$setFilterProperty(_local3._targ, "glow_color", _global.findTweenColor(_local3, _local8), _local3._extras);
}
if (_local3._prop == "__special_glow_alpha__") {
_global.$setFilterProperty(_local3._targ, "glow_alpha", _local4, _local3._extras);
}
if (_local3._prop == "__special_glow_blurX__") {
_global.$setFilterProperty(_local3._targ, "glow_blurX", _local4, _local3._extras);
}
if (_local3._prop == "__special_glow_blurY__") {
_global.$setFilterProperty(_local3._targ, "glow_blurY", _local4, _local3._extras);
}
if (_local3._prop == "__special_glow_strength__") {
_global.$setFilterProperty(_local3._targ, "glow_strength", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_distance__") {
_global.$setFilterProperty(_local3._targ, "bevel_distance", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_angle__") {
_global.$setFilterProperty(_local3._targ, "bevel_angle", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_highlightColor__") {
_global.$setFilterProperty(_local3._targ, "bevel_highlightColor", _global.findTweenColor(_local3, _local8), _local3._extras);
}
if (_local3._prop == "__special_bevel_highlightAlpha__") {
_global.$setFilterProperty(_local3._targ, "bevel_highlightAlpha", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_shadowColor__") {
_global.$setFilterProperty(_local3._targ, "bevel_shadowColor", _global.findTweenColor(_local3, _local8), _local3._extras);
}
if (_local3._prop == "__special_bevel_shadowAlpha__") {
_global.$setFilterProperty(_local3._targ, "bevel_shadowAlpha", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_blurX__") {
_global.$setFilterProperty(_local3._targ, "bevel_blurX", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_blurY__") {
_global.$setFilterProperty(_local3._targ, "bevel_blurY", _local4, _local3._extras);
}
if (_local3._prop == "__special_bevel_strength__") {
_global.$setFilterProperty(_local3._targ, "bevel_strength", _local4, _local3._extras);
}
if (_local3._targ.onTweenUpdate != undefined) {
_local3._targ.onTweenUpdate(_local3._prop);
}
if (_local10 <= _local8) {
if (_local3._targ.onTweenComplete != undefined) {
_local3._targ.onTweenComplete(_local3._prop);
}
_global.$stopTween(_local3._targ, [_local3._prop], false);
_local6--;
if (_local3._callback != undefined) {
if (_global.backwardCallbackTweening) {
var _local11 = _local3._targ.createEmptyMovieClip("__child__", 122344);
_local3._callback.apply(_local11, null);
_local11.removeMovieClip();
} else {
_local3._callback.apply(_local3._targ, null);
}
}
}
}
_local6++;
}
if (this.$_tweenPropList.length == 0) {
_global.$removeTweenController();
}
};
ASSetPropFlags(_global, "$updateTween", 1, 0);
_global.$stopTween = function (mtarget, props, wipeFuture) {
var _local4 = _root.__tweenController__.$_tweenPropList;
var _local7;
for (var _local9 in _local4) {
_local7 = _local4[_local9]._prop;
var _local5 = 0;
while ((_local5 < props.length) || ((_local5 < 1) && (props == undefined))) {
if (((_local4[_local9]._targ == mtarget) && ((_local7 == props[_local5]) || (props == undefined))) && (wipeFuture || ((_local4[_local9]._timeDest + (_local4[_local9]._delay * 1000)) <= getTimer()))) {
switch (_local7) {
case "__special_mc_frame__" :
case "__special_mc_ra__" :
case "__special_mc_rb__" :
case "__special_mc_ga__" :
case "__special_mc_gb__" :
case "__special_mc_ba__" :
case "__special_mc_bb__" :
case "__special_mc_aa__" :
case "__special_mc_ab__" :
case "__special_sound_volume__" :
case "__special_bst_t__" :
delete mtarget[_local7];
break;
case "__special_text_b__" :
delete mtarget.__special_text_r__;
delete mtarget.__special_text_g__;
delete mtarget.__special_text_b__;
}
_local4.splice(_local9, 1);
}
_local5++;
}
}
if (props == undefined) {
delete mtarget.$_tweenCount;
} else {
mtarget.$_tweenCount = 0;
for (var _local9 in _local4) {
if (_local4[_local9]._targ == mtarget) {
mtarget.$_tweenCount++;
}
}
if (mtarget.$_tweenCount == 0) {
delete mtarget.$_tweenCount;
}
}
if (_local4.length == 0) {
_global.$removeTweenController();
}
};
ASSetPropFlags(_global, "$stopTween", 1, 0);
_global.$setFilterProperty = function (mtarget, propName, propValue, extras) {
var _local1;
var _local7 = false;
var _local3 = [];
_local1 = 0;
while (_local1 < mtarget.filters.length) {
_local3.push(mtarget.filters[_local1]);
_local1++;
}
if (propName.substr(0, 5) == "blur_") {
_local1 = 0;
while (_local1 < mtarget.filters.length) {
if (_local3[_local1] instanceof flash.filters.BlurFilter) {
_local3[_local1][propName.substr(5)] = propValue;
if (extras.__special_blur_quality__ != undefined) {
_local3[_local1].quality = extras.__special_blur_quality__;
}
_local7 = true;
break;
}
_local1++;
}
if (!_local7) {
var _local9;
var _local8 = ((extras.__special_blur_quality__ == undefined) ? 2 : (extras.__special_blur_quality__));
if (propName == "blur_blurX") {
_local9 = new flash.filters.BlurFilter(propValue, 0, _local8);
}
if (propName == "blur_blurY") {
_local9 = new flash.filters.BlurFilter(0, propValue, _local8);
}
_local3.push(_local9);
}
} else if (propName.substr(0, 5) == "glow_") {
_local1 = 0;
while (_local1 < mtarget.filters.length) {
if (_local3[_local1] instanceof flash.filters.GlowFilter) {
_local3[_local1][propName.substr(5)] = propValue;
if (extras.__special_glow_quality__ != undefined) {
_local3[_local1].quality = extras.__special_glow_quality__;
}
if (extras.__special_glow_inner__ != undefined) {
_local3[_local1].inner = extras.__special_glow_inner__;
}
if (extras.__special_glow_knockout__ != undefined) {
_local3[_local1].knockout = extras.__special_glow_knockout__;
}
_local7 = true;
break;
}
_local1++;
}
if (!_local7) {
var _local8 = ((extras.__special_glow_quality__ == undefined) ? 2 : (extras.__special_glow_quality__));
var _local12 = ((extras.__special_glow_inner__ == undefined) ? false : (extras.__special_glow_inner__));
var _local10 = ((extras.__special_glow_knockout__ == undefined) ? false : (extras.__special_glow_knockout__));
if (propName == "glow_color") {
var _local9 = new flash.filters.GlowFilter(propValue, 1, 0, 0, 1, _local8, _local12, _local10);
}
if (propName == "glow_alpha") {
var _local9 = new flash.filters.GlowFilter(16777215, propValue, 0, 0, 1, _local8, _local12, _local10);
}
if (propName == "glow_blurX") {
var _local9 = new flash.filters.GlowFilter(16777215, 1, propValue, 0, 1, _local8, _local12, _local10);
}
if (propName == "glow_blurY") {
var _local9 = new flash.filters.GlowFilter(16777215, 1, 0, propValue, 1, _local8, _local12, _local10);
}
if (propName == "glow_strength") {
var _local9 = new flash.filters.GlowFilter(16777215, 1, 0, 0, propValue, _local8, _local12, _local10);
}
_local3.push(_local9);
}
} else if (propName.substr(0, 6) == "bevel_") {
_local1 = 0;
while (_local1 < mtarget.filters.length) {
if (_local3[_local1] instanceof flash.filters.BevelFilter) {
_local3[_local1][propName.substr(6)] = propValue;
if (extras.__special_bevel_quality__ != undefined) {
_local3[_local1].quality = extras.__special_bevel_quality__;
}
if (extras.__special_bevel_type__ != undefined) {
_local3[_local1].inner = extras.__special_bevel_type__;
}
if (extras.__special_bevel_knockout__ != undefined) {
_local3[_local1].knockout = extras.__special_bevel_knockout__;
}
_local7 = true;
break;
}
_local1++;
}
if (!_local7) {
var _local8 = ((extras.__special_bevel_quality__ == undefined) ? 2 : (extras.__special_bevel_quality__));
var _local11 = ((extras.__special_bevel_type__ == undefined) ? "inner" : (extras.__special_bevel_type__));
var _local10 = ((extras.__special_bevel_knockout__ == undefined) ? false : (extras.__special_bevel_knockout__));
if (propName == "bevel_distance") {
var _local9 = new flash.filters.BevelFilter(propValue, 45, 16777215, 1, 0, 1, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_angle") {
var _local9 = new flash.filters.BevelFilter(0, propValue, 16777215, 1, 0, 1, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_highlightColor") {
var _local9 = new flash.filters.BevelFilter(0, 45, propValue, 1, 0, 1, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_highlightAlpha") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, propValue, 0, 1, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_shadowColor") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, propValue, 1, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_shadowAlpha") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, propValue, 0, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_blurX") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, propValue, 0, 1, _local8, _local11, _local10);
}
if (propName == "bevel_blurY") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, 0, propValue, 1, _local8, _local11, _local10);
}
if (propName == "bevel_strength") {
var _local9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, 0, 0, propValue, _local8, _local11, _local10);
}
_local3.push(_local9);
}
} else {
return(undefined);
}
mtarget.filters = _local3;
};
MovieClip.prototype.tween = (TextField.prototype.tween = (Sound.prototype.tween = function (prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2);
}));
ASSetPropFlags(MovieClip.prototype, "tween", 1, 0);
ASSetPropFlags(TextField.prototype, "tween", 1, 0);
ASSetPropFlags(Sound.prototype, "tween", 1, 0);
MovieClip.prototype.roundedTween = (TextField.prototype.roundedTween = (Sound.prototype.roundedTween = function (prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2, {mustRound:true});
}));
ASSetPropFlags(MovieClip.prototype, "roundedTween", 1, 0);
ASSetPropFlags(TextField.prototype, "roundedTween", 1, 0);
ASSetPropFlags(Sound.prototype, "roundedTween", 1, 0);
MovieClip.prototype.stopTween = (TextField.prototype.stopTween = (Sound.prototype.stopTween = function (props) {
if (typeof(props) == "string") {
props = [props];
}
if (props != undefined) {
var _local4 = 1;
while (_local4 < arguments.length) {
props.push(arguments[_local4]);
_local4++;
}
}
_global.$stopTween(this, props, true);
}));
ASSetPropFlags(MovieClip.prototype, "stopTween", 1, 0);
ASSetPropFlags(TextField.prototype, "stopTween", 1, 0);
ASSetPropFlags(Sound.prototype, "stopTween", 1, 0);
MovieClip.prototype.pauseTween = (TextField.prototype.pauseTween = (Sound.prototype.pauseTween = function (props) {
if (props != undefined) {
if (typeof(props) == "string") {
props = [props];
}
var _local6 = 1;
while (_local6 < Arguments.length) {
props.push(Arguments[_local6]);
_local6++;
}
}
var _local4 = _root.__tweenController__.$_tweenPropList;
var _local5;
for (var _local7 in _local4) {
if ((_local4[_local7]._targ == this) && (!_local4[_local7]._isPaused)) {
if (props != undefined) {
_local5 = false;
for (var _local6 in props) {
if (props[_local6] == _local4[_local7]._prop) {
_local5 = true;
break;
}
}
}
if ((props == undefined) || (_local5)) {
_local4[_local7]._isPaused = true;
_local4[_local7]._timePaused = _root.__tweenController__.$_tTime;
}
}
}
}));
ASSetPropFlags(MovieClip.prototype, "pauseTween", 1, 0);
ASSetPropFlags(TextField.prototype, "pauseTween", 1, 0);
ASSetPropFlags(Sound.prototype, "pauseTween", 1, 0);
MovieClip.prototype.resumeTween = (TextField.prototype.resumeTween = (Sound.prototype.resumeTween = function (props) {
if (props != undefined) {
if (typeof(props) == "string") {
props = [props];
}
var _local7 = 1;
while (_local7 < Arguments.length) {
props.push(Arguments[_local7]);
_local7++;
}
}
var _local3 = _root.__tweenController__.$_tweenPropList;
var _local5;
var _local6;
for (var _local8 in _local3) {
if ((_local3[_local8]._targ == this) && (_local3[_local8]._isPaused)) {
if (props != undefined) {
_local5 = false;
for (var _local7 in props) {
if (props[_local7] == _local3[_local8]._prop) {
_local5 = true;
break;
}
}
}
if ((props == undefined) || (_local5)) {
_local3[_local8]._isPaused = false;
_local6 = _root.__tweenController__.$_tTime - _local3[_local8]._timePaused;
_local3[_local8]._timeStart = _local3[_local8]._timeStart + _local6;
_local3[_local8]._timeDest = _local3[_local8]._timeDest + _local6;
_local3[_local8]._timePaused = 0;
}
}
}
}));
ASSetPropFlags(MovieClip.prototype, "resumeTween", 1, 0);
ASSetPropFlags(TextField.prototype, "resumeTween", 1, 0);
ASSetPropFlags(Sound.prototype, "resumeTween", 1, 0);
MovieClip.prototype.lockTween = (TextField.prototype.lockTween = (Sound.prototype.lockTween = function () {
this.$_isTweenLocked = true;
ASSetPropFlags(this, "this.$_isTweenLocked", 1, 0);
}));
ASSetPropFlags(MovieClip.prototype, "lockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "lockTween", 1, 0);
ASSetPropFlags(Sound.prototype, "lockTween", 1, 0);
MovieClip.prototype.unlockTween = (TextField.prototype.unlockTween = (Sound.prototype.unlockTween = function () {
delete this.$_isTweenLocked;
}));
ASSetPropFlags(MovieClip.prototype, "unlockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "unlockTween", 1, 0);
ASSetPropFlags(Sound.prototype, "unlockTween", 1, 0);
MovieClip.prototype.getTweens = (TextField.prototype.getTweens = (Sound.prototype.getTweens = function () {
return(this.$_tweenCount);
}));
ASSetPropFlags(MovieClip.prototype, "getTweens", 1, 0);
ASSetPropFlags(TextField.prototype, "getTweens", 1, 0);
ASSetPropFlags(Sound.prototype, "getTweens", 1, 0);
MovieClip.prototype.isTweening = (TextField.prototype.isTweening = (Sound.prototype.isTweening = function () {
return(((this.$_tweenCount > 0) ? true : false));
}));
ASSetPropFlags(MovieClip.prototype, "isTweening", 1, 0);
ASSetPropFlags(TextField.prototype, "isTweening", 1, 0);
ASSetPropFlags(Sound.prototype, "isTweening", 1, 0);
MovieClip.prototype.alphaTo = (TextField.prototype.alphaTo = function (propDest_a, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_alpha", propDest_a, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "alphaTo", 1, 0);
ASSetPropFlags(TextField.prototype, "alphaTo", 1, 0);
MovieClip.prototype.frameTo = function (propDest_frame, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "__special_mc_frame__", propDest_frame, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(MovieClip.prototype, "frameTo", 1, 0);
MovieClip.prototype.resizeTo = (TextField.prototype.resizeTo = function (propDest_width, propDest_height, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["_width", "_height"], [propDest_width, propDest_height], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "resizeTo", 1, 0);
ASSetPropFlags(TextField.prototype, "resizeTo", 1, 0);
MovieClip.prototype.rotateTo = (TextField.prototype.rotateTo = function (propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_rotation", propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "rotateTo", 1, 0);
ASSetPropFlags(TextField.prototype, "rotateTo", 1, 0);
MovieClip.prototype.scaleTo = (TextField.prototype.scaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["_xscale", "_yscale"], [propDest_scale, propDest_scale], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "scaleTo", 1, 0);
ASSetPropFlags(TextField.prototype, "scaleTo", 1, 0);
MovieClip.prototype.xScaleTo = (TextField.prototype.xScaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_xscale", propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "xScaleTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xScaleTo", 1, 0);
MovieClip.prototype.yScaleTo = (TextField.prototype.yScaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_yscale", propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "yScaleTo", 1, 0);
ASSetPropFlags(TextField.prototype, "yScaleTo", 1, 0);
TextField.prototype.scrollTo = function (propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "scroll", propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(TextField.prototype, "scrollTo", 1, 0);
MovieClip.prototype.slideTo = (TextField.prototype.slideTo = function (propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["_x", "_y"], [propDest_x, propDest_y], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "slideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "slideTo", 1, 0);
MovieClip.prototype.roundedSlideTo = (TextField.prototype.roundedSlideTo = function (propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["_x", "_y"], [propDest_x, propDest_y], timeSeconds, animType, delay, callback, extra1, extra2, {mustRound:true});
});
ASSetPropFlags(MovieClip.prototype, "roundedSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "roundedSlideTo", 1, 0);
MovieClip.prototype.xSlideTo = (TextField.prototype.xSlideTo = function (propDest_x, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_x", propDest_x, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "xSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xSlideTo", 1, 0);
MovieClip.prototype.roundedXSlideTo = (TextField.prototype.roundedXSlideTo = function (propDest_x, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_x", propDest_x, timeSeconds, animType, delay, callback, extra1, extra2, {mustRound:true});
});
ASSetPropFlags(MovieClip.prototype, "roundedXSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "roundedXSlideTo", 1, 0);
MovieClip.prototype.ySlideTo = (TextField.prototype.ySlideTo = function (propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_y", propDest_y, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "ySlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "ySlideTo", 1, 0);
MovieClip.prototype.roundedYSlideTo = (TextField.prototype.roundedYSlideTo = function (propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "_y", propDest_y, timeSeconds, animType, delay, callback, extra1, extra2, {mustRound:true});
});
ASSetPropFlags(MovieClip.prototype, "roundedYSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "roundedYSlideTo", 1, 0);
MovieClip.prototype.bezierSlideTo = (TextField.prototype.bezierSlideTo = function (cpoint_x, cpoint_y, propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local3 = new Object();
_local3.__special_bst_ix__ = undefined;
_local3.__special_bst_iy__ = undefined;
_local3.__special_bst_cx__ = cpoint_x;
_local3.__special_bst_cy__ = cpoint_y;
_local3.__special_bst_dx__ = propDest_x;
_local3.__special_bst_dy__ = propDest_y;
_global.$addTween(this, "__special_bst_t__", 1, timeSeconds, animType, delay, callback, extra1, extra2, _local3);
});
ASSetPropFlags(MovieClip.prototype, "bezierSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "bezierSlideTo", 1, 0);
MovieClip.prototype.roundedBezierSlideTo = (TextField.prototype.roundedBezierSlideTo = function (cpoint_x, cpoint_y, propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local3 = new Object();
_local3.__special_bst_ix__ = undefined;
_local3.__special_bst_iy__ = undefined;
_local3.__special_bst_cx__ = cpoint_x;
_local3.__special_bst_cy__ = cpoint_y;
_local3.__special_bst_dx__ = propDest_x;
_local3.__special_bst_dy__ = propDest_y;
_local3.mustRound = true;
_global.$addTween(this, "__special_bst_t__", 1, timeSeconds, animType, delay, callback, extra1, extra2, _local3);
});
ASSetPropFlags(MovieClip.prototype, "roundedBezierSlideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "roundedBezierSlideTo", 1, 0);
Sound.prototype.volumeTo = function (propDest_volume, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "__special_sound_volume__", propDest_volume, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(Sound.prototype, "volumeTo", 1, 0);
Sound.prototype.panTo = function (propDest_volume, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "__special_sound_pan__", propDest_volume, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(Sound.prototype, "panTo", 1, 0);
MovieClip.prototype.colorTo = function (propDest_color, timeSeconds, animType, delay, callback, extra1, extra2) {
if (propDest_color == null) {
this.colorTransformTo(100, 0, 100, 0, 100, 0, undefined, undefined, timeSeconds, animType, delay, callback, extra1, extra2);
} else {
var _local3 = propDest_color >> 16;
var _local5 = (propDest_color & 65280) >> 8;
var _local4 = propDest_color & 255;
this.colorTransformTo(0, _local3, 0, _local5, 0, _local4, undefined, undefined, timeSeconds, animType, delay, callback, extra1, extra2);
}
};
ASSetPropFlags(MovieClip.prototype, "colorTo", 1, 0);
TextField.prototype.colorTo = function (propDest_color, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local3 = propDest_color >> 16;
var _local6 = (propDest_color & 65280) >> 8;
var _local4 = propDest_color & 255;
_global.$addTween(this, ["__special_text_r__", "__special_text_g__", "__special_text_b__"], [_local3, _local6, _local4], timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(TextField.prototype, "colorTo", 1, 0);
MovieClip.prototype.colorTransformTo = function () {
if ((typeof(arguments[0]) == "object") && (arguments[0] != undefined)) {
_global.$addTween(this, ["__special_mc_ra__", "__special_mc_rb__", "__special_mc_ga__", "__special_mc_gb__", "__special_mc_ba__", "__special_mc_bb__", "__special_mc_aa__", "__special_mc_ab__"], [arguments[0].ra, arguments[0].rb, arguments[0].ga, arguments[0].gb, arguments[0].ba, arguments[0].bb, arguments[0].aa, arguments[0].ab], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
} else {
_global.$addTween(this, ["__special_mc_ra__", "__special_mc_rb__", "__special_mc_ga__", "__special_mc_gb__", "__special_mc_ba__", "__special_mc_bb__", "__special_mc_aa__", "__special_mc_ab__"], [arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13]);
}
};
ASSetPropFlags(MovieClip.prototype, "colorTransformTo", 1, 0);
MovieClip.prototype.blurTo = (TextField.prototype.blurTo = function () {
if ((typeof(arguments[0]) == "object") && (arguments[0] != undefined)) {
_global.$addTween(this, ["__special_blur_x__", "__special_blur_y__"], [arguments[0].blurX, arguments[0].blurY], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], {__special_blur_quality__:arguments[0].quality});
} else {
_global.$addTween(this, ["__special_blur_x__", "__special_blur_y__"], [arguments[0], arguments[0]], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], {__special_blur_quality__:arguments[1]});
}
});
ASSetPropFlags(MovieClip.prototype, "blurTo", 1, 0);
ASSetPropFlags(TextField.prototype, "blurTo", 1, 0);
MovieClip.prototype.xyBlurTo = (TextField.prototype.xyBlurTo = function (propDest_blurX, propDest_blurY, quality, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["__special_blur_x__", "__special_blur_y__"], [propDest_blurX, propDest_blurY], timeSeconds, animType, delay, callback, extra1, extra2, {__special_blur_quality__:quality});
});
ASSetPropFlags(MovieClip.prototype, "xyBlurTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xyBlurTo", 1, 0);
MovieClip.prototype.xBlurTo = (TextField.prototype.xBlurTo = function (propDest_blur, quality, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "__special_blur_x__", propDest_blur, timeSeconds, animType, delay, callback, extra1, extra2, {__special_blur_quality__:quality});
});
ASSetPropFlags(MovieClip.prototype, "xBlurTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xBlurTo", 1, 0);
MovieClip.prototype.yBlurTo = (TextField.prototype.yBlurTo = function (propDest_blur, quality, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, "__special_blur_y__", propDest_blur, timeSeconds, animType, delay, callback, extra1, extra2, {__special_blur_quality__:quality});
});
ASSetPropFlags(MovieClip.prototype, "yBlurTo", 1, 0);
ASSetPropFlags(TextField.prototype, "yBlurTo", 1, 0);
MovieClip.prototype.glowTo = (TextField.prototype.glowTo = function () {
if ((typeof(arguments[0]) == "object") && (arguments[0] != undefined)) {
_global.$addTween(this, ["__special_glow_color__", "__special_glow_alpha__", "__special_glow_blurX__", "__special_glow_blurY__", "__special_glow_strength__"], [arguments[0].color, arguments[0].alpha, arguments[0].blurX, arguments[0].blurY, arguments[0].strength], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], {__special_glow_quality__:arguments[0].quality, __special_glow_inner__:arguments[0].inner, __special_glow_knockout__:arguments[0].knockout});
} else {
_global.$addTween(this, ["__special_glow_color__", "__special_glow_alpha__", "__special_glow_blurX__", "__special_glow_blurY__", "__special_glow_strength__"], [arguments[0], arguments[1], arguments[2], arguments[2], arguments[3]], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], {__special_glow_quality__:arguments[4], __special_glow_inner__:arguments[5], __special_glow_knockout__:arguments[6]});
}
});
ASSetPropFlags(MovieClip.prototype, "glowTo", 1, 0);
ASSetPropFlags(TextField.prototype, "glowTo", 1, 0);
MovieClip.prototype.xyGlowTo = (TextField.prototype.xyGlowTo = function (propDest_color, propDest_alpha, propDest_blurX, propDest_blurY, propDest_strength, quality, inner, knockout, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["__special_glow_color__", "__special_glow_alpha__", "__special_glow_blurX__", "__special_glow_blurY__", "__special_glow_strength__"], [propDest_color, propDest_alpha, propDest_blurX, propDest_blurY, propDest_strength], timeSeconds, animType, delay, callback, extra1, extra2, {__special_glow_quality__:quality, __special_glow_inner__:inner, __special_glow_knockout__:knockout});
});
ASSetPropFlags(MovieClip.prototype, "xyGlowTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xyGlowTo", 1, 0);
MovieClip.prototype.xGlowTo = (TextField.prototype.xGlowTo = function (propDest_color, propDest_alpha, propDest_blur, propDest_strength, quality, inner, knockout, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["__special_glow_color__", "__special_glow_alpha__", "__special_glow_blurX__", "__special_glow_strength__"], [propDest_color, propDest_alpha, propDest_blur, propDest_strength], timeSeconds, animType, delay, callback, extra1, extra2, {__special_glow_quality__:quality, __special_glow_inner__:inner, __special_glow_knockout__:knockout});
});
ASSetPropFlags(MovieClip.prototype, "xGlowTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xGlowTo", 1, 0);
MovieClip.prototype.yGlowTo = (TextField.prototype.yGlowTo = function (propDest_color, propDest_alpha, propDest_blur, propDest_strength, quality, inner, knockout, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["__special_glow_color__", "__special_glow_alpha__", "__special_glow_blurY__", "__special_glow_strength__"], [propDest_color, propDest_alpha, propDest_blur, propDest_strength], timeSeconds, animType, delay, callback, extra1, extra2, {__special_glow_quality__:quality, __special_glow_inner__:inner, __special_glow_knockout__:knockout});
});
ASSetPropFlags(MovieClip.prototype, "yGlowTo", 1, 0);
ASSetPropFlags(TextField.prototype, "yGlowTo", 1, 0);
MovieClip.prototype.bevelTo = (TextField.prototype.bevelTo = function () {
if ((typeof(arguments[0]) == "object") && (arguments[0] != undefined)) {
_global.$addTween(this, ["__special_bevel_distance__", "__special_bevel_angle__", "__special_bevel_highlightColor__", "__special_bevel_highlightAlpha__", "__special_bevel_shadowColor__", "__special_bevel_shadowAlpha__", "__special_bevel_blurX__", "__special_bevel_blurY__", "__special_bevel_strength__"], [arguments[0].distance, arguments[0].angle, arguments[0].highlightColor, arguments[0].highlightAlpha * 100, arguments[0].shadowColor, arguments[0].shadowAlpha * 100, arguments[0].blurX, arguments[0].blurY, arguments[0].strength], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], {__special_bevel_quality__:arguments[0].quality, __special_bevel_type__:arguments[0].type, __special_bevel_knockout__:arguments[0].knockout});
} else {
_global.$addTween(this, ["__special_bevel_distance__", "__special_bevel_angle__", "__special_bevel_highlightColor__", "__special_bevel_highlightAlpha__", "__special_bevel_shadowColor__", "__special_bevel_shadowAlpha__", "__special_bevel_blurX__", "__special_bevel_blurY__", "__special_bevel_strength__"], [arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[6], arguments[7]], arguments[11], arguments[12], arguments[13], arguments[14], arguments[15], arguments[16], {__special_bevel_quality__:arguments[8], __special_bevel_type__:arguments[9], __special_bevel_knockout__:arguments[10]});
}
});
ASSetPropFlags(MovieClip.prototype, "bevelTo", 1, 0);
ASSetPropFlags(TextField.prototype, "bevelTo", 1, 0);
MovieClip.prototype.xyBevelTo = (TextField.prototype.xyBevelTo = function (propDest_distance, propDest_angle, propDest_highlightColor, propDest_highlightAlpha, propDest_shadowColor, propDest_shadowAlpha, propDest_blurX, propDest_blurY, propDest_strength, quality, type, knockout, timeSeconds, animType, delay, callback, extra1, extra2) {
_global.$addTween(this, ["__special_bevel_distance__", "__special_bevel_angle__", "__special_bevel_highlightColor__", "__special_bevel_highlightAlpha__", "__special_bevel_shadowColor__", "__special_bevel_shadowAlpha__", "__special_bevel_blurX__", "__special_bevel_blurY__", "__special_bevel_blurY__", "__special_bevel_strength__"], [propDest_distance, propDest_angle, propDest_highlightColor, propDest_highlightAlpha, propDest_shadowColor, propDest_shadowAlpha, propDest_blur, propDest_blur, propDest_strength], timeSeconds, animType, delay, callback, extra1, extra2, {__special_bevel_quality__:quality, __special_bevel_type__:type, __special_bevel_knockout__:knockout});
});
ASSetPropFlags(MovieClip.prototype, "xyBevelTo", 1, 0);
ASSetPropFlags(TextField.prototype, "xyBevelTo", 1, 0);
_global.findPointOnCurve = function (p1x, p1y, cx, cy, p2x, p2y, t) {
return({x:p1x + (t * (((2 * (1 - t)) * (cx - p1x)) + (t * (p2x - p1x)))), y:p1y + (t * (((2 * (1 - t)) * (cy - p1y)) + (t * (p2y - p1y))))});
};
ASSetPropFlags(_global, "findPointOnCurve", 1, 0);
_global.findTweenColor = function (objProp, tTime) {
var _local8 = objProp._propStart >> 16;
var _local4 = objProp._propDest >> 16;
var _local5 = (objProp._propStart >> 8) & 255;
var _local6 = (objProp._propDest >> 8) & 255;
var _local9 = objProp._propStart & 255;
var _local7 = objProp._propDest & 255;
var _local12 = Math.round(_global.findTweenValue(_local8, _local4, objProp._timeStart, tTime - (objProp._delay * 1000), objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2));
var _local10 = Math.round(_global.findTweenValue(_local5, _local6, objProp._timeStart, tTime - (objProp._delay * 1000), objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2));
var _local3 = Math.round(_global.findTweenValue(_local9, _local7, objProp._timeStart, tTime - (objProp._delay * 1000), objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2));
return(((_local12 << 16) + (_local10 << 8)) + _local3);
};
_global.findTweenValue = function (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) {
var _local1 = _timeNow - _timeStart;
var _local4 = _propStart;
var _local2 = _propDest - _propStart;
var _local3 = _timeDest - _timeStart;
var _local6 = _extra1;
var _local7 = _extra2;
var _local5 = _extra1;
switch (_animType.toLowerCase()) {
case "linear" :
return(((_local2 * _local1) / _local3) + _local4);
case "easeinquad" :
_local1 = _local1 / _local3;
return(((_local2 * _local1) * _local1) + _local4);
case "easeoutquad" :
_local1 = _local1 / _local3;
return((((-_local2) * _local1) * (_local1 - 2)) + _local4);
case "easeinoutquad" :
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return((((_local2 / 2) * _local1) * _local1) + _local4);
}
_local1--;
return((((-_local2) / 2) * ((_local1 * (_local1 - 2)) - 1)) + _local4);
case "easeoutinquad" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutQuad") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInQuad") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeincubic" :
_local1 = _local1 / _local3;
return((((_local2 * _local1) * _local1) * _local1) + _local4);
case "easeoutcubic" :
_local1 = (_local1 / _local3) - 1;
return((_local2 * (((_local1 * _local1) * _local1) + 1)) + _local4);
case "easeinoutcubic" :
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return(((((_local2 / 2) * _local1) * _local1) * _local1) + _local4);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * _local1) + 2)) + _local4);
case "easeoutincubic" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutCubic") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInCubic") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinquart" :
_local1 = _local1 / _local3;
return(((((_local2 * _local1) * _local1) * _local1) * _local1) + _local4);
case "easeoutquart" :
_local1 = (_local1 / _local3) - 1;
return(((-_local2) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + _local4);
case "easeinoutquart" :
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) + _local4);
}
_local1 = _local1 - 2;
return((((-_local2) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + _local4);
case "easeoutinquart" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutQuart") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInQuart") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinquint" :
_local1 = _local1 / _local3;
return((((((_local2 * _local1) * _local1) * _local1) * _local1) * _local1) + _local4);
case "easeoutquint" :
_local1 = (_local1 / _local3) - 1;
return((_local2 * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + _local4);
case "easeinoutquint" :
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return(((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + _local4);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + _local4);
case "easeoutinquint" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutQuint") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInQuint") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinsine" :
return((((-_local2) * Math.cos((_local1 / _local3) * (Math.PI/2))) + _local2) + _local4);
case "easeoutsine" :
return((_local2 * Math.sin((_local1 / _local3) * (Math.PI/2))) + _local4);
case "easeinoutsine" :
return((((-_local2) / 2) * (Math.cos((Math.PI * _local1) / _local3) - 1)) + _local4);
case "easeoutinsine" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutSine") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInSine") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinexpo" :
return(((_local1 == 0) ? (_local4) : ((_local2 * Math.pow(2, 10 * ((_local1 / _local3) - 1))) + _local4)));
case "easeoutexpo" :
return(((_local1 == _local3) ? (_local4 + _local2) : ((_local2 * ((-Math.pow(2, (-10 * _local1) / _local3)) + 1)) + _local4)));
case "easeinoutexpo" :
if (_local1 == 0) {
return(_local4);
}
if (_local1 == _local3) {
return(_local4 + _local2);
}
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return(((_local2 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local4);
}
_local1--;
return(((_local2 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local4);
case "easeoutinexpo" :
if (_local1 == 0) {
return(_local4);
}
if (_local1 == _local3) {
return(_local4 + _local2);
}
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return(((_local2 / 2) * ((-Math.pow(2, (-10 * _local1) / 1)) + 1)) + _local4);
}
return(((_local2 / 2) * (Math.pow(2, (10 * (_local1 - 2)) / 1) + 1)) + _local4);
case "easeincirc" :
_local1 = _local1 / _local3;
return(((-_local2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local4);
case "easeoutcirc" :
_local1 = (_local1 / _local3) - 1;
return((_local2 * Math.sqrt(1 - (_local1 * _local1))) + _local4);
case "easeinoutcirc" :
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
return((((-_local2) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local4);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + _local4);
case "easeoutincirc" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutCirc") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInCirc") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinelastic" :
if (_local1 == 0) {
return(_local4);
}
_local1 = _local1 / _local3;
if (_local1 == 1) {
return(_local4 + _local2);
}
if (!_local7) {
_local7 = _local3 * 0.3;
}
if ((!_local6) || (_local6 < Math.abs(_local2))) {
_local6 = _local2;
_local5 = _local7 / 4;
} else {
_local5 = (_local7 / (Math.PI*2)) * Math.asin(_local2 / _local6);
}
_local1 = _local1 - 1;
return((-((_local6 * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * _local3) - _local5) * (Math.PI*2)) / _local7))) + _local4);
case "easeoutelastic" :
if (_local1 == 0) {
return(_local4);
}
_local1 = _local1 / _local3;
if (_local1 == 1) {
return(_local4 + _local2);
}
if (!_local7) {
_local7 = _local3 * 0.3;
}
if ((!_local6) || (_local6 < Math.abs(_local2))) {
_local6 = _local2;
_local5 = _local7 / 4;
} else {
_local5 = (_local7 / (Math.PI*2)) * Math.asin(_local2 / _local6);
}
return((((_local6 * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * _local3) - _local5) * (Math.PI*2)) / _local7)) + _local2) + _local4);
case "easeinoutelastic" :
if (_local1 == 0) {
return(_local4);
}
_local1 = _local1 / (_local3 / 2);
if (_local1 == 2) {
return(_local4 + _local2);
}
if (!_local7) {
_local7 = _local3 * 0.45;
}
if ((!_local6) || (_local6 < Math.abs(_local2))) {
_local6 = _local2;
_local5 = _local7 / 4;
} else {
_local5 = (_local7 / (Math.PI*2)) * Math.asin(_local2 / _local6);
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((_local6 * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * _local3) - _local5) * (Math.PI*2)) / _local7))) + _local4);
}
_local1 = _local1 - 1;
return(((((_local6 * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * _local3) - _local5) * (Math.PI*2)) / _local7)) * 0.5) + _local2) + _local4);
case "easeoutinelastic" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutElastic") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInElastic") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = _local1 / _local3;
return((((_local2 * _local1) * _local1) * (((_local5 + 1) * _local1) - _local5)) + _local4);
case "easeoutback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = (_local1 / _local3) - 1;
return((_local2 * (((_local1 * _local1) * (((_local5 + 1) * _local1) + _local5)) + 1)) + _local4);
case "easeinoutback" :
if (_local5 == undefined) {
_local5 = 1.70158;
}
_local1 = _local1 / (_local3 / 2);
if (_local1 < 1) {
_local5 = _local5 * 1.525;
return(((_local2 / 2) * ((_local1 * _local1) * (((_local5 + 1) * _local1) - _local5))) + _local4);
}
_local1 = _local1 - 2;
_local5 = _local5 * 1.525;
return(((_local2 / 2) * (((_local1 * _local1) * (((_local5 + 1) * _local1) + _local5)) + 2)) + _local4);
case "easeoutinback" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutBack") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInBack") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeinbounce" :
return((_local2 - findTweenValue(0, _local2, 0, _local3 - _local1, _local3, "easeOutBounce")) + _local4);
case "easeoutbounce" :
_local1 = _local1 / _local3;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local4);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local4);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local4);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local4);
case "easeinoutbounce" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeInBounce") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeOutBounce") * 0.5) + (_local2 * 0.5)) + _local4);
case "easeoutinbounce" :
if (_local1 < (_local3 / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, _local3, "easeOutBounce") * 0.5) + _local4);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - _local3, _local3, "easeInBounce") * 0.5) + (_local2 * 0.5)) + _local4);
}
return(0);
};
ASSetPropFlags(_global, "findTweenValue", 1, 0);
var goodURL = false;
var armorGamesVersion = false;
var urlCheckerOn = true;
urlChecker();
preLoaderCombo.versionNumber.text = versionNumber;
function loadAd() {
System.security.allowDomain("server.cpmstar.com");
_root.attachMovie("adBox", "adBox", 12);
adBox._x = 441.8;
adBox._y = 121.7;
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
}
function removeAd() {
unloadMovie (adBox);
adBox._x = -500;
adBox._y = -500;
removeMovieClip(this);
}
var CPMStarPoolID = 1052;
var CPMStarSubPoolID = 26;
loadAd();
Frame 3
stop();
Frame 4
stop();
Frame 5
function debugTools() {
if (debugMode == true) {
setupConsole();
_root.attachMovie("fpsChecker", "fpsCheck", depth_DEBUG_fps);
_root.fpsCheck._x = Stage.width - 5;
_root.fpsCheck._y = 25;
_root.fpsCheck._alpha = 70;
_root.fpsCheck.onEnterFrame = function () {
fpsTime = getTimer();
framerate = Math.round(1000 / (fpsTime - oldTime));
updateFPScount--;
if (updateFPScount < 0) {
this.fpsText.text = "FPS: " + framerate;
updateFPScount = updateFPScountMax;
if (framerate <= 20) {
this.fpsText.colorTo(10027008);
} else {
this.fpsText.colorTo(16777215);
}
}
oldTime = fpsTime;
};
}
}
function newGameReset() {
unlockedSpells = new Array();
allFoundTrinkets = new Array();
resetRunesForNewGame();
savedBowSlots = new Array();
bowSlots = new Array();
battleNum = 1;
currentLevel = "level1";
trinketEquipped = "empty";
}
function continueGameReset() {
savedBowSlots = new Array();
unlockedSpells = new Array();
bowSlots = new Array();
playingSkirmish = false;
trinketEquipped = "empty";
}
function survivalGameReset() {
unlockedSpells = new Array();
bowSlots = new Array();
savedBowSlots = new Array();
trinketEquipped = "empty";
}
function activateCheats() {
earthRunes = 990;
fireRunes = 990;
boneRunes = 990;
stormRunes = 990;
chaosRunes = 990;
destructionRunes = 990;
trinketDropChance = 100;
}
function resetLevelVariables() {
enemyGenDelay = 550;
level11.maxEnemyCount = 1;
enemySpawnCount = enemySpawnCountMax;
portalIndex = 0;
numPortals = 0;
particleCount = 0;
arrowCount = 0;
enemyCount = 0;
currentSpawnPoint = 0;
survivalModeKills = 0;
survivalPortalsDestroyed = 0;
survivalEnemyCountBonus = 0;
currentEnemySet = "enemyTypesSet1";
alreadyEquippedBow = false;
roofCollisions = new Array();
activeEnemy = new Array();
heroSoldiers = new Array();
activeMinions = new Array();
activePortals = new Array();
activeSplash = new Array();
activeWalls = new Array();
spellStonesArray = new Array();
}
function toggleQuality() {
switch (_root._quality) {
case "MEDIUM" :
showQuickMessage("Quality: High");
_root._quality = "HIGH";
break;
case "LOW" :
showQuickMessage("Quality: Medium");
_root._quality = "MEDIUM";
break;
case "HIGH" :
showQuickMessage("Quality: Low");
_root._quality = "LOW";
break;
}
}
function applyGravity(objName) {
while (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (objPoint = new flash.geom.Point(objName._x, objName._y)))) {
objName._y = objName._y - 1;
}
if (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (objPoint = new flash.geom.Point(objName._x, objName._y))) == false) {
objName._y = objName._y + gravity;
}
}
function applyInstantGravity(objName) {
while (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (objPoint = new flash.geom.Point(objName._x, objName._y)))) {
objName._y = objName._y - 1;
}
while (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (objPoint = new flash.geom.Point(objName._x, objName._y))) == false) {
objName._y = objName._y + 1;
}
}
function applyFallingGravity(objName) {
if (!world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (objPoint = new flash.geom.Point(objName._x, objName._y)))) {
objName.acceleration = 1.03;
objName.fallRate = objName.fallRate * objName.acceleration;
objName._y = objName._y + objName.fallRate;
if (objName._xscale == -100) {
objName._x = objName._x + (objName.fallRate / 4);
} else {
objName._x = objName._x - (objName.fallRate / 4);
}
} else {
objName.gotoAndPlay("hitGround");
objName.onEnterFrame = null;
}
}
function updateInventory() {
for (v in runeButtons) {
runeButtons[v].amount.text = _root[runeButtons[v]._name + "Runes"];
}
}
function setupInventory() {
if (soundMuted == false) {
music_menuMusic.volumeTo(20, 3);
}
hideMenu();
_root.attachMovie("inventoryScreen", "inventory", depth_inventory);
inventory._alpha = 0;
_root.attachMovie("blackOut", "blackOut", depth_blackOut);
blackOut._alpha = 0;
blackOut.alphaTo(100, 0.8, "easeOutSine", 0, function () {
inventory._alpha = 100;
removeMovieClip(storyBook);
});
blackOut.alphaTo(0, 0.8, "easeOutSine", 1.8, function () {
blackOut._visible = false;
});
setTimeout(function () {
if (blackOut._x != undefined) {
blackOut._visible = false;
}
}, 2000);
runeButtons = new Array(inventory.fire, inventory.earth, inventory.storm, inventory.chaos, inventory.bone, inventory.destruction);
for (v in runeButtons) {
runeButtons[v].rune.gotoAndStop(runeButtons[v]._name);
runeButtons[v].amount.text = _root[runeButtons[v]._name + "Runes"];
runeButtons[v].onRollOver = function () {
_root.showToolTip(this._name, "runeStones", "inventory");
};
runeButtons[v].onRollOut = function () {
_root.hideToolTip();
};
runeButtons[v].onRelease = function () {
_root.addRuneToCombiner(this._name);
};
}
inventory.combinerIcon.gotoAndStop("combine");
inventory.combinerIcon.selectRing._visible = false;
combinerSlot1 = new Object();
combinerSlot1.ref = inventory.combiner_slot1;
combinerSlot1.runeType = "empty";
combinerSlot2 = new Object();
combinerSlot2.ref = inventory.combiner_slot2;
combinerSlot2.runeType = "empty";
combinerSlot3 = new Object();
combinerSlot3.ref = inventory.combiner_slot3;
combinerSlot3.runeType = "empty";
combinerSlot4 = new Object();
combinerSlot4.ref = inventory.combiner_slot4;
combinerSlot4.runeType = "empty";
combinerSlots = new Array(combinerSlot1, combinerSlot2, combinerSlot3, combinerSlot4);
for (x in combinerSlots) {
combinerSlots[x].ref.onRelease = function () {
removeRuneFromCombiner(this._name);
};
}
inventory.combineButton.onRelease = function () {
combineRunes();
};
var _local5 = 3;
var _local4 = 60;
var _local3 = 0;
var _local6 = 0;
x = 1;
while (x <= 18) {
inventory.attachMovie("spellStone", "spell" + x, 500 + x);
inventory["spell" + x].spellIcon.selectRing._visible = false;
if (_local3 == _local5) {
_local3 = 0;
_local6++;
_local4 = _local4 + (inventory["spell" + x]._height + 5);
}
inventory["spell" + x]._x = 645 + ((inventory["spell" + x]._width + 5) * _local3);
inventory["spell" + x]._y = _local4;
_local3++;
inventory["spell" + x].inSlotNumber = null;
_root.buttonSetup_spellIcons(inventory["spell" + x]);
inventory["spell" + x].spellIcon.gotoAndStop(allSpells[x - 1].name);
inventory["spell" + x].spell = allSpells[x - 1];
inventory["spell" + x].name = "spell" + x;
s = 0;
while (s < savedBowSlots.length) {
if (inventory["spell" + x].spell.name == savedBowSlots[s].arrowType) {
inventory["spell" + x].inSlotNumber = s;
}
s++;
}
spellStonesArray.push(inventory["spell" + x]);
inventory["spell" + x]._visible = false;
x++;
}
for (s in unlockedSpells) {
for (x in spellStonesArray) {
if (unlockedSpells[s] == spellStonesArray[x].spell.name) {
spellStonesArray[x]._visible = true;
}
}
}
setupBowSlots();
setupTrinkets();
setTimeout(helpMessageInventory, 2000);
inventory.spellDesc.spellName.text = "Spells & Trinkets";
inventory.spellDesc.description.text = "Examine a spell or trinket from your collection to see it's effects and the mana required to cast.\r\rTo equip a SPELL, simply DRAG it from the left into one of the bow slots below. You can equip up to 5 different spells on your bow at a time.\r\rTo equip a TRINKET, simply click it and it will be attached to your bow. Click it again to remove it.";
inventory.spellDesc.effects.text = "Effects: This is a description of the DAMAGE or EFFECTS the highlighted spell will do.";
inventory.spellDesc.manaCost.text = "Mana Cost: Spells cost MANA to cast. Your MANA slowly regenerates over time.";
}
function hideInventory() {
inventory.alphaTo(0, 1, "easeOutSine", 2, function () {
removeMovieClip(this);
});
}
function buttonSetup_inventory(btnName) {
inventory[btnName].onRollOver = function () {
this.colorTransformTo(200, 0, 200, 0, 200, 0, 100, 0, 0.4, "easeOutSine");
this.scaleTo(110, 0.4, "easeOutSine");
};
inventory[btnName].onRollOut = function () {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
this.scaleTo(100, 0.4, "easeOutSine");
};
switch (btnName) {
case "equipBow" :
inventory[btnName].onRelease = function () {
if (_root.equippingBow == false) {
showBowSetup();
moveSpellsToBowSlots();
} else {
showSpellSetup();
}
};
break;
case "toBattle" :
inventory[btnName].onRelease = function () {
_root.equippingBow = false;
emptyCombiner();
saveBowSlotSetup();
showLoadScreen();
};
}
}
function buttonSetup_spellBook(btnName) {
for (a in allSpells) {
inventory.spellBook.page1[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page2[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page3[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page4[_root.allSpells[a].name]._alpha = 0;
}
for (s in _root.unlockedSpells) {
inventory.spellBook.page1[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page2[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page3[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page4[_root.unlockedSpells[s]]._alpha = 100;
}
inventory.spellBook[btnName].onRollOver = function () {
};
inventory.spellBook[btnName].onRollOut = function () {
};
switch (btnName) {
case "bookForward" :
inventory.spellBook[btnName].onRelease = function () {
inventory.spellBook.alphaTo(0, 0.3, "easeOutSine", 0, function () {
this.nextFrame();
});
inventory.spellBook.alphaTo(100, 0.3, "easeOutSine", 0.3);
playSound("sound_pageTurn");
for (a in _root.allSpells) {
inventory.spellBook.page1[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page2[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page3[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page4[_root.allSpells[a].name]._alpha = 0;
}
for (s in _root.unlockedSpells) {
inventory.spellBook.page1[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page2[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page3[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page4[_root.unlockedSpells[s]]._alpha = 100;
}
};
break;
case "bookBack" :
inventory.spellBook[btnName].onRelease = function () {
inventory.spellBook.alphaTo(0, 0.3, "easeOutSine", 0, function () {
this.prevFrame();
});
inventory.spellBook.alphaTo(100, 0.3, "easeOutSine", 0.3);
playSound("sound_pageTurn");
for (a in _root.allSpells) {
inventory.spellBook.page1[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page2[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page3[_root.allSpells[a].name]._alpha = 0;
inventory.spellBook.page4[_root.allSpells[a].name]._alpha = 0;
}
for (s in _root.unlockedSpells) {
inventory.spellBook.page1[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page2[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page3[_root.unlockedSpells[s]]._alpha = 100;
inventory.spellBook.page4[_root.unlockedSpells[s]]._alpha = 0;
}
};
}
}
function addRuneToCombiner(runeType) {
playSound("sound_spellDrop");
var _local3 = false;
v = 0;
while (v < combinerSlots.length) {
if ((combinerSlots[v].runeType == "empty") && (_root[runeType + "Runes"] > 0)) {
_local3 = true;
combinerSlots[v].runeType = runeType;
combinerSlots[v].ref.gotoAndStop(runeType);
combinerSlots[v].ref.placeRuneEffect.play();
_root[runeType + "Runes"]--;
break;
}
v++;
}
if (_local3 == false) {
}
updateInventory();
}
function removeRuneFromCombiner(runeName) {
for (x in combinerSlots) {
if (runeName == combinerSlots[x].ref._name) {
_root[combinerSlots[x].runeType + "Runes"]++;
combinerSlots[x].runeType = "empty";
combinerSlots[x].ref.gotoAndStop("empty");
combinerSlots[x].ref.placeRuneEffect.play();
}
}
playSound("sound_spellPickup");
updateInventory();
}
function emptyCombinerSlots() {
for (x in combinerSlots) {
combinerSlots[x].runeType = "empty";
combinerSlots[x].ref.gotoAndStop("empty");
combinerSlots[x].ref.placeRuneEffect.play();
earthRuneCount = 0;
fireRuneCount = 0;
chaosRuneCount = 0;
boneRuneCount = 0;
stormRuneCount = 0;
destructionRuneCount = 0;
}
}
function emptyCombiner() {
for (x in combinerSlots) {
_root[combinerSlots[x].runeType + "RuneCount"]++;
}
earthRunes = earthRunes + earthRuneCount;
fireRunes = fireRunes + fireRuneCount;
chaosRunes = chaosRunes + chaosRuneCount;
boneRunes = boneRunes + boneRuneCount;
stormRunes = stormRunes + stormRuneCount;
destructionRunes = destructionRunes + destructionRuneCount;
earthRuneCount = 0;
fireRuneCount = 0;
chaosRuneCount = 0;
boneRuneCount = 0;
stormRuneCount = 0;
destructionRuneCount = 0;
}
function showBowSetup() {
helpMessageBow();
equippingBow = true;
inventory.xSlideTo(-600, 0.8, "easeOutSine");
inventory.equipBow.gotoAndStop("createSpell");
}
function showSpellSetup() {
equippingBow = false;
inventory.xSlideTo(0, 0.8, "easeOutSine");
inventory.equipBow.gotoAndStop("equipBow");
}
function buttonSetup_spellIcons(btnObj) {
btnObj.originX = btnObj._x;
btnObj.originY = btnObj._y;
btnObj.onRollOver = function () {
_root.inventory.spellDesc.spellName.text = btnObj.spell.spellName;
_root.inventory.spellDesc.description.text = btnObj.spell.description;
_root.inventory.spellDesc.effects.text = "Effect: " + btnObj.spell.effects;
_root.inventory.spellDesc.manaCost.text = ("Mana Cost: " + btnObj.spell.manaCost) + " per cast.";
};
btnObj.onRollOut = function () {
};
btnObj.onRelease = (btnObj.onReleaseOutside = function () {
if (equippingBow == true) {
checkForSlotDrop(this);
checkForStackedSpells(this);
if (stoneDroppedInSlot == true) {
if (bowSlots[currentDropSlot].full == false) {
playSound("sound_spellDrop");
this.inSlotNumber = currentDropSlot;
bowSlots[currentDropSlot].full = true;
bowSlots[currentDropSlot].arrowType = this.spell.name;
this.stopDrag();
this.xSlideTo(bowSlots[currentDropSlot].ref._x, 0.2, "easeOutSine");
this.ySlideTo(bowSlots[currentDropSlot].ref._y, 0.2, "easeOutSine");
}
stoneDroppedInSlot = false;
} else {
playSound("sound_spellDrop");
this.stopDrag();
this.rotateTo(0, 0.4);
this.xSlideTo(this.originX, 0.2, "easeOutSine");
this.ySlideTo(this.originY, 0.2, "easeOutSine");
bowSlots[this.inSlotNumber].full = false;
bowSlots[this.inSlotNumber].arrowType = "none";
this.inSlotNumber = null;
}
}
});
btnObj.onPress = function () {
depth_inventory_spellStones++;
if (equippingBow == true) {
playSound("sound_spellPickup");
bowSlots[this.inSlotNumber].full = false;
bowSlots[this.inSlotNumber].arrowType = "none";
this.inSlotNumber = null;
this.rotateTo(-5, 0.4);
this.startDrag(false);
this.swapDepths(_root.depth_inventory_spellStones);
}
};
}
function setupBowSlots() {
bowSlots = new Array();
x = 0;
while (x < 6) {
_root["bowSlot" + x] = new Object();
_root["bowSlot" + x].ref = _root.inventory["bowSlot" + x];
_root["bowSlot" + x].name = "bowSlot" + x;
_root["bowSlot" + x].full = false;
_root["bowSlot" + x].arrowType = "none";
bowSlots.push(_root["bowSlot" + x]);
x++;
}
loadBowSlots();
}
function loadBowSlots() {
p = 0;
while (p < 6) {
if ((savedBowSlots[p].arrowType != "none") && (savedBowSlots[p].arrowType != undefined)) {
_root["bowSlot" + p].full = true;
_root["bowSlot" + p].arrowType = savedBowSlots[p].arrowType;
}
p++;
}
}
function saveBowSlotSetup() {
savedBowSlots = new Array();
bowSlotsEmpty = true;
for (e in bowSlots) {
if (bowSlots[e].full == true) {
bowSlotsEmpty = false;
}
}
if (bowSlotsEmpty == false) {
b = 0;
while (b <= bowSlots.length) {
savedBowSlots.push(bowSlots[b]);
b++;
}
}
}
function moveSpellsToBowSlots() {
if (alreadyEquippedBow == false) {
for (x in savedBowSlots) {
for (s in spellStonesArray) {
if (savedBowSlots[x].arrowType == spellStonesArray[s].spell.name) {
spellStonesArray[s].xSlideTo(savedBowSlots[x].ref._x, 0.3, "easeOutSine");
spellStonesArray[s].ySlideTo(savedBowSlots[x].ref._y, 0.3, "easeOutSine");
spellStonesArray[s].rotateTo(savedBowSlots[x].ref._rotation, 0.2);
spellStonesArray[s].inSlot = savedBowSlots[x];
}
}
}
}
}
function checkForSlotDrop(spellIcon) {
for (x in bowSlots) {
if (spellIcon.hitTest(bowSlots[x].ref) && (bowSlots[x].full == false)) {
bowSlots[x].ref.gotoAndStop(spellIcon.spell);
stoneDroppedInSlot = true;
currentDropSlot = x;
break;
}
}
}
function TURNEDOFFcheckForStackedSpells(spellIcon) {
stackedUpSpells = false;
for (s in spellStonesArray) {
if (spellIcon.name != spellStonesArray[s].name) {
if (spellIcon.hitTest(spellStonesArray[s])) {
stackedUpSpells = true;
}
}
}
}
function setupArmy() {
heroSoldiers = new Array();
x = 1;
while (x < _root[currentLevel].numSoldiers) {
world.attachMovie("char_knight", "heroSoldier" + x, depth_world_friendArmy + x);
world["heroSoldier" + x]._x = friendlySoldierPositions[x] + random(5);
world["heroSoldier" + x]._xscale = -100;
world["heroSoldier" + x].name = "armysoldier" + x;
world["heroSoldier" + x].type = "friendly_knight";
world["heroSoldier" + x].alive = true;
world["heroSoldier" + x].health = friendly_knight.health;
world["heroSoldier" + x].speed = friendly_knight.speed;
world["heroSoldier" + x].range = friendly_knight.range;
world["heroSoldier" + x].damage = friendly_knight.damage;
world["heroSoldier" + x].armor = friendly_knight.armor;
world["heroSoldier" + x].hitChance = friendly_knight.hitChance;
world["heroSoldier" + x].critChance = friendly_knight.critChance;
world["heroSoldier" + x].rising = false;
world["heroSoldier" + x].moveAnim = true;
world["heroSoldier" + x].attackAnim = false;
world["heroSoldier" + x].attacking = false;
world["heroSoldier" + x].armor_debuffed = false;
world["heroSoldier" + x].hitChance_debuffed = false;
world["heroSoldier" + x].speed_debuffed = false;
world["heroSoldier" + x].hitWall = false;
world["heroSoldier" + x].hittingWall = "none";
world["heroSoldier" + x].lastClosestEnemyX = 999999999 /* 0x3B9AC9FF */;
world["heroSoldier" + x].dir = "right";
world["heroSoldier" + x].dirCounterMax = 25000;
world["heroSoldier" + x].dirCounter = dirCounterMax;
world["heroSoldier" + x]._x = targetX;
world["heroSoldier" + x]._y = targetY;
applyInstantGravity(world["heroSoldier" + x]);
world["heroSoldier" + x].head.gotoAndStop(random(6) + 1);
world["heroSoldier" + x].gotoAndPlay("walk");
activeMinions.push(world["heroSoldier" + x]);
x++;
}
}
function armyStateControl() {
army.noTargets = true;
for (v in heroSoldiers) {
if (heroSoldiers[v].enemyTarget.name != undefined) {
army.noTargets = false;
}
}
if (((army.noTargets == true) && (army.controlState != "halt")) && (army.controlState != "retreat")) {
army.state = "march";
}
}
function armyUnitAI() {
for (v in heroSoldiers) {
if (heroSoldiers[v].name != "hero") {
if (heroSoldiers[v].alive == true) {
}
heroSoldiers[v].collideFriend = false;
army.fighting = false;
for (x in activeEnemy) {
if ((heroSoldiers[v]._x >= (activeEnemy[x]._x - heroSoldiers[v].range)) && (heroSoldiers[v].enemyTarget == undefined)) {
heroSoldiers[v].attacking = true;
heroSoldiers[v].enemyTarget = activeEnemy[x];
army.state = "halt";
army.fighting = true;
}
}
if ((army.state == "halt") && (heroSoldiers[v].attacking == false)) {
heroSoldiers[v].gotoAndStop("idle");
heroSoldiers[v].moveAnim = false;
}
if (((army.state == "march") && (heroSoldiers[v].moveAnim == false)) && (army.fighting == false)) {
heroSoldiers[v].gotoAndPlay("walk");
heroSoldiers[v].moveAnim = true;
heroSoldiers[v].attacking = false;
}
if (heroSoldiers[v].enemyTarget.name == undefined) {
heroSoldiers[v].enemyTarget = undefined;
heroSoldiers[v].attacking = false;
heroSoldiers[v].attackAnim = false;
}
if (((heroSoldiers[v].attacking == true) && (heroSoldiers[v].attackAnim == false)) && (heroSoldiers[v].enemyTarget.name != undefined)) {
heroSoldiers[v].gotoAndPlay("attack" + (random(2) + 1));
}
if ((heroSoldiers[v].attacking == false) && (army.state == "march")) {
heroSoldiers[v]._x = heroSoldiers[v]._x + heroSoldiers[v].speed;
}
if ((army.fighting == false) && (army.state == "retreat")) {
heroSoldiers[v]._x = heroSoldiers[v]._x - heroSoldiers[v].speed;
}
while (world.terrain.bmp.hitTest((terrainPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (soldPoint = new flash.geom.Point(heroSoldiers[v]._x, heroSoldiers[v]._y)))) {
heroSoldiers[v]._y = heroSoldiers[v]._y - 1;
}
while (world.terrain.bmp.hitTest((terrainPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (soldPoint = new flash.geom.Point(heroSoldiers[v]._x, heroSoldiers[v]._y))) == false) {
heroSoldiers[v]._y = heroSoldiers[v]._y + 1;
}
}
}
}
function checkForSaveGame() {
if (saveGameData.data.gameName != undefined) {
saveGameExists = true;
} else {
saveGameExists = false;
}
}
function saveGameSettings() {
saveGameData.data.qualitySetting = _quality;
saveGameData.data.soundEffectsOn = soundEffectsOn;
saveGameData.data.musicOn = musicOn;
saveGameData.data.helpEnabled = helpEnabled;
saveGameData.data.helpArrayIndex = helpArrayIndex;
}
function loadGameSettings() {
if (saveGameData.data.qualitySetting != undefined) {
_quality = saveGameData.data.qualitySetting;
soundEffectsOn = saveGameData.data.soundEffectsOn;
musicOn = saveGameData.data.musicOn;
if (saveGameData.data.helpEnabled != undefined) {
helpEnabled = saveGameData.data.helpEnabled;
helpArrayIndex = saveGameData.data.helpArrayIndex;
}
}
}
function saveGame() {
saveGameData.data.gameName = "SinMark";
saveGameData.data.seenInGameHelp = seenInGameHelp;
saveGameData.data.helpBowSeen = helpBowSeen;
saveGameData.data.helpCombinerSeen = helpCombinerSeen;
saveGameData.data.currentLevel = currentLevel;
saveGameData.data.battleNum = battleNum;
saveGameData.data.numEarthRunes = earthRunes;
saveGameData.data.numFireRunes = fireRunes;
saveGameData.data.numStormRunes = stormRunes;
saveGameData.data.numBoneRunes = boneRunes;
saveGameData.data.numChaosRunes = chaosRunes;
saveGameData.data.numDestructionRunes = destructionRunes;
saveGameData.data.savedUnlockedSpells = new Array();
for (u in unlockedSpells) {
saveGameData.data.savedUnlockedSpells.push(unlockedSpells[u]);
}
saveGameData.data.foundTrinkets = new Array();
for (f in allFoundTrinkets) {
saveGameData.data.foundTrinkets.push(allFoundTrinkets[f]);
}
}
function loadGameInfo() {
if (saveGameData.data.gameName != undefined) {
currentLevel = saveGameData.data.currentLevel;
}
}
function loadGame() {
helpBowSeen = saveGameData.data.helpBowSeen;
helpCombinerSeen = saveGameData.data.helpCombinerSeen;
seenInGameHelp = saveGameData.data.seenInGameHelp;
currentLevel = saveGameData.data.currentLevel;
battleNum = saveGameData.data.battleNum;
earthRunes = saveGameData.data.numEarthRunes;
fireRunes = saveGameData.data.numFireRunes;
stormRunes = saveGameData.data.numStormRunes;
boneRunes = saveGameData.data.numBoneRunes;
chaosRunes = saveGameData.data.numChaosRunes;
destructionRunes = saveGameData.data.numDestructionRunes;
unlockedSpells = new Array();
for (u in saveGameData.data.savedUnlockedSpells) {
unlockedSpells.push(saveGameData.data.savedUnlockedSpells[u]);
}
allFoundTrinkets = new Array();
for (f in saveGameData.data.foundTrinkets) {
allFoundTrinkets.push(saveGameData.data.foundTrinkets[f]);
}
}
function setupInterface() {
_root.attachMovie("gameInterface", "hud", depth_HUD);
hud.survivalMode._visible = false;
if (survivalMode == true) {
hud.survivalMode._visible = true;
hud.survivalMode.slotIcon1.gotoAndStop("standardArrow");
hud.survivalMode.slotIcon2.selectRing._visible = false;
trinketEquipped = "empty";
} else {
helpMessagesInGame();
}
setupQuickSlots();
hero.currentHealth = hero.health;
hero.currentMana = hero.mana;
setupMouse();
hud.progressBar._visible = false;
hud.runeReport._visible = false;
hud.trinket.gotoAndStop(trinketEquipped);
hud.trinket.onRollOver = function () {
_root.showToolTip(_root.trinketEquipped, "trinket", "hud");
};
hud.trinket.onRollOut = (_root.hud["slotIcon" + v].onDragOut = (_root.hud["slotIcon" + v].onReleaseOutside = function () {
_root.hideToolTip();
}));
updateInterface();
}
function destroyInterface() {
hud.alphaTo(0, 0, "linear", 1, function () {
removeMovieClip(this);
});
}
function pauseGame() {
if (game.state != "paused") {
game.state = "paused";
}
showDialogBox(dialog_pause);
}
function updateInterface() {
hud.deathWarning._visible = false;
hud.health.barMask._yscale = Math.round((world.player.health / hero.health) * 100);
hud.mana.barMask._yscale = Math.round((hero.currentMana / hero.mana) * 100);
if (hud.health.barMask._yscale > 100) {
hud.health.barMask._yscale = 100;
}
if (hud.mana.barMask._yscale > 100) {
hud.mana.barMask._yscale = 100;
}
if (hud.health.barMask._yscale < 30) {
hud.deathWarning._visible = true;
hud.deathWarning._alpha = 100 - (hud.health.barMask._yscale * 3);
}
for (w in allQuickSlots) {
if (_root[allQuickSlots[w].arrowType].manaCost > hero.currentMana) {
allQuickSlots[w].ref.bw.alphaTo(100, 2);
hud.survivalMode.slotIcon2.bw.alphaTo(100, 2);
allQuickSlots[w].unavailable = true;
} else if ((_root[allQuickSlots[w].arrowType].manaCost <= hero.currentMana) && (allQuickSlots[w].unavailable == true)) {
allQuickSlots[w].ref.bw.alphaTo(0, 2);
hud.survivalMode.slotIcon2.bw.alphaTo(0, 2);
allQuickSlots[w].unavailable = false;
}
}
}
function showProgressBar() {
showQuickMessage("Extracting Runes.");
hud.progressBar._visible = true;
hud.progressBar._alpha = 0;
hud.progressBar.alphaTo(100, 0.5);
}
function hideProgressBar() {
hud.progressBar.alphaTo(0, 0.5, "linear", 0, function () {
_root.hud.progressBar._visible = false;
});
}
function showRuneReport() {
hud.runeReport._visible = true;
hud.runeReport._alpha = 0;
hud.runeReport.slot1._alpha = 0;
hud.runeReport.slot2._alpha = 0;
hud.runeReport.slot3._alpha = 0;
hud.runeReport.alphaTo(100, 0.5, "linear", 0.5);
hud.runeReport.slot1.alphaTo(100, 0.5, "linear", 0.8);
hud.runeReport.slot2.alphaTo(100, 0.5, "linear", 1.1);
hud.runeReport.slot3.alphaTo(100, 0.5, "linear", 1.4);
}
function hideRuneReport() {
hud.runeReport.alphaTo(0, 0.5, "linear", 6, function () {
_root.hud.runeReport._visible = false;
});
}
function setupQuickSlots() {
quickSlot1 = new Object();
quickSlot2 = new Object();
quickSlot3 = new Object();
quickSlot4 = new Object();
quickSlot5 = new Object();
quickSlot6 = new Object();
allQuickSlots = new Array(quickSlot1, quickSlot2, quickSlot3, quickSlot4, quickSlot5, quickSlot6);
x = 2;
while (x < 8) {
_root["quickSlot" + (x - 1)].arrowType = bowSlots[x - 2].arrowType;
x++;
}
quickSlot1.arrowType = "standardArrow";
v = 1;
while (v <= 6) {
_root.hud["slotIcon" + v].gotoAndStop(_root["quickSlot" + v].arrowType);
_root["quickSlot" + v].name = "quickSlot" + v;
_root["quickSlot" + v].active = false;
_root["quickSlot" + v].ref = _root.hud["slotIcon" + v];
_root.hud["slotIcon" + v].keyNumber = v;
if (v != 1) {
_root.hud["slotIcon" + v].selectRing._visible = false;
}
_root.hud["slotIcon" + v].onRelease = function () {
_root.hotKeys(this.keyNumber);
};
_root.hud["slotIcon" + v].onRollOver = function () {
_root.showToolTip(_root["quickSlot" + this.keyNumber], "", "hud");
};
_root.hud["slotIcon" + v].onRollOut = (_root.hud["slotIcon" + v].onDragOut = (_root.hud["slotIcon" + v].onReleaseOutside = function () {
hideToolTip();
}));
v++;
}
}
function showToolTip(quickSlotObj, tipType, locale) {
_root[locale].toolTip.backing._width = 10;
_root[locale].toolTip.backing._height = 10;
_root[locale].toolTip.desc._width = 10;
_root[locale].toolTip.header.autoSize = "left";
_root[locale].toolTip.desc.autoSize = "left";
_root[locale].toolTip.header.text = _root[quickSlotObj.arrowType].spellName;
_root[locale].toolTip.desc.text = ("Mana Cost: " + _root[quickSlotObj.arrowType].manaCost) + " per cast";
if (tipType == "trinket") {
_root[locale].toolTip.header.text = _root["trinket_" + trinketEquipped].trinketName;
_root[locale].toolTip.desc.text = "";
}
if (tipType == "runeStones") {
var _local4 = quickSlotObj;
_root[locale].toolTip.header.text = ((" " + _local4.charAt(0).toUpperCase()) + _local4.slice(1)) + " ";
_root[locale].toolTip.desc.text = "";
}
_root[locale].toolTip.backing._width = _root[locale].toolTip.desc._width + 20;
_root[locale].toolTip.backing._height = _root[locale].toolTip.desc._height + 20;
if (_root[locale].toolTip.desc._width <= _root[locale].toolTip.header._width) {
_root[locale].toolTip.backing._width = _root[locale].toolTip.header._width + 10;
}
_root[locale].toolTip._alpha = 0;
_root[locale].toolTip._visible = true;
_root[locale].toolTip.alphaTo(100, 0.4, "easeOutSine", 0.2);
}
function hideToolTip() {
hud.toolTip._visible = false;
inventory.toolTip._visible = false;
}
function hotKeys(keyNum) {
if ((Key.isDown(49) || (keyNum == 1)) && (((quickSlot1.arrowType != undefined) && (quickSlot1.arrowType != null)) && (quickSlot1.arrowType != "none"))) {
currentArrowType = quickSlot1.arrowType;
highLightHotKey(quickSlot1);
}
if ((Key.isDown(50) || (keyNum == 2)) && (((quickSlot2.arrowType != undefined) && (quickSlot2.arrowType != null)) && (quickSlot2.arrowType != "none"))) {
currentArrowType = quickSlot2.arrowType;
highLightHotKey(quickSlot2);
}
if ((Key.isDown(51) || (keyNum == 3)) && (((quickSlot3.arrowType != undefined) && (quickSlot3.arrowType != null)) && (quickSlot3.arrowType != "none"))) {
currentArrowType = quickSlot3.arrowType;
highLightHotKey(quickSlot3);
}
if ((Key.isDown(52) || (keyNum == 4)) && (((quickSlot4.arrowType != undefined) && (quickSlot4.arrowType != null)) && (quickSlot4.arrowType != "none"))) {
currentArrowType = quickSlot4.arrowType;
highLightHotKey(quickSlot4);
}
if ((Key.isDown(53) || (keyNum == 5)) && (((quickSlot5.arrowType != undefined) && (quickSlot5.arrowType != null)) && (quickSlot5.arrowType != "none"))) {
currentArrowType = quickSlot5.arrowType;
highLightHotKey(quickSlot5);
}
if ((Key.isDown(54) || (keyNum == 6)) && (((quickSlot6.arrowType != undefined) && (quickSlot6.arrowType != null)) && (quickSlot6.arrowType != "none"))) {
currentArrowType = quickSlot6.arrowType;
highLightHotKey(quickSlot6);
}
keyNum = 0;
}
function highLightHotKey(highSlot) {
if (survivalMode == true) {
if (highSlot.name == "quickSlot1") {
hud.survivalMode.slotIcon1.selectRing._visible = true;
hud.survivalMode.slotIcon2.selectRing._visible = false;
}
if (highSlot.name == "quickSlot2") {
hud.survivalMode.slotIcon2.selectRing._visible = true;
hud.survivalMode.slotIcon1.selectRing._visible = false;
}
} else {
highSlot.active = true;
for (s in allQuickSlots) {
if (allQuickSlots[s].active == true) {
allQuickSlots[s].active = false;
}
}
for (s in allQuickSlots) {
if (allQuickSlots[s].active == false) {
allQuickSlots[s].ref.selectRing._visible = false;
}
}
highSlot.ref.selectRing._visible = true;
}
}
function armyControlButtons_setup(btnName) {
hud[btnName].onRelease = function () {
army.state = btnName;
army.controlState = btnName;
};
}
function setupMouse() {
Mouse.hide();
hud.attachMovie("mouseCursor", "mouseCursor", depth_HUD_mouse);
hud.mouseCursor.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
};
}
function normaliseMouse() {
Mouse.show();
}
function showDialogBox(contents) {
normaliseMouse();
_root.attachMovie("dialogBox", "dialogBox", depth_dialog);
dialogBox.blackOut._alpha = 0;
dialogBox.backing._alpha = 0;
dialogBox.button1._alpha = 0;
dialogBox.button2._alpha = 0;
dialogBox.backing._visible = true;
dialogBox.textBoxes._alpha = 0;
dialogBox.textBoxes.headingText.autoSize = "center";
dialogBox.textBoxes.bodyText.autoSize = "center";
dialogBox.textBoxes.headingText.text = contents.heading;
if (contents == dialog_gameOver_survival) {
dialogBox.textBoxes.bodyText.text = (("Akahn has fallen in battle. But not without \rtaking these enemies with him.\r\rEnemies Killed: " + _root.survivalModeKills) + "\rGates Destroyed: ") + _root.survivalPortalsDestroyed;
} else {
dialogBox.textBoxes.bodyText.text = contents.body;
}
dialogBox.backing._width = dialogBox.textBoxes.bodyText._width + 30;
dialogBox.backing._height = (dialogBox.textBoxes.headingText._height + dialogBox.textBoxes.bodyText._height) + 20;
if (contents.button1Active == true) {
dialogBox.backing._height = dialogBox.backing._height + 40;
}
if (contents.button1Active == true) {
dialogBox.button1.buttonText.text = contents.button1Desc;
dialogBox.button1._y = dialogBox.backing._height - 55;
dialogBox.button1.alphaTo(100, 0.6, "easeOutSine", 0.4);
dialogBox.button1.onRelease = contents.button1Action;
dialogBox.button1.onRollOver = playRollOverSound;
}
if ((contents.button1Active == true) && (contents.button2Active == true)) {
dialogBox.button1.buttonText.text = contents.button1Desc;
dialogBox.button2.buttonText.text = contents.button2Desc;
dialogBox.button1._x = -50;
dialogBox.button2._x = 50;
dialogBox.button1._y = (dialogBox.button2._y = dialogBox.backing._height - 55);
dialogBox.button1.alphaTo(100, 0.6, "easeOutSine", 0.4);
dialogBox.button2.alphaTo(100, 0.6, "easeOutSine", 0.4);
dialogBox.button1.onRelease = contents.button1Action;
dialogBox.button2.onRelease = contents.button2Action;
dialogBox.button1.onRollOver = playRollOverSound;
dialogBox.button2.onRollOver = playRollOverSound;
}
dialogBox._x = 400;
dialogBox._y = 150;
dialogBox.blackOut.alphaTo(60, 0.8, "easeOutSine");
dialogBox.backing.alphaTo(100, 0.6, "easeOutSine");
dialogBox.textBoxes.alphaTo(100, 0.6, "easeOutSine", 0.4);
}
function closeDialogBox() {
dialogBox.alphaTo(0, 0.1, "easeOutSine", 0, function () {
removeMovieClip(this);
});
}
function initDialogBoxes() {
dialog_startNewCampaign = new Object();
dialog_startNewCampaign.heading = "START A NEW STORY?";
dialog_startNewCampaign.body = ((("Starting a new game will overwrite\ryour previous save game:\r\r" + _root[saveGameData.data.currentLevel].actNumber) + " - ") + _root[saveGameData.data.currentLevel].chapterNumber) + "\r\rAre you sure?";
dialog_startNewCampaign.button1Active = true;
dialog_startNewCampaign.button2Active = true;
dialog_startNewCampaign.button1Desc = "ACCEPT";
dialog_startNewCampaign.button2Desc = "CANCEL";
dialog_startNewCampaign.button1Action = function () {
playClickSound();
loadStoryBook();
newGameReset();
closeDialogBox();
};
dialog_startNewCampaign.button2Action = function () {
playClickSound();
closeDialogBox();
};
dialog_continueCampaign = new Object();
dialog_continueCampaign.heading = "CONTINUE?";
dialog_continueCampaign.body = ((("Continue the story of your adventure at:\r\r" + _root[saveGameData.data.currentLevel].actNumber) + " - ") + _root[saveGameData.data.currentLevel].chapterNumber) + "\r\rAre you sure?";
dialog_continueCampaign.button1Active = true;
dialog_continueCampaign.button2Active = true;
dialog_continueCampaign.button1Desc = "ACCEPT";
dialog_continueCampaign.button2Desc = "CANCEL";
dialog_continueCampaign.button1Action = function () {
continueGameReset();
playingContinue = true;
playClickSound();
loadGame();
setupInventory();
closeDialogBox();
};
dialog_continueCampaign.button2Action = function () {
playClickSound();
closeDialogBox();
};
dialog_newGameSaved = new Object();
dialog_newGameSaved.heading = "NEW GAME";
dialog_newGameSaved.body = "A new save game has been created.\r\rProgress will be saved for you\rautomatically as you play.";
dialog_newGameSaved.button1Active = true;
dialog_newGameSaved.button2Active = false;
dialog_newGameSaved.button1Desc = "OK";
dialog_newGameSaved.button1Action = function () {
playClickSound();
closeDialogBox();
};
}
function showQuickMessage(contents, position) {
_root.hud.attachMovie("dialog_quickMessage", "quickMessage", depth_hud_quickMessage);
hud.quickMessage.stopTween();
hud.quickMessage._xscale = 100;
hud.quickMessage._yscale = 100;
hud.quickMessage._alpha = 0;
hud.quickMessage._x = Stage.width / 2;
if (position == "bottom") {
hud.quickMessage._y = 345;
} else {
hud.quickMessage._y = 60;
}
hud.quickMessage.messageText.autoSize = "center";
hud.quickMessage.messageText.text = contents;
hud.quickMessage.backing._width = hud.quickMessage.messageText._width + 30;
hud.quickMessage.alphaTo(100, 0.6);
quickMessageTime = contents.length * 0.15;
hud.quickMessage.alphaTo(0, 1, "easeOutSine", quickMessageTime, function () {
_root.showingQuickMessage = false;
});
}
function setupSound() {
_root.attachMovie("blankMovie", "sound_effects", 50);
_root.attachMovie("blankMovie", "sound_music", 51);
_root.attachMovie("blankMovie", "sound_loops", 52);
}
function playSound(soundName) {
if (soundEffectsOn) {
soundEffects++;
_root["effect" + soundEffects] = new Sound(sound_effects);
_root["effect" + soundEffects].attachSound(soundName);
_root["effect" + soundEffects].setVolume(100);
_root["effect" + soundEffects].start();
}
}
function playSoundLoop(soundName, loops, loopID) {
if (soundEffectsOn) {
soundEffects++;
_root.attachMovie("blankMovie", "soundLoop" + loopID, depth_sound_tanks + soundEffects);
_root["loop_" + loopID] = new Sound("soundLoop" + loopID);
_root["loop_" + loopID].attachSound(soundName);
_root["loop_" + loopID].setVolume(100);
_root["loop_" + loopID].start(0, loops);
}
}
function playMusicLoop(soundName, loops, loopID) {
if (musicOn) {
musicTracks++;
_root.createEmptyMovieClip("holder" + loopID, depth_music + musicTracks);
_root["music_" + loopID] = new Sound(_root["holder" + loopID]);
_root["music_" + loopID].attachSound(soundName);
_root["music_" + loopID].setVolume(80);
_root["music_" + loopID].start(0, loops);
}
}
function muteAllSound() {
if (soundMuted) {
showQuickMessage("Mute: Off");
soundMuted = false;
music_inGameMusic.start();
musicOn = true;
soundEffectsOn = true;
} else {
showQuickMessage("Mute: On");
soundMuted = true;
music_inGameMusic.stop();
musicOn = false;
soundEffectsOn = false;
}
}
function particleEmitter(particleType, particleName, particleDepth, particleX, particleY, particleGravity, particleQuantity, particleHorizontalEnergy, particleVerticalEnergy, particleFade, particleRotationRate, particleScaling, particleChangeAngle, particleHitGround, particleFalling) {
i = 0;
while (i <= particleQuantity) {
particleCount++;
var _local2 = world.attachMovie(particleType, particleName + i, depth_world_particles + particleCount);
_local2.ref = particleName + i;
_local2.partType = particleType;
_local2.gravity = particleGravity;
if (random(2) > 0) {
_local2.HorzEnergy = Math.random() * particleHorizontalEnergy;
} else {
_local2.HorzEnergy = Math.random() * (-particleHorizontalEnergy);
}
_local2.VertEnergy = (-particleVerticalEnergy) + ((Math.random() * particleVerticalEnergy) / 2);
if (particleFalling == false) {
if (random(2) > 0) {
_local2.VertEnergy = particleVerticalEnergy + ((Math.random() * particleVerticalEnergy) / 2);
} else {
_local2.VertEnergy = (-particleVerticalEnergy) + ((Math.random() * particleVerticalEnergy) / 2);
}
}
if (particleScaling == true) {
_local2._xscale = (_local2._yscale = random(50) + 50);
}
_local2._x = particleX;
_local2._y = particleY;
_local2.hitGround = particleHitGround;
_local2.originY = particleY;
if (particleChangeAngle == true) {
if (random(2) > 0) {
_local2.angle = random(60);
} else {
_local2.angle = random(60) + 300;
}
}
_local2._alpha = random(30) + 70;
_local2._rotation = _local2.angle;
_local2.rotation = particleRotationRate;
_local2.acceleration = 5;
_local2.particleFade = particleFade;
_local2.splash = particleSplash;
_local2.life = 200;
_local2.onEnterFrame = _root.moveParticle;
i++;
}
}
function moveParticle() {
with (this) {
this.life = this.life - 1;
if (this.life <= 0) {
removeMovieClip(this);
}
_alpha = _alpha - particleFade;
if (_alpha < 15) {
removeMovieClip(this);
}
if (this.hitGround && (this._y >= ((this.originY + random(10)) + 30))) {
removeMovieClip(this);
}
this._rotation = this._rotation + rotation;
this.x = Math.cos((this.angle * Math.PI) / 180) * HorzEnergy;
this.y = Math.sin((this.angle * Math.PI) / 180) * VertEnergy;
this._x = this._x - this.x;
this._y = this._y + ((VertEnergy = VertEnergy + this.gravity));
}
}
function bodyPartParticle(targetX, targetY) {
particleEmitter("gib_armChunk", "dustPart", 100, targetX, targetY - 30, 0.2, 0, random(3) + 1, random(3) + 2, 0, 3, false, true, true);
particleEmitter("gib_legChunk", "dustPart", 100, targetX, targetY - 30, 0.2, 0, random(3) + 1, random(3) + 2, 0, 3, false, true, true);
particleEmitter("gib_armChunk", "dustPart", 100, targetX, targetY - 30, 0.2, 0, random(3) + 1, random(3) + 2, 0, 3, false, true, true);
particleEmitter("gib_meatChunk", "dustPart", 100, targetX, targetY - 30, 0.2, 3, random(3) + 1, random(3) + 2, 0, 3, true, true, true);
particleEmitter("blood", "dustPart", 100, targetX, targetY - 30, 0.2, 16, random(5) + 1, random(5) + 1, 1, 3, true, true, true);
particleEmitter("vomitBig", "dustPart", 100, targetX, targetY - random(15), 0.1, 0, random(2), random(2), 0.5, 0, true, true, true);
particleEmitter("bloodDustCloud", "dustPart", 100, targetX - (random(20) - 10), targetY - 20, 0.1, 4, random(1) + 1, random(1) + 1, 3, 0, true, false, false);
}
function boneWallBreakParticle(targetX, targetY) {
particleEmitter("boneFragment", "rockPart", 100, targetX, targetY, 0.15, 4, 3, 3, 0.2, 3, true, true, true);
particleEmitter("dustCloud", "dustPart", 100, targetX, targetY, 1E-5, 0, random(1) + 1, random(1) + 1, 0.5, 0, true, false, false);
}
function soulCrushSmokeParticle(targetX, targetY) {
particleEmitter("particle_soulCrushCloud", "dustPart", 100, targetX, targetY, 1E-5, 4, random(1) + 1, random(1) + 1, 0.5, 0, true, false, true);
}
function portalSpawnParticle(targetX, targetY) {
particleEmitter("fireSpark", "dustPart", 100, targetX, targetY, 0.15, 4, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
}
function arrowStormArrowParticle(targetX, targetY) {
particleEmitter("iceSpark", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
}
function bloatParticles(targetX, targetY) {
particleEmitter("bloatSpark", "dustPart", 100, targetX + (random(30) - 15), targetY - (random(30) + 10), 0.2, 0, random(2) + 2, 1, 6, 0, true, true, false);
}
function fireArrowParticle(targetX, targetY) {
particleEmitter("fireSpark", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
}
function volcanoProjectileParticle(targetX, targetY) {
particleEmitter("fireSpark", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
}
function deathWingVomitParticle(targetX, targetY) {
particleEmitter("vomit", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
particleEmitter("vomitSpike", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 2, random(2) + 2, 3, 0, true, true, false);
}
function deathWingVomitSplash(targetX, targetY) {
particleEmitter("vomitSpike", "rockPart", 100, targetX, targetY, 0.15, 1, 3, 3, 0.2, 3, true, true, true);
particleEmitter("vomit", "rockPart", 100, targetX, targetY, 0.15, 1, 3, 3, 0.2, 3, true, true, true);
particleEmitter("vomitBig", "dustPart", 100, targetX, targetY, 0.1, 1, random(2) + 2, random(2) + 2, 0.5, 0, true, true, true);
}
function shamanFireBallParticle(targetX, targetY) {
particleEmitter("fireSparkLarge", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 1, random(2) + 1, 6, 0, true, true, false);
}
function endBossFireBallParticle(targetX, targetY) {
particleEmitter("smokeParticle", "dustPart", 100, targetX, targetY, 0.15, 0, random(2) + 1, random(2) + 1, 6, 0, true, true, false);
}
function slowArrowParticle(targetX, targetY) {
particleEmitter("greenSpark", "dustPart", 100, targetX, targetY, 0.15, 1, random(2) + 2, random(2) + 2, 0, 3, true, true, false);
}
function earthArrowParticle(targetX, targetY) {
particleEmitter("earthRock", "rockPart", 100, targetX, targetY, 0.15, 5, 3, 3, 0.2, 3, true, true, true);
particleEmitter("dustCloud", "dustPart", 100, targetX, targetY, 1E-5, 2, random(1) + 1, random(1) + 1, 0.5, 0, true, false, false);
}
function earthBreakParticle(targetX, targetY) {
particleEmitter("smallRock", "rockPart", 100, targetX, targetY, 0.15, 5, 3, 3, 0.2, 3, true, true, true);
particleEmitter("dustCloud", "dustPart", 100, targetX, targetY, 1E-5, 0, random(1) + 1, random(1) + 1, 0.5, 0, true, false, false);
}
function fireImpactParticle(targetX, targetY) {
particleEmitter("fireSpark", "rockPart", 100, targetX, targetY, 0.15, 4, 3, 3, 0.2, 3, true, true, true);
}
function smokeTrailParticle(targetX, targetY) {
particleEmitter("smokeTrail", "dustPart", 100, targetX, targetY, 1E-5, 2, random(1) + 1, random(1) + 1, 0.5, 0, true, false, false);
}
function iceParticle(targetX, targetY) {
particleEmitter("iceSpark", "rockPart", 100, targetX, targetY, 0.15, 8, 3, 3, 0.2, 3, true, true, true);
}
function decayArrowParticle(targetX, targetY) {
particleEmitter("particle_decayCloud", "dustPart", 100, targetX, targetY, 1E-5, 0, random(1) + 1, random(1) + 1, 0.5, 0, true, false, true);
}
function runeExtractParticles(targetX, targetY) {
particleEmitter("blueSpark", "dustPart", 100, targetX + 10, targetY - 35, 0.005, 10, 2, 2, 2, 3, true, true, false, false);
}
function bloodParticles(targetX, targetY) {
particleEmitter("blood", "dustPart", 100, targetX, targetY, 0.2, 4, random(2) + 1, random(2) + 1, 1, 3, true, true, true);
}
function bodyRagdoll(soldierRef) {
if (soldierRef.inTrench == true) {
if (soldierRef.squadObjRef.team == "british") {
soldierRef._x = soldierRef._x + 60;
}
if (soldierRef.squadObjRef.team == "german") {
soldierRef._x = soldierRef._x - 60;
}
}
randomLimb = random(10);
switch (randomLimb) {
case 0 :
soldierRef.torso.bloodSplat._visible = true;
break;
case 1 :
soldierRef.front_upperArm.gotoAndStop("gone");
soldierRef.front_lowerArm.gotoAndStop("gone");
soldierRef.torso.bloodSplat._visible = true;
soldierRef.head.bloodSplat._visible = true;
break;
case 2 :
soldierRef.back_upperArm.gotoAndStop("gone");
soldierRef.back_lowerArm.gotoAndStop("gone");
soldierRef.torso.bloodSplat._visible = true;
break;
case 3 :
soldierRef.front_upperLeg.gotoAndStop("gone");
soldierRef.front_lowerLeg.gotoAndStop("gone");
soldierRef.front_foot.gotoAndStop("gone");
break;
case 4 :
soldierRef.back_upperLeg.gotoAndStop("gone");
soldierRef.back_lowerLeg.gotoAndStop("gone");
soldierRef.back_foot.gotoAndStop("gone");
break;
case 5 :
soldierRef.front_upperLeg.gotoAndStop("gone");
soldierRef.front_lowerLeg.gotoAndStop("gone");
soldierRef.front_foot.gotoAndStop("gone");
soldierRef.back_upperLeg.gotoAndStop("gone");
soldierRef.back_lowerLeg.gotoAndStop("gone");
soldierRef.back_foot.gotoAndStop("gone");
break;
case 6 :
soldierRef.front_upperArm.gotoAndStop("gone");
soldierRef.front_lowerArm.gotoAndStop("gone");
soldierRef.back_upperArm.gotoAndStop("gone");
soldierRef.back_lowerArm.gotoAndStop("gone");
soldierRef.torso.bloodSplat._visible = true;
soldierRef.head.bloodSplat._visible = true;
break;
case 7 :
soldierRef.head.gotoAndStop("gone");
soldierRef.torso.bloodSplat._visible = true;
break;
case 8 :
soldierRef.head.gotoAndStop("off");
soldierRef.front_upperArm.gotoAndStop("off");
soldierRef.front_lowerArm.gotoAndStop("gone");
soldierRef.back_upperArm.gotoAndStop("off");
soldierRef.back_lowerArm.gotoAndStop("gone");
soldierRef.torso.gotoAndStop("gone");
break;
case 9 :
break;
}
soldierRef.particleHorizontalEnergy = 6;
soldierRef.particleVerticalEnergy = 11;
if (random(2) > 0) {
soldierRef.HorzEnergy = Math.random() * soldierRef.particleHorizontalEnergy;
} else {
soldierRef.HorzEnergy = Math.random() * (-soldierRef.particleHorizontalEnergy);
}
soldierRef.VertEnergy = (-soldierRef.particleVerticalEnergy) + ((Math.random() * soldierRef.particleVerticalEnergy) / 2);
if (random(2) > 0) {
soldierRef.angle = random(60);
soldierRef.rotation = random(8) + 4;
} else {
soldierRef.angle = random(60) + 300;
soldierRef.rotation = (-random(8)) + 4;
}
soldierRef.gravity = 0.45;
soldierRef.onEnterFrame = function () {
this._rotation = this._rotation + this.rotation;
this.x = Math.cos((this.angle * Math.PI) / 180) * this.HorzEnergy;
this._x = this._x - this.x;
this._y = this._y + ((this.VertEnergy = this.VertEnergy + this.gravity));
if (this._y > (this.ground - 5)) {
this._y = this.ground - 2;
this.onEnterFrame = null;
if (random(2) > 0) {
this._rotation = 0;
} else {
this._rotation = 180;
}
this.gotoAndPlay("flatDead");
setTimeout(_root.fadeDeadSoldier, _root.clearDeadSoldierTime, this);
}
};
}
function sortAllDepths() {
var _local4;
var _local1 = new Array();
for (v in spellStonesArray) {
spellStonesArray[v].depth = activeEnemy[v]._y;
_local1.push(activeEnemy[v]);
}
do {
_local4 = false;
var _local3 = 1;
while (_local3 < _local1.length) {
if (_local1[_local3 - 1].depth > _local1[_local3].depth) {
var _local2 = _local1[_local3 - 1];
_local1[_local3 - 1] = _local1[_local3];
_local1[_local3] = _local2;
_local4 = true;
}
_local3++;
}
} while (_local4);
_local3 = 0;
while (_local3 < _local1.length) {
_local1[_local3].swapDepths(_local3 + depth_world_depthSorted);
_local3++;
}
}
function sortDeadSoldiers(soldierRef) {
soldierRef.swapDepths(soldierRef.depth + _root.depth_world_deadSoldiers);
}
function setupConsole() {
_root.attachMovie("systemConsole", "systemConsole", depth_DEBUG_console);
systemConsole._x = Stage.width / 2;
systemConsole._y = -480;
systemConsole.opened = false;
systemConsole.consoleHistory.autoSize = true;
var _local2 = new Object();
_local2.onKeyUp = function () {
switch (Key.getCode()) {
case 192 :
openCloseConsole();
break;
case 13 :
executeCommand(_root.systemConsole.consoleInput.text);
}
};
Key.addListener(_local2);
}
function openCloseConsole() {
if (systemConsole._y > -100) {
systemConsole.consoleInput.text = "";
systemConsole.ySlideTo(-480, 0.5, "easeOutSine", 0);
systemConsole.opened = false;
}
if (systemConsole._y <= -100) {
systemConsole.opened = true;
systemConsole.ySlideTo(-90, 0.5);
systemConsole.consoleInput.text = "";
Selection.setFocus("_root.systemConsole.consoleInput");
systemConsole.consoleInput.text = "";
}
}
function executeCommand(funcName) {
fullFunctionName = funcName;
fullFunctionName.split();
startParam = fullFunctionName.indexOf("(");
endParam = fullFunctionName.indexOf(")");
functionName = fullFunctionName.substring(0, startParam);
var _local2 = fullFunctionName.substring(startParam + 1, endParam);
_root[functionName](_local2);
_root.systemConsole.consoleHistory.text = _root.systemConsole.consoleHistory.text + (_root.systemConsole.consoleInput.text + "\r");
_root.systemConsole.consoleHistory._y = _root.systemConsole.consoleHistory._y - 16;
_root.systemConsole.consoleInput.text = "";
}
function setupWorld() {
_root.attachMovie(_root[currentLevel].mapName, "world", depth_world);
world.attachMovie(_root[currentLevel].terrainName, "terrain", depth_world_terrain);
world.attachMovie(_root[currentLevel].foregroundName, "fg", depth_world_fg);
world.ground = 320;
world.attachMovie("dummyPlayer", "player", depth_world_player);
world.player._x = 90;
world.player._y = 0;
world.player.name = "hero";
world.player.health = hero.health;
world.player.armor = hero.armor;
world.player.alive = true;
world.player.firingPoint = 30;
world.player.currentFacing = "right";
world.terrain.bmp = new flash.display.BitmapData(world.terrain._width, world.terrain._height, true, 0);
world.terrain.bmp.draw(world.terrain);
world.midGround.bmp = new flash.display.BitmapData(world.midGround._width, world.midGround._height, true, 0);
world.midGround.bmp.draw(world.midGround);
world.fg.bmp = new flash.display.BitmapData(world.fg._width, world.fg._height, true, 0);
world.fg.bmp.draw(world.fg);
if (_root[currentLevel].hasArmy == true) {
setupArmy();
army.state = "march";
army.controlState = "march";
}
if (_root[currentLevel].foregroundName == "hell_3_foreground") {
enemyGenDelay = 1000000000 /* 0x3B9ACA00 */;
setupRoofSpikes();
activePortals.push("null");
currentSpawnPoint = 1200;
generateEnemy("enemy_endBoss");
} else {
setupPortals();
}
setupRuneStones();
setupFireButton();
cameraSetup();
playerControls();
if (_root[currentLevel].sandStorm == true) {
sandStorm();
}
if (_root[currentLevel].lava == true) {
lavaPit();
}
heroSoldiers.push(world.player);
activeMinions.push(world.player);
music_menuMusic.volumeTo(0, 3, "linear");
playMusicLoop(_root[currentLevel].musicTrack, 9999, "inGameMusic");
music_inGameMusic.setVolume(0);
music_inGameMusic.volumeTo(100, 3, "linear", 5);
}
function destroyWorld() {
world.alphaTo(0, 0, "linear", 1, function () {
removeMovieClip(this);
});
removeMovieClip(weather);
}
function setupRoofSpikes() {
var _local2 = 0;
var _local1 = new Array(538, 1055, 1580);
r = 0;
while (r < _local1.length) {
world.attachMovie("roofCollision", "roofCollision" + r, depth_world_roofCollision + r);
world["roofCollision" + r]._x = _local1[r];
roofCollisions.push(world["roofCollision" + r]);
r++;
}
}
function angleBow() {
if ((aimingControl == "unlocked") && (world.player.alive == true)) {
arrowOrigin = new flash.geom.Point(world.player._x, world.player._y - 32);
mousePoint = new flash.geom.Point(_root._xmouse, _root._ymouse);
world.localToGlobal(arrowOrigin);
var _local4 = arrowOrigin.x - mousePoint.x;
var _local3 = arrowOrigin.y - mousePoint.y;
var _local2 = Math.atan2(_local3, _local4) * 57.2957795130823;
if (world.player._xscale == 100) {
world.player.currentAngle = _local2 - 185;
}
if (world.player._xscale == -100) {
world.player.currentAngle = _local2 - 175;
}
world.player.bow._rotation = world.player.currentAngle;
if ((world.player.bow._rotation > -90) && (world.player.bow._rotation < 90)) {
world.player._xscale = 100;
world.player.currentFacing = "right";
world.player.bow._xscale = 100;
world.player.bow._yscale = 100;
}
if (((world.player.bow._rotation > 90) && (world.player.bow._rotation < 180)) || ((world.player.bow._rotation > -180) && (world.player.bow._rotation < -90))) {
world.player._xscale = -100;
world.player.currentFacing = "left";
world.player.bow._xscale = -100;
world.player.bow._yscale = -100;
world.player.bow._rotation = -world.player.currentAngle;
}
}
}
function setupFireButton() {
hud.mouseCursor.ring._xscale = 100 - arrowPowerMax;
hud.mouseCursor.ring._yscale = 100 - arrowPowerMax;
world.onPress = function () {
if ((aimingControl == "unlocked") && (world.player.alive == true)) {
_root.world.player.arrowPower = 0;
hud.mouseCursor.ring._xscale = 100 - arrowPowerMax;
hud.mouseCursor.ring._yscale = 100 - arrowPowerMax;
world.onEnterFrame = function () {
if (_root.trinketEquipped == "quickDraw") {
_root.world.player.arrowPower = _root.world.player.arrowPower + (arrowPowerGain * trinket_quickDraw.effect);
} else {
_root.world.player.arrowPower = _root.world.player.arrowPower + arrowPowerGain;
}
if (hud.mouseCursor.ring._xscale < 100) {
hud.mouseCursor.ring._xscale = hud.mouseCursor.ring._xscale + arrowPowerGain;
hud.mouseCursor.ring._yscale = hud.mouseCursor.ring._yscale + arrowPowerGain;
}
if (_root.world.player.arrowPower > arrowPowerMax) {
_root.world.player.arrowPower = arrowPowerMax;
}
if (world.player.bow.drawn == false) {
if (world.player.bow._currentframe >= 30) {
world.player.bow.gotoAndStop(1);
}
world.player.bow.nextFrame();
}
hud.power.text = "POWER: " + _root.world.player.arrowPower;
hud.angle.text = "ANGLE: " + currentAngle;
};
}
};
world.onRelease = function () {
if ((aimingControl == "unlocked") && (world.player.alive == true)) {
world.player.bow.drawn = false;
delete world.onEnterFrame;
if (_root.world.player.arrowPower >= arrowPowerMin) {
fire(currentArrowType, _root.world.player);
playSound("sound_arrowRelease" + (random(3) + 1));
if (_root[currentArrowType].fireSound == true) {
playSound(("sound_" + currentArrowType) + "_fire");
}
}
world.player.bow.gotoAndPlay("fire");
}
};
}
function fire(arrowType, owner) {
if (owner.name == "hero") {
if (hero.currentMana >= _root[arrowType].manaCost) {
calculateAngle();
hero.currentMana = hero.currentMana - _root[arrowType].manaCost;
} else {
showQuickMessage("NOT ENOUGH MANA", "bottom");
arrowType = "standardArrow";
}
}
arrowCount++;
_root.world.attachMovie("arrowBolt", "arrow" + arrowCount, depth_world_arrows + arrowCount);
if ((_root[arrowType].fireSound == true) && (arrowType != "deathWingVomit")) {
playSound(("sound_" + arrowType) + "_fire");
} else if ((_root[arrowType].fireSound == true) && (arrowType == "deathWingVomit")) {
playSound("sound_deathWingVomit_fire" + (random(2) + 1));
}
currentArrow = _root.world["arrow" + arrowCount];
currentArrow.bmp = new flash.display.BitmapData(currentArrow.collision._width, currentArrow.collision._height, true, 0);
currentArrow.bmp.draw(currentArrow.collision);
currentArrow.name = "arrowRef" + arrowCount;
currentArrow.x = 0;
currentArrow.y = 0;
currentArrow._x = owner._x;
currentArrow._y = owner._y - owner.firingPoint;
if (owner.firingPointX != undefined) {
currentArrow._x = owner._x + owner.firingPointX;
}
if (arrowType == "rockFall") {
currentArrow.collision._xscale = 300;
currentArrow.collision._yscale = 300;
}
if (arrowType == "endBossFireBall") {
endBossFirePoint.x = owner.firePoint_head._x;
endBossFirePoint.y = owner.firePoint_head._y;
owner.localToGlobal(endBossFirePoint);
world.globalToLocal(endBossFirePoint);
currentArrow._x = endBossFirePoint.x;
currentArrow._y = endBossFirePoint.y;
currentArrow.arrowBolt._xscale = (currentArrow.arrowBolt._yscale = random(90) + 70);
}
currentArrow.type = arrowType;
currentArrow.angle = owner.currentAngle;
currentArrow.owner = owner.name;
currentArrow.power = owner.arrowPower;
currentArrow.gravity = gravity;
currentArrow.grounded = false;
currentArrow.depth = currentArrow._y;
currentArrow.damage = _root[arrowType].damage;
if (trinketEquipped == "strongArm") {
currentArrow.damage = currentArrow.damage * trinket_strongArm.effect;
}
currentArrow.splashDamage = _root[arrowType].splashDamage;
currentArrow.hasSpecialEffect = _root[arrowType].hasSpecialEffect;
currentArrow.particleType = _root[arrowType].particleType;
currentArrow.dropParticles = _root[arrowType].dropParticles;
currentArrow.doSplashDamage = _root[arrowType].doSplashDamage;
currentArrow.showEffectOnEnemy = _root[arrowType].showEffectOnEnemy;
currentArrow.timed = _root[arrowType].timed;
currentArrow.timer = _root[arrowType].timer;
currentArrow.bolt.gotoAndStop(_root[arrowType].arrowGraph);
currentArrow.arrowHead.gotoAndStop(arrowType);
activeArrows.push(currentArrow);
currentArrow.onEnterFrame = function () {
with (this) {
if (this.timed == true) {
this.timer--;
if (this.timer < 0) {
_root.specialEffect(this.type, this);
}
}
if (((_x < -50) || (_x > 3000)) || (_y > 460)) {
removeMovieClip(this);
}
this.xant = _x;
this.yant = _y;
_x = _x + (Math.cos((this.angle / 180) * Math.PI) * this.power);
_y = _y + (this.gravity + (Math.sin((this.angle / 180) * Math.PI) * this.power));
this.power = this.power * 0.98;
this.gravity = this.gravity * 1.05;
_rotation = (Math.atan2(_y - this.yant, _x - this.xant) * 180) / Math.PI;
if (this.dropParticles == true) {
_root[this.type + "Particle"](this._x, this._y);
}
}
};
}
function arrowCollisions() {
for (x in activeArrows) {
if (activeArrows[x]._y > 460) {
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
break;
}
if (roofCollisions.length > 1) {
for (r in roofCollisions) {
arrCollPoint = new flash.geom.Point(activeArrows[x]._x, activeArrows[x]._y);
world.localToGlobal(arrCollPoint);
if (roofCollisions[r].collision.hitTest(arrCollPoint.x, arrCollPoint.y) && (activeArrows[x].owner != roofCollisions[r].name)) {
playSound("sound_arrowHit" + (random(4) + 1));
playSound(("sound_" + activeArrows[x].type) + "_impact");
dropRock(roofCollisions[r]);
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
}
}
}
if (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 8, activeArrows[x].bmp, (arrowPt = new flash.geom.Point(activeArrows[x]._x, activeArrows[x]._y)), 8)) {
delete activeArrows[x].onEnterFrame;
activeArrows[x].grounded = true;
if (activeArrows[x].type != "endBossFireBall") {
playSound("sound_arrowHitGround" + (random(2) + 1));
playSound(("sound_" + activeArrows[x].type) + "_impact");
}
if (activeArrows[x].doSplashDamage == true) {
splashDamage(activeArrows[x].type, arrowPt.x, arrowPt.y, activeArrows[x].owner);
activeArrows[x].removeMovieClip();
}
if (activeArrows[x].hasSpecialEffect == true) {
specialEffect(activeArrows[x].type, activeArrows[x]);
}
activeArrows[x].cacheAsBitmap = true;
if (activeArrows[x].type != "endBossFireBall") {
activeArrows[x].alphaTo(0, 0.5, "linear", arrowRemoveTime, function () {
removeMovieClip(this);
});
} else if (activeArrows[x].type == "endBossFireBall") {
removeMovieClip(activeArrows[x]);
}
activeArrows.splice(x, 1);
}
for (v in activeWalls) {
arrCollPoint = new flash.geom.Point(activeArrows[x]._x, activeArrows[x]._y);
world.localToGlobal(arrCollPoint);
if (activeWalls[v].collision.hitTest(arrCollPoint.x, arrCollPoint.y)) {
if (activeArrows[x].doSplashDamage == true) {
splashDamage(activeArrows[x].type, arrowPt.x, arrowPt.y, activeArrows[x].owner);
}
if (activeArrows[x].hasSpecialEffect == true) {
specialEffect(activeArrows[x].type, activeArrows[x]);
}
attachSpark(activeArrows[x]);
currentDamage = Math.round(activeArrows[x].damage + (activeArrows[x].power / 1.5));
activeWalls[v].health = activeWalls[v].health - currentDamage;
playSound(("sound_" + activeArrows[x].type) + "_impact");
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
updateWallHealthBar(activeWalls[v]);
if (activeWalls[v].health < 0) {
activeWalls[v].gotoAndPlay("break");
activeWalls.splice(v, 1);
}
}
}
for (v in activePortals) {
arrCollPoint = new flash.geom.Point(activeArrows[x]._x, activeArrows[x]._y);
world.localToGlobal(arrCollPoint);
if (activeArrows[x].owner == "hero") {
if (activePortals[v].collision.hitTest(activeArrows[x].collision)) {
if (activeArrows[x].doSplashDamage == true) {
splashDamage(activeArrows[x].type, arrowPt.x, arrowPt.y, activeArrows[x].owner);
}
if (activeArrows[x].hasSpecialEffect == true) {
specialEffect(activeArrows[x].type, activeArrows[x]);
}
attachSpark(activeArrows[x]);
currentDamage = Math.round(activeArrows[x].damage + (activeArrows[x].power / 1.5));
activePortals[v].health = activePortals[v].health - currentDamage;
showDamageText(activePortals[v], currentDamage);
playSound(("sound_" + activeArrows[x].type) + "_impact");
playSound("sound_hitPortal" + (random(2) + 1));
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
updatePortalHealthBar(activePortals[v]);
if (activePortals[v].health < 0) {
if (survivalMode == true) {
survivalPortalsDestroyed++;
updateSurvivalInterface();
}
activePortals[v].gotoAndPlay("dead");
activePortals.splice(v, 1);
openPortal();
}
}
}
}
for (v in heroSoldiers) {
if ((activeArrows[x].grounded == false) && (activeArrows[x].owner != "hero")) {
if (heroSoldiers[v].collision.hitTest(activeArrows[x].collision)) {
if (activeArrows[x].doSplashDamage == true) {
splashDamage(activeArrows[x].type, arrowPt.x, arrowPt.y, activeArrows[x].owner);
}
if (activeArrows[x].hasSpecialEffect == true) {
specialEffect(activeArrows[x].type, activeArrows[x]);
}
bloodParticles(heroSoldiers[v]._x, activeArrows[x]._y);
currentDamage = Math.round((activeArrows[x].damage + (activeArrows[x].power / 1.5)) - heroSoldiers[v].armor);
if (currentDamage < 0) {
currentDamage = 0;
}
heroSoldiers[v].health = heroSoldiers[v].health - currentDamage;
showDamageText(heroSoldiers[v], currentDamage);
playSound("sound_arrowHit" + (random(4) + 1));
playSound(("sound_" + activeArrows[x].type) + "_impact");
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
if (heroSoldiers[v].health <= 0) {
heroSoldiers[v].alive = false;
heroSoldiers[v].gotoAndPlay("dead");
heroSoldiers[v].legs.gotoAndPlay("dead");
heroSoldiers[v].normalArms.gotoAndStop("dead");
if (heroSoldiers[v].name != "hero") {
heroSoldiers[v].alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
heroSoldiers.splice(v, 1);
}
}
}
}
}
for (v in activeEnemy) {
if (((activeArrows[x].grounded == false) && (activeArrows[x].owner != activeEnemy[v].name)) && ((activeArrows[x].owner == "hero") || (activeArrows[x].owner == "rock"))) {
if (activeEnemy[v].collision.hitTest(activeArrows[x].collision)) {
if (activeArrows[x].showEffectOnEnemy && (activeEnemy[v].type != "enemy_endBoss")) {
showEffectOnEnemy(activeEnemy[v], activeArrows[x].type);
}
if ((activeArrows[x].type == "bloat") && (activeEnemy[v].type != "enemy_endBoss")) {
activeEnemy[v].bloated = true;
}
if (activeArrows[x].doSplashDamage == true) {
splashDamage(activeArrows[x].type, arrowPt.x, arrowPt.y, activeArrows[x].owner);
}
if (activeArrows[x].hasSpecialEffect == true) {
specialEffect(activeArrows[x].type, activeArrows[x]);
}
attachSpark(activeArrows[x]);
bloodParticles(activeEnemy[v]._x, activeArrows[x]._y);
if (trinketEquipped == "piercing") {
currentDamage = Math.round((activeArrows[x].damage + (activeArrows[x].power / 1.5)) - (activeEnemy[v].armor * trinket_piercing.effect));
} else {
currentDamage = Math.round((activeArrows[x].damage + (activeArrows[x].power / 1.5)) - activeEnemy[v].armor);
}
if (trinketEquipped == "deadEye") {
criticalChance = hero.critChance * trinket_deadEye.effect;
} else {
criticalChance = hero.critChance;
}
if ((random(100) + 1) <= criticalChance) {
activeEnemy[v].critHit = true;
currentDamage = currentDamage * 2;
}
if (currentDamage < 0) {
currentDamage = 0;
}
if (activeEnemy[v].name == "hero") {
world.player.health = world.player.health - currentDamage;
} else {
activeEnemy[v].health = activeEnemy[v].health - currentDamage;
}
showDamageText(activeEnemy[v], currentDamage);
if (currentDamage > 0) {
if (activeEnemy[v].type == "enemy_endBoss") {
endBossHealthBar();
}
}
playSound("sound_arrowHit" + (random(4) + 1));
playSound(("sound_" + activeArrows[x].type) + "_impact");
if (activeArrows[x].doSplashDamage == false) {
stuckArrows++;
var _local3 = random(5) + 1;
if (activeEnemy[v].type == "enemy_endBoss") {
_local3 = random(20) + 1;
}
activeEnemy[v].head["stuckArrow" + _local3].gotoAndStop("show");
activeEnemy[v].torso["stuckArrow" + _local3].gotoAndStop("show");
activeEnemy[v].torso["stuckArrow" + _local3]._rotation = activeArrows[x]._rotation;
if (activeEnemy[v]._xscale == -100) {
activeEnemy[v].torso["stuckArrow" + _local3]._rotation = activeArrows[x]._rotation - 180;
activeEnemy[v].head["stuckArrow" + _local3]._rotation = activeEnemy[v].head["stuckArrow" + _local3]._rotation - 180;
}
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v].torso["stuckArrow" + _local3]._yscale = 70;
if (activeEnemy[v]._xscale == -100) {
activeEnemy[v].torso["stuckArrow" + _local3]._xscale = -70;
} else {
activeEnemy[v].torso["stuckArrow" + _local3]._xscale = 70;
}
}
}
activeArrows[x].removeMovieClip();
activeArrows.splice(x, 1);
if (activeEnemy[v].health < 0) {
if ((_root[currentLevel].mapName == "hell_3") && (activeEnemy[v].type == "enemy_endBoss")) {
setTimeout(endBattle, 12000);
}
if (survivalMode == true) {
survivalModeKills++;
updateSurvivalInterface();
} else {
dropTrinket(activeEnemy[v]);
}
activeEnemy[v].alive = false;
activeEnemy[v].gotoAndPlay("dead");
activeEnemy[v].torso.gotoAndPlay("dead");
activeEnemy[v].legs.gotoAndPlay("dead");
activeEnemy[v].normalArms.gotoAndStop("dead");
if ((activeEnemy[v].name != "hero") && (activeEnemy[v].type != "enemy_endBoss")) {
activeEnemy[v].alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
}
activeEnemy.splice(v, 1);
}
}
}
}
}
}
function splashCollisions() {
for (v in activeSplash) {
if (activeSplash[v].name != undefined) {
for (x in heroSoldiers) {
var _local5 = new flash.geom.Point(heroSoldiers[x]._x, heroSoldiers[x]._y);
world.localToGlobal(_local5);
if (activeSplash[v].owner != "hero") {
if (activeSplash[v].collision.hitTest(_local5.x, _local5.y, true)) {
var _local3 = activeSplash[v].damage;
if (heroSoldiers[x].name == "hero") {
world.player.health = world.player.health - _local3;
} else {
heroSoldiers[x].health = heroSoldiers[x].health - _local3;
}
if (_local3 > 0) {
showDamageText(heroSoldiers[x], _local3);
bloodParticles(heroSoldiers[x]._x, heroSoldiers[x]._y - 30);
}
if (heroSoldiers[x].health < 0) {
heroSoldiers[x].alive = false;
heroSoldiers[x].gotoAndPlay("dead");
heroSoldiers[x].torso.gotoAndPlay("dead");
heroSoldiers[x].legs.gotoAndPlay("dead");
heroSoldiers[x].normalArms.gotoAndStop("dead");
if (heroSoldiers[x].name != "hero") {
heroSoldiers[x].alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
}
heroSoldiers.splice(x, 1);
}
}
}
}
for (x in activeMinions) {
var _local4 = new flash.geom.Point(activeMinions[x]._x, activeMinions[x]._y);
world.localToGlobal(_local4);
if ((activeSplash[v].owner != "hero") && (activeMinions[x].name != "hero")) {
if (activeSplash[v].collision.hitTest(_local4.x, _local4.y, true)) {
var _local3 = activeSplash[v].damage;
activeMinions[x].health = activeMinions[x].health - _local3;
if (_local3 > 0) {
showDamageText(activeMinions[x], _local3);
bloodParticles(activeMinions[x]._x, activeMinions[x]._y - 30);
}
if (activeMinions[x].health < 0) {
activeMinions[x].alive = false;
activeMinions[x].gotoAndPlay("dead");
activeMinions[x].alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
activeMinions.splice(x, 1);
}
}
}
}
for (x in activeWalls) {
if (activeSplash[v].owner != "hero") {
if (activeWalls[x].collision.hitTest(activeSplash[v].collision)) {
var _local3 = activeSplash[v].damage;
activeWalls[x].health = activeWalls[x].health - _local3;
if (_local3 > 0) {
showDamageText(activeWalls[x], _local3);
}
if (activeWalls[x].health < 0) {
activeWalls[x].gotoAndPlay("break");
activeWalls.splice(x, 1);
}
}
}
}
for (x in activePortals) {
if (((activeSplash[v].owner == "hero") && (activeSplash[v].type != "rockWall")) && (activeSplash[v].type != "boneWall")) {
if (activePortals[x].collision.hitTest(activeSplash[v].collision)) {
var _local3 = activeSplash[v].damage;
activePortals[x].health = activePortals[x].health - _local3;
showDamageText(activePortals[x], _local3);
playSound("sound_hitPortal" + (random(2) + 1));
}
updatePortalHealthBar(activePortals[x]);
if (activePortals[x].health < 0) {
if (survivalMode == true) {
survivalPortalsDestroyed++;
updateSurvivalInterface();
}
activePortals[x].gotoAndPlay("dead");
activePortals.splice(x, 1);
openPortal();
}
}
}
for (x in activeEnemy) {
if (activeSplash[v].owner == "hero") {
if (activeEnemy[x].collision.hitTest(activeSplash[v].collision)) {
var _local3 = activeSplash[v].damage - activeEnemy[x].armor;
if (_local3 < 0) {
_local3 = 0;
}
activeEnemy[x].health = activeEnemy[x].health - _local3;
if (_local3 > 0) {
showDamageText(activeEnemy[x], _local3);
bloodParticles(activeEnemy[x]._x, activeEnemy[x]._y - 30);
if (activeEnemy[x].type == "enemy_endBoss") {
endBossHealthBar();
}
}
if (((activeSplash[v].attackStats == true) && (activeEnemy[x][activeSplash[v].statToAttack + "_debuffed"] == false)) && (activeEnemy[v].type != "enemy_endBoss")) {
activeEnemy[x][activeSplash[v].statToAttack + "_debuffed"] = true;
activeEnemy[x][activeSplash[v].statToAttack] = activeEnemy[x][activeSplash[v].statToAttack] * activeSplash[v].statDamage;
}
if (activeSplash[v].showEffectOnEnemy && (activeEnemy[x].type != "enemy_endBoss")) {
showEffectOnEnemy(activeEnemy[x], activeSplash[v].type);
}
if (activeEnemy[x].health <= 0) {
if ((_root[currentLevel].mapName == "hell_3") && (activeEnemy[x].type == "enemy_endBoss")) {
setTimeout(endBattle, 12000);
}
if (survivalMode == true) {
survivalModeKills++;
updateSurvivalInterface();
} else {
dropTrinket(activeEnemy[x]);
}
activeEnemy[x].alive = false;
activeEnemy[x].gotoAndStop("dead");
activeEnemy[x].torso.gotoAndPlay("dead");
if ((activeEnemy[x].name != "hero") && (activeEnemy[x].type != "enemy_endBoss")) {
activeEnemy[x].alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
activeEnemy.splice(x, 1);
}
}
}
}
}
}
}
}
function generateEnemy(enemyType) {
if ((activeEnemy.length < (_root[currentLevel].maxEnemyCount + survivalEnemyCountBonus)) && (activePortals.length > 0)) {
enemyCount++;
world.attachMovie(_root[enemyType].clip, "enemy" + enemyCount, depth_world_enemy + enemyCount);
if (world["enemy" + enemyCount]._x > world.player._x) {
world["enemy" + enemyCount]._x = currentSpawnPoint - random(60);
} else {
world["enemy" + enemyCount]._x = currentSpawnPoint + random(60);
}
world["enemy" + enemyCount]._y = 300;
world["enemy" + enemyCount].gotoAndPlay("walk");
world["enemy" + enemyCount].name = "enemySoldier" + enemyCount;
world["enemy" + enemyCount].type = enemyType;
world["enemy" + enemyCount].alive = true;
world["enemy" + enemyCount].speed = _root[enemyType].speed;
world["enemy" + enemyCount].maxHealth = _root[enemyType].maxHealth;
world["enemy" + enemyCount].health = _root[enemyType].health;
world["enemy" + enemyCount].damage = _root[enemyType].damage;
world["enemy" + enemyCount].attacking = _root[enemyType].attacking;
world["enemy" + enemyCount].attackAnim = false;
world["enemy" + enemyCount].enemyTarget = undefined;
world["enemy" + enemyCount].range = _root[enemyType].range;
world["enemy" + enemyCount].armor = _root[enemyType].armor;
world["enemy" + enemyCount].hitChance = _root[enemyType].hitChance;
world["enemy" + enemyCount].critChance = _root[enemyType].critChance;
world["enemy" + enemyCount].dirTimer = _root[enemyType].dirTimer;
world["enemy" + enemyCount].dirTimerMax = _root[enemyType].dirTimerMax;
world["enemy" + enemyCount].dir = _root[enemyType].dir;
world["enemy" + enemyCount].armor_debuffed = false;
world["enemy" + enemyCount].hitChance_debuffed = false;
world["enemy" + enemyCount].speed_debuffed = false;
world["enemy" + enemyCount].frozen = false;
world["enemy" + enemyCount].fearing = false;
world["enemy" + enemyCount].bloated = false;
world["enemy" + enemyCount].bloatTimer = _root.bloat.timer;
world["enemy" + enemyCount].hitWall = false;
world["enemy" + enemyCount].hittingWall = "none";
world["enemy" + enemyCount].rangedAttack = _root[enemyType].rangedAttack;
world["enemy" + enemyCount].depth = world["enemy" + enemyCount]._y;
world["enemy" + enemyCount].scaling = _root[enemyType].scaling;
world["enemy" + enemyCount].bossSummonTimerMax = 1750;
world["enemy" + enemyCount].bossSummonTimer = world["enemy" + enemyCount].bossSummonTimerMax;
if (enemyType == "enemy_giantDemon") {
world["enemy" + enemyCount]._yscale = _root[enemyType].scaling;
world["enemy" + enemyCount]._xscale = _root[enemyType].scaling;
for (e in world["enemy" + enemyCount]) {
world["enemy" + enemyCount][e].gotoAndStop("giantDemon");
}
}
var _local3 = random(3) + 1;
world["enemy" + enemyCount].weapon.gotoAndStop(_local3);
if (((enemyType == "enemy_shaman") || (enemyType == "enemy_deadlingArcher")) || (enemyType == "enemy_deathWing")) {
world["enemy" + enemyCount].arrowPower = 15;
world["enemy" + enemyCount].currentAngle = 0;
world["enemy" + enemyCount].firingPoint = 20;
}
portalSpawnParticle(currentPortal._x, currentPortal._y - 30);
if (_root[currentLevel].environment == "desert") {
world["enemy" + enemyCount].colorTransformTo(150, 0, 150, 0, 140, 0, 100, 0);
}
if (_root[currentLevel].environment == "hell") {
world["enemy" + enemyCount].colorTransformTo(150, 0, 120, 0, 100, 0, 100, 0);
}
activeEnemy.push(world["enemy" + enemyCount]);
}
}
function enemyTicker() {
enemySpawnCount--;
if (enemySpawnCount <= 0) {
enemySpawnCount = _root[currentLevel].enemyRate;
playSound("sound_teleport" + (random(3) + 1));
g = 0;
while (g < 10) {
enemyIndex++;
if (survivalMode == false) {
if (enemyIndex > (_root[currentLevel].enemyTypes.length - 1)) {
enemyIndex = 0;
}
var _local2 = _root[currentLevel].enemyTypes[enemyIndex];
setTimeout(generateEnemy, g * enemyGenDelay, _local2);
} else {
if (enemyIndex > (_root[currentLevel][currentEnemySet].length - 1)) {
enemyIndex = 0;
}
var _local2 = _root[currentLevel][currentEnemySet][enemyIndex];
setTimeout(generateEnemy, g * enemyGenDelay, _local2);
}
g++;
}
}
}
function endBossHealthBar() {
for (e in activeEnemy) {
if (activeEnemy[e].type == "enemy_endBoss") {
activeEnemy[e].healthBar.alphaTo(100, 0.4);
activeEnemy[e].healthBar.bar._xscale = Math.round((activeEnemy[e].health / activeEnemy[e].maxHealth) * 100);
activeEnemy[e].healthBar.alphaTo(0, 0.4, "linear", 3);
}
}
}
function enemyUnitAI() {
for (v in activeEnemy) {
if (activeEnemy[v].alive == true) {
for (x in activeMinions) {
var _local3 = activeEnemy[v]._x - activeMinions[x]._x;
var _local2 = activeEnemy[v]._y - activeMinions[x]._y;
activeEnemy[v].prox = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if ((((activeEnemy[v].prox <= activeEnemy[v].range) && (activeEnemy[v].rangedAttack == false)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
activeEnemy[v].attacking = true;
activeEnemy[v].enemyTarget = activeMinions[x];
} else if (((((activeEnemy[v].prox <= (activeEnemy[v].range + (random(20) + 50))) && (activeEnemy[v].prox >= (activeEnemy[v].range - (random(20) + 50)))) && (activeEnemy[v].rangedAttack == true)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
if (activeEnemy[v]._x > activeEnemy[v].enemyTarget._x) {
activeEnemy[v]._xscale = 100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = activeEnemy[v].scaling;
}
} else {
activeEnemy[v]._xscale = -100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = -activeEnemy[v].scaling;
}
}
activeEnemy[v].attacking = true;
activeEnemy[v].enemyTarget = activeMinions[x];
}
}
if ((((activeEnemy[v].attacking == true) && (activeEnemy[v].attackAnim == false)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
if ((activeEnemy[v].type == "enemy_shaman") || (activeEnemy[v].type == "enemy_endBoss")) {
activeEnemy[v].gotoAndPlay("attack" + (random(2) + 1));
} else {
activeEnemy[v].gotoAndPlay("attack1");
}
}
if (activeEnemy[v].type == "enemy_endBoss") {
activeEnemy[v].bossSummonTimer--;
if (((activeEnemy[v].bossSummonTimer < 0) && (activeEnemy[v].attackAnim == false)) && (activeEnemy[v].attacking == false)) {
activeEnemy[v].bossSummonTimer = activeEnemy[v].bossSummonTimerMax;
activeEnemy[v].attacking = true;
activeEnemy[v].gotoAndPlay("summon");
}
}
if ((((activeEnemy[v].type == "enemy_endBoss") && (activeEnemy[v].attackAnim == false)) && (random(70) == 0)) && (activeEnemy[v].attacking == false)) {
activeEnemy[v].attacking = true;
activeEnemy[v].enemyTarget = heroSoldiers[0];
activeEnemy[v].gotoAndPlay("attack3");
if (activeEnemy[v]._x > world.player._x) {
activeEnemy[v]._xscale = 100;
} else {
activeEnemy[v]._xscale = -100;
}
}
if (((activeEnemy[v].attackAnim == false) && (activeEnemy[v].prox >= activeEnemy[v].range)) && (activeEnemy[v].type != "enemy_endBoss")) {
activeEnemy[v].enemyTarget = undefined;
}
for (w in activeWalls) {
if (activeWalls[w].collision.hitTest(activeEnemy[v].collision)) {
activeEnemy[v].hitWall = true;
activeEnemy[v].hittingWall = activeWalls[w];
activeEnemy[v].enemyTarget = activeWalls[w];
activeEnemy[v].attacking = true;
} else {
activeEnemy[v].hitWall = false;
activeEnemy[v].hittingWall = undefined;
}
}
if (_root[activeEnemy[v].enemyTarget].health < 0) {
activeEnemy[v].enemyTarget = undefined;
activeEnemy[v].attacking = false;
activeEnemy[v].attackAnim = false;
activeEnemy[v].hitWall = false;
activeEnemy[v].hittingWall = undefined;
}
if ((((((_root[activeEnemy[v].enemyTarget].health != undefined) && (activeEnemy[v].attacking == true)) && (activeEnemy[v].attackAnim == false)) && (activeEnemy[v].hitWall == true)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
if ((activeEnemy[v].type == "enemy_shaman") || (activeEnemy[v].type == "enemy_endBoss")) {
activeEnemy[v].gotoAndPlay("attack" + (random(2) + 1));
} else {
activeEnemy[v].gotoAndPlay("attack1");
}
}
if ((((((activeEnemy[v]._x > worldBorder) && (activeEnemy[v].attacking == false)) && (world.player._x < activeEnemy[v]._x)) && (activeEnemy[v].rangedAttack == false)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
activeEnemy[v]._x = activeEnemy[v]._x - activeEnemy[v].speed;
activeEnemy[v]._xscale = 100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = activeEnemy[v].scaling;
}
} else if ((((((activeEnemy[v]._x < (world.bg._width - worldBorder)) && (activeEnemy[v].attacking == false)) && (world.player._x > activeEnemy[v]._x)) && (activeEnemy[v].rangedAttack == false)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
activeEnemy[v]._x = activeEnemy[v]._x + activeEnemy[v].speed;
activeEnemy[v]._xscale = -100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = -activeEnemy[v].scaling;
}
}
if ((((activeEnemy[v].attacking == false) && (activeEnemy[v].rangedAttack == true)) && (activeEnemy[v].frozen == false)) && (activeEnemy[v].fearing == false)) {
if (activeEnemy[v].prox <= activeEnemy[v].range) {
if (activeEnemy[v].type == "enemy_deadlingArcher") {
playVoice("deadlingScared");
}
if ((world.player._x >= activeEnemy[v]._x) && (activeEnemy[v]._x > worldBorder)) {
activeEnemy[v]._x = activeEnemy[v]._x - (activeEnemy[v].speed * 1.5);
activeEnemy[v]._xscale = 100;
} else if (activeEnemy[v]._x < (world.bg._width - worldBorder)) {
activeEnemy[v]._x = activeEnemy[v]._x + (activeEnemy[v].speed * 1.5);
activeEnemy[v]._xscale = -100;
}
if ((activeEnemy[v]._x <= worldBorder) || (activeEnemy[v]._x >= (world.bg._width - worldBorder))) {
if (activeEnemy[v]._x > world.player._x) {
activeEnemy[v]._xscale = 100;
} else {
activeEnemy[v]._xscale = -100;
}
activeEnemy[v].attacking = true;
}
} else if ((world.player._x >= activeEnemy[v]._x) && (activeEnemy[v]._x < (world.bg._width - worldBorder))) {
activeEnemy[v]._x = activeEnemy[v]._x + activeEnemy[v].speed;
activeEnemy[v]._xscale = -100;
} else if ((world.player._x <= activeEnemy[v]._x) && (activeEnemy[v]._x > worldBorder)) {
activeEnemy[v]._x = activeEnemy[v]._x - activeEnemy[v].speed;
activeEnemy[v]._xscale = 100;
} else {
activeEnemy[v].attacking = true;
}
}
if (activeEnemy[v].fearing == true) {
if ((world.player._x >= activeEnemy[v]._x) && (activeEnemy[v]._x > worldBorder)) {
activeEnemy[v]._x = activeEnemy[v]._x - (activeEnemy[v].speed * 1.5);
activeEnemy[v]._xscale = 100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = activeEnemy[v].scaling;
}
} else if ((world.player._x <= activeEnemy[v]._x) && (activeEnemy[v]._x < (world.bg._width - worldBorder))) {
activeEnemy[v]._x = activeEnemy[v]._x + (activeEnemy[v].speed * 1.5);
activeEnemy[v]._xscale = -100;
if (activeEnemy[v].type == "enemy_giantDemon") {
activeEnemy[v]._xscale = -activeEnemy[v].scaling;
}
}
}
if (activeEnemy[v].type == "enemy_deathWing") {
activeEnemy[v].dirTimer--;
if (activeEnemy[v].dirTimer <= 0) {
if (random(2) > 0) {
activeEnemy[v].dir = "up";
} else {
activeEnemy[v].dir = "down";
}
activeEnemy[v].dirTimer = activeEnemy[v].dirTimerMax;
}
if ((activeEnemy[v].dir == "up") && (activeEnemy[v]._y > (random(20) + 30))) {
activeEnemy[v]._y = activeEnemy[v]._y - (activeEnemy[v].speed * 2);
}
if (activeEnemy[v].dir == "down") {
activeEnemy[v]._y = activeEnemy[v]._y - activeEnemy[v].speed;
}
}
applyGravity(activeEnemy[v]);
if (activeEnemy[v].bloated == true) {
bloatParticles(activeEnemy[v]._x, activeEnemy[v]._y);
activeEnemy[v].bloatTimer--;
if (activeEnemy[v].bloatTimer < 0) {
explodeTarget(activeEnemy[v]);
}
}
}
}
}
function endBossSummonEnemies(targetX, targetY) {
currentSpawnPoint = targetX + (random(100) - 50);
generateEnemy("enemy_deadling");
currentSpawnPoint = targetX + (random(100) - 50);
generateEnemy("enemy_deadling");
currentSpawnPoint = targetX + (random(100) - 50);
generateEnemy("enemy_deadling");
currentSpawnPoint = targetX + (random(100) - 50);
generateEnemy("enemy_demon");
currentSpawnPoint = targetX + (random(100) - 50);
generateEnemy("enemy_deadlingArcher");
}
function endBossBreatheFire(unit) {
unit.arrowPower = random(13) + 13;
unit.currentAngle = -150 + (random(30) - 15);
if (unit._xscale == -100) {
unit.currentAngle = -30 + (random(30) - 15);
}
_root.fire("endBossFireBall", unit);
}
function dropRock(unit) {
unit.name = "rock";
unit.firingPoint = 0;
unit.firingPointX = random(100) - 50;
unit.arrowPower = 0;
unit.currentAngle = 0;
unit.damage = 1000;
_root.fire("rockFall", unit);
}
function shamanFire(unit) {
unit.arrowPower = random(5) + 15;
unit.currentAngle = -150 + (random(30) - 15);
unit.firingPoint = 35;
if (unit._xscale == -100) {
unit.currentAngle = -45 + (random(30) - 15);
}
_root.fire("shamanFireBall", unit);
}
function shamanSkyFire(unit) {
unit.arrowPower = random(5) + 10;
unit.currentAngle = -150 + (random(30) - 15);
unit.firingPoint = 500;
if (unit._xscale == -100) {
unit.currentAngle = -45 + (random(30) - 15);
}
_root.fire("shamanFireBall", unit);
}
function deathWingVomitAttack(unit) {
unit.arrowPower = random(5) + 5;
unit.currentAngle = -155 + (random(10) - 15);
unit.firingPoint = 35;
if (unit._xscale == -100) {
unit.currentAngle = 5 + (random(10) - 15);
}
_root.fire("deathWingVomit", unit);
}
function deadlingArcherFire(unit) {
unit.arrowPower = random(5) + 20;
unit.currentAngle = -150 + (random(30) - 15);
if (unit._xscale == -100) {
unit.currentAngle = -45 + (random(30) - 15);
}
_root.fire("deadlingBolt", unit);
}
function playerControls() {
movePlayerPoint = new flash.geom.Point(world.player._x, world.player._y);
world.localToGlobal(movePlayerPoint);
playerCollideRight = false;
playerCollideLeft = false;
if (world.player.alive == true) {
for (v in heroSoldiers) {
if (heroSoldiers[v].collision.hitTest(world.player) && (heroSoldiers[v].name != "hero")) {
playerCollideRight = true;
}
}
for (w in activeWalls) {
if (activeWalls[w].collision.hitTest(world.player)) {
if (world.player._x < activeWalls[w]._x) {
playerCollideRight = true;
}
if (world.player._x > activeWalls[w]._x) {
playerCollideLeft = true;
}
}
}
for (e in activeEnemy) {
if (activeEnemy[e].collision.hitTest(world.player)) {
if (world.player._x < activeEnemy[e]._x) {
playerCollideRight = true;
}
if (world.player._x > activeEnemy[e]._x) {
playerCollideLeft = true;
}
}
}
if (Key.isDown(27)) {
_root.pauseGame();
}
if (((Key.isDown(65) || (Key.isDown(81))) || (Key.isDown(37))) && (playerCollideLeft == false)) {
hideProgressBar();
aimingControl = "unlocked";
searchingRuneStone = false;
world.player.bow._y = -25;
playerMove("left");
playerMovingBackward = true;
if (world.player.currentFacing == "right") {
if (playerMoveBackwardAnim == false) {
world.player.gotoAndPlay("running");
playerMoveBackwardAnim = true;
playerMoveForwardAnim = false;
world.player.legs.gotoAndPlay("backward");
}
} else if (playerMoveForwardAnim == false) {
world.player.gotoAndPlay("running");
playerMoveForwardAnim = true;
playerMoveBackwardAnim = false;
world.player.legs.gotoAndPlay("forward");
}
} else if ((Key.isDown(68) || (Key.isDown(39))) && (playerCollideRight == false)) {
hideProgressBar();
aimingControl = "unlocked";
searchingRuneStone = false;
world.player.bow._y = -25;
playerMove("right");
playerMovingForward = true;
if (world.player.currentFacing == "left") {
if (playerMoveBackwardAnim == false) {
world.player.gotoAndPlay("running");
playerMoveBackwardAnim = true;
playerMoveForwardAnim = false;
world.player.legs.gotoAndPlay("backward");
}
} else if (playerMoveForwardAnim == false) {
world.player.gotoAndPlay("running");
playerMoveForwardAnim = true;
playerMoveBackwardAnim = false;
world.player.legs.gotoAndPlay("forward");
}
} else if (Key.isDown(32)) {
if (hero.nearStone && (hero.closestStone.searched == false)) {
showProgressBar();
playerMoveForwardAnim = false;
playerMoveBackwardAnim = false;
world.player.bow._y = -5000;
aimingControl = "locked";
searchingRuneStone = true;
searchTimer = runeSearchTime;
world.player.gotoAndPlay("extractStones");
world.player.legs.gotoAndPlay("kneel");
}
if (hero.closestStone.searched == true) {
showQuickMessage("Runes already Extracted.", "bottom");
}
} else if (aimingControl == "unlocked") {
world.player.bow._y = -25;
playerMoveForwardAnim = false;
playerMoveBackwardAnim = false;
world.player.gotoAndStop("idle");
world.player.legs.gotoAndStop("idle");
playerMovingForward = false;
playerMovingBackward = false;
}
}
}
function playerMove(dir) {
movePlayerPoint = new flash.geom.Point(world.player._x, world.player._y);
world.localToGlobal(movePlayerPoint);
if ((dir == "left") && (movePlayerPoint.x > moveEdgeBuffer)) {
if (world.player._xscale == -100) {
world.player._x = world.player._x - hero.speed;
} else {
world.player._x = world.player._x - (hero.speed / 1.3);
}
}
if ((dir == "right") && (movePlayerPoint.x < (Stage.width - moveEdgeBuffer))) {
if (world.player._xscale == 100) {
world.player._x = world.player._x + hero.speed;
} else {
world.player._x = world.player._x + (hero.speed / 1.3);
}
}
}
function playerGrav() {
while (!world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (playerPoint = new flash.geom.Point(world.player._x, world.player._y)))) {
world.player._y = world.player._y + 1;
}
while (world.terrain.bmp.hitTest((terrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (playerPoint = new flash.geom.Point(world.player._x, world.player._y)))) {
world.player._y = world.player._y - 1;
}
}
function manaRegen() {
if (hero.currentMana < hero.mana) {
if (trinketEquipped == "manaRegen") {
hero.currentMana = hero.currentMana + (hero.manaRegen * trinket_manaRegen.effect);
} else {
hero.currentMana = hero.currentMana + hero.manaRegen;
}
}
if ((world.player.health < hero.maxHealth) && (survivalMode == false)) {
world.player.health = world.player.health + hero.healthRegen;
}
if ((world.player.health < hero.maxHealth) && (trinketEquipped == "healthRegen")) {
world.player.health = world.player.health + trinket_healthRegen.effect;
}
}
function cameraSetup() {
var _local1 = new Object();
_local1.onKeyDown = function () {
if (Key.isDown(37)) {
cameraPanKeys("left");
}
if (Key.isDown(39)) {
cameraPanKeys("right");
}
};
Key.addListener(_local1);
}
function cameraControl() {
if ((game.state != "paused") && (camera.state != "locked")) {
playerCamPoint = new flash.geom.Point(world.player._x, world.player._y);
worldCamPoint = new flash.geom.Point(world.bg._x, world.bg._y);
world.localToGlobal(worldCamPoint);
world.localToGlobal(playerCamPoint);
if (((playerMovingForward == true) && (playerCamPoint.x >= 500)) && (worldCamPoint.x >= (((-world.bg._width) + Stage.width) + panEdgeBuffer))) {
world._x = world._x - panSpeed;
if (world.midGround._x <= 0) {
world.midGround._x = world.midGround._x + (panSpeed / 5);
}
world.distantGround._x = world.distantGround._x + (panSpeed / 8);
}
if (((playerMovingBackward == true) && (playerCamPoint.x <= 300)) && (worldCamPoint.x <= (-panEdgeBuffer))) {
world._x = world._x + panSpeed;
if (world.midGround._x >= (world.midGround.width + Stage.width)) {
world.midGround._x = world.midGround._x - (panSpeed / 5);
}
world.distantGround._x = world.distantGround._x - (panSpeed / 8);
}
if ((((_xmouse <= panBuffer) && (_ymouse <= panInterfaceBlock)) && (world._x <= (-panBuffer))) && (playerCamPoint.x <= (Stage.width - panEdgeBuffer))) {
world._x = world._x + (panSpeed * 2);
if (world.midGround._x >= (world.midGround.width + Stage.width)) {
world.midGround._x = world.midGround._x - (panSpeed / 5);
}
world.distantGround._x = world.distantGround._x - (panSpeed / 8);
}
if ((((_xmouse >= (Stage.width - panBuffer)) && (_ymouse <= panInterfaceBlock)) && (world._x > (((-world.bg._width) + Stage.width) + panBuffer))) && (playerCamPoint.x >= panEdgeBuffer)) {
world._x = world._x - (panSpeed * 2);
if (world.midGround._x <= 0) {
world.midGround._x = world.midGround._x + (panSpeed / 5);
}
world.distantGround._x = world.distantGround._x + (panSpeed / 8);
}
}
}
function cameraPanKeys(panDir) {
if ((game.state != "paused") && (camera.state != "locked")) {
if ((panDir == "left") && (world._x <= (-panBuffer))) {
world._x = world._x + panSpeed;
}
if ((panDir == "right") && (world._x > (((-world.bg._width) + Stage.width) + panBuffer))) {
world._x = world._x - panSpeed;
}
}
}
function hitEnemy(attacker, target) {
var _local4 = random(100) + 1;
if ((target.name == "hero") && (trinketEquipped == "elusiveCharm")) {
targetArmor = target.armor + trinket_elusiveCharm.effect;
} else {
targetArmor = target.armor;
}
if (_local4 <= (attacker.hitChance - targetArmor)) {
attackHit = true;
meleeDamage = attacker.damage;
}
if (((random(100) + 1) <= attacker.critChance) && (attackHit == true)) {
meleeDamage = meleeDamage * 2;
critAttack = true;
bloodParticles(target._x, target._y - 28);
}
if (attackHit == true) {
target.health = target.health - meleeDamage;
targetPoint = new flash.geom.Point(target._x, target._y);
world.localToGlobal(targetPoint);
showDamageText(target, meleeDamage);
}
if ((critAttack == false) && (attackHit == true)) {
playSound("sound_swordClash" + (random(4) + 1));
}
if (critAttack == true) {
playSound("sound_swordClash5");
}
attackHit = false;
critAttack = false;
if (target.health < 0) {
target.alive = false;
target.gotoAndPlay("dead");
target.legs.gotoAndPlay("dead");
target.normalArms.gotoAndStop("dead");
if ((target.name != "hero") && (activeEnemy[x].type != "enemy_endBoss")) {
target.alphaTo(0, 1, "linear", deadWaitTime, function () {
removeMovieClip(this);
});
}
attacker.attacking = false;
attacker.enemyTarget = undefined;
for (x in activeEnemy) {
if (activeEnemy[x].name == target.name) {
activeEnemy.splice(x, 1);
}
}
for (x in heroSoldiers) {
if (heroSoldiers[x].name == target.name) {
heroSoldiers.splice(x, 1);
}
}
for (x in activeMinions) {
if (activeMinions[x].name == target.name) {
activeMinions.splice(x, 1);
}
}
for (w in activeWalls) {
if (activeWalls[w].name == target.name) {
activeWalls[w].gotoAndPlay("break");
activeWalls.splice(w, 1);
}
}
}
}
function splashDamage(arrowType, splashX, splashY, owner) {
splashEffect++;
world.attachMovie("splash_" + arrowType, "splash" + splashEffect, depth_world_splashEffects + splashEffect);
world["splash" + splashEffect].name = "splash" + splashEffect;
world["splash" + splashEffect].type = arrowType;
world["splash" + splashEffect].damage = _root[arrowType].splashDamage;
world["splash" + splashEffect].owner = owner;
world["splash" + splashEffect].attackStats = _root[arrowType].attackStats;
world["splash" + splashEffect].statToAttack = _root[arrowType].statToAttack;
world["splash" + splashEffect].statDamage = _root[arrowType].statDamage;
world["splash" + splashEffect].showEffectOnEnemy = _root[arrowType].showEffectOnEnemy;
world["splash" + splashEffect]._x = splashX;
world["splash" + splashEffect]._y = splashY;
activeSplash.push(world["splash" + splashEffect]);
for (a in activeSplash) {
if (activeSplash[a].name == world["splash" + splashEffect].name) {
activeSplash[a].splashIndex = a;
}
}
while (world.terrain.bmp.hitTest((splashTerrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (sPoint = new flash.geom.Point(world["splash" + splashEffect]._x, world["splash" + splashEffect]._y))) == true) {
world["splash" + splashEffect]._y = world["splash" + splashEffect]._y - 1;
}
if (_root[arrowType].splashGrounded == true) {
while (world.terrain.bmp.hitTest((splashTerrPoint = new flash.geom.Point(_root.world.terrain._x, _root.world.terrain._y)), 128, (sPoint = new flash.geom.Point(world["splash" + splashEffect]._x, world["splash" + splashEffect]._y))) == false) {
world["splash" + splashEffect]._y = world["splash" + splashEffect]._y + 1;
}
}
}
function showDamageText(targetName, damage) {
if (damage > 0) {
dmgTexts++;
targetName.attachMovie("damageText", "dmgText" + dmgTexts, 5000 + dmgTexts);
if (targetName.type == "enemy_giantDemon") {
targetName["dmgText" + dmgTexts]._xscale = 80;
targetName["dmgText" + dmgTexts]._yscale = 80;
}
if (targetName._xscale <= 0) {
targetName["dmgText" + dmgTexts]._xscale = -targetName["dmgText" + dmgTexts]._xscale;
}
if (targetName.critHit == true) {
targetName["dmgText" + dmgTexts]._xscale = targetName["dmgText" + dmgTexts]._xscale * 1.2;
targetName["dmgText" + dmgTexts]._yscale = targetName["dmgText" + dmgTexts]._yscale * 1.2;
targetName["dmgText" + dmgTexts].dText.dmg.colorTo(16763904, 0.1);
targetName["dmgText" + dmgTexts].dText.crit._alpha = 100;
targetName["dmgText" + dmgTexts].dText.dmg.dmgText.text = "-" + damage;
targetName.critHit = false;
} else {
targetName["dmgText" + dmgTexts].dText.dmg.dmgText.text = "-" + damage;
}
targetName["dmgText" + dmgTexts].cacheAsBitmap = true;
if (targetName.type != "enemy_endBoss") {
targetName["dmgText" + dmgTexts]._y = -45;
targetName["dmgText" + dmgTexts]._alpha = 0;
targetName["dmgText" + dmgTexts].alphaTo(100, 0.2, "easeOutSine");
targetName["dmgText" + dmgTexts].ySlideTo(-60, 6);
targetName["dmgText" + dmgTexts].alphaTo(0, 0.5, "easeOutSine", 1);
} else {
targetName["dmgText" + dmgTexts]._x = targetName.head._x;
targetName["dmgText" + dmgTexts]._y = targetName.head._y - 45;
targetName["dmgText" + dmgTexts]._alpha = 0;
targetName["dmgText" + dmgTexts].alphaTo(100, 0.2, "easeOutSine");
targetName["dmgText" + dmgTexts].ySlideTo(targetName.head._y - 45, 6);
targetName["dmgText" + dmgTexts].alphaTo(0, 0.5, "easeOutSine", 1);
}
updateWallHealthBar(targetName);
}
}
function explodeTarget(targetName) {
bodyPartParticle(targetName._x, targetName._y);
playSound("sound_bloatExplode");
for (e in activeEnemy) {
if (targetName.name == activeEnemy[e].name) {
activeEnemy.splice(e, 1);
}
}
removeMovieClip(targetName);
}
function setupEnemyBuildings() {
towerCount++;
world.attachMovie("enemyBuilding_woodTower", "tempTurret", depth_world_enemyBuildings + towerCount);
world.tempTurret._x = 950;
world.tempTurret._y = 240;
world.tempTurret.damage = 50;
world.tempTurret.firingPoint = 90;
world.tempTurret.arrowPower = 5;
world.tempTurret.currentAngle = 45;
}
function enemyBuildingFire(building) {
buildingOrigin = new flash.geom.Point(building._x, building._y);
target = new flash.geom.Point(world.player._x, world.player._y - 30);
world.localToGlobal(buildingOrigin);
var _local3 = buildingOrigin.x - target.x;
var _local2 = buildingOrigin.y - target.y;
var _local4 = Math.atan2(_local2, _local3) * 57.2957795130823;
building.currentAngle = _local4 - 180;
building.arrowPower = random(20) + 15;
fire("standardArrow", building);
}
function resetRunesForNewGame() {
earthRunes = 0;
fireRunes = 0;
boneRunes = 0;
stormRunes = 0;
chaosRunes = 0;
destructionRunes = 0;
}
function searchRuneStone(stoneName) {
if (stoneName.searched == false) {
foundRunes = new Array();
stoneName.searched = true;
while (foundRunes.length < 4) {
for (x in runeTypes) {
var _local2 = random(100) + 1;
if (trinketEquipped == "rareRunes") {
hero.findStoneBonus = trinket_rareRunes.effect;
} else {
hero.findStoneBonus = 0;
}
if (_local2 <= (runeTypes[x].findChance - hero.findStoneBonus)) {
foundRunes.push(runeTypes[x]);
}
}
}
r = 0;
while (r <= 3) {
randomRune = random(foundRunes.length);
_root["foundRune" + r] = foundRunes[randomRune];
foundRunes.splice(randomRune, 1);
r++;
}
_root[foundRune1.runeName + "Held"]++;
_root[foundRune2.runeName + "Held"]++;
_root[foundRune3.runeName + "Held"]++;
hud.runeReport.slot1.gotoAndStop(foundRune1.name);
hud.runeReport.slot2.gotoAndStop(foundRune2.name);
hud.runeReport.slot3.gotoAndStop(foundRune3.name);
}
}
function runeSearchTimer() {
if (searchingRuneStone == true) {
searchTimer--;
var _local2 = Math.round((searchTimer / runeSearchTime) * 100);
hud.progressBar.bar._xscale = -(_local2 - 100);
if (searchTimer <= 0) {
showRuneReport();
_root.aimingControl = "unlocked";
_root.searchRuneStone(_root.hero.closestStone);
searchingRuneStone = false;
hero.closestStone.gotoAndPlay("exhausted");
playSound("sound_runeStoneExtract");
hideProgressBar();
hideRuneReport();
}
}
}
function setupRuneStones() {
for (x in _root[currentLevel].runeStones) {
runeStoneCount++;
world.attachMovie("runeStone", "runeStone" + runeStoneCount, depth_world_runeStones + runeStoneCount);
currentRuneStone = world["runeStone" + runeStoneCount];
currentRuneStone._x = _root[currentLevel].runeStones[x];
currentRuneStone._y = -50;
currentRuneStone.searched = false;
applyInstantGravity(currentRuneStone);
activeRuneStones.push(currentRuneStone);
}
}
function runeStoneCollision() {
hero.nearStone = false;
playerRunePoint = new flash.geom.Point(world.player._x, world.player._y);
world.localToGlobal(playerRunePoint);
for (v in activeRuneStones) {
if (activeRuneStones[v].collision.hitTest(playerRunePoint.x, playerRunePoint.y, true)) {
hero.nearStone = true;
hero.closestStone = activeRuneStones[v];
break;
}
}
if (hero.nearStone == false) {
hero.closestStone = null;
hero.nearStoneMessageShown = false;
}
if (((hero.nearStone == true) && (hero.nearStoneMessageShown == false)) && (hero.closestStone.searched == false)) {
showQuickMessage("Press SPACE to Extract Runes.", "bottom");
hero.nearStoneMessageShown = true;
}
}
function playRollOverSound() {
playSound("sound_interface_rollOver");
}
function playClickSound() {
playSound("sound_interface_click");
}
function loadMenu() {
debugTools();
survivalMode = false;
allFoundTrinkets = new Array();
music_inGameMusic.volumeTo(0, 3, "linear", 0, function () {
this.stop();
});
normaliseMouse();
initDialogBoxes();
checkForSaveGame();
loadGameInfo();
if (music_menuMusic == undefined) {
playMusicLoop("music_menu", 9999, "menuMusic");
}
music_menuMusic.volumeTo(100, 3);
_root.attachMovie("menu", "menu", depth_menu);
menu._alpha = 0;
_root.attachMovie("blackOut", "blackOut", depth_blackOut);
blackOut._alpha = 0;
blackOut.alphaTo(100, 0.8, "easeOutSine", 0, function () {
menu._alpha = 100;
destroyWorld();
removeMovieClip(inventory);
removeMovieClip(storyBook);
removeMovieClip(hud);
});
blackOut.alphaTo(0, 0.8, "easeOutSine", 1, function () {
blackOut._visible = false;
});
menu.mainMenu.versionNumber.text = _root.versionNumber;
menu.instructions._visible = false;
menu.mainMenu.logo._alpha = 0;
menu.mainMenu.pages._alpha = 0;
menu.mainMenu.menuItems._alpha = 0;
menu.mainMenu.logo.colorTo(16777215);
menu.mainMenu.logo.alphaTo(100, 1.2, "easeOutSine");
menu.mainMenu.pages.alphaTo(100, 1.2, "easeOutSine", 2);
menu.mainMenu.menuItems.alphaTo(100, 1.2, "easeOutSine", 2.5);
menu.mainMenu.logo.colorTo(null, 0.8, "easeOutSine");
}
function hideMenu() {
menu.alphaTo(0, 1, "easeOutSine", 1, function () {
removeMovieClip(this);
});
}
function loadCredits() {
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.credits._alpha = 0;
menu.credits._visible = true;
menu.credits.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function hideCredits() {
menu.credits.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
function loadInstructions() {
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.instructions._alpha = 0;
menu.instructions._visible = true;
menu.instructions.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function hideInstructions() {
menu.instructions.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
function loadOptions() {
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.options._alpha = 0;
menu.options._visible = true;
menu.options.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function optionsToMainMenu() {
menu.options.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
function loadSurvival() {
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.survival._alpha = 0;
menu.survival._visible = true;
menu.survival.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function survivalToMainMenu() {
menu.survival.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
function buttonSetup_survivalBack(btnName) {
_root.menu.survival[btnName].buttonText.text = "BACK";
_root.menu.survival[btnName].onRelease = function () {
playClickSound();
survivalToMainMenu();
};
}
function buttonSetup_survivalLaunch(btnName) {
_root.menu.survival[btnName].onRelease = function () {
survivalGameReset();
playClickSound();
resetLevelVariables();
survivalMode = true;
currentLevel = btnName;
showLoadScreen();
};
}
function buttonSetup_mainMenu(btnName) {
checkForSaveGame();
_root.menu.mainMenu.menuItems[btnName].activated = true;
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.autoSize = "center";
if ((saveGameExists == false) && (btnName == "continueCampaign")) {
_root.menu.mainMenu.menuItems[btnName].activated = false;
_root.menu.mainMenu.menuItems[btnName].textClip.alphaTo(50);
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "CONTINUE";
}
if (_root.menu.mainMenu.menuItems[btnName].activated == true) {
_root.menu.mainMenu.menuItems[btnName].onRollOver = function () {
playRollOverSound();
if (this.activated == true) {
this.textClip.colorTo(1973778, 0.4, "easeOutSine");
this.textClip.scaleTo(110, 0.5);
}
};
_root.menu.mainMenu.menuItems[btnName].onRollOut = function () {
if (this.activated == true) {
this.textClip.colorTo(null, 0.8, "easeOutSine");
this.textClip.scaleTo(100, 0.6);
}
};
switch (btnName) {
case "continueCampaign" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "CONTINUE STORY";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
showDialogBox(dialog_continueCampaign);
};
break;
case "newCampaign" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "NEW STORY";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
if (saveGameExists == true) {
showDialogBox(dialog_startNewCampaign);
} else {
newGameReset();
loadStoryBook();
}
};
break;
case "options" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "OPTIONS";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
loadOptions();
};
break;
case "survival" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "SURVIVAL";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
loadSurvival();
};
break;
case "credits" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "CREDITS";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
loadCredits();
};
break;
case "howToPlay" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "INSTRUCTIONS";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
loadInstructions();
};
break;
case "strategyGuide" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "STRATEGY GUIDE";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
getURL ("http://armorgames.com/guide/Sin-Mark-Strategy-Guide-and-Walkthrough", "_blank");
};
break;
case "playMoreGames" :
_root.menu.mainMenu.menuItems[btnName].textClip.btnText.text = "PLAY MORE GAMES";
_root.menu.mainMenu.menuItems[btnName].onRelease = function () {
playClickSound();
getURL ("http://armorGames.com", "_blank");
};
break;
}
}
}
function buttonSetup_options(btnName) {
_root.menu.options[btnName].textClip.btnText.autoSize = "center";
switch (btnName) {
case "low" :
_root.menu.options[btnName].textClip.btnText.text = "LOW";
if (_quality == "LOW") {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.medium.textClip.colorTo(null, 0);
_root.menu.options.high.textClip.colorTo(null, 0);
_quality = "LOW";
};
break;
case "medium" :
_root.menu.options[btnName].textClip.btnText.text = "MEDIUM";
if (_quality == "MEDIUM") {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.low.textClip.colorTo(null, 0);
_root.menu.options.high.textClip.colorTo(null, 0);
_quality = "MEDIUM";
};
break;
case "high" :
_root.menu.options[btnName].textClip.btnText.text = "HIGH";
if (_quality == "HIGH") {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.medium.textClip.colorTo(null, 0);
_root.menu.options.low.textClip.colorTo(null, 0);
_quality = "HIGH";
};
break;
case "effectsOn" :
_root.menu.options[btnName].textClip.btnText.text = "ON";
if (soundEffectsOn == true) {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.effectsOff.textClip.colorTo(null, 0);
soundEffectsOn = true;
};
break;
case "effectsOff" :
_root.menu.options[btnName].textClip.btnText.text = "OFF";
if (soundEffectsOn == false) {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.effectsOn.textClip.colorTo(null, 0);
soundEffectsOn = false;
};
break;
case "musicOn" :
_root.menu.options[btnName].textClip.btnText.text = "ON";
if (musicOn == true) {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.musicOff.textClip.colorTo(null, 0);
music_menuMusic.setVolume(100);
music_menuMusic.start();
musicOn = true;
};
break;
case "musicOff" :
_root.menu.options[btnName].textClip.btnText.text = "OFF";
if (musicOn == false) {
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
}
_root.menu.options[btnName].onRelease = function () {
playClickSound();
_root.menu.options[btnName].textClip.colorTo(15987699, 0);
_root.menu.options.musicOn.textClip.colorTo(null, 0);
musicOn = false;
music_menuMusic.stop();
};
break;
}
_root.menu.options[btnName].onRollOver = function () {
playRollOverSound();
this.textClip.scaleTo(110, 0.5);
};
_root.menu.options[btnName].onRollOut = (_root.menu.options[btnName].onDragOut = function () {
this.textClip.scaleTo(100, 0.6);
});
}
function buttonSetup_optionsBack(btnName) {
_root.menu.options[btnName].buttonText.text = "BACK";
_root.menu.options[btnName].onRelease = function () {
playClickSound();
saveGameSettings();
optionsToMainMenu();
};
}
function setupPortals() {
if (survivalMode == false) {
numPortals++;
world.attachMovie("portal", "portal" + numPortals, depth_world_portals + numPortals);
world["portal" + numPortals]._x = _root[currentLevel].portals[0];
currentPortal = world["portal" + numPortals];
currentPortal.health = portal.health;
applyInstantGravity(currentPortal);
activePortals.push(currentPortal);
currentSpawnPoint = _root[currentLevel].portals[0];
} else {
numPortals++;
world.attachMovie("portal", "portal" + numPortals, depth_world_portals + numPortals);
world["portal" + numPortals]._x = 800;
currentPortal = world["portal" + numPortals];
currentPortal.health = portal.health;
applyInstantGravity(currentPortal);
activePortals.push(currentPortal);
currentSpawnPoint = activePortals[0]._x;
}
}
function openPortal() {
portalIndex++;
numPortals++;
if (survivalMode == false) {
if (portalIndex < _root[currentLevel].portals.length) {
portalsDepleted = false;
world.attachMovie("portal", "portal" + numPortals, depth_world_portals + numPortals);
world["portal" + numPortals]._x = _root[currentLevel].portals[portalIndex];
currentPortal = world["portal" + numPortals];
currentPortal.health = portal.health;
if (_root[currentLevel].terrain == "hell_3_terrain") {
world["portal" + numPortals]._xscale = (world["portal" + numPortals]._yscale = 200);
}
applyInstantGravity(currentPortal);
activePortals.push(currentPortal);
currentSpawnPoint = _root[currentLevel].portals[portalIndex];
} else if (portalsDepleted == false) {
portalsDepleted = true;
for (y in activeRuneStones) {
activeRuneStones[y].gotoAndPlay("exhausted");
activeRuneStones[y].searched = true;
}
}
} else {
world.attachMovie("portal", "portal" + numPortals, depth_world_portals + numPortals);
world["portal" + numPortals]._x = random(world.bg._width);
if ((world["portal" + numPortals]._x < world.player._x) && (world["portal" + numPortals]._x >= (world.player._x - 250))) {
world["portal" + numPortals]._x = world.player._x - 250;
}
if ((world["portal" + numPortals]._x > world.player._x) && (world["portal" + numPortals]._x <= (world.player._x + 250))) {
world["portal" + numPortals]._x = world.player._x + 250;
}
if (world["portal" + numPortals]._x < 150) {
world["portal" + numPortals]._x = 150;
}
if (world["portal" + numPortals]._x > (world.bg._width - 150)) {
world["portal" + numPortals]._x = world.bg._width - 150;
}
currentPortal = world["portal" + numPortals];
currentPortal.health = portal.health;
applyInstantGravity(currentPortal);
activePortals.push(currentPortal);
currentSpawnPoint = world["portal" + numPortals]._x;
}
}
function updatePortalHealthBar(portalName) {
portalName.healthBar.alphaTo(100, 0.4);
portalName.healthBar.bar._xscale = Math.round((portalName.health / portal.maxHealth) * 100);
portalName.healthBar.alphaTo(0, 0.4, "linear", 3);
}
function showEffectOnEnemy(target, arrowType) {
numEnemyEffects++;
target.attachMovie("effect_" + arrowType, "enemyEffect" + numEnemyEffects, 1000 + numEnemyEffects);
if (arrowType == "freeze") {
target["enemyEffect" + numEnemyEffects]._xscale = (target["enemyEffect" + numEnemyEffects]._yscale = random(40) + 80);
target.frozen = true;
}
if (((arrowType == "fear") || (arrowType == "decayArmor")) || (arrowType == "soulCrush")) {
target["enemyEffect" + numEnemyEffects]._y = target.head._y - 20;
}
if (random(2) == 0) {
target["enemyEffect" + numEnemyEffects]._xscale = -100;
}
}
function attachSpark(targetArrow) {
particleCount++;
world.attachMovie("hitPortalSpark", "hitSpark" + particleCount, depth_world_particles + particleCount);
world["hitSpark" + particleCount]._rotation = random(360);
world["hitSpark" + particleCount]._xscale = (world["hitSpark" + particleCount]._yscale = random(60) + 70);
world["hitSpark" + particleCount]._x = targetArrow._x;
world["hitSpark" + particleCount]._y = targetArrow._y;
}
function attachThorns(splashName) {
x = 0;
while (x < 5) {
particleCount++;
world.attachMovie("thorn", "thorn" + particleCount, depth_world_particles + particleCount);
world["thorn" + particleCount]._x = splashName._x + (random(80) - 40);
applyInstantGravity(world["thorn" + particleCount]);
if (random(2) > 0) {
world["thorn" + particleCount]._xscale = -100;
}
x++;
}
}
function volcanicExplosion(splash) {
splash.arrowPower = random(10) + 12;
splash.currentAngle = -90 + (random(60) - 30);
splash.firingPoint = 20;
splash.name = "hero";
_root.fire("volcanoProjectile", splash);
}
function specialEffect(arrowType, parentArrow) {
switch (arrowType) {
case "arrowStorm" :
a = 0;
while (a < 6) {
parentArrow.arrowPower = Math.round(random(10) + 20);
parentArrow.currentAngle = parentArrow._rotation + (random(30) - 15);
parentArrow.firingPoint = 0;
parentArrow.name = "hero";
parentArrow.damage = arrowStormArrow.damage;
_root["arrowStormArrow" + a] = new Object();
_root["arrowStormArrow" + a] = parentArrow;
fire("arrowStormArrow", _root["arrowStormArrow" + a]);
a++;
}
removeMovieClip(parentArrow);
break;
case "boneStorm" :
v = 0;
while (v < 9) {
splashEffect++;
world.attachMovie("splash_boneStorm", "splash" + splashEffect, depth_world_splashEffects + splashEffect);
world["splash" + splashEffect].name = "splash" + splashEffect;
world["splash" + splashEffect].type = arrowType;
world["splash" + splashEffect].owner = "hero";
world["splash" + splashEffect].damage = _root[arrowType].splashDamage;
world["splash" + splashEffect]._x = parentArrow._x + (random(400) - 200);
if (world["splash" + splashEffect]._x < 75) {
world["splash" + splashEffect]._x = 75;
}
if (world["splash" + splashEffect]._x > (world.bg._width - 75)) {
world["splash" + splashEffect]._x = world.bg._width - 75;
}
world["splash" + splashEffect]._y = -(random(200) - 50);
world["splash" + splashEffect]._rotation = random(20) - 20;
world["splash" + splashEffect].gotoAndPlay(random(5) + (v * 10));
applyInstantGravity(world["splash" + splashEffect]);
activeSplash.push(world["splash" + splashEffect]);
v++;
}
break;
case "fireStorm" :
playSound("sound_boneStorm_impact");
v = 0;
while (v < 6) {
splashEffect++;
world.attachMovie("splash_fireStorm", "splash" + splashEffect, depth_world_splashEffects + splashEffect);
world["splash" + splashEffect].name = "splash" + splashEffect;
world["splash" + splashEffect].type = arrowType;
world["splash" + splashEffect].owner = "hero";
world["splash" + splashEffect].damage = _root[arrowType].splashDamage;
world["splash" + splashEffect]._x = parentArrow._x + (random(200) - 100);
if (world["splash" + splashEffect]._x < 75) {
world["splash" + splashEffect]._x = 75;
}
if (world["splash" + splashEffect]._x > (world.bg._width - 75)) {
world["splash" + splashEffect]._x = world.bg._width - 75;
}
world["splash" + splashEffect]._y = -(random(200) - 50);
world["splash" + splashEffect]._rotation = random(10) - 10;
world["splash" + splashEffect].gotoAndPlay(random(5) + (v * 10));
applyInstantGravity(world["splash" + splashEffect]);
activeSplash.push(world["splash" + splashEffect]);
v++;
}
break;
}
}
function createWall(wallName) {
wallCount++;
wallName.name = wallName.name;
wallName.armor = 0;
wallName.hitChance = 0;
wallName.health = _root[wallName.type].health;
wallName.maxHealth = _root[wallName.type].health;
wallName.alive = true;
activeWalls.push(wallName);
}
function updateWallHealthBar(wallName) {
wallName.healthBar.alphaTo(100, 0.4);
wallName.healthBar.bar._xscale = Math.round((wallName.health / wallName.maxHealth) * 100);
wallName.healthBar.alphaTo(0, 0.4, "linear", 3);
}
function setupTrinkets() {
for (x in allTrinkets) {
inventory[allTrinkets[x].name]._visible = false;
}
for (f in allFoundTrinkets) {
inventory[allFoundTrinkets[f].name]._visible = true;
}
}
function buttonSetup_trinkets(btnName) {
inventory[btnName].icons.gotoAndStop(btnName);
inventory[btnName].originX = inventory[btnName]._x;
inventory[btnName].originY = inventory[btnName]._y;
if (trinketEquipped == btnName) {
inventory[btnName]._x = 1327;
inventory[btnName]._y = 390;
}
inventory[btnName].onRollOver = function () {
_root.inventory.spellDesc.spellName.text = _root["trinket_" + btnName].trinketName;
_root.inventory.spellDesc.description.text = _root["trinket_" + btnName].description;
_root.inventory.spellDesc.effects.text = "";
_root.inventory.spellDesc.manaCost.text = "";
};
inventory[btnName].onRelease = function () {
_root.inventory[trinketEquipped].xSlideTo(inventory[trinketEquipped].originX, 0.2, "easeOutSine");
_root.inventory[trinketEquipped].ySlideTo(inventory[trinketEquipped].originY, 0.2, "easeOutSine");
if ((_root.trinketEquipped != btnName) || ((_root.trinketEquipped == btnName) && (_root.inventory[trinketEquipped]._y == inventory[trinketEquipped].originY))) {
playSound("sound_spellPickup");
_root.trinketEquipped = btnName;
this.xSlideTo(1327, 0.2, "easeOutSine");
this.ySlideTo(390, 0.2, "easeOutSine");
}
if ((_root.trinketEquipped == btnName) && (inventory[btnName]._y == 390)) {
trinketEquipped = "empty";
}
};
}
function dropTrinket(enemyName) {
_root.checkIfAllTrinketsFound();
var _local3 = random(1000);
if (trinketEquipped == "luckyCharm") {
_local3 = _local3 - trinket_luckyCharm.effect;
}
if ((_local3 <= trinketDropChance) && (allTrinketsFound == false)) {
playSound("sound_trinketDrop");
trinketDropped++;
world.attachMovie("trinket", "trinket" + trinketDropped, depth_world_trinkets + trinketDropped);
world["trinket" + trinketDropped]._x = enemyName._x;
world["trinket" + trinketDropped]._y = enemyName._y - 50;
world["trinket" + trinketDropped].onEnterFrame = function () {
applyGravity(this);
if (this.collision.hitTest(_root.world.player.collision)) {
_root.checkIfAllTrinketsFound();
_root.pickUpTrinket();
this.gotoAndPlay("pickedUp");
playSound("sound_trinketPickup");
delete this.onEnterFrame;
}
if (_root.allTrinketsFound == true) {
this.gotoAndPlay("pickedUp");
delete this.onEnterFrame;
}
};
}
}
function pickUpTrinket() {
var _local2 = false;
if (allTrinketsFound == false) {
while (_local2 == false) {
var _local1 = random(allTrinkets.length);
if (allTrinkets[_local1].found == false) {
allTrinkets[_local1].found = true;
foundTrinket = allTrinkets[_local1];
_local2 = true;
allFoundTrinkets.push(foundTrinket);
showQuickMessage("Found Trinket: " + foundTrinket.trinketName);
}
}
}
}
function checkIfAllTrinketsFound() {
allTrinketsFound = true;
for (t in allTrinkets) {
if (allTrinkets[t].found == false) {
allTrinketsFound = false;
}
}
}
function createMinion(minionType, targetX, targetY) {
minionCount++;
world.attachMovie("char_knight", "minion" + minionCount, depth_world_friendArmy + minionCount);
world["minion" + minionCount].name = "minion" + minionCount;
world["minion" + minionCount].type = _root[minionType].name;
world["minion" + minionCount].alive = true;
world["minion" + minionCount].health = _root[minionType].health;
world["minion" + minionCount].speed = _root[minionType].speed;
world["minion" + minionCount].range = _root[minionType].range;
world["minion" + minionCount].damage = _root[minionType].damage;
world["minion" + minionCount].armor = _root[minionType].armor;
world["minion" + minionCount].hitChance = _root[minionType].hitChance;
world["minion" + minionCount].critChance = _root[minionType].critChance;
world["minion" + minionCount].rising = false;
world["minion" + minionCount].moveAnim = true;
world["minion" + minionCount].attackAnim = false;
world["minion" + minionCount].attacking = false;
world["minion" + minionCount].armor_debuffed = false;
world["minion" + minionCount].hitChance_debuffed = false;
world["minion" + minionCount].speed_debuffed = false;
world["minion" + minionCount].hitWall = false;
world["minion" + minionCount].hittingWall = "none";
world["minion" + minionCount].lastClosestEnemyX = 999999999 /* 0x3B9AC9FF */;
world["minion" + minionCount].dir = "right";
world["minion" + minionCount].dirCounterMax = 80;
world["minion" + minionCount].dirCounter = dirCounterMax;
world["minion" + minionCount]._x = targetX;
world["minion" + minionCount]._y = targetY;
applyInstantGravity(world["minion" + minionCount]);
for (x in world["minion" + minionCount]) {
world["minion" + minionCount][x].gotoAndStop(minionType);
}
world["minion" + minionCount].gotoAndPlay("rise");
activeMinions.push(world["minion" + minionCount]);
}
function minionAI() {
for (v in activeMinions) {
if (activeMinions[v].name != "hero") {
if ((activeMinions[v]._x < 50) || (activeMinions[v]._x > world.bg._width)) {
activeMinions[v].removeMovieClip();
activeMinions.splice(v, 1);
}
if (activeMinions[v].alive == true) {
for (x in activeEnemy) {
var _local2 = activeMinions[v]._x - activeEnemy[x]._x;
var _local1 = activeMinions[v]._y - activeEnemy[x]._y;
activeMinions[v].prox = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if ((activeEnemy[x].name != "hero") && (activeMinions[v].prox <= activeMinions[v].range)) {
activeMinions[v].wander = false;
activeMinions[v].attacking = true;
activeMinions[v].enemyTarget = activeEnemy[x];
}
}
if ((activeMinions[v].attacking == true) && (activeMinions[v].attackAnim == false)) {
activeMinions[v].gotoAndPlay("attack" + (random(2) + 1));
}
if ((activeMinions[v].enemyTarget.name == undefined) || (activeMinions[v].enemyTarget.health <= 0)) {
activeMinions[v].wander = true;
activeMinions[v].enemyTarget = null;
activeMinions[v].attacking = false;
activeMinions[v].attackAnim = false;
activeMinions[v].hitWall = false;
activeMinions[v].hittingWall = undefined;
}
for (w in activeWalls) {
if (activeWalls[w].collision.hitTest(activeMinions[v].collision)) {
activeMinions[v].hitWall = true;
activeMinions[v].hittingWall = activeWalls[w];
activeMinions[v].enemyTarget = activeWalls[w];
activeMinions[v].attacking = true;
}
}
if (((activeMinions[v].attacking == true) && (activeMinions[v].attackAnim == false)) && (activeMinions[v].hitWall == true)) {
activeMinions[v].gotoAndPlay("attack1");
}
for (x in activeEnemy) {
if (activeEnemy[x]._x >= activeMinions[v]._x) {
activeMinions[v].closestEnemyX = activeMinions[v]._x - activeEnemy[x]._x;
}
if (activeEnemy[x]._x <= activeMinions[v]._x) {
activeMinions[v].closestEnemyX = activeEnemy[x]._x - activeMinions[v]._x;
}
if ((activeMinions[v].closestEnemyX < activeMinions[v].lastClosestEnemyX) && (activeEnemy[x].type != "enemy_deathWing")) {
activeMinions[v].lastClosestEnemyX = activeMinions[v].closestEnemyX;
activeMinions[v].closestEnemy = activeEnemy[x];
}
}
if (((activeMinions[v].attacking == false) && (activeMinions[v].rising == false)) && (activeMinions[v].closestEnemy._x <= activeMinions[v]._x)) {
activeMinions[v].wander = false;
activeMinions[v]._x = activeMinions[v]._x - activeMinions[v].speed;
activeMinions[v]._xscale = 100;
}
if (((activeMinions[v].attacking == false) && (activeMinions[v].rising == false)) && (activeMinions[v].closestEnemy._x >= activeMinions[v]._x)) {
activeMinions[v].wander = false;
activeMinions[v]._x = activeMinions[v]._x + activeMinions[v].speed;
activeMinions[v]._xscale = -100;
}
if ((activeMinions[v].closestEnemy.health <= 0) || (activeMinions[v].closestEnemy.health == undefined)) {
activeMinions[v].wander = true;
activeMinions[v].closestEnemy = null;
activeMinions[v].closestEnemyX = 9999999 /* 0x98967F */;
activeMinions[v].lastClosestEnemyX = 999999 /* 0x0F423F */;
}
if (activeMinions[v].wander == true) {
activeMinions[v].dirCounter--;
if (activeMinions[v].dirCounter <= 0) {
activeMinions[v].dirCounter = activeMinions[v].dirCounterMax;
if (random(2) == 0) {
activeMinions[v].dir = "left";
} else {
activeMinions[v].dir = "right";
}
}
if (activeMinions[v].dir == "left") {
activeMinions[v]._xscale = 100;
activeMinions[v]._x = activeMinions[v]._x - activeMinions[v].speed;
} else {
activeMinions[v]._xscale = -100;
activeMinions[v]._x = activeMinions[v]._x + activeMinions[v].speed;
}
}
applyGravity(activeMinions[v]);
}
}
}
}
function unlockSpell(spellUnlocked) {
inventory.combinerIcon._alpha = 0;
inventory.combinerIcon.gotoAndStop(spellUnlocked);
inventory.combinerIcon.selectRing._visible = false;
inventory.combinerIcon.alphaTo(100, 0.4);
inventory.combinerIcon.alphaTo(0, 0.8, "easeOutSine", 1, function () {
this.gotoAndStop("combine");
});
inventory.combinerIcon.alphaTo(100, 0.4, "linear", 2);
for (s in spellStonesArray) {
if (spellStonesArray[s].spell.name == spellUnlocked) {
spellStonesArray[s]._visible = true;
unlockedSpells.push(spellStonesArray[s].spell.name);
inventory.spellBook.page1[spellStonesArray[s].spell.name]._alpha = 100;
inventory.spellBook.page2[spellStonesArray[s].spell.name]._alpha = 100;
inventory.spellBook.page3[spellStonesArray[s].spell.name]._alpha = 100;
inventory.spellBook.page4[spellStonesArray[s].spell.name]._alpha = 100;
}
}
}
function createRuneSpell(spellName) {
spellAlreadyCreated = false;
for (g in unlockedSpells) {
if (spellName == unlockedSpells[g]) {
spellAlreadyCreated = true;
}
}
if (spellAlreadyCreated == false) {
unlockSpell(spellName);
emptyCombinerSlots();
playSound("sound_combineRunes");
} else {
playSound("sound_combineFail");
}
spellUnlocked = "";
}
function combineRunes() {
earthRuneCount = 0;
fireRuneCount = 0;
chaosRuneCount = 0;
boneRuneCount = 0;
stormRuneCount = 0;
destructionRuneCount = 0;
for (x in combinerSlots) {
_root[combinerSlots[x].runeType + "RuneCount"]++;
}
if ((((((fireRuneCount == 2) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "fireArrow";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 2)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "earthArrow";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 4)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "stormStrike";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 2)) && (boneRuneCount == 0)) && (chaosRuneCount == 1)) && (destructionRuneCount == 1)) {
spellUnlocked = "arrowStorm";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 2)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 2)) {
spellUnlocked = "thorns";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 2) && (earthRuneCount == 0)) && (stormRuneCount == 2)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "fireStorm";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 1) && (earthRuneCount == 0)) && (stormRuneCount == 1)) && (boneRuneCount == 1)) && (chaosRuneCount == 0)) && (destructionRuneCount == 1)) {
spellUnlocked = "boneStorm";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 2) && (earthRuneCount == 2)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "volcano";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 1)) && (destructionRuneCount == 2)) {
spellUnlocked = "bloat";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 3)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "rockWall";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 2)) && (stormRuneCount == 0)) && (boneRuneCount == 2)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "boneWall";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 2)) && (destructionRuneCount == 0)) {
spellUnlocked = "soulCrush";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 2)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 0)) {
spellUnlocked = "freeze";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 3)) && (destructionRuneCount == 0)) {
spellUnlocked = "fear";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 0)) && (chaosRuneCount == 0)) && (destructionRuneCount == 2)) {
spellUnlocked = "decayArmor";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 0)) && (stormRuneCount == 0)) && (boneRuneCount == 1)) && (chaosRuneCount == 2)) && (destructionRuneCount == 0)) {
spellUnlocked = "slowArrow";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 1)) && (stormRuneCount == 0)) && (boneRuneCount == 2)) && (chaosRuneCount == 1)) && (destructionRuneCount == 0)) {
spellUnlocked = "raiseDead";
createRuneSpell(spellUnlocked);
}
if ((((((fireRuneCount == 0) && (earthRuneCount == 1)) && (stormRuneCount == 0)) && (boneRuneCount == 1)) && (chaosRuneCount == 1)) && (destructionRuneCount == 1)) {
spellUnlocked = "warriorOfChaos";
createRuneSpell(spellUnlocked);
}
}
function playVoice(voiceType) {
switch (voiceType) {
case "deadlingScared" :
if (random(90) == 0) {
setTimeout(playSound, random(600) + 100, "sound_voice_deadlingScared" + (random(deadlingScaredVoices) + 1));
}
break;
case "demonDeath" :
playSound("sound_enemy_demonDeath" + (random(2) + 1));
break;
case "playerDeath" :
playSound("sound_playerDeath" + (random(3) + 1));
break;
case "deadlingDeath" :
playSound("sound_enemy_deadlingDeath" + (random(3) + 1));
break;
case "demonChatter" :
if (random(10) == 0) {
playSound("sound_enemy_demonChatter" + (random(3) + 1));
}
break;
case "deadlingChatter" :
if (random(10) == 0) {
playSound("sound_enemy_deadlingChatter" + (random(3) + 1));
}
break;
case "deadlingAttack" :
if (random(10) == 0) {
playSound("sound_enemy_deadlingAttack" + (random(2) + 1));
}
break;
case "bossFootStep" :
playSound("sound_endBossStep" + (random(3) + 1));
break;
case "dragonAttack" :
if (random(4) == 0) {
playSound("sound_dragonAttack" + (random(2) + 1));
}
break;
}
}
function startBattle() {
resetLevelVariables();
battleEnded = false;
currentArrowType = "standardArrow";
setupWorld();
setupInterface();
hideMenu();
hideInventory();
if (survivalMode == false) {
saveGame();
}
}
function loadBattle(battleName) {
endBattleLoss();
currentLevel = battleName;
battleNum = _root[currentLevel].battleNum;
showLoadScreen();
}
function checkForEndBattle() {
if (((activePortals.length <= 0) && (activeEnemy.length <= 0)) && (battleEnded == false)) {
battleEnded = true;
_root.alphaTo(100, 0, "linear", 2, function () {
_root.endBattle();
});
}
}
function endBattle() {
earthRunes = earthRunes + earthRunesHeld;
fireRunes = fireRunes + fireRunesHeld;
boneRunes = boneRunes + boneRunesHeld;
stormRunes = stormRunes + stormRunesHeld;
chaosRunes = chaosRunes + chaosRunesHeld;
destructionRunes = destructionRunes + destructionRunesHeld;
earthRunesHeld = 0;
fireRunesHeld = 0;
boneRunesHeld = 0;
stormRunesHeld = 0;
chaosRunesHeld = 0;
destructionRunesHeld = 0;
normaliseMouse();
music_inGameMusic.volumeTo(0, 2, "linear", 0, function () {
this.stop();
});
resetLevelVariables();
game.state = "paused";
destroyInterface();
destroyWorld();
var _local3 = currentLevel;
battleNum++;
if (_root[_local3].mapName == "hell_3") {
loadStoryBook("ending");
battleNum--;
}
currentLevel = "level" + battleNum;
if ((battleNum == 5) || (battleNum == 9)) {
loadStoryBook(_root[currentLevel].actNumber);
} else {
setupInventory();
}
closeDialogBox();
saveGame();
}
function endBattleLoss() {
normaliseMouse();
earthRunesHeld = 0;
fireRunesHeld = 0;
boneRunesHeld = 0;
stormRunesHeld = 0;
chaosRunesHeld = 0;
destructionRunesHeld = 0;
music_inGameMusic.volumeTo(0, 2, "linear", 0, function () {
this.stop();
});
resetLevelVariables();
normaliseMouse();
game.state = "paused";
destroyInterface();
destroyWorld();
setupInventory();
closeDialogBox();
}
function showLoadScreen() {
game.state = "paused";
_root.attachMovie("battleLoad", "loadBattleScreen", depth_loadBattle);
loadBattleScreen._alpha = 0;
loadBattleScreen.actNumber.text = _root[currentLevel].actNumber;
loadBattleScreen.chapterNumber.text = _root[currentLevel].chapterNumber;
loadBattleScreen.chapterName.text = _root[currentLevel].chapterName;
loadBattleScreen.chapterDesc.text = _root[currentLevel].chapterDesc;
loadBattleScreen.alphaTo(100, 2, "easeOutSine", 0, function () {
_root.startBattle();
removeMovieClip(storyBook);
this.bg.onPress = null;
});
_root.alphaTo(100, 0, "linear", 4.2, function () {
_root.game.state = "unpaused";
});
loadBattleScreen.alphaTo(0, 1.8, "easeOutSine", 6, function () {
_root.loadBattleScreen.removeMovieClip();
});
}
function buttonSetup_storyBook(btnName) {
storyBook[btnName].onRollOver = function () {
this.scaleTo(110, 0.4, "easeOutSine");
};
storyBook[btnName].onRollOut = function () {
this.scaleTo(100, 0.4, "easeOutSine");
};
switch (btnName) {
case "skip" :
storyBook[btnName].onRelease = function () {
if (_root.battleNum == 1) {
showLoadScreen();
} else {
closeStory();
}
};
break;
case "next" :
storyBook[btnName].onRelease = function () {
_root.storyBook.nextFrame();
_root.storyBook.img._alpha = 0;
_root.storyBook.img.alphaTo(100, 1.5, "easeOutSine");
_root.storyBook.txt._alpha = 0;
_root.storyBook.txt.alphaTo(100, 1.1, "easeOutSine");
playSound("sound_pageTurn");
};
break;
case "close" :
storyBook[btnName].onRelease = function () {
if (_root.battleNum == 1) {
showLoadScreen();
} else {
closeStory();
}
};
}
}
function loadStoryBook(actNum) {
survivalMode = false;
if (soundMuted == false) {
music_menuMusic.volumeTo(70, 3);
}
_root.attachMovie("storyBook", "storyBook", depth_storyBook);
storyBook._alpha = 0;
_root.attachMovie("blackOut", "blackOut", depth_blackOut);
blackOut._alpha = 0;
blackOut.alphaTo(100, 0.8, "easeOutSine", 0, function () {
storyBook._alpha = 100;
});
blackOut.alphaTo(0, 0.8, "easeOutSine", 1, function () {
blackOut._visible = false;
});
storyBook.gotoAndStop(actNum);
}
function closeStory() {
setupInventory();
}
function sandStorm() {
_root.createEmptyMovieClip("weather", depth_particleEffects);
ssp = 0;
while (ssp < 40) {
weather.attachMovie("particle_sandStorm", "ssp" + ssp, depth_particleEffects + ssp);
weather["ssp" + ssp]._x = random(800);
weather["ssp" + ssp]._y = random(400);
weather["ssp" + ssp]._xscale = (weather["ssp" + ssp]._yscale = random(50) + 50);
weather["ssp" + ssp]._rotation = random(360);
weather["ssp" + ssp].gotoAndStop(random(3) + 1);
weather["ssp" + ssp].onEnterFrame = function () {
this._x = this._x - 9;
this._y = this._y + (random(4) - 2);
if (this._x < 0) {
this.gotoAndStop(random(3) + 1);
this._xscale = (this._yscale = random(50) + 50);
this._x = 800 + random(800);
this._y = random(400);
this._rotation = random(360);
}
};
ssp++;
}
}
function lavaPit() {
world.createEmptyMovieClip("weather", depth_world_particleEffects);
ssp = 0;
while (ssp < 250) {
world.weather.attachMovie("particle_lava", "ssp" + ssp, depth_particleEffects + ssp);
world.weather["ssp" + ssp]._x = random(800);
world.weather["ssp" + ssp]._y = random(150) + 360;
world.weather["ssp" + ssp]._xscale = (world.weather["ssp" + ssp]._yscale = random(50) + 50);
world.weather["ssp" + ssp]._rotation = random(360);
world.weather["ssp" + ssp].gotoAndStop(random(3) + 1);
world.weather["ssp" + ssp].riseSpeed = random(3) + 0.5;
world.weather["ssp" + ssp].fadeSpeed = random(4) + 1;
world.weather["ssp" + ssp].onEnterFrame = function () {
this._x = this._x - (random(3) - 1);
this._y = this._y - this.riseSpeed;
this._alpha = this._alpha - this.fadeSpeed;
if (this._alpha <= 0) {
this.riseSpeed = random(3) + 0.5;
this._alpha = 100;
this.gotoAndStop(random(3) + 1);
this._xscale = (this._yscale = random(50) + 50);
this._x = random(_root.world.bg._width);
this._y = random(150) + 360;
this._rotation = random(360);
}
};
ssp++;
}
}
function updateSurvivalInterface() {
hud.survivalMode.killCount.text = survivalModeKills;
hud.survivalMode.portalsDestroyed.text = survivalPortalsDestroyed;
if (survivalModeKills == 25) {
currentEnemySet = "enemyTypesSet2";
}
if (survivalModeKills == 50) {
currentEnemySet = "enemyTypesSet3";
survivalEnemyCountBonus++;
}
if (survivalModeKills == 100) {
currentEnemySet = "enemyTypesSet4";
survivalEnemyCountBonus++;
}
if (survivalModeKills == 150) {
currentEnemySet = "enemyTypesSet5";
survivalEnemyCountBonus++;
}
}
function survivalSpellDrop() {
spellDropTimer--;
if (spellDropTimer < 0) {
spellDropTimer = spellDropTimerMax;
var _local3 = droppedSpell.name;
var droppedSpell = survivalSpells[random(survivalSpells.length)];
var _local4 = false;
if (droppedSpell.name == _local3) {
_local4 = true;
}
while (_local4 == true) {
droppedSpell = survivalSpells[random(survivalSpells.length)];
if (droppedSpell.name != _local3) {
_local4 = false;
_local3 = droppedSpell.name;
}
}
world.attachMovie("spellDrop", "droppedSpell", depth_world_spellDrop);
if (random(2) == 0) {
world.droppedSpell._x = world.player._x + (random(100) + 100);
} else {
world.droppedSpell._x = world.player._x - (random(100) + 100);
}
if (world.droppedSpell._x < 150) {
world.droppedSpell._x = 150;
}
if (world.droppedSpell._x > (world.bg._width - 150)) {
world.droppedSpell._x = world.bg._width - 150;
}
applyInstantGravity(world.droppedSpell);
if ((droppedSpell.name == "healthPotion") || (droppedSpell.name == "manaPotion")) {
world.droppedSpell.stone._visible = false;
}
world.droppedSpell.spell = droppedSpell;
world.droppedSpell.spellIcon.gotoAndStop(droppedSpell.name);
world.droppedSpell.alive = true;
world.droppedSpell.life = 250;
world.droppedSpell.onEnterFrame = function () {
this.life--;
if ((this.life <= 0) && (this.alive == true)) {
this.alive = false;
this.gotoAndPlay("dead");
}
if (_root.world.player.collision.hitTest(this.collision) && (this.alive == true)) {
this.alive = false;
_root.playSound("sound_spellPickup");
if ((this.spell.name != "healthPotion") && (this.spell.name != "manaPotion")) {
_root.quickSlot2.arrowType = this.spell.name;
_root.hud.survivalMode.slotIcon2.gotoAndStop(this.spell.name);
_root.hotKeys(1);
} else {
if (this.spell.name == "healthPotion") {
world.player.health = world.player.health + this.spell.effects;
}
if (this.spell.name == "manaPotion") {
hero.currentMana = hero.currentMana + this.spell.effects;
}
}
_root.showQuickMessage("Picked up spell: " + this.spell.spellName);
this.gotoAndPlay("dead");
this.onEnterFrame = null;
}
};
}
}
function helpMessagesInGame() {
if ((seenInGameHelp == false) || (seenInGameHelp == undefined)) {
setTimeout(showQuickMessage, 8000, "Hold and Release MOUSE BUTTON to fire bow.");
setTimeout(showQuickMessage, 15000, "Use A and D keys to move.");
setTimeout(showQuickMessage, 21000, "Destroy all Dark Gates and Enemies.");
seenInGameHelp = true;
}
}
function helpMessageInventory() {
if ((helpCombinerSeen == false) || (helpCombinerSeen == undefined)) {
showDialogBox(dialog_helpCombiner);
}
}
function helpMessageBow() {
if ((helpBowSeen == false) || (helpBowSeen == undefined)) {
showDialogBox(dialog_helpBow);
}
}
function slowEnterFrame() {
slowEFcount--;
if (slowEFcount <= 0) {
slowEFcount = slowEFcountMax;
checkForEndBattle();
if ((world.player.alive == false) && (game.state == "unpaused")) {
game.state = "paused";
normaliseMouse();
for (x in activeEnemy) {
activeEnemy[x].stop();
}
if (survivalMode == false) {
setTimeout(showDialogBox, 2000, dialog_gameOver);
} else {
setTimeout(showDialogBox, 2000, dialog_gameOver_survival);
}
}
}
}
function mediumEnterFrame() {
mediumEFcount--;
if (mediumEFcount <= 0) {
runeStoneCollision();
manaRegen();
updateInterface();
enemyTicker();
mediumEFcount = mediumEFcountMax;
}
}
function stopAllSoldiers() {
for (b in britishSquadsOnScreen) {
for (s in britishSquadsOnScreen[b].members) {
britishSquadsOnScreen[b].members[s].stop();
}
}
for (g in germanSquadsOnScreen) {
for (s in germanSquadsOnScreen[b].members) {
germanSquadsOnScreen[b].members[s].stop();
}
}
}
function startAllSoldiers() {
for (b in britishSquadsOnScreen) {
for (s in britishSquadsOnScreen[b].members) {
if (britishSquadsOnScreen[b].members[s].animating == true) {
britishSquadsOnScreen[b].members[s].play();
}
}
}
for (g in germanSquadsOnScreen) {
for (s in germanSquadsOnScreen[b].members) {
if (germanSquadsOnScreen[b].members[s].animating == true) {
germanSquadsOnScreen[b].members[s].play();
}
}
}
}
stop();
_quality = "medium";
var debugMode = false;
var intoMenu = true;
var slowEFcount = 0;
var slowEFcountMax = 40;
var mediumEFcount = 0;
var mediumEFcountMax = 4;
var depth_menu = 550;
var depth_world = 100;
var depth_world_enemyBuildings = 5;
var depth_world_runeStones = 100;
var depth_world_portals = 185000;
var depth_world_terrain = 200000;
var depth_world_player = 300100;
var depth_world_enemy = 405000;
var depth_world_depthSorted = 800000;
var depth_world_friendArmy = 650000;
var depth_world_projectiles = 700000;
var depth_world_trinkets = 790000;
var depth_world_arrows = 800000;
var depth_world_splashEffects = 900000;
var depth_world_particles = 1500000;
var depth_world_fg = 1900000;
var depth_world_roofCollision = 1900050;
var depth_world_spellDrop = 1950000;
var depth_world_particleEffects = 1975000;
var depth_particleEffects = 1000;
var depth_HUD = 2000;
var depth_HUD_console = 510000;
var depth_HUD_dmgText = 520000;
var depth_HUD_mouse = 900000;
var depth_inventory = 4000;
var depth_inventory_spellStones = 800;
var depth_dialog = 5000;
var depth_storyBook = 9000;
var depth_blackOut = 10000;
var depth_loadBattle = 150000;
var depth_music = 900000;
var depth_DEBUG_fps = 900550;
var depth_DEBUG_console = 900555;
var updateFPScountMax = 20;
var updateFPScount = updateFPScountMax;
var emptyCombinerSlot = false;
var earthRuneCount = 0;
var fireRuneCount = 0;
var stormRuneCount = 0;
var chaosRuneCount = 0;
var boneRuneCount = 0;
var destructionRuneCount = 0;
var equippingBow = false;
var alreadyEquippedBow = false;
var spellUnlocked = "";
var currentDropSlot = -1;
var stoneDroppedInSlot = false;
var stackedUpSpells = false;
var bowSlotsEmpty = false;
var bowSlots = new Array();
var savedBowSlots = new Array();
var spellStonesArray = new Array();
var unlockedSpells = new Array();
var army = new Object();
army.state = "march";
army.controlState = "march";
army.fighting = false;
army.noTargets = true;
var heroSoldiers = new Array();
var numHeroSoldiers = 0;
var friendlySoldierPositions = new Array(200, 215, 210, 205, 200, 265, 260, 255, 250, 305, 300, 295, 290);
var saveGameExists = false;
saveGameData = SharedObject.getLocal("SinMark");
checkForSaveGame();
dialog_gameOver = new Object();
dialog_gameOver.heading = "AKAHN HAS DIED.";
dialog_gameOver.body = "Akahn has fallen in battle. What would you like to do?";
dialog_gameOver.button1Active = true;
dialog_gameOver.button2Active = true;
dialog_gameOver.button1Desc = "RETRY";
dialog_gameOver.button2Desc = "QUIT";
dialog_gameOver.button1Action = function () {
playClickSound();
endBattleLoss();
closeDialogBox();
};
dialog_gameOver.button2Action = function () {
playClickSound();
loadMenu();
closeDialogBox();
};
dialog_quitToMenu = new Object();
dialog_quitToMenu.heading = "QUIT TO MAIN MENU?";
dialog_quitToMenu.body = "Do you want to return to the main menu?\r\rAll unsaved progress will be lost.";
dialog_quitToMenu.button1Active = true;
dialog_quitToMenu.button2Active = true;
dialog_quitToMenu.button1Desc = "ACCEPT";
dialog_quitToMenu.button2Desc = "CANCEL";
dialog_quitToMenu.button1Action = function () {
playClickSound();
loadMenu();
closeDialogBox();
};
dialog_quitToMenu.button2Action = function () {
playClickSound();
closeDialogBox();
};
dialog_gameOver_survival = new Object();
dialog_gameOver_survival.heading = "SURVIVAL - AKAHN HAS DIED.";
dialog_gameOver_survival.body = (("Akahn has fallen in battle. But not without \rtaking these enemies with him.\r\rEnemies Killed: " + _root.survivalModeKills) + "\rGates Destroyed: ") + _root.survivalPortalsDestroyed;
dialog_gameOver_survival.button1Active = true;
dialog_gameOver_survival.button1Desc = "QUIT";
dialog_gameOver_survival.button1Action = function () {
playClickSound();
loadMenu();
closeDialogBox();
};
dialog_helpCombiner = new Object();
dialog_helpCombiner.heading = "INVENTORY.";
dialog_helpCombiner.body = "Here you can create SPELLS by combining the RUNES you've found.\r\rFollow the recipe and CLICK the RUNE ICONS to\radd them to the combiner. Once the runes are in place, press\rthe CENTER button to combine them.";
dialog_helpCombiner.button1Active = true;
dialog_helpCombiner.button1Desc = "CLOSE";
dialog_helpCombiner.button1Action = function () {
playClickSound();
helpCombinerSeen = true;
closeDialogBox();
};
dialog_helpBow = new Object();
dialog_helpBow.heading = "BOW SETUP.";
dialog_helpBow.body = "To use created spells, DRAG them onto the slots on your bow.\r\rIf you have found any TRINKETS you can equip\rone by CLICKING on it to attach it to your bow.";
dialog_helpBow.button1Active = true;
dialog_helpBow.button1Desc = "CLOSE";
dialog_helpBow.button1Action = function () {
playClickSound();
helpBowSeen = true;
closeDialogBox();
};
dialog_pause = new Object();
dialog_pause.heading = "GAME PAUSED.";
dialog_pause.body = "Press RESUME to continue.\r\rQUIT to return to the title screen.\rAll unsaved progress will be lost.";
dialog_pause.button1Active = true;
dialog_pause.button2Active = true;
dialog_pause.button1Desc = "QUIT";
dialog_pause.button2Desc = "RESUME";
dialog_pause.button1Action = function () {
playClickSound();
loadMenu();
closeDialogBox();
};
dialog_pause.button2Action = function () {
playClickSound();
setupMouse();
game.state = "unpaused";
closeDialogBox();
};
initDialogBoxes();
var quickMessageTime = 0;
var showingQuickMessage = false;
var soundEffects = 0;
var soundEffectsOn = true;
var musicOn = true;
var musicTracks = 0;
var soundMuted = false;
var particleCount = 0;
var bounceParticleCount = depth_bounceParticles;
var randomLimb = 0;
var fullFunctionName = "";
var startParam = 0;
var endParam = 0;
var functionName = "";
var param = "";
var roofCollisions = new Array();
var currentArrowType = "standardArrow";
var arrowCount = 0;
var arrowPower = 0;
var arrowPowerMax = 40;
var arrowPowerMin = 5;
var arrowPowerGain = 1.5;
var arrowOrigin = new Object();
var currentAngle = 0;
var drag = 0.97;
var gravity = 3;
var arrowRotationRate = 0.8;
var arrowParticles = 0;
var activeArrows = new Array();
var aimingControl = "unlocked";
var endBossFirePoint = new Object();
standardArrow = new Object();
standardArrow.name = "standardArrow";
standardArrow.spellName = "Standard Arrow";
standardArrow.arrowGraph = "standard";
standardArrow.dropParticles = false;
standardArrow.doSplashDamage = false;
standardArrow.particleType = "fireSpark";
standardArrow.damage = 75;
standardArrow.doSplashDamage = false;
standardArrow.timed = false;
standardArrow.manaCost = 0;
endBossFireBall = new Object();
endBossFireBall.name = "endBossFireBall";
endBossFireBall.arrowGraph = "endBossFireBall";
endBossFireBall.dropParticles = true;
endBossFireBall.damage = 40;
endBossFireBall.doSplashDamage = false;
endBossFireBall.timed = false;
endBossFireBall.fireSound = true;
endBossFireBall.manaCost = 0;
endBossHammer = new Object();
endBossHammer.name = "endBossHammer";
endBossHammer.arrowGraph = "endBossHammer";
endBossHammer.dropParticles = true;
endBossHammer.damage = 200;
endBossHammer.splashDamage = 200;
endBossHammer.doSplashDamage = true;
endBossHammer.timed = false;
endBossHammer.fireSound = true;
endBossHammer.manaCost = 0;
rockFall = new Object();
rockFall.name = "rockFall";
rockFall.arrowGraph = "fallingRock";
rockFall.dropParticles = false;
rockFall.damage = 500;
rockFall.splashDamage = 0;
rockFall.doSplashDamage = true;
rockFall.timed = false;
rockFall.fireSound = true;
rockFall.manaCost = 0;
deadlingBolt = new Object();
deadlingBolt.name = "deadlingBolt";
deadlingBolt.arrowGraph = "deadlingBolt";
deadlingBolt.dropParticles = false;
deadlingBolt.particleType = "fireSpark";
deadlingBolt.damage = 50;
deadlingBolt.doSplashDamage = false;
deadlingBolt.timed = false;
deadlingBolt.fireSound = true;
deadlingBolt.manaCost = 0;
deathWingVomit = new Object();
deathWingVomit.name = "fireArrow";
deathWingVomit.arrowGraph = "deathWingVomit";
deathWingVomit.dropParticles = true;
deathWingVomit.particleType = "vomit";
deathWingVomit.damage = 50;
deathWingVomit.splashDamage = 20;
deathWingVomit.doSplashDamage = true;
deathWingVomit.splashGrounded = false;
deathWingVomit.timed = false;
deathWingVomit.fireSound = true;
deathWingVomit.manaCost = 75;
fireArrow = new Object();
fireArrow.name = "fireArrow";
fireArrow.spellName = "Fire Arrow";
fireArrow.description = "Charged with the power of fire rune this arrow will burst flames upon your enemy and those around it.";
fireArrow.dropParticles = true;
fireArrow.particleType = "fireSpark";
fireArrow.damage = 50;
fireArrow.splashDamage = 80;
fireArrow.doSplashDamage = true;
fireArrow.splashGrounded = false;
fireArrow.effects = ("Fire splash damage that does " + fireArrow.splashDamage) + " damage to those nearby.";
fireArrow.timed = false;
fireArrow.fireSound = true;
fireArrow.manaCost = 75;
earthArrow = new Object();
earthArrow.name = "earthArrow";
earthArrow.spellName = "Earth Arrow";
earthArrow.dropParticles = false;
earthArrow.description = "The tip of this arrow will become hardened with stone and shatter on impact with your enemy dealing damage to them and those close by.";
earthArrow.damage = 50;
earthArrow.splashDamage = 60;
earthArrow.doSplashDamage = true;
earthArrow.splashGrounded = false;
earthArrow.timed = false;
earthArrow.effects = ("Earth splash damage that does " + earthArrow.splashDamage) + " damage to those nearby.";
earthArrow.manaCost = 55;
stormStrike = new Object();
stormStrike.name = "stormStrike";
stormStrike.dropParticles = false;
stormStrike.spellName = "Storm Strike";
stormStrike.description = "Calling lightning from the sky this spell marks an area that will act as a beacon to strike all within it's range.";
stormStrike.damage = 0;
stormStrike.splashDamage = 150;
stormStrike.doSplashDamage = true;
stormStrike.splashGrounded = true;
stormStrike.timed = false;
stormStrike.effects = ("Lightning strikes hit all in the area of effect for " + stormStrike.splashDamage) + " damage.";
stormStrike.showEffectOnEnemy = true;
stormStrike.manaCost = 250;
arrowStorm = new Object();
arrowStorm.name = "arrowStorm";
arrowStorm.dropParticles = true;
arrowStorm.arrowGraph = "arrowStormArrow";
arrowStorm.spellName = "Arrow Storm";
arrowStorm.description = "A storm infused ice arrow that splits into many arrows shortly after it is launched.";
arrowStorm.damage = 50;
arrowStorm.splashDamage = 0;
arrowStorm.doSplashDamage = false;
arrowStorm.splashGrounded = false;
arrowStorm.timed = true;
arrowStorm.timer = 5;
arrowStorm.effects = ("Multiple arrows that do " + arrowStorm.damage) + " damage.";
arrowStorm.showEffectOnEnemy = false;
arrowStorm.manaCost = 300;
arrowStormArrow = new Object();
arrowStormArrow.name = "arrowStormArrow";
arrowStormArrow.arrowGraph = "arrowStormArrow";
arrowStormArrow.dropParticles = true;
arrowStormArrow.particleType = "fireSpark";
arrowStormArrow.damage = 120;
arrowStormArrow.doSplashDamage = false;
arrowStormArrow.timed = false;
arrowStormArrow.fireSound = true;
arrowStormArrow.manaCost = 0;
thorns = new Object();
thorns.name = "thorns";
thorns.dropParticles = false;
thorns.spellName = "Thorns";
thorns.description = "Thrusting from the earth, nature's thorns devastate all who try to cross their path.";
thorns.damage = 100;
thorns.splashDamage = 60;
thorns.doSplashDamage = true;
thorns.splashGrounded = true;
thorns.timed = false;
thorns.effects = ("Ground spikes do " + thorns.splashDamage) + " damage periodically over a few seconds.";
thorns.manaCost = 200;
boneStorm = new Object();
boneStorm.name = "boneStorm";
boneStorm.dropParticles = false;
boneStorm.spellName = "Bone Storm";
boneStorm.description = "Deadly shards of bone fall from the sky like hell fire.";
boneStorm.damage = 100;
boneStorm.splashDamage = 110;
boneStorm.doSplashDamage = false;
boneStorm.splashGrounded = false;
boneStorm.timed = false;
boneStorm.hasSpecialEffect = true;
boneStorm.noCollideEnemy = true;
boneStorm.effects = ("Bone spikes do " + boneStorm.splashDamage) + " damage to those they strike.";
boneStorm.manaCost = 650;
fireStorm = new Object();
fireStorm.name = "fireStorm";
fireStorm.dropParticles = true;
fireStorm.spellName = "Fire Storm";
fireStorm.description = "Fire from the heavens like you have never seen. This barrage of fire from the gods shall cleanse the earth where it is directed.";
fireStorm.damage = 50;
fireStorm.splashDamage = 100;
fireStorm.doSplashDamage = false;
fireStorm.splashGrounded = false;
fireStorm.hasSpecialEffect = true;
fireStorm.timed = false;
fireStorm.timer = 20;
fireStorm.multiArrow = true;
fireStorm.fireSound = true;
fireStorm.effects = ("Balls of fire that do " + fireStorm.splashDamage) + " damage each to those in the area.";
fireStorm.noCollideEnemy = true;
fireStorm.manaCost = 550;
volcano = new Object();
volcano.name = "volcano";
volcano.dropParticles = true;
volcano.spellName = "Volcano";
volcano.description = "Tapping into the burning heart of the earth this spell brings forth the power that lies below. Be aware that extracting such power may take time.";
volcano.damage = 100;
volcano.splashDamage = 150;
volcano.doSplashDamage = true;
volcano.splashGrounded = true;
volcano.noCollideEnemy = true;
volcano.effects = ("Balls of fire that do " + volcanoProjectile.damage) + " damage to those it hits.";
volcano.fireSound = true;
volcano.manaCost = 450;
volcanoProjectile = new Object();
volcanoProjectile.name = "volcanoProjectile";
volcanoProjectile.arrowGraph = "volcanoProjectile";
volcanoProjectile.dropParticles = true;
volcanoProjectile.particleType = "fireSpark";
volcanoProjectile.damage = 100;
volcanoProjectile.splashDamage = 0;
volcanoProjectile.doSplashDamage = true;
volcanoProjectile.splashGrounded = false;
volcanoProjectile.fireSound = false;
volcanoProjectile.manaCost = 0;
bloat = new Object();
bloat.name = "bloat";
bloat.spellName = "Bloat";
bloat.description = "This arrow destroys the innards of it's target, dissolving them into a toxic gas which eventually causes them to explode.";
bloat.dropParticles = false;
bloat.particleType = "";
bloat.damage = 0;
bloat.splashDamage = 0;
bloat.doSplashDamage = false;
bloat.splashGrounded = false;
bloat.timed = false;
bloat.timer = 100;
bloat.attackStats = false;
bloat.statToAttack = "hitChance";
bloat.statDamage = 0.5;
bloat.effects = "Once affected by bloat, a target is destroyed within a few seconds.";
bloat.showEffectOnEnemy = true;
bloat.manaCost = 250;
rockWall = new Object();
rockWall.name = "rockWall";
rockWall.spellName = "Rock Wall";
rockWall.description = "Summons a great spire of rock to defend you. Your enemies will find it hard to reach you when the earth thrusts this barrier skyward in your favour.";
rockWall.dropParticles = false;
rockWall.particleType = "";
rockWall.damage = 0;
rockWall.splashDamage = 0;
rockWall.doSplashDamage = true;
rockWall.splashGrounded = true;
rockWall.timed = false;
rockWall.health = 550;
rockWall.effects = "A wall of rock that blocks all, friend and foe.";
rockWall.noCollideEnemy = true;
rockWall.manaCost = 150;
boneWall = new Object();
boneWall.name = "boneWall";
boneWall.spellName = "Bone Wall";
boneWall.description = "Gathering the bones of the dead from the battlefield, this spell brings forth a wall of sturdy bone between you and your enemy.";
boneWall.dropParticles = false;
boneWall.particleType = "";
boneWall.damage = 0;
boneWall.splashDamage = 0;
boneWall.doSplashDamage = true;
boneWall.splashGrounded = true;
boneWall.timed = false;
boneWall.health = 800;
boneWall.effects = "A wall of bone that blocks all, friend and foe.";
boneWall.noCollideEnemy = true;
boneWall.manaCost = 220;
soulCrush = new Object();
soulCrush.name = "soulCrush";
soulCrush.spellName = "Mind Blast";
soulCrush.description = "The confusion of chaotic magic from this spell pierces the minds of your enemy taking away their clarity of mind making them unable to fight effectively.";
soulCrush.dropParticles = false;
soulCrush.particleType = "";
soulCrush.damage = 0;
soulCrush.splashDamage = 0;
soulCrush.doSplashDamage = true;
soulCrush.splashGrounded = true;
soulCrush.timed = false;
soulCrush.attackStats = true;
soulCrush.statToAttack = "hitChance";
soulCrush.statDamage = 0.5;
soulCrush.effects = "Reduces an enemies chance to hit in melee by 50%.";
soulCrush.showEffectOnEnemy = true;
soulCrush.manaCost = 120;
freeze = new Object();
freeze.name = "freeze";
freeze.spellName = "Freeze";
freeze.description = "Storm runes summon the cold of the far reaches of the earth below the feet of your enemy, encasing them in ice.";
freeze.dropParticles = false;
freeze.particleType = "";
freeze.damage = 0;
freeze.splashDamage = 0;
freeze.doSplashDamage = true;
freeze.splashGrounded = true;
freeze.timed = false;
freeze.effects = "Freezes all enemies in the area of effect for a few seconds.";
freeze.showEffectOnEnemy = true;
freeze.manaCost = 150;
fear = new Object();
fear.name = "fear";
fear.spellName = "Fear";
fear.description = "Overwhelmed by the power of chaotic magic, your enemy will flee in fear for a short time.";
fear.dropParticles = false;
fear.particleType = "";
fear.damage = 0;
fear.splashDamage = 0;
fear.doSplashDamage = true;
fear.splashGrounded = true;
fear.timed = false;
fear.effects = "Causes all enemies in area of effect to run away for a few seconds.";
fear.showEffectOnEnemy = true;
fear.manaCost = 75;
decayArmor = new Object();
decayArmor.name = "decayArmor";
decayArmor.spellName = "Decay Armor";
decayArmor.description = "Destructive powers ruin the elements that make up the protective armors of your enemy making them much easier to damage.";
decayArmor.dropParticles = false;
decayArmor.particleType = "";
decayArmor.damage = 0;
decayArmor.splashDamage = 0;
decayArmor.doSplashDamage = true;
decayArmor.splashGrounded = true;
decayArmor.timed = false;
decayArmor.attackStats = true;
decayArmor.statToAttack = "armor";
decayArmor.statDamage = 0.5;
decayArmor.effects = "Reduces enemy armor by 50%, increasing any melee or direct hit arrow damage.";
decayArmor.showEffectOnEnemy = true;
decayArmor.manaCost = 75;
slowArrow = new Object();
slowArrow.name = "slowArrow";
slowArrow.spellName = "Slow";
slowArrow.description = "Confuses the mind of your targets crippling their ability to move quickly.";
slowArrow.dropParticles = true;
slowArrow.particleType = "greenSpark";
slowArrow.damage = 0;
slowArrow.splashDamage = 0;
slowArrow.doSplashDamage = true;
slowArrow.splashGrounded = true;
slowArrow.timed = false;
slowArrow.attackStats = true;
slowArrow.statToAttack = "speed";
slowArrow.statDamage = 0.6;
slowArrow.effects = "Reduces enemy movement speed by 40%.";
slowArrow.showEffectOnEnemy = true;
slowArrow.manaCost = 100;
raiseDead = new Object();
raiseDead.name = "raiseDead";
raiseDead.spellName = "Raise Dead";
raiseDead.description = "This spell will ressurect a fallen warrior to aide in your quest.";
raiseDead.dropParticles = false;
raiseDead.particleType = "";
raiseDead.damage = 0;
raiseDead.splashDamage = 0;
raiseDead.doSplashDamage = true;
raiseDead.splashGrounded = true;
raiseDead.timed = false;
raiseDead.effects = "Raises an undead minion to fight for you.";
raiseDead.noCollideEnemy = true;
raiseDead.manaCost = 300;
warriorOfChaos = new Object();
warriorOfChaos.name = "warriorOfChaos";
warriorOfChaos.spellName = "Warrior of Chaos";
warriorOfChaos.description = "Summons a mighty Warrior of Chaos from the earth to fight at your side.";
warriorOfChaos.dropParticles = false;
warriorOfChaos.particleType = "";
warriorOfChaos.damage = 0;
warriorOfChaos.splashDamage = 0;
warriorOfChaos.doSplashDamage = true;
warriorOfChaos.splashGrounded = true;
warriorOfChaos.timed = false;
warriorOfChaos.effects = "Raises a chaos warrior minion to fight for you.";
warriorOfChaos.noCollideEnemy = true;
warriorOfChaos.manaCost = 450;
shamanFireBall = new Object();
shamanFireBall.name = "shamanFireBall";
shamanFireBall.dropParticles = true;
shamanFireBall.particleType = "fireSpark";
shamanFireBall.damage = 50;
shamanFireBall.splashDamage = 20;
shamanFireBall.doSplashDamage = true;
shamanFireBall.splashGrounded = false;
shamanFireBall.timed = false;
shamanFireBall.fireSound = true;
shamanFireBall.manaCost = 75;
var allSpells = new Array(fireArrow, earthArrow, stormStrike, fear, freeze, thorns, fireStorm, volcano, rockWall, boneWall, soulCrush, decayArmor, slowArrow, raiseDead, bloat, arrowStorm, warriorOfChaos, boneStorm);
var currentDamage = 0;
var deadWaitTime = 5;
var arrowRemoveTime = 15;
var stuckArrows = 100;
var criticalChance = 0;
var maxEnemyCount = 6;
var enemyCount = 0;
var enemySpawnCountMax = 20;
var enemySpawnCount = enemySpawnCountMax;
var activeEnemy = new Array();
var enemyIndex = 0;
var enemyGenDelay = 550;
var currentSpawnPoint = 0;
var allEnemyTypes = new Array("enemy_deadling", "enemy_deathWing", "enemy_demon", "enemy_shaman", "enemy_deadlingArcher", "enemy_scorpion");
enemy_knight = new Object();
enemy_knight.name = "Knight";
enemy_knight.clip = "char_knight";
enemy_knight.alive = true;
enemy_knight.speed = 0.8;
enemy_knight.health = 100;
enemy_knight.damage = 20;
enemy_knight.range = 40;
enemy_knight.hitChance = 70;
enemy_knight.armor = 30;
enemy_knight.critChance = 5;
enemy_knight.attacking = false;
enemy_endBoss = new Object();
enemy_endBoss.name = "EndBoss";
enemy_endBoss.clip = "char_endBoss";
enemy_endBoss.alive = true;
enemy_endBoss.speed = 0.8;
enemy_endBoss.maxHealth = 12500;
enemy_endBoss.health = 12500;
enemy_endBoss.damage = 20;
enemy_endBoss.range = 150;
enemy_endBoss.rangedAttack = false;
enemy_endBoss.hitChance = 70;
enemy_endBoss.armor = 30;
enemy_endBoss.critChance = 5;
enemy_endBoss.attacking = false;
enemy_deadling = new Object();
enemy_deadling.name = "Deadling";
enemy_deadling.clip = "char_deadling";
enemy_deadling.alive = true;
enemy_deadling.speed = 2.5;
enemy_deadling.health = 70;
enemy_deadling.damage = 50;
enemy_deadling.range = 30;
enemy_deadling.rangedAttack = false;
enemy_deadling.hitChance = 70;
enemy_deadling.armor = 35;
enemy_deadling.critChance = 5;
enemy_deadling.attacking = false;
enemy_scorpion = new Object();
enemy_scorpion.name = "Deadling";
enemy_scorpion.clip = "char_scorpion";
enemy_scorpion.alive = true;
enemy_scorpion.speed = 2;
enemy_scorpion.health = 70;
enemy_scorpion.damage = 80;
enemy_scorpion.range = 30;
enemy_scorpion.rangedAttack = false;
enemy_scorpion.hitChance = 70;
enemy_scorpion.armor = 55;
enemy_scorpion.critChance = 5;
enemy_scorpion.attacking = false;
enemy_deathWing = new Object();
enemy_deathWing.name = "Death Wing";
enemy_deathWing.clip = "char_deathWing";
enemy_deathWing.alive = true;
enemy_deathWing.speed = 2;
enemy_deathWing.health = 60;
enemy_deathWing.damage = 30;
enemy_deathWing.range = 150;
enemy_deathWing.rangedAttack = true;
enemy_deathWing.dirTimerMax = 30;
enemy_deathWing.dirTimer = enemy_deathWing.dirTimerMax;
enemy_deathWing.dir = "up";
enemy_deathWing.hitChance = 70;
enemy_deathWing.armor = 35;
enemy_deathWing.critChance = 5;
enemy_deathWing.attacking = false;
enemy_deadlingArcher = new Object();
enemy_deadlingArcher.name = "Deadling Archer";
enemy_deadlingArcher.clip = "char_deadlingArcher";
enemy_deadlingArcher.alive = true;
enemy_deadlingArcher.speed = 2.1;
enemy_deadlingArcher.health = 55;
enemy_deadlingArcher.damage = 70;
enemy_deadlingArcher.range = 400;
enemy_deadlingArcher.rangedAttack = true;
enemy_deadlingArcher.hitChance = 70;
enemy_deadlingArcher.armor = 35;
enemy_deadlingArcher.critChance = 5;
enemy_deadlingArcher.attacking = false;
enemy_shaman = new Object();
enemy_shaman.name = "Shaman";
enemy_shaman.clip = "char_shaman";
enemy_shaman.alive = true;
enemy_shaman.speed = 0.8;
enemy_shaman.health = 100;
enemy_shaman.damage = 30;
enemy_shaman.range = 350;
enemy_shaman.rangedAttack = true;
enemy_shaman.hitChance = 70;
enemy_shaman.armor = 25;
enemy_shaman.critChance = 5;
enemy_shaman.attacking = false;
enemy_demon = new Object();
enemy_demon.name = "Demon";
enemy_demon.clip = "char_demon";
enemy_demon.alive = true;
enemy_demon.speed = 1.6;
enemy_demon.health = 180;
enemy_demon.damage = 80;
enemy_demon.range = 30;
enemy_demon.rangedAttack = false;
enemy_demon.hitChance = 70;
enemy_demon.armor = 55;
enemy_demon.critChance = 5;
enemy_demon.attacking = false;
enemy_giantDemon = new Object();
enemy_giantDemon.name = "Demon";
enemy_giantDemon.clip = "char_demon";
enemy_giantDemon.alive = true;
enemy_giantDemon.speed = 1.3;
enemy_giantDemon.health = 330;
enemy_giantDemon.damage = 160;
enemy_giantDemon.range = 50;
enemy_giantDemon.rangedAttack = false;
enemy_giantDemon.hitChance = 70;
enemy_giantDemon.armor = 65;
enemy_giantDemon.critChance = 5;
enemy_giantDemon.scaling = 130;
enemy_giantDemon.attacking = false;
friendly_knight = new Object();
friendly_knight.name = "Knight";
friendly_knight.clip = "char_knight";
friendly_knight.alive = true;
friendly_knight.speed = 1.5;
friendly_knight.health = 600;
friendly_knight.damage = 70;
friendly_knight.range = 40;
friendly_knight.hitChance = 70;
friendly_knight.armor = 30;
friendly_knight.critChance = 5;
friendly_knight.attacking = false;
var worldBorder = 45;
var moveEdgeBuffer = 20;
var playerCollideRight = false;
var playerCollideLeft = false;
var playerMoveForwardAnim = false;
var playerMoveBackwardAnim = false;
var playerGravity = 6;
var playerMovingForward = false;
var playerMovingBackward = false;
hero = new Object();
hero.name = "Dalton";
hero.alive = true;
hero.maxHealth = 950;
hero.health = hero.maxHealth;
hero.mana = 1000;
hero.armor = 30;
hero.speed = 4;
hero.damage = 50;
hero.critChance = 5;
hero.manaRegen = 2.5;
hero.healthRegen = 0.5;
hero.nearStone = false;
hero.nearStoneMessageShown = false;
hero.findStoneBonus = 0;
var unlockedSpells = new Array();
var panSpeed = hero.speed;
var panEdgeBuffer = 40;
var panBuffer = 80;
var panInterfaceBlock = (Stage.height - 80);
var camera;
camera.state = "free";
var meleeDamage = 0;
var dmgTexts = 0;
var attackHit = false;
var critAttack = false;
var targetArmor = 0;
var splashEffect = 0;
var activeSplash = new Array();
var towerCount = 0;
var runeStoneCount = 0;
var activeRuneStones = new Array();
var foundRune1;
var foundRune2;
var foundRune3;
var runeSearchTime = 145;
var earthRunes = 990;
var fireRunes = 990;
var boneRunes = 990;
var stormRunes = 990;
var chaosRunes = 990;
var destructionRunes = 990;
var earthRunesHeld = 0;
var fireRunesHeld = 0;
var boneRunesHeld = 0;
var stormRunesHeld = 0;
var chaosRunesHeld = 0;
var destructionRunesHeld = 0;
earthRune = new Object();
earthRune.runeName = "earthRunes";
earthRune.name = "earth";
earthRune.description = "This rune harnesses the elements of the earth.";
earthRune.findChance = 90;
fireRune = new Object();
fireRune.runeName = "fireRunes";
fireRune.name = "fire";
fireRune.description = "This rune shows the heat and light of the flame.";
fireRune.findChance = 70;
boneRune = new Object();
boneRune.runeName = "boneRunes";
boneRune.name = "bone";
boneRune.description = "This rune gives the power to desecrate bones.";
boneRune.findChance = 50;
stormRune = new Object();
stormRune.runeName = "stormRunes";
stormRune.name = "storm";
stormRune.description = "This rune is linked to the weather and sky.";
stormRune.findChance = 80;
chaosRune = new Object();
chaosRune.runeName = "chaosRunes";
chaosRune.name = "chaos";
chaosRune.description = "This rune calls on the powers of Chaos to corrupt minds.";
chaosRune.findChance = 60;
destructionRune = new Object();
destructionRune.runeName = "destructionRunes";
destructionRune.name = "destruction";
destructionRune.description = "This rune has the power to destroy the physical.";
destructionRune.findChance = 40;
var runeTypes = new Array(earthRune, stormRune, fireRune, chaosRune, boneRune, destructionRune);
var playingContinue;
var xpBarText;
var prevExpLevel = 0;
var xpSoFar = 0;
var nextXPLevel = 0;
var currentLevel = "level1";
survival1 = new Object();
survival1.name = "survival1";
survival1.mapName = "survival_1";
survival1.actNumber = "SURVIVAL";
survival1.chapterNumber = "";
survival1.chapterName = "INCLINE";
survival1.chapterDesc = "A large hill stands to the east and a small valley in the west, choose your footing wisely.";
survival1.terrainName = "survival_1_terrain";
survival1.foregroundName = "survival_1_foreground";
survival1.portals = new Array();
survival1.runeStones = new Array();
survival1.musicTrack = "music_green";
survival1.enemyTypesSet1 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher");
survival1.enemyTypesSet2 = new Array("enemy_deadling", "enemy_demon", "enemy_deadling", "enemy_deadlingArcher");
survival1.enemyTypesSet3 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_deadlingArcher", "enemy_deathWing");
survival1.enemyTypesSet4 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_shaman", "enemy_deadlingArcher", "enemy_deathWing");
survival1.enemyTypesSet5 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon", "enemy_shaman", "enemy_giantDemon", "enemy_deathWing");
survival1.maxEnemyCount = 5;
survival1.enemyRate = 100;
survival2 = new Object();
survival2.name = "survival2";
survival2.mapName = "survival_2";
survival2.actNumber = "SURVIVAL";
survival2.chapterNumber = "";
survival2.chapterName = "TEMPLE";
survival2.chapterDesc = "Make your stand atop the steps striking down any who dare rise to your level.";
survival2.terrainName = "survival_2_terrain";
survival2.foregroundName = "survival_2_foreground";
survival2.portals = new Array();
survival2.runeStones = new Array();
survival2.musicTrack = "music_hell";
survival2.enemyTypesSet1 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher");
survival2.enemyTypesSet2 = new Array("enemy_deadling", "enemy_demon", "enemy_deadling", "enemy_deadlingArcher");
survival2.enemyTypesSet3 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_deadlingArcher", "enemy_deathWing");
survival2.enemyTypesSet4 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_shaman", "enemy_deadlingArcher", "enemy_deathWing");
survival2.enemyTypesSet5 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon", "enemy_shaman", "enemy_giantDemon", "enemy_deathWing");
survival2.maxEnemyCount = 5;
survival2.enemyRate = 100;
survival2.environment = "desert";
survival3 = new Object();
survival3.name = "survival3";
survival3.mapName = "survival_3";
survival3.actNumber = "SURVIVAL";
survival3.chapterNumber = "";
survival3.chapterName = "DUNES";
survival3.chapterDesc = "The sandy dunes wait to soak up the blood of the enemy you fell.";
survival3.terrainName = "survival_3_terrain";
survival3.foregroundName = "survival_3_foreground";
survival3.portals = new Array();
survival3.runeStones = new Array();
survival3.musicTrack = "music_desert";
survival3.enemyTypesSet1 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher");
survival3.enemyTypesSet2 = new Array("enemy_deadling", "enemy_demon", "enemy_deadling", "enemy_deadlingArcher");
survival3.enemyTypesSet3 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_deadlingArcher", "enemy_deathWing");
survival3.enemyTypesSet4 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_shaman", "enemy_deadlingArcher", "enemy_deathWing");
survival3.enemyTypesSet5 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon", "enemy_shaman", "enemy_giantDemon", "enemy_deathWing");
survival3.maxEnemyCount = 5;
survival3.enemyRate = 100;
survival3.sandStorm = true;
survival3.environment = "desert";
survival4 = new Object();
survival4.name = "survival4";
survival4.mapName = "survival_4";
survival4.actNumber = "SURVIVAL";
survival4.chapterNumber = "";
survival4.chapterName = "VALLEY";
survival4.chapterDesc = "Great hills surround this deep valley.";
survival4.terrainName = "survival_4_terrain";
survival4.foregroundName = "survival_4_foreground";
survival4.portals = new Array();
survival4.runeStones = new Array();
survival4.musicTrack = "music_green";
survival4.enemyTypesSet1 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher");
survival4.enemyTypesSet2 = new Array("enemy_deadling", "enemy_demon", "enemy_deadling", "enemy_deadlingArcher");
survival4.enemyTypesSet3 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_deadlingArcher", "enemy_deathWing");
survival4.enemyTypesSet4 = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_shaman", "enemy_deadlingArcher", "enemy_deathWing");
survival4.enemyTypesSet5 = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon", "enemy_shaman", "enemy_giantDemon", "enemy_deathWing");
survival4.maxEnemyCount = 5;
survival4.enemyRate = 100;
survival4.sandStorm = false;
level1 = new Object();
level1.name = "level1";
level1.mapName = "homeland_1";
level1.actNumber = "ACT I";
level1.chapterNumber = "CHAPTER 1";
level1.chapterName = "INTO THE WILD";
level1.chapterDesc = "At the request of the King you set out to investigate the so called 'Rune Stones' & 'Dark Gates' that have appeared within the boundaries of your homeland.";
level1.terrainName = "homeland_1_terrain";
level1.foregroundName = "homeland_1_foreground";
level1.portals = new Array(900, 1500, 2100);
level1.runeStones = new Array(500, 1600);
level1.musicTrack = "music_green";
level1.enemyTypes = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher");
level1.maxEnemyCount = 4;
level1.enemyRate = 100;
level2 = new Object();
level2.name = "level2";
level2.mapName = "homeland_2";
level2.actNumber = "ACT I";
level2.chapterNumber = "CHAPTER 2";
level2.chapterName = "MOUNTAIN PASS";
level2.chapterDesc = "The trail of the crimson devils continues to the east, towards the mountains.";
level2.terrainName = "homeland_2_terrain";
level2.foregroundName = "homeland_2_foreground";
level2.portals = new Array(850, 1800, 1200);
level2.runeStones = new Array(1620, 350);
level2.musicTrack = "music_green";
level2.enemyTypes = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_deathWing");
level2.maxEnemyCount = 4;
level2.enemyRate = 100;
level3 = new Object();
level3.name = "level3";
level3.mapName = "homeland_3";
level3.actNumber = "ACT I";
level3.chapterNumber = "CHAPTER 3";
level3.chapterName = "DARK MAGIC";
level3.chapterDesc = "The dark gates are appearing more frequently and carrying with them new and more deadly foes.";
level3.terrainName = "homeland_3_terrain";
level3.foregroundName = "homeland_3_foreground";
level3.portals = new Array(825, 1400, 525, 2070);
level3.runeStones = new Array(1070, 1750);
level3.musicTrack = "music_green";
level3.enemyTypes = new Array("enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_deadlingArcher", "enemy_demon", "enemy_deathWing");
level3.maxEnemyCount = 5;
level3.enemyRate = 95;
level4 = new Object();
level4.name = "level4";
level4.mapName = "homeland_4";
level4.actNumber = "ACT I";
level4.chapterNumber = "CHAPTER 4";
level4.chapterName = "BORDERLANDS";
level4.chapterDesc = "I have met with a small band of soldiers who have agreed to accompany me as far as the borders of the homeland.";
level4.terrainName = "homeland_4_terrain";
level4.foregroundName = "homeland_4_foreground";
level4.portals = new Array(1150, 1600, 2000);
level4.runeStones = new Array(1070, 1750);
level4.musicTrack = "music_green";
level4.enemyTypes = new Array("enemy_deadling", "enemy_deadling", "enemy_demon", "enemy_deadlingArcher", "enemy_deathWing");
level4.maxEnemyCount = 5;
level4.enemyRate = 85;
level4.hasArmy = true;
level4.numSoldiers = 5;
level5 = new Object();
level5.name = "level5";
level5.mapName = "desert_1";
level5.actNumber = "ACT II";
level5.chapterNumber = "CHAPTER 1";
level5.chapterName = "DESERT SANDS";
level5.chapterDesc = "The broad expanse of the desert lay before me, I must push on towards the temple the elders spoke of.";
level5.environment = "desert";
level5.terrainName = "desert_1_terrain";
level5.foregroundName = "desert_1_foreground";
level5.portals = new Array(750, 1550, 350);
level5.runeStones = new Array(1200, 2200);
level5.musicTrack = "music_desert";
level5.enemyTypes = new Array("enemy_scorpion", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon");
level5.maxEnemyCount = 5;
level5.enemyRate = 85;
level5.hasArmy = false;
level5.sandStorm = true;
level6 = new Object();
level6.name = "level6";
level6.mapName = "desert_2";
level6.actNumber = "ACT II";
level6.chapterNumber = "CHAPTER 2";
level6.chapterName = "DISTANT DUNES";
level6.chapterDesc = "The storm continues to rage, ahead of me are signs that the temple is near.";
level6.environment = "desert";
level6.terrainName = "desert_2_terrain";
level6.foregroundName = "desert_2_foreground";
level6.portals = new Array(830, 1460, 450, 2000);
level6.runeStones = new Array(200, 1150, 1760);
level6.musicTrack = "music_desert";
level6.enemyTypes = new Array("enemy_scorpion", "enemy_deadling", "enemy_deadlingArcher", "enemy_demon", "enemy_shaman");
level6.maxEnemyCount = 6;
level6.enemyRate = 85;
level6.hasArmy = false;
level6.sandStorm = true;
level7 = new Object();
level7.name = "level7";
level7.mapName = "desert_3";
level7.actNumber = "ACT II";
level7.chapterNumber = "CHAPTER 3";
level7.chapterName = "TEMPLE GROUNDS";
level7.chapterDesc = "A band of soldiers from another part of the region await my arrival, their help will be invaluable in gaining entrance to the temple.";
level7.environment = "desert";
level7.terrainName = "desert_3_terrain";
level7.foregroundName = "desert_3_foreground";
level7.portals = new Array(650, 1350, 1900);
level7.runeStones = new Array(1050, 2200);
level7.musicTrack = "music_desert";
level7.enemyTypes = new Array("enemy_scorpion", "enemy_deadling", "enemy_deadlingArcher", "enemy_deadlingArcher", "enemy_demon", "enemy_demon", "enemy_shaman");
level7.maxEnemyCount = 6;
level7.enemyRate = 85;
level7.hasArmy = true;
level7.numSoldiers = 7;
level7.sandStorm = false;
level8 = new Object();
level8.name = "level8";
level8.mapName = "desert_4";
level8.actNumber = "ACT II";
level8.chapterNumber = "CHAPTER 4";
level8.chapterName = "INNER SANCTUM";
level8.chapterDesc = "The soldiers dared not enter the temple for fear of it's darkness and the chattering of the damned echoing in its halls.";
level8.environment = "";
level8.terrainName = "desert_4_terrain";
level8.foregroundName = "desert_4_foreground";
level8.portals = new Array(725, 1350, 725, 1550);
level8.runeStones = new Array(200, 1150, 1760);
level8.musicTrack = "music_desert";
level8.enemyTypes = new Array("enemy_deadling", "enemy_deadlingArcher", "enemy_deadlingArcher", "enemy_demon", "enemy_demon", "enemy_shaman");
level8.maxEnemyCount = 6;
level8.enemyRate = 85;
level8.hasArmy = false;
level8.numSoldiers = 0;
level8.sandStorm = false;
level9 = new Object();
level9.name = "level9";
level9.mapName = "hell_1";
level9.actNumber = "ACT III";
level9.chapterNumber = "CHAPTER 1";
level9.chapterName = "THE OTHER SIDE";
level9.chapterDesc = "This place is like none I've seen before. The essence of evil is strong in what little air lies in these caves.";
level9.environment = "hell";
level9.terrainName = "hell_1_terrain";
level9.foregroundName = "hell_1_foreground";
level9.portals = new Array(950, 1460, 1800);
level9.runeStones = new Array(200, 1150, 1760);
level9.musicTrack = "music_hell";
level9.enemyTypes = new Array("enemy_shaman", "enemy_deadling", "enemy_deadlingArcher", "enemy_giantDemon", "enemy_deathWing", "enemy_demon");
level9.maxEnemyCount = 5;
level9.enemyRate = 85;
level9.hasArmy = false;
level9.numSoldiers = 0;
level9.lava = true;
level10 = new Object();
level10.name = "level10";
level10.mapName = "hell_2";
level10.actNumber = "ACT III";
level10.chapterNumber = "CHAPTER 2";
level10.chapterName = "DISTANT THUNDER";
level10.chapterDesc = "Something large can be heard in the echoes of the caverns, I must continue deeper.";
level10.environment = "hell";
level10.terrainName = "hell_2_terrain";
level10.foregroundName = "hell_2_foreground";
level10.portals = new Array(625, 1550, 800, 1950);
level10.runeStones = new Array(200, 1150, 1760);
level10.musicTrack = "music_hell";
level10.enemyTypes = new Array("enemy_giantDemon", "enemy_deadling", "enemy_deadling", "enemy_deadlingArcher", "enemy_deadlingArcher", "enemy_deathWing", "enemy_shaman");
level10.maxEnemyCount = 7;
level10.enemyRate = 80;
level10.hasArmy = false;
level10.numSoldiers = 0;
level10.lava = true;
level11 = new Object();
level11.name = "level11";
level11.mapName = "hell_3";
level11.actNumber = "ACT III";
level11.chapterNumber = "FINAL CHAPTER";
level11.chapterName = "FIRE AND EARTH";
level11.chapterDesc = "The growls from beneath draw near.";
level11.terrainName = "hell_3_terrain";
level11.foregroundName = "hell_3_foreground";
level11.portals = new Array();
level11.runeStones = new Array();
level11.musicTrack = "music_hell";
level11.enemyTypes = new Array("enemy_endBoss");
level11.maxEnemyCount = 1;
level11.enemyRate = 10000000 /* 0x989680 */;
level11.hasArmy = false;
level11.numSoldiers = 0;
level11.lava = true;
var numPortals = 0;
var portalIndex = 0;
var activePortals = new Array();
var portalsDepleted = false;
var portal = new Object();
portal.maxHealth = 700;
portal.health = portal.maxHealth;
var numEnemyEffects = 0;
var wallCount = 0;
var activeWalls = new Array();
var trinketDropped = 0;
var trinketDropChance = 11;
var allTrinketsFound = false;
var foundTrinket = null;
var allFoundTrinkets = new Array();
var allallFoundTrinkets = new Array();
var trinketEquipped = "";
trinket_manaRegen = new Object();
trinket_manaRegen.name = "manaRegen";
trinket_manaRegen.trinketName = "Trinket of Mana";
trinket_manaRegen.description = "This trinket holds the power to regenerate your mana at a quicker pace.";
trinket_manaRegen.found = false;
trinket_manaRegen.effect = 1.2;
trinket_healthRegen = new Object();
trinket_healthRegen.name = "healthRegen";
trinket_healthRegen.trinketName = "Health Restoration";
trinket_healthRegen.description = "Using this trinket will regenerate slowly your heatlh slowly over time.";
trinket_healthRegen.found = false;
trinket_healthRegen.effect = 1.5;
trinket_quickDraw = new Object();
trinket_quickDraw.name = "quickDraw";
trinket_quickDraw.trinketName = "Quick Draw";
trinket_quickDraw.description = "Pulling the drawstring back quickly is effortless to you with this trinket equipped.";
trinket_quickDraw.found = false;
trinket_quickDraw.effect = 2;
trinket_strongArm = new Object();
trinket_strongArm.name = "strongArm";
trinket_strongArm.trinketName = "Strong Arm";
trinket_strongArm.description = "This trinket bolsters the strength in your drawing arm.";
trinket_strongArm.found = false;
trinket_strongArm.effect = 1.2;
trinket_luckyCharm = new Object();
trinket_luckyCharm.name = "luckyCharm";
trinket_luckyCharm.trinketName = "Lucky Charm";
trinket_luckyCharm.description = "You'll find more trinkets than most with this equipped.";
trinket_luckyCharm.found = false;
trinket_luckyCharm.effect = 25;
trinket_rareRunes = new Object();
trinket_rareRunes.name = "rareRunes";
trinket_rareRunes.trinketName = "Rune Hunter's Charm";
trinket_rareRunes.description = "With this trinket equipped you seem to find rarer runes.";
trinket_rareRunes.found = false;
trinket_rareRunes.effect = 20;
trinket_deadEye = new Object();
trinket_deadEye.name = "deadEye";
trinket_deadEye.trinketName = "Dead Eye";
trinket_deadEye.description = "This trinket increases your chance of getting critical hits.";
trinket_deadEye.found = false;
trinket_deadEye.effect = 1.3;
trinket_elusiveCharm = new Object();
trinket_elusiveCharm.name = "elusiveCharm";
trinket_elusiveCharm.trinketName = "Elusive Charm";
trinket_elusiveCharm.description = "You will be much harder to hit with this charm on.";
trinket_elusiveCharm.found = false;
trinket_elusiveCharm.effect = 15;
trinket_piercing = new Object();
trinket_piercing.name = "piercing";
trinket_piercing.trinketName = "Pendant of Piercing";
trinket_piercing.description = "Your arrows will ignore any enemy armor in their way.";
trinket_piercing.found = false;
trinket_piercing.effect = 0.35;
var allTrinkets = new Array(trinket_manaRegen, trinket_healthRegen, trinket_quickDraw, trinket_strongArm, trinket_luckyCharm, trinket_rareRunes, trinket_deadEye, trinket_elusiveCharm, trinket_piercing);
var activeMinions = new Array();
var minionCount = 0;
skeleton = new Object();
skeleton.alive = true;
skeleton.health = 200;
skeleton.speed = 1.5;
skeleton.range = 30;
skeleton.damage = 50;
skeleton.armor = 20;
skeleton.hitChance = 99;
skeleton.critChance = 10;
chaos = new Object();
chaos.alive = true;
chaos.health = 250;
chaos.speed = 1;
chaos.range = 40;
chaos.damage = 80;
chaos.armor = 25;
chaos.hitChance = 95;
chaos.critChance = 10;
var spellAlreadyCreated = false;
var spellUnlocked = "";
var deadlingScaredVoices = 3;
var battleNum = 1;
var battleEnded = false;
var survivalMode = false;
var currentEnemySet = "enemyTypesSet1";
var survivalModeKills = 0;
var survivalPortalsDestroyed = 0;
var survivalEnemyCountBonus = 0;
var spellDropTimerMax = 850;
var spellDropTimer = spellDropTimerMax;
healthPotion = new Object();
healthPotion.name = "healthPotion";
healthPotion.effects = 200;
healthPotion.spellName = ("+" + healthPotion.effects) + " Health";
manaPotion = new Object();
manaPotion.name = "manaPotion";
manaPotion.effects = 250;
manaPotion.spellName = ("+" + manaPotion.effects) + " Mana";
var survivalSpells = new Array(healthPotion, healthPotion, healthPotion, healthPotion, healthPotion, manaPotion, manaPotion, manaPotion, fireArrow, earthArrow, stormStrike, fear, freeze, thorns, fireStorm, volcano, rockWall, boneWall, soulCrush, decayArmor, slowArrow, raiseDead, bloat, arrowStorm, warriorOfChaos, boneStorm);
var seenInGameHelp = false;
game = new Object();
game.state = "paused";
if (intoMenu == true) {
setupSound();
loadMenu();
}
if (intoMenu == false) {
setupSound();
setupWorld();
setupInterface();
game.state = "unpaused";
generateEnemy("enemy_demon");
if (debugMode == true) {
debugTools();
}
}
_root.onEnterFrame = function () {
if (game.state == "unpaused") {
hotKeys();
playerControls();
slowEnterFrame();
mediumEnterFrame();
armyStateControl();
minionAI();
armyUnitAI();
enemyUnitAI();
playerGrav();
arrowCollisions();
splashCollisions();
angleBow();
cameraControl();
runeSearchTimer();
if (survivalMode == true) {
survivalSpellDrop();
}
}
if (game.state == "endBattle") {
cameraControl();
}
};
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 51 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
getURL ("http://armorgames.com/", "_blank");
};
}
Instance of Symbol 27 MovieClip [blankBlock] "blackOut" in Symbol 73 MovieClip [dialogBox] Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.useHandCursor = false;
}
Symbol 213 MovieClip [portal] Frame 1
stop();
Instance of Symbol 192 MovieClip "portalMask" in Symbol 213 MovieClip [portal] Frame 1
onClipEvent (load) {
function portalMaskScaleUp() {
this.scaleTo(80, 2, "easeOutSine", 0, portalMaskScaleDown);
}
function portalMaskScaleDown() {
this.scaleTo(105, 2, "easeOutSine", 0, portalMaskScaleUp);
}
portalMaskScaleUp();
}
Instance of Symbol 205 MovieClip "healthBar" in Symbol 213 MovieClip [portal] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 213 MovieClip [portal] Frame 5
_root.playSound("sound_portalExplode");
Symbol 213 MovieClip [portal] Frame 8
_root.fireImpactParticle(this._x, this._y - 20);
_root.earthBreakParticle(this._x, this._y - 20);
Symbol 213 MovieClip [portal] Frame 11
_root.earthBreakParticle(this._x, this._y - 70);
_root.fireImpactParticle(this._x, this._y - 50);
Symbol 213 MovieClip [portal] Frame 29
_root.fireImpactParticle(this._x, this._y - 50);
Symbol 213 MovieClip [portal] Frame 43
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] "collision" in Symbol 264 MovieClip [roofCollision] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 273 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 28
if (_root.hero.alive == true) {
gotoAndPlay ("forward");
}
Symbol 273 MovieClip Frame 48
if (_root.hero.alive == true) {
gotoAndPlay ("backward");
}
Symbol 273 MovieClip Frame 59
stop();
Symbol 273 MovieClip Frame 73
stop();
Symbol 287 MovieClip Frame 6
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 1
this.drawn = false;
stop();
Symbol 311 MovieClip Frame 2
play();
Symbol 311 MovieClip Frame 29
stop();
this.drawn = true;
Symbol 311 MovieClip Frame 34
this.drawn = false;
this.firing = true;
Symbol 311 MovieClip Frame 42
this.firing = false;
Symbol 312 MovieClip Frame 1
play();
Symbol 312 MovieClip Frame 36
gotoAndPlay ("loop");
Symbol 312 MovieClip Frame 38
stop();
Symbol 313 MovieClip [dummyPlayer] Frame 1
stop();
Symbol 313 MovieClip [dummyPlayer] Frame 27
if (_root.hero.alive == true) {
gotoAndPlay ("running");
}
Symbol 313 MovieClip [dummyPlayer] Frame 48
stop();
Symbol 313 MovieClip [dummyPlayer] Frame 50
bow._y = -600;
play();
_root.playVoice("playerDeath");
Symbol 313 MovieClip [dummyPlayer] Frame 64
stop();
Symbol 327 MovieClip [arrowBolt_stuck] Frame 1
stop();
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 327 MovieClip [arrowBolt_stuck] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 334 MovieClip Frame 1
stop();
Symbol 338 MovieClip Frame 28
stop();
Symbol 345 MovieClip [char_deadling] Frame 1
_root.playVoice("deadlingChatter");
Symbol 345 MovieClip [char_deadling] Frame 18
if (this.alive == true) {
gotoAndPlay ("run");
} else {
gotoAndPlay ("dead");
}
Symbol 345 MovieClip [char_deadling] Frame 21
this.attackAnim = true;
play();
Symbol 345 MovieClip [char_deadling] Frame 28
_root.playVoice("deadlingAttack");
Symbol 345 MovieClip [char_deadling] Frame 32
_root.hitEnemy(this, this.enemyTarget);
Symbol 345 MovieClip [char_deadling] Frame 38
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 345 MovieClip [char_deadling] Frame 61
play();
_root.playVoice("deadlingDeath");
Symbol 345 MovieClip [char_deadling] Frame 81
stop();
Symbol 354 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 372 MovieClip Frame 12
stop();
Symbol 373 MovieClip [char_demon] Frame 1
play();
_root.playVoice("demonChatter");
Symbol 373 MovieClip [char_demon] Frame 36
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 373 MovieClip [char_demon] Frame 39
this.attackAnim = true;
play();
Symbol 373 MovieClip [char_demon] Frame 63
_root.hitEnemy(this, this.enemyTarget);
Symbol 373 MovieClip [char_demon] Frame 74
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 373 MovieClip [char_demon] Frame 95
play();
_root.playVoice("demonDeath");
Symbol 373 MovieClip [char_demon] Frame 139
stop();
Symbol 387 MovieClip Frame 1
stop();
Symbol 388 MovieClip [char_shaman] Frame 1
_root.playVoice("deadlingChatter");
Symbol 388 MovieClip [char_shaman] Frame 34
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 388 MovieClip [char_shaman] Frame 36
this.attackAnim = true;
play();
Symbol 388 MovieClip [char_shaman] Frame 50
_root.shamanFire(this);
Symbol 388 MovieClip [char_shaman] Frame 83
this.attackAnim = false;
this.attacking = false;
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 388 MovieClip [char_shaman] Frame 85
this.attackAnim = true;
play();
Symbol 388 MovieClip [char_shaman] Frame 108
_root.shamanSkyFire(this);
Symbol 388 MovieClip [char_shaman] Frame 149
this.attackAnim = false;
this.attacking = false;
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 388 MovieClip [char_shaman] Frame 150
play();
_root.playVoice("deadlingDeath");
Symbol 388 MovieClip [char_shaman] Frame 176
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 408 MovieClip [char_deadlingArcher] Frame 1
_root.playVoice("deadlingChatter");
Symbol 408 MovieClip [char_deadlingArcher] Frame 18
if (this.alive == true) {
gotoAndPlay ("run");
} else {
gotoAndPlay ("dead");
}
Symbol 408 MovieClip [char_deadlingArcher] Frame 21
this.attackAnim = true;
play();
Symbol 408 MovieClip [char_deadlingArcher] Frame 39
weapon.bowString._visible = false;
Symbol 408 MovieClip [char_deadlingArcher] Frame 51
_root.deadlingArcherFire(this);
Symbol 408 MovieClip [char_deadlingArcher] Frame 59
weapon.bowString._visible = true;
Symbol 408 MovieClip [char_deadlingArcher] Frame 68
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 408 MovieClip [char_deadlingArcher] Frame 73
play();
_root.playVoice("deadlingDeath");
Symbol 408 MovieClip [char_deadlingArcher] Frame 93
stop();
Symbol 425 MovieClip [char_deathWing] Frame 29
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 425 MovieClip [char_deathWing] Frame 32
this.attackAnim = true;
play();
Symbol 425 MovieClip [char_deathWing] Frame 47
_root.deathWingVomitAttack(this);
Symbol 425 MovieClip [char_deathWing] Frame 83
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 425 MovieClip [char_deathWing] Frame 85
this.fallRate = _root.gravity;
_root.playVoice("deadlingDeath");
wings.leftWing.stop();
wings.rightWing.stop();
this.onEnterFrame = function () {
_root.applyFallingGravity(this);
};
Symbol 425 MovieClip [char_deathWing] Frame 112
stop();
Symbol 425 MovieClip [char_deathWing] Frame 122
stop();
Symbol 441 MovieClip [char_scorpion] Frame 15
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 441 MovieClip [char_scorpion] Frame 17
this.attackAnim = true;
Symbol 441 MovieClip [char_scorpion] Frame 35
_root.hitEnemy(this, this.enemyTarget);
Symbol 441 MovieClip [char_scorpion] Frame 54
this.attackAnim = false;
this.attacking = false;
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 441 MovieClip [char_scorpion] Frame 57
play();
Symbol 441 MovieClip [char_scorpion] Frame 68
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 5
Symbol 470 MovieClip Frame 25
stop();
Symbol 479 MovieClip Frame 1
stop();
Symbol 479 MovieClip Frame 41
gotoAndStop ("closed");
Symbol 479 MovieClip Frame 73
stop();
Symbol 486 MovieClip [char_endBoss] Frame 1
if (_root.game.state != "unpaused") {
stop();
}
Instance of Symbol 201 MovieClip "collision" in Symbol 486 MovieClip [char_endBoss] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 205 MovieClip "healthBar" in Symbol 486 MovieClip [char_endBoss] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 486 MovieClip [char_endBoss] Frame 43
_root.playVoice("bossFootStep");
_root.earthBreakParticle(this._x - 45, this._y);
Symbol 486 MovieClip [char_endBoss] Frame 82
_root.playVoice("bossFootStep");
_root.earthBreakParticle(this._x - 45, this._y + 10);
Symbol 486 MovieClip [char_endBoss] Frame 89
if (this.alive == true) {
gotoAndPlay ("run");
}
Symbol 486 MovieClip [char_endBoss] Frame 94
this.attackAnim = true;
play();
Symbol 486 MovieClip [char_endBoss] Frame 101
_root.playSound("sound_dragonFire");
Symbol 486 MovieClip [char_endBoss] Frame 108
p = 0;
while (p < 10) {
setTimeout(_root.endBossBreatheFire, random(650), this);
p++;
}
Symbol 486 MovieClip [char_endBoss] Frame 114
head.gotoAndPlay("open");
Symbol 486 MovieClip [char_endBoss] Frame 153
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 486 MovieClip [char_endBoss] Frame 155
this.attackAnim = true;
play();
Symbol 486 MovieClip [char_endBoss] Frame 166
_root.playVoice("dragonAttack");
Symbol 486 MovieClip [char_endBoss] Frame 183
hammerPoint = new Object();
hammerPoint.x = firePoint_head._x;
hammerPoint.y = firePoint_head._y;
this.localToGlobal(hammerPoint);
_root.world.globalToLocal(hammerPoint);
_root.splashDamage("endBossHammer", hammerPoint.x, hammerPoint.y, this);
_root.playSound("sound_dragonHitGround");
Symbol 486 MovieClip [char_endBoss] Frame 205
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 486 MovieClip [char_endBoss] Frame 207
this.attackAnim = true;
play();
Symbol 486 MovieClip [char_endBoss] Frame 215
_root.playVoice("dragonAttack");
Symbol 486 MovieClip [char_endBoss] Frame 226
head.gotoAndPlay("open");
Symbol 486 MovieClip [char_endBoss] Frame 230
hammerPoint = new Object();
hammerPoint.x = firePoint_head._x;
hammerPoint.y = firePoint_head._y;
this.localToGlobal(hammerPoint);
_root.world.globalToLocal(hammerPoint);
_root.splashDamage("endBossHammer", hammerPoint.x, hammerPoint.y, this);
_root.playVoice("bossFootStep");
Symbol 486 MovieClip [char_endBoss] Frame 242
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 486 MovieClip [char_endBoss] Frame 244
this.attackAnim = true;
play();
_root.activePortals.push("hamburger");
_root[_root.currentLevel].maxEnemyCount = 7;
Symbol 486 MovieClip [char_endBoss] Frame 255
Symbol 486 MovieClip [char_endBoss] Frame 259
head.gotoAndPlay("open");
_root.playSound("sound_dragonAttack2");
Symbol 486 MovieClip [char_endBoss] Frame 275
_root.endBossSummonEnemies(this._x, this._y);
_root.playSound("sound_teleport" + (random(3) + 1));
Symbol 486 MovieClip [char_endBoss] Frame 290
this.attackAnim = false;
this.attacking = false;
stop();
gotoAndPlay ("run");
Symbol 486 MovieClip [char_endBoss] Frame 294
play();
Symbol 486 MovieClip [char_endBoss] Frame 319
_root.playSound("sound_dragonDeath");
Symbol 486 MovieClip [char_endBoss] Frame 325
head.gotoAndPlay("open");
Symbol 486 MovieClip [char_endBoss] Frame 364
_root.playVoice("bossFootStep");
_root.earthBreakParticle(this._x - 30, this._y);
Symbol 486 MovieClip [char_endBoss] Frame 365
_root.earthBreakParticle(this._x - 60, this._y);
_root.earthBreakParticle(this._x + 50, this._y);
Symbol 486 MovieClip [char_endBoss] Frame 366
_root.playVoice("bossFootStep");
_root.earthBreakParticle(this._x - 100, this._y);
Symbol 486 MovieClip [char_endBoss] Frame 368
_root.earthBreakParticle(this._x - 90, this._y);
Symbol 486 MovieClip [char_endBoss] Frame 370
_root.playVoice("bossFootStep");
Symbol 486 MovieClip [char_endBoss] Frame 398
head.gotoAndPlay("dead");
Symbol 486 MovieClip [char_endBoss] Frame 426
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 1
stop();
Symbol 502 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 1
stop();
Symbol 519 MovieClip Frame 1
stop();
Symbol 520 MovieClip [char_knight] Frame 6
stop();
Symbol 520 MovieClip [char_knight] Frame 11
this.rising = true;
Symbol 520 MovieClip [char_knight] Frame 22
this.rising = false;
Symbol 520 MovieClip [char_knight] Frame 53
if (this.alive == true) {
gotoAndPlay ("walk");
}
Symbol 520 MovieClip [char_knight] Frame 55
this.attackAnim = true;
play();
Symbol 520 MovieClip [char_knight] Frame 81
_root.hitEnemy(this, this.enemyTarget);
Symbol 520 MovieClip [char_knight] Frame 86
this.attackAnim = false;
stop();
gotoAndPlay ("walk");
Symbol 520 MovieClip [char_knight] Frame 87
this.attackAnim = true;
play();
Symbol 520 MovieClip [char_knight] Frame 113
_root.hitEnemy(this, this.enemyTarget);
Symbol 520 MovieClip [char_knight] Frame 122
this.attackAnim = false;
stop();
gotoAndPlay ("walk");
Symbol 520 MovieClip [char_knight] Frame 143
play();
Symbol 520 MovieClip [char_knight] Frame 156
stop();
Symbol 531 MovieClip Frame 1
stop();
Instance of Symbol 288 MovieClip "bolt" in Symbol 532 MovieClip [arrowBolt] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 531 MovieClip "arrowHead" in Symbol 532 MovieClip [arrowBolt] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 532 MovieClip [arrowBolt] Frame 3
stop();
bolt._visible = true;
arrowHead._visible = true;
Symbol 538 MovieClip [runeStone] Frame 104
gotoAndPlay (1);
Symbol 538 MovieClip [runeStone] Frame 113
_root.runeExtractParticles(this._x, this._y);
Symbol 538 MovieClip [runeStone] Frame 136
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 628 MovieClip Frame 1
stop();
Symbol 628 MovieClip Frame 16
stop();
Symbol 641 MovieClip Frame 1
stop();
Symbol 657 MovieClip Frame 1
stop();
Instance of Symbol 27 MovieClip [blankBlock] "retreat" in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
_root.armyControlButtons_setup(this._name);
}
Instance of Symbol 27 MovieClip [blankBlock] "halt" in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
_root.armyControlButtons_setup(this._name);
}
Instance of Symbol 27 MovieClip [blankBlock] "march" in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
_root.armyControlButtons_setup(this._name);
}
Instance of Symbol 663 MovieClip in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.pauseGame();
};
}
Instance of Symbol 665 MovieClip in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.toggleQuality();
};
}
Instance of Symbol 667 MovieClip in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.muteAllSound();
};
}
Instance of Symbol 686 MovieClip "toolTip" in Symbol 687 MovieClip [gameInterface] Frame 1
onClipEvent (load) {
this._visible = false;
this.onEnterFrame = function () {
this._x = _root._xmouse + 10;
this._y = _root._ymouse - 30;
if (_root._xmouse > 750) {
this._x = _root._xmouse - 100;
}
};
}
Symbol 715 MovieClip Frame 1
stop();
Symbol 717 MovieClip Frame 1
rune._visible = true;
stop();
Symbol 717 MovieClip Frame 6
rune._visible = false;
Symbol 730 MovieClip Frame 1
stop();
this._alpha = 0;
this.alphaTo(100, 0.4);
Symbol 730 MovieClip Frame 10
this._alpha = 0;
this.alphaTo(100, 0.4);
Symbol 787 MovieClip Frame 1
page1._visible = true;
page2._visible = false;
page3._visible = false;
page4._visible = false;
stop();
Instance of Symbol 27 MovieClip [blankBlock] "bookForward" in Symbol 787 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_spellBook(this._name);
}
Instance of Symbol 27 MovieClip [blankBlock] "bookBack" in Symbol 787 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_spellBook(this._name);
}
Symbol 787 MovieClip Frame 2
page1._visible = false;
page2._visible = true;
page3._visible = false;
page4._visible = false;
Symbol 787 MovieClip Frame 3
page1._visible = false;
page2._visible = false;
page3._visible = true;
page4._visible = false;
Instance of Symbol 27 MovieClip [blankBlock] "bookForward" in Symbol 787 MovieClip Frame 3
onClipEvent (load) {
_root.buttonSetup_spellBook(this._name);
}
Symbol 787 MovieClip Frame 4
page1._visible = false;
page2._visible = false;
page3._visible = false;
page4._visible = true;
Instance of Symbol 619 MovieClip "combinerIcon" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 730 MovieClip "equipBow" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_inventory(this._name);
}
Instance of Symbol 733 MovieClip "toBattle" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_inventory(this._name);
}
Instance of Symbol 619 MovieClip "bowSlot1" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 619 MovieClip "bowSlot2" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 619 MovieClip "bowSlot3" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 619 MovieClip "bowSlot4" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 619 MovieClip "bowSlot5" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Instance of Symbol 24 MovieClip [trinketIcons] "healthRegen" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "manaRegen" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "deadEye" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "quickDraw" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "elusiveCharm" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "strongArm" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "rareRunes" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "luckyCharm" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 24 MovieClip [trinketIcons] "piercing" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
_root.buttonSetup_trinkets(this._name);
}
Instance of Symbol 789 MovieClip [spellStone] in Symbol 792 MovieClip [inventoryScreen] Frame 1
/* no clip actions */
Instance of Symbol 791 MovieClip in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.showDialogBox(_root.dialog_quitToMenu);
};
}
Instance of Symbol 686 MovieClip "toolTip" in Symbol 792 MovieClip [inventoryScreen] Frame 1
onClipEvent (load) {
this._visible = false;
this.onEnterFrame = function () {
this._x = _root._xmouse - 30;
this._y = _root._ymouse - 30;
if (_root._xmouse > 750) {
this._x = _root._xmouse - 100;
}
};
}
Instance of Symbol 803 MovieClip "continueCampaign" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "newCampaign" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "options" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "playMoreGames" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "howToPlay" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "credits" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "survival" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "strategyGuide" in Symbol 804 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 803 MovieClip "low" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "medium" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "high" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "effectsOff" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "effectsOn" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "musicOff" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 803 MovieClip "musicOn" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 69 MovieClip "backButton" in Symbol 812 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_optionsBack(this._name);
}
Instance of Symbol 69 MovieClip "backButton" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_survivalBack(this._name);
}
Instance of Symbol 822 MovieClip "survival1" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_survivalLaunch(this._name);
}
Instance of Symbol 825 MovieClip "survival2" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_survivalLaunch(this._name);
}
Instance of Symbol 828 MovieClip "survival3" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_survivalLaunch(this._name);
}
Instance of Symbol 831 MovieClip "survival4" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_survivalLaunch(this._name);
}
Symbol 843 Button
on (release) {
getURL ("mailto:con@armorgames.com");
}
Instance of Symbol 69 MovieClip "backButton" in Symbol 850 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "CLOSE";
this.onRollOver = function () {
_root.playRollOverSound();
};
this.onRelease = function () {
_root.playClickSound();
_root.hideCredits();
};
}
Instance of Symbol 69 MovieClip "backButton" in Symbol 860 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "CLOSE";
this.onRollOver = function () {
_root.playRollOverSound();
};
this.onRelease = function () {
_root.playClickSound();
_root.hideInstructions();
};
}
Instance of Symbol 812 MovieClip "options" in Symbol 864 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 832 MovieClip "survival" in Symbol 864 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 850 MovieClip "credits" in Symbol 864 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 860 MovieClip "instructions" in Symbol 864 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 932 MovieClip [earthRock] Frame 14
stop();
Symbol 940 MovieClip [fireSpark] Frame 14
stop();
Symbol 944 MovieClip [dustCloud] Frame 14
stop();
Symbol 948 MovieClip [blueSpark] Frame 18
stop();
Symbol 949 MovieClip [greenSpark] Frame 18
stop();
Symbol 952 MovieClip [smokeTrail] Frame 45
removeMovieClip(this);
Symbol 971 MovieClip [bloodDustCloud] Frame 14
stop();
Symbol 979 MovieClip [bloatSpark] Frame 18
stop();
Symbol 986 MovieClip [effect_slowArrow] Frame 50
stop();
Symbol 992 MovieClip [trinket] Frame 60
gotoAndPlay ("loop");
Symbol 992 MovieClip [trinket] Frame 82
removeMovieClip(this);
Symbol 995 MovieClip [particle_decayCloud] Frame 45
stop();
Symbol 1002 MovieClip Frame 19
stop();
Symbol 1003 MovieClip [effect_decayArmor] Frame 258
removeMovieClip(this);
Symbol 1013 MovieClip Frame 5
stop();
Symbol 1014 MovieClip [effect_stormStrike] Frame 3
_root.playSound("sound_stormStrike");
Symbol 1014 MovieClip [effect_stormStrike] Frame 50
removeMovieClip(this);
Symbol 1030 MovieClip [effect_freeze] Frame 1
_parent.stop();
_root.iceParticle(_parent._x, _parent._y);
_root.playSound("sound_freeze_effect");
Symbol 1030 MovieClip [effect_freeze] Frame 134
_parent.frozen = false;
if (_parent.alive == true) {
_parent.play();
}
removeMovieClip(this);
stop();
Symbol 1035 MovieClip [effect_fear] Frame 1
_parent.fearing = true;
Symbol 1035 MovieClip [effect_fear] Frame 145
_parent.fearing = false;
removeMovieClip(this);
Symbol 1036 MovieClip [hitPortalSpark] Frame 13
removeMovieClip(this);
Symbol 1040 MovieClip [particle_soulCrushCloud] Frame 45
stop();
Symbol 1044 MovieClip [effect_soulCrush] Frame 145
removeMovieClip(this);
Symbol 1051 MovieClip [particle_sandStorm] Frame 1
stop();
Symbol 1052 MovieClip [effect_bloat] Frame 95
stop();
Symbol 1053 MovieClip Frame 12
stop();
Instance of Symbol 619 MovieClip "spellIcon" in Symbol 1054 MovieClip [spellDrop] Frame 1
onClipEvent (load) {
this.selectRing._visible = false;
}
Symbol 1054 MovieClip [spellDrop] Frame 97
if (this.alive == true) {
gotoAndPlay ("loop");
}
Symbol 1054 MovieClip [spellDrop] Frame 109
stop();
removeMovieClip(this);
Symbol 1062 MovieClip [particle_lava] Frame 1
stop();
Symbol 1063 MovieClip [splash_fireArrow] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1064 MovieClip [splash_earthArrow] Frame 2
_root.earthArrowParticle(this._x, this._y - 10);
Symbol 1064 MovieClip [splash_earthArrow] Frame 5
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1073 MovieClip [splash_soulCrush] Frame 1
_root.soulCrushSmokeParticle(this._x, this._y);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1073 MovieClip [splash_soulCrush] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1073 MovieClip [splash_soulCrush] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1074 MovieClip [splash_decayArmor] Frame 1
_root.decayArrowParticle(this._x, this._y);
_root.decayArrowParticle(this._x - 30, this._y);
_root.decayArrowParticle(this._x + 30, this._y);
Symbol 1074 MovieClip [splash_decayArmor] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1075 MovieClip [splash_slowArrow] Frame 72
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Instance of Symbol 205 MovieClip "healthBar" in Symbol 1105 MovieClip [splash_rockWall] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 1105 MovieClip [splash_rockWall] Frame 4
_root.earthArrowParticle(this._x, this._y - 10);
_root.createWall(this);
Symbol 1105 MovieClip [splash_rockWall] Frame 17
stop();
Symbol 1105 MovieClip [splash_rockWall] Frame 20
_root.playSound("sound_rockWall_break");
Symbol 1105 MovieClip [splash_rockWall] Frame 21
_root.earthBreakParticle(this._x, this._y - 50);
_root.earthArrowParticle(this._x, this._y - 20);
Symbol 1105 MovieClip [splash_rockWall] Frame 66
removeMovieClip(this);
Instance of Symbol 205 MovieClip "healthBar" in Symbol 1121 MovieClip [splash_boneWall] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 1121 MovieClip [splash_boneWall] Frame 4
_root.earthArrowParticle(this._x, this._y - 10);
_root.createWall(this);
Symbol 1121 MovieClip [splash_boneWall] Frame 17
stop();
Symbol 1121 MovieClip [splash_boneWall] Frame 19
_root.boneWallBreakParticle(this._x, this._y);
_root.playSound("sound_boneWall_break");
Symbol 1121 MovieClip [splash_boneWall] Frame 45
removeMovieClip(this);
Symbol 1122 MovieClip [splash_thorns] Frame 1
_root.attachThorns(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1122 MovieClip [splash_thorns] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1122 MovieClip [splash_thorns] Frame 90
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1127 MovieClip [thorn] Frame 1
_root.earthBreakParticle(this._x, this._y);
Symbol 1127 MovieClip [thorn] Frame 91
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1129 MovieClip [splash_stormStrike] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1129 MovieClip [splash_stormStrike] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1130 MovieClip [splash_raiseDead] Frame 4
_root.earthBreakParticle(this._x, this._y - 10);
_root.createMinion("skeleton", this._x, this._y);
Symbol 1130 MovieClip [splash_raiseDead] Frame 94
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1131 MovieClip [splash_fireStorm] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1131 MovieClip [splash_fireStorm] Frame 90
this.smokeTrailing = true;
_root.playSound("sound_fireStorm" + (random(2) + 1));
_root.particleCount++;
this.attachMovie("fireBall", "fireBall", _root.particleCount);
fireBall._y = -500;
fireBall._xscale = (fireBall._yscale = 150 + random(60));
fireBall.onEnterFrame = function () {
fireBall._y = fireBall._y + 25;
if (fireBall._y > 0) {
removeMovieClip(this);
}
};
this.onEnterFrame = function () {
if (this.smokeTrailing) {
_root.particleCount++;
this.attachMovie("smokeTrail", "smoke" + _root.particleCount, _root.depth_world_particles + _root.particleCount);
this["smoke" + _root.particleCount]._rotation = random(360);
this["smoke" + _root.particleCount]._x = (fireBall._x + random(10)) - 5;
this["smoke" + _root.particleCount]._y = (fireBall._y - random(10)) - 5;
this["smoke" + _root.particleCount]._xscale = (this["smoke" + _root.particleCount]._yscale = random(80) + 90);
}
};
Symbol 1131 MovieClip [splash_fireStorm] Frame 114
this.smokeTrailing = false;
Symbol 1131 MovieClip [splash_fireStorm] Frame 190
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1132 MovieClip [splash_shamanFireBall] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1133 MovieClip [splash_deathWingVomit] Frame 1
_root.deathWingVomitSplash(this._x, this._y);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1133 MovieClip [splash_deathWingVomit] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1133 MovieClip [splash_deathWingVomit] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1139 MovieClip [splash_freeze] Frame 1
_root.iceParticle(this._x, this._y);
Symbol 1139 MovieClip [splash_freeze] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1145 MovieClip Frame 21
stop();
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1146 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1147 MovieClip [splash_volcano] Frame 92
_root.earthArrowParticle(this._x, this._y - 10);
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 96
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 101
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 107
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 113
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 118
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 123
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 127
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 130
_root.volcanicExplosion(this);
Symbol 1147 MovieClip [splash_volcano] Frame 142
stop();
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1148 MovieClip [splash_volcanoProjectile] Frame 48
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1152 MovieClip [splash_fear] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1152 MovieClip [splash_fear] Frame 43
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1154 MovieClip [splash_endBossFireBall] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1154 MovieClip [splash_endBossFireBall] Frame 6
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1155 MovieClip [splash_rockFall] Frame 2
_root.earthArrowParticle(this._x, this._y - 10);
Symbol 1155 MovieClip [splash_rockFall] Frame 5
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1156 MovieClip [splash_endBossHammer] Frame 2
_root.earthArrowParticle(this._x, this._y - 10);
Symbol 1156 MovieClip [splash_endBossHammer] Frame 5
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1157 MovieClip [splash_warriorOfChaos] Frame 4
_root.earthBreakParticle(this._x, this._y - 10);
_root.createMinion("chaos", this._x, this._y);
Symbol 1157 MovieClip [splash_warriorOfChaos] Frame 94
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1158 MovieClip Frame 1
_root.attachThorns(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1158 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1158 MovieClip Frame 90
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Instance of Symbol 27 MovieClip [blankBlock] in Symbol 1159 MovieClip [splash_boneStorm] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1159 MovieClip [splash_boneStorm] Frame 112
_root.particleCount++;
this.attachMovie("boneSpike", "boneSpike", _root.particleCount);
boneSpike._y = -500;
boneSpike._xscale = (boneSpike._yscale = 150 + random(60));
boneSpike.gotoAndStop(random(3) + 1);
boneSpike.onEnterFrame = function () {
boneSpike._y = boneSpike._y + 25;
if (boneSpike._y > 0) {
removeMovieClip(this);
}
};
Symbol 1159 MovieClip [splash_boneStorm] Frame 141
_root.boneWallBreakParticle(this._x, this._y);
_root.playSound("sound_boneWall_break");
Symbol 1159 MovieClip [splash_boneStorm] Frame 212
_root.activeSplash.splice(this.splashIndex, 1);
removeMovieClip(this);
Symbol 1163 MovieClip [boneSpike] Frame 1
stop();
Instance of Symbol 1164 MovieClip "bg" in Symbol 1178 MovieClip [battleLoad] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
this.onPress = function () {
};
}
Symbol 1252 MovieClip [storyBook] Frame 1
stop();
Instance of Symbol 1183 MovieClip "next" in Symbol 1252 MovieClip [storyBook] Frame 1
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1185 MovieClip "skip" in Symbol 1252 MovieClip [storyBook] Frame 1
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1204 MovieClip "close" in Symbol 1252 MovieClip [storyBook] Frame 4
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1183 MovieClip "next" in Symbol 1252 MovieClip [storyBook] Frame 5
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1204 MovieClip "close" in Symbol 1252 MovieClip [storyBook] Frame 7
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1183 MovieClip "next" in Symbol 1252 MovieClip [storyBook] Frame 8
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1204 MovieClip "close" in Symbol 1252 MovieClip [storyBook] Frame 9
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1183 MovieClip "next" in Symbol 1252 MovieClip [storyBook] Frame 21
onClipEvent (load) {
_root.buttonSetup_storyBook(this._name);
}
Instance of Symbol 1204 MovieClip "close" in Symbol 1252 MovieClip [storyBook] Frame 22
onClipEvent (load) {
this.onRelease = function () {
_root.loadMenu();
};
}
Symbol 1253 MovieClip Frame 1
stop();
Symbol 1340 MovieClip Frame 1
stop();
Symbol 1359 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 1364 MovieClip Frame 235
_root.gotoAndPlay("conArtistsLogo");
Symbol 1398 MovieClip Frame 304
_root.gotoAndStop("main");