Frame 1
var versionNumber = "v1.21";
function loadAd() {
System.security.allowDomain("server.cpmstar.com");
_root.attachMovie("adBox", "adBox", 12);
adBox._x = 428.5;
adBox._y = 79.3;
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 = 24;
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") {
armorGamesVersion = true;
mainAd.gotoAndStop("hints");
mainAd.hintText.text = "INTELLIGENCE:\r" + hints[random(hints.length)];
} else {
nextHintButton._visible = false;
}
if ((domain != "kongregate.com") && (domain != "")) {
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._xscale = _local2;
if (_local2 >= 100) {
onLoadComplete();
delete this.onEnterFrame;
}
}
function onLoadComplete() {
preloaderPlayButton.playText._alpha = 100;
preloaderPlayButton.backing.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
preloaderPlayButton.backing.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine", 0.5);
preloaderPlayButton.onRelease = function () {
_root.gotoAndStop("logo");
_root.removeAd();
};
preloaderPlayButton.onRollOver = function () {
this.backing.colorTransformTo(180, 0, 180, 0, 180, 0, 100, 0, 0.5);
};
preloaderPlayButton.onRollOut = function () {
this.backing.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.5);
};
}
stop();
_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 hints = new Array("War isn't fair.", "War isn't fair.", "War isn't fair.", "The enemy has a greater supply of fire support than you at times during the campaign.", "The enemy has a greater supply of fire support than you at times during the campaign.", "The enemy has a greater supply of fire support than you at times during the campaign.", "Assault troops will throw grenades at tanks in an attempt to disable them.", "Experience is earned by killing enemy units, taking control of trenches and winning battles.", "Keep an eye on the grey Morale Bar at the top of screen, depletion of morale will lead to your men surrendering.", "Killing enemies, deploying Officers and bringing Tanks to the battlefield will boost the Morale of your men.", "The destruction of Tanks and the death of Officers will greatly affect the morale of the men.", "Upgrade your units via the upgrades button on the HUD or in the Campaign Map menu.", "Gas is best used against entrenched infantry or to block movement to an area.", "Officers provide a damage bonus to any infantry near them.", "Be cautious when moving over open ground. Listen in the distance for artillery guns before sending your men over the top.", "Upgrades carry over between battles.", "Your game is saved automatically each time you start and finish a battle.", "Deploy weaker units such as Machine Gunners and Sharpshooters behind other Infantry for protection.", "Use Assault Teams to charge trenches and gain ground on long range infantry.", "Mortar strikes do a great deal of damage to infantry in the open but are less effective against entrenched troops.", "Artillery strikes take a long time to reload, use them wisely.", "Machine Gunners and Sharpshooters are weak in the open, try to get them to entrenched positions quickly.", "Tanks are almost invulnerable against small arms fire. Use your fire support to knock them out.", "Take notice of the 'Ground Taken' progress bar at the top of screen. It shows your units front most position.", "You can lock trenches via each trench's interface. This tells your units to ignore that trench and keep advancing.");
var goodURL = false;
var armorGamesVersion = false;
var urlCheckerOn = true;
var everyWhereVersion = true;
urlChecker();
preLoaderCombo.versionNumber.text = versionNumber;
Frame 2
armorAnim.alphaTo(100, 2, "easeOutSine", 0, function () {
this.play();
});
Instance of Symbol 94 MovieClip "armorAnim" in Frame 2
onClipEvent (load) {
this.onEnterFrame = function () {
removeAd();
};
}
Frame 3
stop();
Instance of Symbol 127 MovieClip in Frame 3
onClipEvent (load) {
this.onEnterFrame = function () {
removeAd();
};
}
Frame 5
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 = "Warfare1917";
saveGameData.data.teamName = playerTeam.team;
saveGameData.data.enemyTeamName = compTeam.team;
saveGameData.data.currentMapName = currentMap.name;
saveGameData.data.missionNumber = currentMap.mission;
saveGameData.data.experiencePoints = experiencePoints;
saveGameData.data.experienceLevel = experienceLevel;
saveGameData.data.upgradePoints = upgradePoints;
x = 1;
while (x <= 22) {
saveGameData.data["upgrade" + x] = _root[((playerTeam.team + "_slot") + x) + "_upgrade"];
x++;
}
saveGameData.data.career_soldiersKilled = career_soldiersKilled;
saveGameData.data.career_soldiersLost = career_soldiersLost;
saveGameData.data.career_trenchesTaken = career_trenchesTaken;
saveGameData.data.career_supportUsed = career_supportUsed;
saveGameData.data.career_wins = career_wins;
saveGameData.data.career_losses = career_losses;
saveGameData.data.career_moraleWins = career_moraleWins;
saveGameData.data.career_moraleLosses = career_moraleLosses;
saveGameData.data.career_conquerWins = career_conquerWins;
saveGameData.data.career_conquerLosses = career_conquerLosses;
saveGameData.data.career_moraleGained = career_moraleGained;
saveGameData.data.career_moraleLost = career_moraleLost;
saveGameData.data.career_experienceGained = career_experienceGained;
saveGameData.data.career_bonusExpGained = career_bonusExpGained;
saveGameData.data.career_riflemenDeployed = career_riflemenDeployed;
saveGameData.data.career_assaultDeployed = career_assaultDeployed;
saveGameData.data.career_machineGunDeployed = career_machineGunDeployed;
saveGameData.data.career_sniperDeployed = career_sniperDeployed;
saveGameData.data.career_officerDeployed = career_officerDeployed;
saveGameData.data.career_tankDeployed = career_tankDeployed;
}
function loadGameInfo() {
playerTeam.team = saveGameData.data.teamName;
compTeam.team = saveGameData.data.enemyTeamName;
currentMapName = saveGameData.data.currentMapName;
currentMap = _root[currentMapName];
}
function loadGame() {
playerTeam.team = saveGameData.data.teamName;
compTeam.team = saveGameData.data.enemyTeamName;
currentMapName = saveGameData.data.currentMapName;
currentMap = _root[currentMapName];
battleNum = _root[currentMapName].mission;
experiencePoints = saveGameData.data.experiencePoints;
experienceLevel = saveGameData.data.experienceLevel;
upgradePoints = saveGameData.data.upgradePoints;
lastMapPlayed = saveGameData.data.lastMapPlayed;
x = 1;
while (x <= 22) {
_root[((playerTeam.team + "_slot") + x) + "_upgrade"] = saveGameData.data["upgrade" + x];
x++;
}
career_soldiersKilled = saveGameData.data.career_soldiersKilled;
career_soldiersLost = saveGameData.data.career_soldiersLost;
career_trenchesTaken = saveGameData.data.career_trenchesTaken;
career_supportUsed = saveGameData.data.career_supportUsed;
career_wins = saveGameData.data.career_wins;
career_losses = saveGameData.data.career_losses;
career_moraleWins = saveGameData.data.career_moraleWins;
career_moraleLosses = saveGameData.data.career_moraleLosses;
career_conquerWins = saveGameData.data.career_conquerWins;
career_conquerLosses = saveGameData.data.career_conquerLosses;
career_experienceGained = saveGameData.data.career_experienceGained;
career_bonusExpGained = saveGameData.data.career_bonusExpGained;
career_riflemenDeployed = saveGameData.data.career_riflemenDeployed;
career_assaultDeployed = saveGameData.data.career_assaultDeployed;
career_machineGunDeployed = saveGameData.data.career_machineGunDeployed;
career_sniperDeployed = saveGameData.data.career_sniperDeployed;
career_officerDeployed = saveGameData.data.career_officerDeployed;
career_tankDeployed = saveGameData.data.career_tankDeployed;
}
function showDialogBox(contents) {
_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;
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 - 45;
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 - 45);
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 CAMPAIGN?";
dialog_startNewCampaign.body = ((("Starting a new campaign will overwrite\ryour previous save game:\r\r" + saveGameData.data.teamName.toUpperCase()) + " CAMPAIGN - MISSION ") + saveGameData.data.missionNumber) + "\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();
loadCampaignSelect();
closeDialogBox();
};
dialog_startNewCampaign.button2Action = function () {
playClickSound();
closeDialogBox();
};
dialog_continueCampaign = new Object();
dialog_continueCampaign.heading = "CONTINUE CAMPAIGN?";
dialog_continueCampaign.body = ((("Continue playing:\r\r" + saveGameData.data.teamName.toUpperCase()) + " CAMPAIGN - MISSION ") + saveGameData.data.missionNumber) + "\r\rAre you sure?";
dialog_continueCampaign.button1Active = true;
dialog_continueCampaign.button2Active = true;
dialog_continueCampaign.button1Desc = "ACCEPT";
dialog_continueCampaign.button2Desc = "CANCEL";
dialog_continueCampaign.button1Action = function () {
playingSkirmish = false;
playingContinue = true;
playClickSound();
loadGame();
loadMapScreen();
closeDialogBox();
};
dialog_continueCampaign.button2Action = function () {
playClickSound();
closeDialogBox();
};
dialog_newGameSaved = new Object();
dialog_newGameSaved.heading = "NEW CAMPAIGN";
dialog_newGameSaved.body = "A new save game has been created.\r\rProgress will be saved for you\rautomatically during the campaign.";
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 == "center") {
hud.quickMessage._y = 210;
hud.quickMessage._xscale = 125;
hud.quickMessage._yscale = 125;
} 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.25;
hud.quickMessage.alphaTo(0, 1, "easeOutSine", quickMessageTime);
}
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) {
_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) {
_root["music_" + loopID] = new Sound(sound_music);
_root["music_" + loopID].attachSound(soundName);
_root["music_" + loopID].setVolume(0);
_root["music_" + loopID].start(0, loops);
}
}
function playRollOverSound() {
playSound("sound_interface_rollOver");
}
function playClickSound() {
playSound("sound_interface_click");
}
function loadMenu() {
initDialogBoxes();
checkForSaveGame();
loadGameInfo();
loadGame();
playMusicLoop("sound_menuMusic", 1, "menuMusic");
music_menuMusic.volumeTo(100, 3);
_root.attachMovie("menu", "menu", depth_menu);
menu.mainMenu.versionNumber.text = _root.versionNumber;
menu.skirmish._visible = false;
menu.instructions._visible = false;
menu.mapScreen._visible = false;
menu.upgrades._visible = false;
menu.mainMenu._alpha = 0;
menu.mainMenu.alphaTo(100, 0.2, "easeOutSine");
menu.mainMenu.logo._alpha = 0;
menu.mainMenu.logo.colorTo(16777215);
menu.mainMenu.logo.alphaTo(100, 0.2, "easeOutSine");
menu.mainMenu.logo.colorTo(null, 0.8, "easeOutSine");
}
function hideMenu() {
music_menuMusic.volumeTo(0, 5, "easeOutSine", 0, function () {
this.stop();
});
menu.alphaTo(0, 1, "easeOutSine", 2, function () {
removeMovieClip(this);
});
}
function moveMenu() {
music_menuMusic.volumeTo(0, 5, "easeOutSine", 0, function () {
this.stop();
});
menu.alphaTo(0, 1, "easeOutSine", 2, function () {
this._visible = false;
});
}
function mapScreenToMainMenu() {
loadGameInfo();
menu.mapScreen.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
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 loadCampaignSelect() {
playingSkirmish = false;
playingContinue = false;
initBattleStats();
resetCareerStats();
battleNum = 1;
upgradePoints = 0;
retry = false;
resetExperience();
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.teamSelect._alpha = 0;
menu.teamSelect._visible = true;
menu.teamSelect.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function loadSkirmish() {
setupSkirmishMapDefaults();
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
menu.skirmish._alpha = 0;
menu.skirmish._visible = true;
menu.skirmish.alphaTo(100, 0.6, "easeOutSine", 0.8);
}
function skirmishToMainMenu() {
menu.skirmish.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
menu.mainMenu._visible = true;
menu.mainMenu.alphaTo(100, 0.8, "easeOutSine", 0.8);
}
function loadSkirmishEndBattle() {
_root.menu._visible = true;
_root.menu._alpha = 100;
menu.mainMenu.versionNumber.text = _root.versionNumber;
_root.menu.mainMenu._visible = false;
_root.menu.mapScreen._visible = false;
_root.menu.skirmish._visible = true;
_root.menu.skirmish._alpha = 100;
_root.menu.skirmish.alphaTo(100, 0.8, "easeOutSine", 0.5);
}
function loadMapScreen() {
rainSetup = false;
resetDepthVariables();
_root.menu.mapScreen.upgradePointsText.text = upgradePoints;
setupUpgradeInterface(playerTeam.team);
_root.menu.skirmish._visible = false;
_root.menu.instructions._visible = false;
_root.menu.upgrades._visible = false;
if (experienceLevel > 0) {
prevExpLevel = experienceLevel - 1;
xpSoFar = experiencePoints - experienceIntervals[prevExpLevel];
nextXPLevel = experienceIntervals[experienceLevel] - experienceIntervals[prevExpLevel];
xpBarText = ((("" + xpSoFar) + " / ") + nextXPLevel) + " XP";
_root.menu.mapScreen.expBar._xscale = Math.round((xpSoFar / nextXPLevel) * 100);
} else {
xpBarText = ((("" + experiencePoints) + " / ") + experienceIntervals[experienceLevel]) + " XP";
_root.menu.mapScreen.expBar._xscale = Math.round((experiencePoints / experienceIntervals[experienceLevel]) * 100);
}
_root.menu.mapScreen.xpText.htmlText = xpBarText.split("").join("<font size='5'> </font>");
checkForUnlocks();
if (unlocksInQueue) {
displayUnlockDialog();
}
campaignMapSetup(currentMap);
menu.mainMenu.alphaTo(0, 0.8, "easeOutSine", 0, function () {
this._visible = false;
});
_root.menu.mapScreen._visible = true;
_root.menu.mapScreen._alpha = 0;
_root.menu.mapScreen.alphaTo(100, 0.8, "easeOutSine", 0.5);
}
function loadMapScreenEndBattle() {
rainSetup = false;
_root.attachMovie("menu", "menu", depth_menu);
_root.menu.instructions._visible = false;
menu.mainMenu.versionNumber.text = _root.versionNumber;
if (experienceLevel > 0) {
prevExpLevel = experienceLevel - 1;
xpSoFar = experiencePoints - experienceIntervals[prevExpLevel];
nextXPLevel = experienceIntervals[experienceLevel] - experienceIntervals[prevExpLevel];
xpBarText = ((("" + xpSoFar) + " / ") + nextXPLevel) + " XP";
_root.menu.mapScreen.expBar._xscale = Math.round((xpSoFar / nextXPLevel) * 100);
} else {
xpBarText = ((("" + experiencePoints) + " / ") + experienceIntervals[experienceLevel]) + " XP";
_root.menu.mapScreen.expBar._xscale = Math.round((experiencePoints / experienceIntervals[experienceLevel]) * 100);
}
_root.menu.mapScreen.xpText.htmlText = xpBarText.split("").join("<font size='5'> </font>");
checkForUnlocks();
if (unlocksInQueue) {
displayUnlockDialog();
}
saveGame();
_root.menu.mapScreen.upgradePointsText.text = upgradePoints;
_root.menu.upgrades._visible = false;
_root.menu.skirmish._visible = false;
campaignMapSetup(currentMap);
_root.menu.mainMenu._visible = false;
_root.menu.mapScreen._visible = true;
_root.menu.mapScreen._alpha = 100;
_root.menu.mapScreen.alphaTo(100, 0.8, "easeOutSine", 0.5);
}
function loadUpgradeScreen() {
_root.menu.attachMovie("upgrades", "upgrades", depth_menu_upgrades);
_root.menu.upgrades.gotoAndStop(playerTeam.team);
checkUpgrades(playerTeam.team);
_root.menu.upgrades.upgradePointsText.text = upgradePoints;
_root.menu.upgrades._visible = true;
_root.menu.mapScreen.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
_root.menu.upgrades.alphaTo(100, 0.8, "easeOutSine", 0.5);
_root.menu.upgrades.doneButton.onRelease = function () {
saveGame();
backToMapScreen();
};
}
function loadUpgradeScreenInGame() {
_root.attachMovie("blankMovie", "menu", depth_HUD_upgrades);
_root.menu.attachMovie("upgrades", "upgrades", depth_menu_upgrades);
_root.menu.upgrades.gotoAndStop(playerTeam.team);
game.state = "paused";
stopAllSoldiers();
_root.menu.upgrades.backing.alphaTo(60, 1);
checkUpgrades(playerTeam.team);
_root.menu.upgrades.upgradePointsText.text = upgradePoints;
_root.menu.upgrades._visible = true;
_root.menu.upgrades.alphaTo(100, 0.8, "easeOutSine", 0.5);
_root.hud.onRelease = function () {
};
_root.menu.upgrades.doneButton.onRelease = function () {
_root.menu.alphaTo(0, 0.6, "easeOutSine", 0.1, function () {
removeMovieClip(this);
game.state = "unpaused";
startAllSoldiers();
delete _root.hud.onRelease;
});
};
}
function backToMapScreen() {
_root.menu.mapScreen.upgradePointsText.text = upgradePoints;
_root.menu.mapScreen._visible = true;
_root.menu.mapScreen.alphaTo(100, 0.8, "easeOutSine", 0.5);
_root.menu.upgrades.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
}
function showLoadScreen() {
_root.attachMovie("loadScreen", "loadScreen", depth_blackOut);
loadScreen._alpha = 0;
loadScreen.bg.gotoAndStop(playerTeam.team);
loadScreen.battleTitle.autoSize = "center";
loadScreen.hintText.autoSize = "center";
loadScreen.battleHeading.text = currentMap.battleTitle;
loadScreen.hintText.text = "HINT: " + hints[random(hints.length)];
loadScreen.alphaTo(100, 1.8, "easeOutSine", 0, buildGameInterface);
}
function buttonSetup_hudMenuButton(btnName) {
_root.hud[btnName].onRollOver = function () {
playRollOverSound();
_root.hud[btnName].colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
_root.hud[btnName].onRollOut = function () {
_root.hud[btnName].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
};
_root.hud[btnName].onRelease = function () {
playClickSound();
loadInGameMenu();
};
}
function buttonSetup_mainMenu(btnName) {
checkForSaveGame();
_root.menu.mainMenu[btnName].activated = true;
_root.menu.mainMenu[btnName].textClip.btnText.autoSize = "center";
if ((saveGameExists == false) && (btnName == "continueCampaign")) {
_root.menu.mainMenu[btnName].activated = false;
_root.menu.mainMenu[btnName].textClip.colorTo(1973778, 0);
_root.menu.mainMenu[btnName].textClip.btnText.text = "CONTINUE CAMPAIGN";
}
if (_root.menu.mainMenu[btnName].activated == true) {
_root.menu.mainMenu[btnName].onRollOver = function () {
playRollOverSound();
if (this.activated == true) {
this.textClip.colorTo(15461097, 0.4, "easeOutSine");
this.textClip.scaleTo(110, 0.5);
}
};
_root.menu.mainMenu[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[btnName].textClip.btnText.text = "CONTINUE CAMPAIGN";
_root.menu.mainMenu[btnName].onRelease = function () {
showDialogBox(dialog_continueCampaign);
};
break;
case "newCampaign" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "NEW CAMPAIGN";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
if (saveGameExists == true) {
showDialogBox(dialog_startNewCampaign);
} else {
showDialogBox(dialog_newGameSaved);
loadCampaignSelect();
}
};
break;
case "skirmish" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "CUSTOM BATTLE";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
loadSkirmish();
};
break;
case "options" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "OPTIONS";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
loadOptions();
};
break;
case "credits" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "CREDITS";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
loadCredits();
};
break;
case "howToPlay" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "INSTRUCTIONS";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
loadInstructions();
};
break;
case "playMoreGames" :
_root.menu.mainMenu[btnName].textClip.btnText.text = "PLAY MORE GAMES";
_root.menu.mainMenu[btnName].onRelease = function () {
playClickSound();
getURL ("http://armorGames.com", "_blank");
};
break;
}
}
}
function buttonSetup_campaignSelect(btnName) {
if (armorGamesVersion == false) {
_root.menu.teamSelect.german.gotoAndStop("bw");
}
_root.menu.teamSelect[btnName].onRollOver = function () {
playRollOverSound();
if (btnName == "british") {
this.flag.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
this.nameTag.glowTo(5, 5);
}
if ((btnName == "german") && (armorGamesVersion)) {
this.flag.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
this.nameTag.glowTo(5, 5);
}
if ((armorGamesVersion == false) && (btnName == "german")) {
_root.menu.teamSelect.descriptions[btnName + "Desc"].gotoAndStop(2);
}
_root.menu.teamSelect.descriptions[btnName + "Desc"].alphaTo(100, 0.8);
_root.menu.teamSelect.descriptions.generalDesc.alphaTo(0, 0.4);
};
_root.menu.teamSelect[btnName].onRollOut = (_root.menu.teamSelect[btnName].onDragOut = function () {
this.flag.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
this.nameTag.glowTo(0, 0);
_root.menu.teamSelect.descriptions[btnName + "Desc"].alphaTo(0, 0.4);
_root.menu.teamSelect.descriptions.generalDesc.alphaTo(100, 0.8, "easeOutSine", 0.5);
});
_root.menu.teamSelect[btnName].onRelease = function () {
playClickSound();
if (btnName == "british") {
playerTeam.team = "british";
compTeam.team = "german";
_root.menu.teamSelect.alphaTo(0, 0.4, "easeOutSine", 0, function () {
this._visible = false;
});
_root.currentMap = _root[(playerTeam.team + "_map") + battleNum];
loadMapScreen();
} else {
if ((armorGamesVersion == true) && (btnName == "german")) {
playerTeam.team = "german";
compTeam.team = "british";
_root.menu.teamSelect.alphaTo(0, 0.4, "easeOutSine", 0, function () {
this._visible = false;
});
_root.currentMap = _root[(playerTeam.team + "_map") + battleNum];
loadMapScreen();
}
if ((armorGamesVersion == false) && (btnName == "german")) {
getURL ("http://armorgames.com/play/2267/warfare-1917", "_blank");
}
}
};
}
function buttonSetup_mapScreen(btnName) {
_root.menu.mapScreen[btnName].onRollOver = function () {
playRollOverSound();
this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
_root.menu.mapScreen[btnName].onRollOut = (_root.menu.mapScreen[btnName].onDragOut = function () {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
});
_root.menu.mapScreen[btnName].onRelease = function () {
playClickSound();
switch (btnName) {
case "launch" :
hideMenu();
buildMap(currentMap);
showLoadScreen();
saveGame();
return;
case "backToMainButt" :
mapScreenToMainMenu();
return;
case "upgrades" :
loadUpgradeScreen();
return;
}
};
}
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 = "DONE";
_root.menu.options[btnName].onRelease = function () {
playClickSound();
saveGameSettings();
optionsToMainMenu();
};
}
function debugTools() {
if (debugMode == true) {
setupConsole();
hud.attachMovie("fpsChecker", "fpsCheck", depth_HUD_fps);
hud.fpsCheck._x = Stage.width - 5;
hud.fpsCheck._y = 25;
hud.fpsCheck._alpha = 70;
hud.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 cameraSetup() {
if (playerTeam.team == "german") {
world._x = ((-world.bg._width) + Stage.width) + 100;
}
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")) {
Mouse.show();
hud.panArrow._visible = false;
gameCursor._visible = true;
if (((_xmouse <= panBuffer) && (_ymouse <= panInterfaceBlock)) && (world._x <= (-panBuffer))) {
Mouse.hide();
world._x = world._x + panSpeed;
gameCursor._visible = false;
hud.panArrow._xscale = -100;
hud.panArrow._visible = true;
hud.panArrow._x = _xmouse - (hud.panArrow._width / 2);
hud.panArrow._y = _ymouse;
if (_xmouse <= (panBuffer / 3)) {
hud.panArrow._x = 0;
}
}
if (((_xmouse >= (Stage.width - panBuffer)) && (_ymouse <= panInterfaceBlock)) && (world._x > (((-world.bg._width) + Stage.width) + panBuffer))) {
Mouse.hide();
world._x = world._x - panSpeed;
gameCursor._visible = false;
hud.panArrow._xscale = 100;
hud.panArrow._visible = true;
hud.panArrow._x = _xmouse + (hud.panArrow._width / 2);
hud.panArrow._y = _ymouse;
if (_xmouse >= (Stage.width - (panBuffer / 2))) {
hud.panArrow._x = Stage.width;
}
}
}
}
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 createSquad(team, squadType) {
squadNumber++;
if (team == playerTeam.team) {
_root[("career_" + squadType) + "Deployed"]++;
}
adjustStats("unitDeployed", team);
currentSquad = (team + squadType) + squadNumber;
_root[team].currentSquad = new Object();
_root[team].currentSquad.members = new Array();
_root[team].currentSquad.leader = new Object();
_root[team].currentSquad.isVisible = false;
_root[team].currentSquad.ref = currentSquad;
_root[team].currentSquad.team = team;
_root[team].currentSquad.squadID = _root[team + "SquadsOnScreen"].length;
_root[team].currentSquad.type = squadType;
_root[team].currentSquad.name = (team + squadType) + squadNumber;
_root[team].currentSquad.range = _root[team][squadType].range;
_root[team].currentSquad.lastState = "moving";
_root[team].currentSquad.enemyTarget = undefined;
_root[team].currentSquad.targetProx = 999999 /* 0x0F423F */;
_root[team].currentSquad.hit = false;
_root[team].currentSquad.accuracy = _root[team][squadType].accuracy;
_root[team].currentSquad.damage = _root[team][squadType].damage;
_root[team].currentSquad.speed = _root[team][squadType].speed;
_root[team].currentSquad.health = _root[team][squadType].health;
_root[team].currentSquad.minHealth = _root[team][squadType].soldierHealth;
_root[team].currentSquad.totalHealth = 0;
_root[team].currentSquad.morale = _root[team][squadType].morale;
_root[team].currentSquad.nearTrench = false;
_root[team].currentSquad.inTrench = false;
_root[team].currentSquad.passingTrench = false;
_root[team].currentSquad.allMembersInTrench = false;
_root[team].currentSquad.trenchRef = null;
_root[team].currentSquad.trenchSlotRef = null;
_root[team].currentSquad.inWire = false;
_root[team].currentSquad.nearGas = false;
_root[team].currentSquad.gasMasksOn = false;
_root[team].currentSquad.allMasksOn = false;
_root[team].currentSquad.allMasksOff = false;
_root[team].currentSquad.nearOfficer = false;
_root[team].currentSquad.officerRef = null;
if (squadType == "tank") {
_root[team].currentSquad.state = "tankMoving";
if (team == playerTeam.team) {
playerMorale = playerMorale + moraleCost.tankBonus;
} else if (team == compTeam.team) {
compMorale = compMorale + moraleCost.tankBonus;
}
} else {
_root[team].currentSquad.state = "moving";
}
if (squadType == "officer") {
_root[team + "Officers"].push(_root[team].currentSquad);
if (team == playerTeam.team) {
playerMorale = playerMorale + moraleCost.officerBonus;
} else if (team == compTeam.team) {
compMorale = compMorale + moraleCost.officerBonus;
}
}
for (unitAdd in _root[team][squadType].units) {
setTimeout(createSoldier, 300 * unitAdd, _root[team][squadType].units[unitAdd], team, squadType);
}
_root[team + "SquadsOnScreen"].push(_root[team].currentSquad);
}
function decorateSoldier(team, soldierRef, soldierType) {
soldierRef.helmet.gotoAndStop((team + "_") + soldierType);
soldierRef.torso.gotoAndStop((team + "_") + soldierType);
soldierRef.front_upperArm.gotoAndStop((team + "_") + soldierType);
soldierRef.front_lowerArm.gotoAndStop((team + "_") + soldierType);
soldierRef.front_upperLeg.gotoAndStop((team + "_") + soldierType);
soldierRef.front_lowerLeg.gotoAndStop((team + "_") + soldierType);
soldierRef.back_upperArm.gotoAndStop((team + "_") + soldierType);
soldierRef.back_lowerArm.gotoAndStop((team + "_") + soldierType);
soldierRef.back_upperLeg.gotoAndStop((team + "_") + soldierType);
soldierRef.back_lowerLeg.gotoAndStop((team + "_") + soldierType);
}
function createSoldier(soldierType, team, squadType) {
soldierNumber++;
if (squadType != "tank") {
world.attachMovie("soldier", "soldier" + soldierNumber, soldierNumber + _root.depth_world_soldiers);
} else {
world.attachMovie("tank", "soldier" + soldierNumber, soldierNumber + _root.depth_world_soldiers);
world["soldier" + soldierNumber].gotoAndStop(team);
}
world["soldier" + soldierNumber]._visible = true;
world["soldier" + soldierNumber]._xscale = (world["soldier" + soldierNumber]._yscale = random(7) + 105);
world["soldier" + soldierNumber].cacheAsBitmap = false;
world["soldier" + soldierNumber].squadRef = _root[team].currentSquad.name;
world["soldier" + soldierNumber].squadObjRef = _root[team].currentSquad;
world["soldier" + soldierNumber].unitID = v;
world["soldier" + soldierNumber].team = team;
_root[team].currentSquad.totalHealth = _root[team].currentSquad.totalHealth + _root[team][squadType].soldierHealth;
world["soldier" + soldierNumber].health = _root[team].currentSquad.totalHealth;
world["soldier" + soldierNumber].alive = true;
world["soldier" + soldierNumber].ref = world["soldier" + soldierNumber];
world["soldier" + soldierNumber].leader = false;
world["soldier" + soldierNumber].name = "soldier" + soldierNumber;
world["soldier" + soldierNumber].type = soldierType;
world["soldier" + soldierNumber].squadType = squadType;
world["soldier" + soldierNumber].position = "standing";
world["soldier" + soldierNumber].inPosition = false;
world["soldier" + soldierNumber].wayPoint = null;
world["soldier" + soldierNumber].wayPointSet = false;
world["soldier" + soldierNumber].wayPointReached = false;
world["soldier" + soldierNumber].changingPosition = false;
world["soldier" + soldierNumber].inMovingPosition = true;
world["soldier" + soldierNumber].animating = true;
world["soldier" + soldierNumber].moveAnim = true;
world["soldier" + soldierNumber].weaponType = "rifle";
world["soldier" + soldierNumber].mainWeapon = _root[team][soldierType].mainWeapon;
world["soldier" + soldierNumber].secondaryWeapon = _root[team][soldierType].secondaryWeapon;
world["soldier" + soldierNumber].damage = _root[team][soldierType].damage;
world["soldier" + soldierNumber].firePose = _root[team][soldierType].firePose;
world["soldier" + soldierNumber].maxAmmo = _root[team][squadType].maxAmmo;
world["soldier" + soldierNumber].ammo = world["soldier" + soldierNumber].maxAmmo;
world["soldier" + soldierNumber].firing = false;
world["soldier" + soldierNumber].startFiring = false;
world["soldier" + soldierNumber].squadState.text = "";
world["soldier" + soldierNumber].firingSecondary = false;
world["soldier" + soldierNumber].throwingGrenade = false;
world["soldier" + soldierNumber].changingPosition = false;
world["soldier" + soldierNumber].changingToMove = false;
world["soldier" + soldierNumber].changingToFire = false;
world["soldier" + soldierNumber].changingToEntrench = false;
world["soldier" + soldierNumber].inFiringPosition = false;
world["soldier" + soldierNumber].puttingOnMask = false;
world["soldier" + soldierNumber].takingOffMask = false;
world["soldier" + soldierNumber].gasMaskOn = false;
world["soldier" + soldierNumber].gasMaskOff = false;
world["soldier" + soldierNumber].directionCountMax = 100;
world["soldier" + soldierNumber].directionCount = world["soldier" + soldierNumber].directionCountMax - random(world["soldier" + soldierNumber].directionCountMax);
world["soldier" + soldierNumber].movingUp = false;
world["soldier" + soldierNumber].movingDown = false;
world["soldier" + soldierNumber].burstCounter = 1;
world["soldier" + soldierNumber].waitCounter = 0;
world["soldier" + soldierNumber].mgBurstCounter = 0;
world["soldier" + soldierNumber].mgWaitCounter = 0;
world["soldier" + soldierNumber].endBattleAnim = false;
world["soldier" + soldierNumber].trenchWayPoint = null;
world["soldier" + soldierNumber].trenchWayPointSet = false;
world["soldier" + soldierNumber].trenchWayPointReached = false;
world["soldier" + soldierNumber].inTrench = false;
world["soldier" + soldierNumber].inTrenchPosition = false;
world["soldier" + soldierNumber].enteringTrench = false;
world["soldier" + soldierNumber].exitingTrench = false;
world["soldier" + soldierNumber].exitedTrench = false;
world["soldier" + soldierNumber]._y = world.ground + random(110);
if (squadType == "tank") {
world["soldier" + soldierNumber]._y = 230 + (random(80) - 40);
world["soldier" + soldierNumber].tag.tagNumber.text = "C" + (random(40) + 10);
}
world["soldier" + soldierNumber].depth = world["soldier" + soldierNumber]._y;
world["soldier" + soldierNumber].ground = world["soldier" + soldierNumber]._y;
_root[team].currentSquad.members.push(world["soldier" + soldierNumber]);
if (team == british.name) {
world["soldier" + soldierNumber]._x = british.spawnPoint;
} else if (team == german.name) {
world["soldier" + soldierNumber]._x = german.spawnPoint;
world["soldier" + soldierNumber]._xscale = -100;
}
if (squadType != "officer") {
world["soldier" + soldierNumber].officerStar._visible = false;
}
if ((squadType == "officer") && (team == "german")) {
world["soldier" + soldierNumber].officerStar.gotoAndStop("german_officer");
}
if (squadType != "tank") {
world["soldier" + soldierNumber].gotoAndPlay(20 + random(15));
world["soldier" + soldierNumber].weapon.gotoAndStop(world["soldier" + soldierNumber].mainWeapon);
decorateSoldier(team, world["soldier" + soldierNumber], soldierType);
}
soldierRollOvers(world["soldier" + soldierNumber]);
}
function squadAI(teamName) {
for (s in _root[teamName + "SquadsOnScreen"]) {
var _local6 = _root[teamName + "SquadsOnScreen"][s].members[0];
squadLocalX = _root[teamName + "SquadsOnScreen"][s].members[0]._x;
squadLocalPoint = new Object();
squadLocalPoint.x = squadLocalX;
squadLocalPoint.y = squadLocalX;
world.localToGlobal(squadLocalPoint);
squadGlobalX = squadLocalPoint.x;
if ((squadGlobalX > -100) && (squadGlobalX < 900)) {
for (v in _root[teamName + "SquadsOnScreen"][s].members) {
_root[teamName + "SquadsOnScreen"][s].members[v]._visible = true;
}
} else {
for (v in _root[teamName + "SquadsOnScreen"][s].members) {
_root[teamName + "SquadsOnScreen"][s].members[v]._visible = false;
}
}
if (teamName == german.name) {
_root[teamName + "SquadsOnScreen"][s].members[0].debug._xscale = -100;
}
_root[teamName + "SquadsOnScreen"][s].members[0].debug.squadName.text = _root[teamName + "SquadsOnScreen"][s].name;
_root[teamName + "SquadsOnScreen"][s].members[0].debug.squadState.text = _root[teamName + "SquadsOnScreen"][s].state;
_root[teamName + "SquadsOnScreen"][s].members[0].debug.soldierPosition.text = _root[teamName + "SquadsOnScreen"][s].members[0].position;
_root[teamName + "SquadsOnScreen"][s].members[0].debug.changePosition.text = _root[teamName + "SquadsOnScreen"][s].members[0].changingPosition;
_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar._xscale = Math.round((_root[teamName + "SquadsOnScreen"][s].members.length / (_root[teamName + "SquadsOnScreen"][s].totalHealth / _root[teamName + "SquadsOnScreen"][s].minHealth)) * 100);
if (_root[teamName + "SquadsOnScreen"][s].type == "tank") {
_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar._xscale = Math.round((_root[teamName + "SquadsOnScreen"][s].health / _root[teamName + "SquadsOnScreen"][s].totalHealth) * 100);
_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.healthNumber.text = _root[teamName + "SquadsOnScreen"][s].health;
}
if (_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar._xscale < 60) {
_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar.colorTo(16763904, 0.4);
}
if (_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar._xscale < 30) {
_root[teamName + "SquadsOnScreen"][s].members[0].healthBar.bar.colorTo(10027008, 0.4);
}
if (_local6.inTrench) {
_local6.officerStar._x = 32;
_local6.officerStar._y = -26;
} else {
_local6.officerStar._x = 0;
_local6.officerStar._y = -48;
}
if (game.state != "endBattle") {
findEnemy(british.name, german.name);
findEnemy(german.name, british.name);
findTrenches(british.name);
findTrenches(german.name);
}
switch (_root[teamName + "SquadsOnScreen"][s].state) {
case "moving" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
movingSoldierRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (movingSoldierRef.cacheAsBitmap == true) {
movingSoldierRef.cacheAsBitmap = false;
}
_root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name] = _root[teamName + "SquadsOnScreen"][s].members[m];
movingSoldierRef.firing = false;
movingSoldierRef.inFiringPosition = false;
movingSoldierRef.inTrench = false;
movingSoldierRef.wayPoint = null;
movingSoldierRef.trenchWayPoint = null;
movingSoldierRef.wayPointSet = false;
movingSoldierRef.wayPointReached = false;
movingSoldierRef.trenchWayPointSet = false;
movingSoldierRef.trenchWayPointReached = false;
movingSoldierRef.directionCount--;
if (movingSoldierRef.directionCount < 0) {
movingSoldierRef.directionCount = movingSoldierRef.directionCountMax;
var _local4 = random(10);
if (_local4 == 0) {
movingSoldierRef.movingUp = true;
}
if (_local4 == 1) {
movingSoldierRef.movingDown = true;
}
if (_local4 > 1) {
movingSoldierRef.movingUp = false;
movingSoldierRef.movingDown = false;
}
}
if ((movingSoldierRef.alive == true) && (game.state != "endBattle")) {
if ((movingSoldierRef.changingToMove == false) && (movingSoldierRef.inMovingPosition == false)) {
movingSoldierRef.changingToMove = true;
setTimeout(soldierMovements, random(400) + 100, _root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name].position + "ToStand", _root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name]);
}
if (((movingSoldierRef.changingToMove == false) && (movingSoldierRef.inMovingPosition == true)) && (movingSoldierRef.alive == true)) {
if ((movingSoldierRef.moveAnim == false) && (movingSoldierRef.alive == true)) {
movingSoldierRef.moveAnim = true;
playVoice("advance", teamName);
soldierMovements("run", movingSoldierRef);
}
if ((teamName == british.name) && (movingSoldierRef.alive == true)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
movingSoldierRef._x = movingSoldierRef._x + (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
movingSoldierRef._x = movingSoldierRef._x + _root[teamName + "SquadsOnScreen"][s].speed;
}
if (movingSoldierRef.movingUp && (movingSoldierRef._y > world.ground)) {
movingSoldierRef._y = movingSoldierRef._y - (_root[teamName + "SquadsOnScreen"][s].speed / 6);
}
if (movingSoldierRef.movingDown && (movingSoldierRef._y < (world.ground + 100))) {
movingSoldierRef._y = movingSoldierRef._y + (_root[teamName + "SquadsOnScreen"][s].speed / 6);
}
if (movingSoldierRef._x > (world.bg._width - conquerWinArea)) {
endBattle("british", "conquer");
}
}
if ((teamName == german.name) && (movingSoldierRef.alive == true)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
movingSoldierRef._x = movingSoldierRef._x - (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
movingSoldierRef._x = movingSoldierRef._x - _root[teamName + "SquadsOnScreen"][s].speed;
}
if (movingSoldierRef.movingUp && (movingSoldierRef._y > world.ground)) {
movingSoldierRef._y = movingSoldierRef._y - (_root[teamName + "SquadsOnScreen"][s].speed / 6);
}
if (movingSoldierRef.movingDown && (movingSoldierRef._y < (world.ground + 100))) {
movingSoldierRef._y = movingSoldierRef._y + (_root[teamName + "SquadsOnScreen"][s].speed / 6);
}
if (movingSoldierRef._x < conquerWinArea) {
endBattle("german", "conquer");
}
}
}
}
}
break;
case "engaging" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
_root["soldierRef" + m] = _root[teamName + "SquadsOnScreen"][s].members[m];
soldierRef = _root[teamName + "SquadsOnScreen"][s].members[m];
squadRef = _root[teamName + "SquadsOnScreen"][s];
if (soldierRef.cacheAsBitmap == true) {
soldierRef.cacheAsBitmap = false;
}
if (soldierRef.alive == true) {
if (soldierRef.wayPointSet == false) {
if (teamName == british.name) {
if (squadRef.nearTrench == false) {
if (soldierRef._x > -50) {
if ((soldierRef.moveAnim == false) && (soldierRef.alive == true)) {
soldierRef.moveAnim = true;
soldierMovements("run", movingSoldierRef);
}
soldierRef.wayPoint = soldierRef._x + random(50);
soldierRef.wayPointSet = true;
} else {
if ((soldierRef.moveAnim == false) && (soldierRef.alive == true)) {
soldierRef.moveAnim = true;
soldierMovements("run", movingSoldierRef);
}
soldierRef.wayPoint = 100 + random(50);
soldierRef.wayPointSet = true;
}
} else {
soldierRef.wayPoint = soldierRef._x + 1;
soldierRef.wayPointSet = true;
}
}
if (teamName == german.name) {
if (squadRef.nearTrench == false) {
if (soldierRef._x < world.bg._width) {
if ((soldierRef.moveAnim == false) && (soldierRef.alive == true)) {
soldierRef.moveAnim = true;
soldierMovements("run", movingSoldierRef);
}
soldierRef.wayPoint = soldierRef._x - random(50);
soldierRef.wayPointSet = true;
} else {
if ((soldierRef.moveAnim == false) && (soldierRef.alive == true)) {
soldierRef.moveAnim = true;
soldierMovements("run", movingSoldierRef);
}
soldierRef.wayPoint = (world.bg._width - 100) - random(50);
soldierRef.wayPointSet = true;
}
} else {
soldierRef.wayPoint = soldierRef._x - 1;
soldierRef.wayPointSet = true;
}
}
}
if ((teamName == british.name) && (soldierRef._x < soldierRef.wayPoint)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
soldierRef._x = soldierRef._x + (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
soldierRef._x = soldierRef._x + _root[teamName + "SquadsOnScreen"][s].speed;
}
}
if ((teamName == british.name) && (soldierRef._x >= soldierRef.wayPoint)) {
soldierRef.wayPointReached = true;
}
if ((teamName == german.name) && (soldierRef._x > soldierRef.wayPoint)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
soldierRef._x = soldierRef._x - (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
soldierRef._x = soldierRef._x - _root[teamName + "SquadsOnScreen"][s].speed;
}
}
if ((teamName == german.name) && (soldierRef._x <= soldierRef.wayPoint)) {
soldierRef.wayPointReached = true;
}
if ((((soldierRef.wayPointReached == true) && (soldierRef.inFiringPosition == false)) && (soldierRef.changingToFire == false)) && (soldierRef.alive == true)) {
soldierRef.changingToFire = true;
soldierRef.inMovingPosition = false;
soldierRef.moveAnim = false;
soldierRef.gotoAndStop("stop_idle");
var _local5 = random(3) + 1;
if (soldierRef.type == "lieutenant") {
_local5 = 1;
}
if (soldierRef.type == "machineGunner") {
_local5 = random(2) + 2;
}
if (_local5 == 1) {
setTimeout(soldierMovements, random(400) + 100, "stand", _root["soldierRef" + m]);
} else if (_local5 == 2) {
setTimeout(soldierMovements, random(400) + 100, "crouch", _root["soldierRef" + m]);
} else if (_local5 == 3) {
setTimeout(soldierMovements, random(400) + 100, "prone", _root["soldierRef" + m]);
}
}
if (game.state != "endBattle") {
if (((squadRef.enemyTarget.members[0].alive == undefined) && (squadRef.inTrench == false)) || (((squadRef.enemyTarget.type == "tank") && (squadRef.enemyTarget.members[0].alive == false)) && (squadRef.inTrench == false))) {
squadRef.state = "moving";
}
}
if ((((squadRef.enemyTarget.members[0].alive != undefined) && (soldierRef.inFiringPosition == true)) && (soldierRef.firing == false)) && (soldierRef.alive == true)) {
soldierRef.inMovingPosition = false;
if (((soldierRef.throwingGrenade == false) && (squadRef.type == "assault")) && (squadRef.enemyTarget.type == "tank")) {
if (random(2) == 0) {
soldierRef.throwingGrenade = true;
soldierRef.gotoAndPlay("standing_throwGrenade");
}
}
if (soldierRef.type == "machineGunner") {
if (soldierRef.burstCounter <= (random(8) + 8)) {
soldierRef.burstCounter++;
playSound((("sound_" + _root[teamName][soldierRef.type].mainWeapon) + "_fire") + (random(2) + 1));
soldierRef.gotoAndPlay((_root[teamName][soldierRef.type].firePose + "_fire_") + soldierRef.position);
if (teamName == british.name) {
hitEnemy(british.name, german.name, soldierRef, squadRef);
} else {
hitEnemy(german.name, british.name, soldierRef, squadRef);
}
} else {
soldierRef.waitCounter++;
}
if (soldierRef.waitCounter >= (random(30) + 15)) {
soldierRef.waitCounter = 0;
soldierRef.burstCounter = 0;
}
} else if (soldierRef.throwingGrenade == false) {
playVoice("attack", teamName);
playSound((("sound_" + _root[teamName][soldierRef.type].mainWeapon) + "_fire") + (random(2) + 1));
soldierRef.gotoAndPlay((_root[teamName][soldierRef.type].firePose + "_fire_") + soldierRef.position);
if (teamName == british.name) {
hitEnemy(british.name, german.name, soldierRef, squadRef);
} else {
hitEnemy(german.name, british.name, soldierRef, squadRef);
}
}
}
}
}
break;
case "assaultTrench" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
soldierRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (soldierRef.cacheAsBitmap == true) {
soldierRef.cacheAsBitmap = false;
}
_root["soldierRef" + m] = _root[teamName + "SquadsOnScreen"][s].members[m];
squadRef = _root[teamName + "SquadsOnScreen"][s];
if (soldierRef.alive == true) {
if (soldierRef.wayPointSet == false) {
if (teamName == british.name) {
soldierRef.wayPoint = (squadRef.enemyTarget.trenchRef._x - 150) - random(60);
soldierRef.wayPointSet = true;
}
if (teamName == german.name) {
soldierRef.wayPoint = (squadRef.enemyTarget.trenchRef._x + 150) + random(60);
soldierRef.wayPointSet = true;
}
}
if ((teamName == british.name) && (soldierRef._x <= soldierRef.wayPoint)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
soldierRef._x = soldierRef._x + (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
soldierRef._x = soldierRef._x + _root[teamName + "SquadsOnScreen"][s].speed;
}
} else if ((teamName == british.name) && (soldierRef._x >= soldierRef.wayPoint)) {
soldierRef.wayPointReached = true;
}
if ((teamName == german.name) && (soldierRef._x >= soldierRef.wayPoint)) {
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
soldierRef._x = soldierRef._x - (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
soldierRef._x = soldierRef._x - _root[teamName + "SquadsOnScreen"][s].speed;
}
} else if ((teamName == german.name) && (soldierRef._x <= soldierRef.wayPoint)) {
soldierRef.wayPointReached = true;
}
if ((((soldierRef.wayPointReached == true) && (soldierRef.inFiringPosition == false)) && (soldierRef.changingToFire == false)) && (soldierRef.alive == true)) {
soldierRef.changingToFire = true;
soldierRef.inMovingPosition = false;
soldierRef.moveAnim = false;
soldierRef.gotoAndStop("stop_idle");
var _local5 = random(2) + 1;
if (_local5 == 1) {
setTimeout(soldierMovements, random(400) + 100, "crouch", _root["soldierRef" + m]);
} else if (_local5 == 2) {
setTimeout(soldierMovements, random(400) + 100, "stand", _root["soldierRef" + m]);
}
}
if (game.state != "endBattle") {
if (((squadRef.enemyTarget.members[0].alive == undefined) && (squadRef.inTrench == false)) || (((squadRef.enemyTarget.type == "tank") && (squadRef.enemyTarget.members[0].alive == false)) && (squadRef.inTrench == false))) {
squadRef.state = "moving";
}
}
if ((((squadRef.enemyTarget.members[0].alive != undefined) && (soldierRef.inFiringPosition == true)) && (soldierRef.firing == false)) && (soldierRef.alive == true)) {
soldierRef.inMovingPosition = false;
if ((soldierRef.throwingGrenade == false) && (squadRef.type == "assault")) {
if (random(6) == 0) {
soldierRef.throwingGrenade = true;
soldierRef.gotoAndPlay("standing_throwGrenade");
}
}
if (soldierRef.throwingGrenade == false) {
playSound((("sound_" + _root[teamName][soldierRef.type].mainWeapon) + "_fire") + (random(2) + 1));
soldierRef.gotoAndPlay((_root[teamName][soldierRef.type].firePose + "_fire_") + soldierRef.position);
if (teamName == british.name) {
hitEnemy(british.name, german.name, soldierRef, squadRef);
} else {
hitEnemy(german.name, british.name, soldierRef, squadRef);
}
}
}
}
}
break;
case "stopped" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
_root[teamName + "SquadsOnScreen"][s].members[m].gotoAndStop(1);
}
break;
case "entrench" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
entrenchedSoldier = _root[teamName + "SquadsOnScreen"][s].members[m];
if (entrenchedSoldier.cacheAsBitmap == true) {
entrenchedSoldier.cacheAsBitmap = false;
}
entrenchedSquad = _root[teamName + "SquadsOnScreen"][s];
if (entrenchedSoldier.alive == true) {
if (entrenchedSoldier.trenchWayPointSet == false) {
if (teamName == "british") {
entrenchedSoldier.trenchWayPoint = (entrenchedSquad.trenchRef._x - (entrenchedSquad.trenchRef._width / 2)) + (random(15) + 37);
entrenchedSoldier.trenchWayPointSet = true;
}
if (teamName == "german") {
entrenchedSoldier.trenchWayPoint = (entrenchedSquad.trenchRef._x + (entrenchedSquad.trenchRef._width / 2)) - (random(15) + 32);
entrenchedSoldier.trenchWayPointSet = true;
}
}
if ((teamName == "british") && (entrenchedSoldier._x < entrenchedSoldier.trenchWayPoint)) {
if (((entrenchedSoldier.moveAnim == false) && (entrenchedSoldier.alive == true)) && (entrenchedSoldier.enteringTrench == false)) {
entrenchedSoldier.changingToMove = false;
entrenchedSoldier.changingToFire = false;
entrenchedSoldier.moveAnim = true;
soldierMovements("run", entrenchedSoldier);
}
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
entrenchedSoldier._x = entrenchedSoldier._x + (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
entrenchedSoldier._x = entrenchedSoldier._x + _root[teamName + "SquadsOnScreen"][s].speed;
}
}
if ((teamName == "british") && (entrenchedSoldier._x >= entrenchedSoldier.trenchWayPoint)) {
entrenchedSoldier.trenchWayPointReached = true;
entrenchedSoldier.inTrenchPosition = true;
entrenchedSoldier.trenchWayPoint = null;
}
if ((teamName == "german") && (entrenchedSoldier._x > entrenchedSoldier.trenchWayPoint)) {
if (((entrenchedSoldier.moveAnim == false) && (entrenchedSoldier.alive == true)) && (entrenchedSoldier.enteringTrench == false)) {
entrenchedSoldier.changingToMove = false;
entrenchedSoldier.changingToFire = false;
entrenchedSoldier.moveAnim = true;
soldierMovements("run", entrenchedSoldier);
}
if (_root[teamName + "SquadsOnScreen"][s].inWire == true) {
entrenchedSoldier._x = entrenchedSoldier._x - (_root[teamName + "SquadsOnScreen"][s].speed / wireSpeedMod);
} else {
entrenchedSoldier._x = entrenchedSoldier._x - _root[teamName + "SquadsOnScreen"][s].speed;
}
}
if ((teamName == "german") && (entrenchedSoldier._x <= entrenchedSoldier.trenchWayPoint)) {
entrenchedSoldier.trenchWayPointReached = true;
entrenchedSoldier.inTrenchPosition = true;
entrenchedSoldier.trenchWayPoint = null;
}
if (((((entrenchedSoldier.alive == true) && (entrenchedSoldier.trenchWayPointReached == true)) && (entrenchedSoldier.inTrenchPosition == true)) && (entrenchedSoldier.inTrench == false)) && (entrenchedSoldier.enteringTrench == false)) {
entrenchedSoldier.enteringTrench = true;
if (entrenchedSoldier.type != "lieutenant") {
entrenchedSoldier.gotoAndPlay("enterTrench");
} else {
entrenchedSoldier.gotoAndPlay("enterTrench_officer");
}
}
if (entrenchedSoldier.inTrench) {
entrenchedSquad.trenchRef.ownerTeam = teamName;
}
if (entrenchedSquad.passingTrench == true) {
entrenchedSquad.allMembersInTrench = true;
for (m in entrenchedSquad.members) {
if (entrenchedSquad.members[m].inTrench == false) {
entrenchedSquad.allMembersInTrench = false;
}
}
if (entrenchedSquad.allMembersInTrench == true) {
entrenchedSquad.state = "exitTrench";
entrenchedSquad.passingTrench = false;
}
} else {
entrenchedSquad.allMembersInTrench = true;
for (m in entrenchedSquad.members) {
if (entrenchedSquad.members[m].inTrench == false) {
entrenchedSquad.allMembersInTrench = false;
}
}
}
if ((((entrenchedSquad.enemyTarget.members[0].alive != undefined) && (entrenchedSoldier.inTrench == true)) && (entrenchedSquad.enemyTarget.members[0].alive != undefined)) && (entrenchedSoldier.firing == false)) {
setTimeout(startFiringDelay, random(3000) + 500, entrenchedSoldier);
entrenchedSoldier.cacheAsBitmap = true;
if (entrenchedSoldier.startFiring == true) {
if (entrenchedSoldier.type == "machineGunner") {
if (entrenchedSoldier.burstCounter <= (random(8) + 8)) {
entrenchedSoldier.cacheAsBitmap = false;
entrenchedSoldier.burstCounter++;
playSound((("sound_" + _root[teamName][entrenchedSoldier.type].mainWeapon) + "_fire") + (random(2) + 1));
entrenchedSoldier.gotoAndPlay(_root[teamName][entrenchedSoldier.type].firePose + "_fire_trench");
if (teamName == british.name) {
hitEnemy(british.name, german.name, entrenchedSoldier, entrenchedSquad);
} else {
hitEnemy(german.name, british.name, entrenchedSoldier, entrenchedSquad);
}
} else {
entrenchedSoldier.waitCounter++;
}
if (entrenchedSoldier.waitCounter >= (random(30) + 15)) {
entrenchedSoldier.waitCounter = 0;
entrenchedSoldier.burstCounter = 0;
}
} else {
entrenchedSoldier.cacheAsBitmap = false;
playSound((("sound_" + _root[teamName][entrenchedSoldier.type].mainWeapon) + "_fire") + (random(2) + 1));
entrenchedSoldier.gotoAndPlay(_root[teamName][entrenchedSoldier.type].firePose + "_fire_trench");
if (teamName == british.name) {
hitEnemy(british.name, german.name, entrenchedSoldier, entrenchedSquad);
} else {
hitEnemy(german.name, british.name, entrenchedSoldier, entrenchedSquad);
}
}
}
}
}
}
break;
case "exitTrench" :
_root[teamName + "SquadsOnScreen"][s].enemyTarget = undefined;
if (teamName != playerTeam.team) {
_root[teamName + "SquadsOnScreen"][s].trenchRef["slot" + _root[teamName + "SquadsOnScreen"][s].trenchSlotRef] = "empty";
}
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (memberRef.cacheAsBitmap == true) {
memberRef.cacheAsBitmap = false;
}
if (memberRef.exitingTrench == false) {
memberRef.exitingTrench = true;
memberRef.gotoAndPlay("exitTrench");
playVoice("advance", teamName);
}
if (memberRef.exitedTrench == true) {
memberRef.exitedTrench = false;
if (teamName == "british") {
memberRef._x = memberRef._x + 60;
} else {
memberRef._x = memberRef._x - 60;
}
memberRef.gotoAndPlay("rifle_run");
memberRef.trenchWayPointReached = false;
memberRef.trenchWayPointSet = false;
memberRef.trenchWayPoint = null;
memberRef.inTrenchPosition = false;
memberRef.enteringTrench = false;
memberRef.firing = false;
memberRef.inTrench = false;
memberRef.squadObjRef.trenchRef = null;
memberRef.squadObjRef.trenchNumRef = null;
memberRef.squadObjRef.trenchSlotRef = null;
memberRef.squadObjRef.state = "moving";
memberRef.squadObjRef.inTrench = false;
memberRef.squadObjRef.nearTrench = false;
memberRef.squadObjRef.allMembersInTrench = false;
memberRef.exitingTrench = false;
memberRef.inFiringPosition = false;
memberRef.moveAnim = false;
}
memberRef = null;
}
break;
case "gasMasksOn" :
_root[teamName + "SquadsOnScreen"][s].allMasksOn = true;
_root[teamName + "SquadsOnScreen"][s].gasMasksOn = true;
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
memberRef.cacheAsBitmap = false;
if ((memberRef.gasMaskOn == false) && (memberRef.puttingOnMask == false)) {
memberRef.puttingOnMask = true;
memberRef.moveAnim = false;
memberRef.firing = false;
memberRef.gotoAndPlay("gasMaskOn_standing");
}
if (memberRef.gasMaskOn == false) {
_root[teamName + "SquadsOnScreen"][s].allMasksOn = false;
}
}
if (_root[teamName + "SquadsOnScreen"][s].allMasksOn == true) {
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
memberRef.puttingOnMask = false;
}
_root[teamName + "SquadsOnScreen"][s].state = _root[teamName + "SquadsOnScreen"][s].lastState;
}
break;
case "gasMasksOff" :
_root[teamName + "SquadsOnScreen"][s].allMasksOff = true;
_root[teamName + "SquadsOnScreen"][s].gasMasksOn = false;
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
memberRef.cacheAsBitmap = false;
if ((memberRef.gasMaskOff == false) && (memberRef.takingOffMask == false)) {
memberRef.takingOffMask = true;
memberRef.moveAnim = false;
memberRef.firing = false;
memberRef.gotoAndPlay("gasMaskOff_standing");
}
if (memberRef.gasMaskOff == false) {
_root[teamName + "SquadsOnScreen"][s].allMasksOff = false;
}
}
if (_root[teamName + "SquadsOnScreen"][s].allMasksOff == true) {
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
memberRef.takingOffMask = false;
}
_root[teamName + "SquadsOnScreen"][s].state = _root[teamName + "SquadsOnScreen"][s].lastState;
if ((_root[teamName + "SquadsOnScreen"][s].lastState = "gasMasksOn")) {
if (_root[teamName + "SquadsOnScreen"][s].members[0].position == "trench") {
_root[teamName + "SquadsOnScreen"][s].state = "entrench";
} else {
_root[teamName + "SquadsOnScreen"][s].state = "moving";
}
}
}
break;
case "tankMoving" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
movingTankRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (movingTankRef.alive == true) {
if (movingTankRef.engineSoundPlaying != true) {
movingTankRef.engineSoundPlaying = true;
playSoundLoop("sound_tankMoving", 9999, movingTankRef.name);
}
if ((teamName == british.name) && (movingTankRef.alive == true)) {
movingTankRef._x = movingTankRef._x + _root[teamName + "SquadsOnScreen"][s].speed;
if (movingTankRef._x >= (world.bg._width - conquerWinArea)) {
endBattle("british", "conquer");
}
}
if ((teamName == german.name) && (movingTankRef.alive == true)) {
movingTankRef._x = movingTankRef._x - _root[teamName + "SquadsOnScreen"][s].speed;
if (movingTankRef._x <= conquerWinArea) {
endBattle("german", "conquer");
}
}
}
}
break;
case "tankDead" :
break;
case "tankEngaging" :
tankSquadRef = _root[teamName + "SquadsOnScreen"][s];
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
tankRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if ((((teamName == british.name) && (tankRef.alive == true)) && (tankSquadRef.enemyTarget.type != "tank")) && (tankRef._x <= (tankSquadRef.enemyTarget.members[0]._x - 50))) {
tankRef._x = tankRef._x + (_root[teamName + "SquadsOnScreen"][s].speed / 2);
if (tankRef._x >= (world.bg._width - conquerWinArea)) {
endBattle("british", "conquer");
}
}
if ((((teamName == german.name) && (tankRef.alive == true)) && (tankSquadRef.enemyTarget.type != "tank")) && (tankRef._x >= (tankSquadRef.enemyTarget.members[0]._x + 50))) {
tankRef._x = tankRef._x - (_root[teamName + "SquadsOnScreen"][s].speed / 2);
if (tankRef._x <= conquerWinArea) {
endBattle("german", "conquer");
}
}
tankRef.mainGun.disabled = false;
tankRef.secondGun.disabled = false;
if ((((((tankSquadRef.enemyTarget.members[0].alive != undefined) && (tankRef.alive == true)) && (tankRef.mainGun.disabled == false)) && (tankRef.burstCounter < 1)) && (tankRef.firing == false)) && (_root[teamName + "SquadsOnScreen"][s].enemyTarget != undefined)) {
tankRef.burstCounter++;
tankRef.mainGun.gotoAndPlay("firing");
tankRound((_root[teamName + "SquadsOnScreen"][s].enemyTarget.members[0]._x + random(200)) - 100, (_root[teamName + "SquadsOnScreen"][s].enemyTarget.members[0]._y + random(50)) - 25, teamName);
playSound("sound_tankMainGunFire");
} else {
tankRef.waitCounter++;
}
if (tankRef.waitCounter >= (random(20) + 10)) {
tankRef.waitCounter = 0;
tankRef.burstCounter = 0;
}
if (((((tankRef.alive == true) && (tankRef.secondGun.disabled == false)) && (tankRef.mgBurstCounter <= (random(5) + 3))) && (tankRef.firingSecondary == false)) && (_root[teamName + "SquadsOnScreen"][s].enemyTarget != undefined)) {
tankRef.mgBurstCounter++;
tankRef.secondGun.gotoAndPlay("firing");
tankRef.tracer.play();
playSound("sound_lewis_fire" + (random(2) + 1));
if (teamName == british.name) {
hitEnemy(british.name, german.name, tankRef, tankSquadRef);
} else {
hitEnemy(german.name, british.name, tankRef, tankSquadRef);
}
} else {
tankRef.mgWaitCounter++;
}
if (tankRef.mgWaitCounter >= (random(60) + 30)) {
tankRef.mgWaitCounter = 0;
tankRef.mgBurstCounter = 0;
}
}
break;
case "victory" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
victoryMemberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (victoryMemberRef.endBattleAnim == false) {
victoryMemberRef.endBattleAnim = true;
_root["loop" + victoryMemberRef.name].volumeTo(0, 2, "easeOutSine", 0, function () {
this.stop();
});
setTimeout(soldierMovements, random(400) + 100, "victory", victoryMemberRef);
}
}
break;
case "defeated" :
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
victoryMemberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if ((victoryMemberRef.endBattleAnim == false) && (victoryMemberRef.inTrench)) {
victoryMemberRef.endBattleAnim = true;
_root["loop" + victoryMemberRef.name].volumeTo(0, 2, "easeOutSine", 0, function () {
this.stop();
});
setTimeout(soldierMovements, random(200) + 100, "defeatTrench", victoryMemberRef);
}
if ((victoryMemberRef.endBattleAnim == false) && (victoryMemberRef.inTrench == false)) {
victoryMemberRef.endBattleAnim = true;
_root["loop" + victoryMemberRef.name].volumeTo(0, 2, "easeOutSine", 0, function () {
this.stop();
});
setTimeout(soldierMovements, random(200) + 100, "defeatGround", victoryMemberRef);
}
}
break;
}
}
}
function soldierMovements(moveType, soldier) {
if (soldier.alive == true) {
switch (moveType) {
case "victory" :
soldier.gotoAndPlay("victory_" + soldier.position);
break;
case "defeatTrench" :
soldier.gotoAndPlay("defeat_trench");
break;
case "defeatGround" :
soldier.gotoAndPlay("defeat_standing");
break;
case "crouch" :
soldier.gotoAndPlay(soldier.weaponType + "_stop_crouch");
break;
case "stand" :
soldier.gotoAndPlay(soldier.weaponType + "_stop_standing");
break;
case "prone" :
soldier.gotoAndPlay(soldier.weaponType + "_stop_prone");
break;
case "proneToStand" :
soldier.gotoAndPlay(soldier.weaponType + "_start_prone");
break;
case "crouchToStand" :
soldier.gotoAndPlay(soldier.weaponType + "_start_crouch");
break;
case "standingToStand" :
soldier.gotoAndPlay(soldier.weaponType + "_start_standing");
break;
case "run" :
if (soldier.changingToMove == false) {
soldier.gotoAndPlay(soldier.weaponType + "_run");
}
break;
}
}
}
function startFiringDelay(firingSoldierRef) {
firingSoldierRef.startFiring = true;
}
function findEnemy(friendlyTeam, enemyTeam) {
for (v in _root[friendlyTeam + "SquadsOnScreen"]) {
friendlySquad = _root[friendlyTeam + "SquadsOnScreen"][v];
if ((_root[enemyTeam + "SquadsOnScreen"].length > 0) && (friendlySquad.members[0].alive == true)) {
for (e in _root[enemyTeam + "SquadsOnScreen"]) {
enemySquad = _root[enemyTeam + "SquadsOnScreen"][e];
if ((enemySquad.members[0].alive == true) && (enemySquad.members[0].alive != undefined)) {
currentSquadProx = enemySquad.members[0]._x - friendlySquad.members[0]._x;
if (friendlyTeam == german.name) {
currentSquadProx = -currentSquadProx;
}
if ((((((((enemySquad != friendlySquad.enemyTarget) && (currentSquadProx < friendlySquad.targetProx)) && (currentSquadProx < friendlySquad.range)) && (enemySquad.members.length > 0)) && (friendlySquad.members[0]._x > targetingBuffer)) && (friendlySquad.members[0]._x < (world.bg._width - targetingBuffer))) && (enemySquad.members[0]._x > targetingBuffer)) && (enemySquad.members[0]._x < (world.bg._width - targetingBuffer))) {
friendlySquad.enemyTarget = enemySquad;
friendlySquad.targetProx = currentSquadProx;
if ((friendlySquad.state != "entrench") && (friendlySquad.state != "exitTrench")) {
if (((friendlySquad.nearTrench == false) && (friendlySquad.enemyTarget.state == "entrench")) && (friendlySquad.type == "assault")) {
friendlySquad.state = "assaultTrench";
} else if (((friendlySquad.nearTrench == false) && (friendlySquad.state != "entrench")) && (friendlySquad.state != "assaultTrench")) {
friendlySquad.state = "engaging";
}
}
if (friendlySquad.type == "tank") {
friendlySquad.state = "tankEngaging";
}
}
if (((friendlySquad.enemyTarget.members.length == 0) || (friendlySquad.enemyTarget.members[0].alive == undefined)) || (friendlySquad.enemyTarget.members[0].alive == false)) {
friendlySquad.enemyTarget = undefined;
friendlySquad.targetProx = 999999 /* 0x0F423F */;
for (f in friendlySquad.members) {
friendlySquad.members[f].startFiring = false;
friendlySquad.members[f].firing = false;
}
if ((((((friendlySquad.nearTrench == false) && (friendlySquad.state != "assaultTrench")) && (friendlySquad.type != "tank")) && (friendlySquad.state != "stopped")) && (friendlySquad.state != "entrench")) && (friendlySquad.state != "exitTrench")) {
friendlySquad.state = "moving";
}
if (friendlySquad.type == "tank") {
friendlySquad.state = "tankMoving";
}
}
}
}
} else {
friendlySquad.enemyTarget = undefined;
friendlySquad.targetProx = 999999 /* 0x0F423F */;
for (f in friendlySquad.members) {
friendlySquad.members[f].startFiring = false;
friendlySquad.members[f].firing = false;
}
if ((((((friendlySquad.nearTrench == false) && (friendlySquad.state != "assaultTrench")) && (friendlySquad.type != "tank")) && (friendlySquad.state != "stopped")) && (friendlySquad.state != "entrench")) && (friendlySquad.state != "exitTrench")) {
friendlySquad.state = "moving";
}
if (friendlySquad.type == "tank") {
friendlySquad.state = "tankMoving";
}
}
}
}
function findOfficer(teamName) {
if ((teamName == "british") && (british_slot8_upgrade.active == true)) {
officerInfluence = 250;
}
for (x in _root[teamName + "Officers"]) {
officerUnitRef = _root[teamName + "Officers"][x];
officerRef = _root[teamName + "Officers"][x].members[0];
for (v in _root[teamName + "SquadsOnScreen"]) {
unitRef = _root[teamName + "SquadsOnScreen"][v];
unitLeaderRef = _root[teamName + "SquadsOnScreen"][v].members[0];
if (unitRef.type != "officer") {
if ((((unitRef.nearOfficer == false) && (unitRef.officerRef.name != officerUnitRef.name)) && ((unitLeaderRef._x - officerRef._x) > (-officerInfluence))) && ((unitLeaderRef._x - officerRef._x) < officerInfluence)) {
unitRef.nearOfficer = true;
unitRef.officerUnitRef = officerUnitRef;
unitLeaderRef.officerStar._visible = true;
unitLeaderRef.officerStar.gotoAndStop("silver");
unitLeaderRef.officerStar._alpha = 0;
unitLeaderRef.officerStar.alphaTo(100, 0.3);
}
if ((unitRef.officerUnitRef.name == officerUnitRef.name) && (((unitLeaderRef._x - officerRef._x) < (-officerInfluence)) || ((unitLeaderRef._x - officerRef._x) > officerInfluence))) {
unitRef.nearOfficer = false;
unitLeaderRef.officerStar.alphaTo(0, 0.3);
}
if (unitRef.officerUnitRef.members.length < 1) {
unitRef.officerUnitRef = null;
unitRef.nearOfficer = false;
unitLeaderRef.officerStar.alphaTo(0, 0.3);
}
}
}
}
}
function findTrenches(teamName) {
for (w in _root[teamName + "SquadsOnScreen"]) {
squadTrenchRef = _root[teamName + "SquadsOnScreen"][w];
leaderTrenchRef = _root[teamName + "SquadsOnScreen"][w].members[0];
if (leaderTrenchRef.type != "tankMarkIV") {
for (p in trenches) {
if (teamName == "british") {
if (((trenches[p]._x - leaderTrenchRef._x) <= trenchBoundary) && ((trenches[p]._x - leaderTrenchRef._x) > 0)) {
if (((trenches[p].slot1.team != "german") && (trenches[p].slot2.team != "german")) && (trenches[p].slot3.team != "german")) {
squadTrenchRef.nearTrench = true;
}
} else {
squadTrenchRef.nearTrench = false;
}
} else if (teamName == "german") {
if (((leaderTrenchRef._x - trenches[p]._x) <= trenchBoundary) && ((leaderTrenchRef._x - trenches[p]._x) > 0)) {
if (((trenches[p].slot1.team != "british") && (trenches[p].slot2.team != "british")) && (trenches[p].slot3.team != "british")) {
squadTrenchRef.nearTrench = true;
}
} else {
squadTrenchRef.nearTrench = false;
}
}
if ((squadTrenchRef.nearTrench == true) && (squadTrenchRef.state != "exitTrench")) {
if ((trenches[p].owner == teamName) || (trenches[p].owner == undefined)) {
if ((((((trenches[p].slot1 != "empty") && (trenches[p].slot1 != squadTrenchRef)) && (trenches[p].slot1 != undefined)) && (((trenches[p].slot2 != "empty") && (trenches[p].slot2 != squadTrenchRef)) && (trenches[p].slot2 != undefined))) && (((trenches[p].slot3 != "empty") && (trenches[p].slot3 != squadTrenchRef)) && (trenches[p].slot3 != undefined))) || (trenches[p].locked == true)) {
if (squadTrenchRef.inTrench == false) {
squadTrenchRef.state = "entrench";
squadTrenchRef.trenchRef = trenches[p];
squadTrenchRef.inTrench = true;
squadTrenchRef.passingTrench = true;
squadTrenchRef.enemyTarget = undefined;
}
}
r = 1;
while (r <= 3) {
if (squadTrenchRef.inTrench == false) {
squadTrenchRef.state = "entrench";
if (((((trenches[p]["slot" + r] == "empty") || (trenches[p]["slot" + r] == undefined)) && (squadTrenchRef.state != "exitTrench")) && (squadTrenchRef.state != "gasMasksOn")) && (squadTrenchRef.state != "gasMasksOff")) {
if ((trenches[p].locked != true) && ((trenches[p].owner == teamName) || (trenches[p].owner == undefined))) {
trenches[p].owner = teamName;
squadTrenchRef.trenchRef = trenches[p];
squadTrenchRef.trenchNumRef = p;
squadTrenchRef.trenchSlotRef = r;
squadTrenchRef.inTrench = true;
trenches[p]["slot" + r] = squadTrenchRef;
squadTrenchRef.passingTrench = false;
squadTrenchRef.enemyTarget = undefined;
if ((teamName == playerTeam.team) && (trenches[p].controlVisible == false)) {
showTrenchButton(trenches[p]);
} else if (teamName == compTeam.team) {
hideTrenchControls(trenches[p]);
hideTrenchButton(trenches[p]);
}
if (trenches[p].controlVisible) {
updateTrenchInterface(trenches[p]);
}
}
}
}
r++;
}
} else if ((trenches[p].owner != teamName) && (trenches[p].owner != undefined)) {
if (((((trenches[p].slot1 != "empty") && (trenches[p].slot1 != squadTrenchRef)) && (trenches[p].slot1 != undefined)) && (((trenches[p].slot2 != "empty") && (trenches[p].slot2 != squadTrenchRef)) && (trenches[p].slot2 != undefined))) && (((trenches[p].slot3 != "empty") && (trenches[p].slot3 != squadTrenchRef)) && (trenches[p].slot3 != undefined))) {
if (squadTrenchRef.inTrench == false) {
squadTrenchRef.state = "entrench";
squadTrenchRef.trenchRef = trenches[p];
squadTrenchRef.inTrench = true;
squadTrenchRef.passingTrench = true;
squadTrenchRef.enemyTarget = undefined;
}
}
r = 1;
while (r <= 3) {
if (squadTrenchRef.inTrench == false) {
squadTrenchRef.state = "entrench";
if (((((trenches[p]["slot" + r] == "empty") || (trenches[p]["slot" + r] == undefined)) && (squadTrenchRef.state != "exitTrench")) && (squadTrenchRef.state != "gasMasksOn")) && (squadTrenchRef.state != "gasMasksOff")) {
if (teamName != playerTeam.team) {
trenches[p].locked = false;
}
trenches[p].owner = teamName;
squadTrenchRef.trenchRef = trenches[p];
squadTrenchRef.trenchNumRef = p;
squadTrenchRef.trenchSlotRef = r;
squadTrenchRef.inTrench = true;
trenches[p]["slot" + r] = squadTrenchRef;
squadTrenchRef.passingTrench = false;
squadTrenchRef.enemyTarget = undefined;
if ((teamName == playerTeam.team) && (trenches[p].controlVisible == false)) {
showTrenchButton(trenches[p]);
} else if (teamName == compTeam.team) {
hideTrenchControls(trenches[p]);
hideTrenchButton(trenches[p]);
}
if (trenches[p].controlVisible) {
updateTrenchInterface(trenches[p]);
}
}
}
r++;
}
}
}
}
}
}
}
function findWire(teamName) {
for (w in _root[teamName + "SquadsOnScreen"]) {
squadWireRef = _root[teamName + "SquadsOnScreen"][w];
leaderWireRef = _root[teamName + "SquadsOnScreen"][w].members[0];
squadWireRef.inWire = false;
x = 1;
while (x <= currentMap.wire) {
if (((currentMap[("wire" + x) + "Pos"] - leaderWireRef._x) > -50) && ((currentMap[("wire" + x) + "Pos"] - leaderWireRef._x) < 50)) {
squadWireRef.inWire = true;
}
x++;
}
}
}
function findMines(teamName) {
if (teamName == "british") {
mineEnemyName = "german";
}
if (teamName == "german") {
mineEnemyName = "british";
}
if (_root["currentMapMines_" + mineEnemyName] > 0) {
for (v in _root[teamName + "SquadsOnScreen"]) {
currentMineLeader = _root[teamName + "SquadsOnScreen"][v].members[0];
for (x in _root.currentMap[mineEnemyName + "Mines"]) {
if (((_root[teamName + "SquadsOnScreen"][v].state == "moving") && ((_root.currentMap[mineEnemyName + "Mines"][x] - currentMineLeader._x) > (-mineBoundary))) && ((_root.currentMap[mineEnemyName + "Mines"][x] - currentMineLeader._x) < mineBoundary)) {
if (random(mineDeathChance) == 0) {
_root["currentMapMines_" + mineEnemyName]--;
mineVictim = random(_root[teamName + "SquadsOnScreen"][v].members[0].length);
specialRounds++;
world.attachMovie("mineStrike", "mineRound" + specialRounds, depth_world_artillery + specialRounds);
world["mineRound" + specialRounds]._x = _root[teamName + "SquadsOnScreen"][v].members[mineVictim]._x;
world["mineRound" + specialRounds]._y = _root[teamName + "SquadsOnScreen"][v].members[mineVictim]._y;
world["mineRound" + specialRounds].ownerTeam = ownerTeam;
}
}
}
}
}
}
function enemyUnitAI() {
for (t in trenches) {
if (trenches[t].owner == compTeam.team) {
if (((trenches[t].slot1 != "empty") && (trenches[t].slot2 != "empty")) && (trenches[t].slot3 != "empty")) {
if (((_root.currentMap.enemyMood == "aggressive") && (random(15) == 0)) || ((_root.currentMap.enemyMood == "balanced") && (random(30) == 0))) {
setTimeout(enemyCharge, 4000, trenches[t]);
}
}
}
}
for (v in _root[compTeam.team + "SquadsOnScreen"]) {
enemySquadAIRef = _root[compTeam.team + "SquadsOnScreen"][v];
switch (_root.currentMap.enemyMood) {
case "aggressive" :
if (((enemySquadAIRef.state == "entrench") && (enemySquadAIRef.allMembersInTrench == true)) && (enemySquadAIRef.enemyTarget == undefined)) {
if ((random(5) == 0) && ((enemySquadAIRef.type == "riflemen") || (enemySquadAIRef.type == "assault"))) {
enemySquadAIRef.state = "exitTrench";
}
if ((random(10) == 0) && (enemySquadAIRef.type == "sniper")) {
enemySquadAIRef.state = "exitTrench";
}
if ((random(20) == 0) && ((enemySquadAIRef.type == "officer") || (enemySquadAIRef.type == "machineGun"))) {
enemySquadAIRef.state = "exitTrench";
}
}
break;
case "defensive" :
if (((enemySquadAIRef.state == "entrench") && (enemySquadAIRef.allMembersInTrench == true)) && (enemySquadAIRef.enemyTarget == undefined)) {
if ((random(20) == 0) && ((enemySquadAIRef.type == "riflemen") || (enemySquadAIRef.type == "assault"))) {
enemySquadAIRef.state = "exitTrench";
}
if ((random(35) == 0) && (enemySquadAIRef.type == "sniper")) {
enemySquadAIRef.state = "exitTrench";
}
if ((random(60) == 0) && ((enemySquadAIRef.type == "officer") || (enemySquadAIRef.type == "machineGun"))) {
enemySquadAIRef.state = "exitTrench";
}
}
break;
case "balanced" :
if (!(((enemySquadAIRef.state == "entrench") && (enemySquadAIRef.allMembersInTrench == true)) && (enemySquadAIRef.enemyTarget == undefined))) {
break;
}
if ((random(10) == 0) && ((enemySquadAIRef.type == "riflemen") || (enemySquadAIRef.type == "assault"))) {
enemySquadAIRef.state = "exitTrench";
}
if ((random(20) == 0) && (enemySquadAIRef.type == "sniper")) {
enemySquadAIRef.state = "exitTrench";
}
if (!((random(30) == 0) && ((enemySquadAIRef.type == "officer") || (enemySquadAIRef.type == "machineGun")))) {
break;
}
enemySquadAIRef.state = "exitTrench";
}
break;
}
}
function enemyCharge(trenchName) {
trenchName.slot1.state = "exitTrench";
trenchName.slot2.state = "exitTrench";
trenchName.slot3.state = "exitTrench";
}
function setupEnemyUnitGenerator() {
enemyUnitRateMax = currentMap.enemyRate;
enemyUnitRate = enemyUnitRateMax;
enemyUnitWave = 0;
}
function enemyUnitGenerator() {
enemyUnitRate--;
if ((firstEnemyUnit == true) && (enemyUnitRate <= 10)) {
firstEnemyUnit = false;
enemyUnitRate = enemyUnitRateMax;
if (playingSkirmish == true) {
randomEnemyUnit = random(currentMap.enemyUnits.length);
createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit]);
} else {
createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave]);
}
}
if (createEnemyUnits && (enemyUnitRate < 0)) {
enemyUnitRate = enemyUnitRateMax;
enemyUnitWave++;
if (enemyUnitWave > currentMap.enemyUnits.length) {
enemyUnitWave = 0;
}
if (playingSkirmish == true) {
randomEnemyUnit = random(currentMap.enemyUnits.length);
createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit]);
} else {
createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave]);
}
}
if ((createEnemyUnits && (AIpanicMode == true)) && (enemyUnitRate <= (enemyUnitRate / 2))) {
enemyUnitRate = enemyUnitRateMax;
enemyUnitWave++;
if (enemyUnitWave > currentMap.enemyUnits.length) {
enemyUnitWave = 0;
}
if (playingSkirmish == true) {
randomEnemyUnit = random(currentMap.enemyUnits.length);
createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit]);
} else {
createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave]);
}
}
}
function setupEnemySupportGenerator() {
enemySupportRateMax = currentMap.enemySupportRate;
enemySupportRate = enemySupportRateMax;
enemySupportWave = 0;
}
function enemySupportGenerator() {
enemySupportRate--;
if (enemySupportRate < 0) {
enemySupportRate = enemySupportRateMax;
closestSupportTargetX = _root[playerTeam.team + "SquadsOnScreen"][x].members[0]._x;
for (x in _root[playerTeam.team + "SquadsOnScreen"]) {
if (playerTeam.team == "british") {
if (_root[playerTeam.team + "SquadsOnScreen"][x].members[0]._x > closestSupportTargetX) {
enemySupportTarget = _root[playerTeam.team + "SquadsOnScreen"][x].members[0];
}
}
if (playerTeam.team == "german") {
if (_root[playerTeam.team + "SquadsOnScreen"][x].members[0]._x < closestSupportTargetX) {
enemySupportTarget = _root[playerTeam.team + "SquadsOnScreen"][x].members[0];
}
}
if (random(5) == 0) {
if ((_root[playerTeam.team + "SquadsOnScreen"][random(_root[playerTeam.team + "SquadsOnScreen"].length)].members[0]._x > 100) && (_root[playerTeam.team + "SquadsOnScreen"][random(_root[playerTeam.team + "SquadsOnScreen"].length)].members[0]._x < (world.bg._width - 150))) {
enemySupportTarget = _root[playerTeam.team + "SquadsOnScreen"][random(_root[playerTeam.team + "SquadsOnScreen"].length)].members[0];
}
}
}
if (enemySupportTarget != null) {
if (playingSkirmish == true) {
launchSpecialAttack(currentMap.enemySupport[random(currentMap.enemySupport.length)], enemySupportTarget._x, enemySupportTarget._y, compTeam.team);
} else if (currentMap.enemySupport[enemySupportWave] != "wait") {
launchSpecialAttack(currentMap.enemySupport[enemySupportWave], enemySupportTarget._x, enemySupportTarget._y, compTeam.team);
}
enemySupportTarget = null;
enemySupportWave++;
}
if (enemySupportWave > currentMap.enemySupport.length) {
enemySupportWave = 0;
}
}
}
function hitEnemy(friendTeam, targetTeam, attacker, attackingSquad) {
e = 0;
while (e <= _root[targetTeam + "SquadsOnScreen"].length) {
currentTargetSquad = _root[targetTeam + "SquadsOnScreen"][e];
currentDamage = attacker.damage;
if (currentTargetSquad.name == attackingSquad.enemyTarget.name) {
if (currentTargetSquad.type == "tank") {
currentTargetSquad.health = currentTargetSquad.health - (currentDamage / 16);
} else {
if (attacker.inTrench == true) {
currentDamage = currentDamage * trenchBonus;
if (currentTargetSquad.type == "assault") {
currentDamage = currentDamage * 0.7;
}
if (friendTeam == "german") {
if (german_slot5_upgrade.active && (attacker.type == "machineGun")) {
currentDamage = currentDamage * german_slot5_upgrade.bonus;
}
}
}
if (currentTargetSquad.state == "entrench") {
currentDamage = currentDamage * trenchDefence;
if (friendTeam == "british") {
if (british_slot7_upgrade.active) {
currentDamage = currentDamage * british_slot7_upgrade.bonus;
}
}
if (friendTeam == "german") {
if (german_slot2_upgrade.active) {
currentDamage = currentDamage * german_slot2_upgrade.bonus;
}
if (german_slot6_upgrade.active) {
currentDamage = currentDamage * german_slot6_upgrade.bonus;
}
}
}
if (attacker.nearOfficer == true) {
currentDamage = currentDamage * officerBonus;
if (german_slot11_upgrade.active == true) {
currentDamage = currentDamage * german_slot11_upgrade.bonus;
}
}
if (friendTeam == "british") {
if (british_slot2_upgrade.active) {
currentDamage = currentDamage * british_slot2_upgrade.bonus;
}
if ((british_slot9_upgrade.active == true) && (attacker.type == "sharpShooter")) {
currentDamage = currentDamage * british_slot9_upgrade.bonus;
}
if ((british_slot10_upgrade.active == true) && (attacker.type == "machineGunner")) {
currentDamage = currentDamage * british_slot10_upgrade.bonus;
}
if ((british_slot11_upgrade.active == true) && (attacker.type == "tank")) {
currentDamage = currentDamage * british_slot11_upgrade.bonus;
}
}
if (friendTeam == "german") {
if (german_slot1_upgrade.active) {
currentDamage = currentDamage * german_slot1_upgrade.bonus;
}
if (german_slot9_upgrade.active) {
currentDamage = currentDamage * german_slot9_upgrade.bonus;
}
if (british_slot3_upgrade.active) {
currentDamage = currentDamage * british_slot3_upgrade.bonus;
}
}
currentTargetSquad.health = currentTargetSquad.health - currentDamage;
}
m = 0;
while (m <= currentTargetSquad.members.length) {
if ((currentTargetSquad.type == "tank") && (currentTargetSquad.members[m].alive == true)) {
if (random(10) <= showBulletDustChance) {
playSound("sound_ricochetMetal" + (random(2) + 1));
currentTargetSquad.members[m]["ricochet" + (random(11) + 1)].play();
}
if (random(100) <= showBulletDustChance) {
bulletDust(currentTargetSquad.members[m]._x + (random(120) - 60), currentTargetSquad.members[m]._y);
break;
}
}
if (((currentTargetSquad.type != "tank") && (currentTargetSquad.health <= currentTargetSquad.members[m].health)) && (currentTargetSquad.members[m].alive == true)) {
currentTargetSquad.members[m].alive = false;
updateTrenchInterface(currentTargetSquad.trenchRef);
adjustMorale(targetTeam, currentTargetSquad.type, "normal");
if (friendTeam == playerTeam.team) {
updateExperience(currentTargetSquad.type, currentTargetSquad.members[m]);
career_soldiersKilled++;
} else {
career_soldiersLost++;
}
adjustStats("kill", friendTeam);
if (random(10) == 0) {
currentTargetSquad.members[m].torso.bloodSplat._visible = true;
}
if (random(10) == 0) {
currentTargetSquad.members[m].head.bloodSplat._visible = true;
}
currentTargetSquad.members[m].gotoAndPlay(currentTargetSquad.members[m].position + "_death");
setTimeout(fadeDeadSoldier, clearDeadSoldierTime, currentTargetSquad.members[m]);
sortDeadSoldiers(currentTargetSquad.members[m]);
currentTargetSquad.members[m]._visible = true;
currentTargetSquad.members[m].selectedRing.alphaTo(0, 0.3);
currentTargetSquad.members[m].healthBar.alphaTo(0, 0.3);
currentTargetSquad.members[m].officerStar.alphaTo(0, 0.3);
if ((attackingSquad.type == "sniper") && (m != 0)) {
playVoice("sniper", targetTeam);
if (((currentTargetSquad.team != playerTeam.team) && (currentTargetSquad.enemyTarget == undefined)) && (currentTargetSquad.inTrench == true)) {
if (random(2) == 0) {
currentTargetSquad.state = "exitTrench";
}
}
}
if ((attackingSquad.type == "machineGun") && (m != 0)) {
playVoice("machineGun", targetTeam);
}
if ((attackingSquad.type == "tank") && (m != 0)) {
playVoice("tank", targetTeam);
}
currentTargetSquad.members.splice(m, 1);
playSound("sound_soldierDeath" + (random(10) + 1));
} else if (random(100) <= showBulletDustChance) {
bulletDust(currentTargetSquad.members[m]._x + (random(120) - 60), currentTargetSquad.members[m]._y);
break;
}
if (currentTargetSquad.members.length == 0) {
for (s in _root[targetTeam + "SquadsOnScreen"]) {
if (_root[targetTeam + "SquadsOnScreen"][s].name == currentTargetSquad.name) {
_root["loop" + currentTargetSquad.name].stop();
_root.trenches[currentTargetSquad.trenchNumRef]["slot" + currentTargetSquad.trenchSlotRef] = "empty";
_root[targetTeam + "SquadsOnScreen"].splice(s, 1);
adjustStats("unitLost", targetTeam);
break;
}
}
}
m++;
}
}
e++;
}
}
function explosiveHit(explosionName, teamName, ownerTeam, explosionType) {
for (s in _root[teamName + "SquadsOnScreen"]) {
currentTargetSquad = _root[teamName + "SquadsOnScreen"][s];
var _local7 = currentTargetSquad.members[0]._x - explosionName._x;
if (((_local7 < 60) && (_local7 >= 0)) || ((_local7 > -60) && (_local7 <= 0))) {
if (random(explosionSurvivalChance) != 0) {
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
memberRef = _root[teamName + "SquadsOnScreen"][s].members[m];
if (teamName != ownerTeam) {
playVoice("incoming", teamName);
}
_root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name] = _root[teamName + "SquadsOnScreen"][s].members[m];
if (memberRef.alive == true) {
if ((explosionName.collision.hitTest(memberRef.collision) == true) && (memberRef.alive == true)) {
if (memberRef.squadType == "tank") {
explosiveDamage = 0;
explosiveDamage = _root[ownerTeam][explosionType].damage;
if ((ownerTeam == "british") && (british_slot11_upgrade.active)) {
explosiveDamage = explosiveDamage * british_slot11_upgrade.bonus;
}
if (((ownerTeam == "british") && (british_slot14_upgrade.active)) && (explosionType == "mortar")) {
explosiveDamage = explosiveDamage * british_slot14_upgrade.bonus;
}
if (((ownerTeam == "british") && (british_slot18_upgrade.active)) && ((explosionType == "artillery") || (explosionType == "antiTank"))) {
explosiveDamage = explosiveDamage * british_slot18_upgrade.bonus;
}
_root[teamName + "SquadsOnScreen"][s].health = _root[teamName + "SquadsOnScreen"][s].health - explosiveDamage;
particleCount++;
world.attachMovie("particle_fireball_tank", "tankPart" + particleCount, particleCount);
world["tankPart" + particleCount]._x = explosionName._x + (random(10) - 5);
world["tankPart" + particleCount]._y = explosionName._y - (random(15) + 15);
metalFragmentParticle(explosionName._x, explosionName._y);
playSound("sound_metalImpact");
if (_root[teamName + "SquadsOnScreen"][s].health <= 0) {
memberRef.alive = false;
_root[teamName + "SquadsOnScreen"][s].state = "tankDead";
memberRef.damageClip._alpha = 0;
memberRef.damageClip._visible = true;
memberRef.damageClip.alphaTo(100, 3);
memberRef.damageClip.fireAnim1.alphaTo(0, 6, "easeOutSine", 5 + random(10), function () {
removeMovieClip(this);
});
memberRef.damageClip.fireAnim2.alphaTo(0, 6, "easeOutSine", 5 + random(10), function () {
removeMovieClip(this);
});
memberRef.damageClip.fireAnim3.alphaTo(0, 6, "easeOutSine", 5 + random(10), function () {
removeMovieClip(this);
});
memberRef.damageClip.fireAnim4.alphaTo(0, 6, "easeOutSine", 5 + random(10), function () {
removeMovieClip(this);
});
memberRef.damageClip.fireAnim1.fireAnim.gotoAndPlay(random(45) + 1);
memberRef.damageClip.fireAnim2.fireAnim.gotoAndPlay(random(45) + 1);
memberRef.tankBody.gotoAndStop("destroyed");
if (random(2) > 0) {
memberRef.damageClip.fireAnim3.fireAnim.gotoAndPlay(random(45) + 1);
} else {
memberRef.damageClip.fireAnim3._visible = false;
}
if (random(2) > 0) {
memberRef.damageClip.fireAnim4.fireAnim.gotoAndPlay(random(45) + 1);
} else {
memberRef.damageClip.fireAnim4._visible = false;
}
_root["loop" + memberRef.name].volumeTo(0, 2, "easeOutSine", 0, function () {
this.stop();
});
memberRef.healthBar.alphaTo(0, 0.3);
adjustMorale(memberRef.squadObjRef.team, "tank", "normal");
adjustStats("kill", ownerTeam);
adjustStats("unitLost", memberRef.squadObjRef.team);
_root.deadTanks.push(memberRef);
memberRef._visible = true;
_root[teamName + "SquadsOnScreen"][s].members.splice(m, 1);
if (_root[teamName + "SquadsOnScreen"][s].members.length == 0) {
_root[teamName + "SquadsOnScreen"].splice(s, 1);
}
}
}
if (memberRef.squadType != "tank") {
memberRef.alive = false;
updateTrenchInterface(currentTargetSquad.trenchRef);
if (teamName != ownerTeam) {
adjustStats("kill", ownerTeam);
}
adjustMorale(teamName, _root[teamName + "SquadsOnScreen"][s].type, "explosive", ownerTeam);
if ((ownerTeam == playerTeam.team) && (teamName != playerTeam.team)) {
updateExperience(_root[teamName + "SquadsOnScreen"][s].type, memberRef);
}
_root[teamName + "SquadsOnScreen"][s].health = _root[teamName + "SquadsOnScreen"][s].health - _root[teamName + "SquadsOnScreen"][s].minHealth;
if (random(2) > 0) {
bodyRagdoll(memberRef);
_root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name].gotoAndPlay("exploded_death");
} else {
if (random(10) == 0) {
currentTargetSquad.members[m].head.bloodSplat._visible = true;
}
if (random(10) == 0) {
currentTargetSquad.members[m].torso.bloodSplat._visible = true;
}
_root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name].gotoAndPlay(_root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name].position + "_death");
}
setTimeout(fadeDeadSoldier, clearDeadSoldierTime, _root["unique" + _root[teamName + "SquadsOnScreen"][s].members[m].name]);
playSound("sound_soldierDeath" + (random(10) + 1));
bldCloud = new Object();
bldCloud.x = memberRef._x;
bldCloud.y = memberRef._y;
bloodCloudParticle(bldCloud.x, bldCloud.y - random(15));
_root[teamName + "SquadsOnScreen"][s].members[m].selectedRing.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members[m].healthBar.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members[m].officerStar.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members[m]._visible = true;
sortDeadSoldiers(_root[teamName + "SquadsOnScreen"][s].members[m]);
_root[teamName + "SquadsOnScreen"][s].members.splice(m, 1);
if (_root[teamName + "SquadsOnScreen"][s].members.length == 0) {
_root.trenches[currentTargetSquad.trenchNumRef]["slot" + currentTargetSquad.trenchSlotRef] = "empty";
_root[teamName + "SquadsOnScreen"].splice(s, 1);
}
}
}
}
}
}
}
}
}
function playExplodedDeath(deadSoldierRef) {
deadSoldierRef.gotoAndPlay("exploded_death");
}
function fadeDeadSoldier(soldierRef) {
soldierRef.alphaTo(0, 1, "linear");
setTimeout(removeDeadSoldier, 1000, soldierRef);
}
function removeDeadSoldier(soldierRef) {
removeMovieClip(soldierRef);
}
function particleEmitter(particleType, particleName, particleDepth, particleX, particleY, particleGravity, particleQuantity, particleHorizontalEnergy, particleVerticalEnergy, particleFade, particleRotationRate, particleScaling, particleChangeAngle) {
i = 0;
while (i <= particleQuantity) {
particleCount++;
var _local2 = world.attachMovie(particleType, particleName + i, 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 (particleScaling == true) {
_local2._xscale = (_local2._yscale = random(50) + 50);
}
_local2._x = particleX;
_local2._y = particleY;
_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.onEnterFrame = _root.moveParticle;
i++;
}
}
function moveParticle() {
with (this) {
_alpha = _alpha - particleFade;
if ((_alpha < 15) || (this._y > (this.originY + 10))) {
removeMovieClip(this);
}
this._rotation = this._rotation + rotation;
this.x = Math.cos((this.angle * Math.PI) / 180) * HorzEnergy;
_x = _x - this.x;
_y = _y + ((VertEnergy = VertEnergy + gravity));
}
}
function artilleryExplosionParticle(targetX, targetY) {
particleEmitter("particle_dustShaft", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.01, true, true);
particleEmitter("particle_dustShaft", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.01, true, false);
particleEmitter("particle_cloudDust", "dustPart", 100, targetX, targetY, 0.01, 0, 0.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_cloudDust_white", "dustPart", 100, targetX, targetY, 0.01, 0, 0.5, 0.5, 1, 0.05, true, true);
particleEmitter("particle_fireball", "firePart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 3, 0, true, false);
particleEmitter("particle_cloudDust", "dustPart", 100, targetX, targetY, 0.01, 0, 1.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_sparks", "sparkPart", 100, targetX + (random(50) - 25), targetY - 20, 0.4, 0, 4, 10, 6, 1.5, true, true);
particleEmitter("particle_dirt", "dirtPart", 100, targetX + (random(50) - 25), targetY - 20, 0.4, 1, 4, 10, 2, 1.5, true, true);
particleEmitter("particle_dirt2", "dirtPart", 100, targetX + (random(50) - 25), targetY - 20, 0.35, 1, 4, 10, 2, 0, true, true);
}
function mortarExplosionParticle(targetX, targetY) {
particleEmitter("particle_dustShaft_mortar", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.05, true, false);
particleEmitter("particle_cloudDust_mortar", "dustPart", 100, targetX, targetY, 0.01, 0, 0.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_dirt", "dirtPart", 100, targetX + (random(10) - 5), targetY - 10, 0.4, 0, 2, 10, 2, 1.5, true, true);
particleEmitter("particle_fireball_mortar", "firePart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 2, 0, true, false);
particleEmitter("particle_dirt2_mortar", "dirtPart", 100, targetX + (random(10) - 5), targetY - 10, 0.35, 0, 3, 8, 2, 0, true, true);
particleEmitter("particle_cloudDust_mortar", "dustPart", 100, targetX + (random(20) - 10), targetY, 0.01, 0, 4, 0.5, 2, 0.05, true, false);
}
function bulletDustParticle(targetX, targetY) {
particleEmitter("particle_dustShaft_bullet", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.05, true, false);
particleEmitter("particle_cloudDust_bullet", "dustPart", 100, targetX, targetY, 0.01, 1, 0.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_dirt2_bullet", "dirtPart", 100, targetX + (random(50) - 25), targetY - 20, 0.4, 1, 1, 1, 6, 1.5, true, true);
}
function bloodCloudParticle(targetX, targetY) {
particleEmitter("particle_bloodCloud", "dustPart", 100, targetX, targetY, 0.01, 0, 0.5, 0.5, 3, 0.05, true, true);
}
function grenadeExplosionParticle(targetX, targetY) {
particleEmitter("particle_dustShaft_grenade", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.05, true, false);
particleEmitter("particle_cloudDust_grenade", "dustPart", 100, targetX, targetY, 0.01, 1, 0.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_dirt", "dirtPart", 100, targetX, targetY - 10, 0.4, 1, 2, 10, 2, 1.5, true, true);
particleEmitter("particle_fireball_grenade", "firePart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 2, 0, true, false);
particleEmitter("particle_dirt2_grenade", "dirtPart", 100, targetX, targetY - 10, 0.35, 1, 3, 8, 2, 0, true, true);
particleEmitter("particle_cloudDust_grenade", "dustPart", 100, targetX, targetY, 0.01, 1, 4, 0.5, 2, 0.05, true, false);
}
function mineExplosionParticle(targetX, targetY) {
particleEmitter("particle_dustShaft_mortar", "dustPart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 1.75, 0.05, true, false);
particleEmitter("particle_cloudDust_mortar", "dustPart", 100, targetX, targetY, 0.01, 0, 0.5, 0.5, 1.5, 0.05, true, true);
particleEmitter("particle_dirt", "dirtPart", 100, targetX + (random(10) - 5), targetY - 10, 0.4, 3, 2, 10, 2, 1.5, true, true);
particleEmitter("particle_fireball_mortar", "firePart", 100, targetX, targetY, 0.015, 0, 0, 0.5, 2, 0, true, false);
particleEmitter("particle_dirt2_mortar", "dirtPart", 100, targetX + (random(10) - 5), targetY - 10, 0.35, 2, 3, 8, 2, 0, true, true);
particleEmitter("particle_cloudDust_mortar", "dustPart", 100, targetX + (random(20) - 10), targetY, 0.01, 1, 4, 0.5, 2, 0.05, true, false);
}
function metalFragmentParticle(targetX, targetY) {
particleEmitter("particle_metalFragment", "metalFrag", 100, targetX + (random(10) - 5), targetY - 10, 0.4, 6, 2, 8, 0, 1.5, 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 mortarExplosion(targetX, targetY) {
mortarExplosionParticle(targetX, targetY);
randomSound = "sound_mortar_explosion" + (random(2) + 1);
playSound(randomSound);
}
function mineExplosion(targetX, targetY) {
mineExplosionParticle(targetX, targetY);
randomSound = "sound_mine_explosion" + (random(2) + 1);
playSound(randomSound);
}
function artilleryExplosion(targetX, targetY) {
artilleryExplosionParticle(targetX, targetY);
randomSound = "sound_artillery_explosion" + (random(3) + 1);
playSound(randomSound);
}
function grenadeExplosion(targetX, targetY) {
grenadeExplosionParticle(targetX, targetY);
randomSound = "sound_grenade_explosion" + (random(2) + 1);
playSound(randomSound);
}
function bulletDust(targetX, targetY) {
bulletDustParticle(targetX, targetY);
randomSound = "sound_bulletHit" + (random(2) + 1);
setTimeout(playSound, random(100), randomSound);
}
function gasExplosion(targetX, targetY, strikeName, collisionName, ownerTeam) {
showGasMask();
specialRounds++;
world.attachMovie("gasCloud", "gasCloud" + specialRounds, depth_world_artillery + specialRounds);
world["gasCloud" + specialRounds]._rotation = random(360);
world["gasCloud" + specialRounds]._x = targetX;
world["gasCloud" + specialRounds]._y = targetY;
world["gasCloud" + specialRounds].collisionName = collisionName;
world["gasCloud" + specialRounds].strikeName = strikeName;
world["gasCloud" + specialRounds].ownerTeam = ownerTeam;
world["gasCloud" + specialRounds].timer = _root[ownerTeam].gas.duration;
world["gasCloud" + specialRounds].onEnterFrame = function () {
if (_root.game.state != "paused") {
this.timer--;
if (this.timer < 0) {
this.alphaTo(0, 2, "easeOutSine");
if (this._alpha == 0) {
_root.clearGas(this.collisionName, this.strikeName);
this.onEnterFrame = null;
}
}
}
};
randomSound = "sound_mortar_explosion" + (random(2) + 1);
playSound(randomSound);
}
function rainEffect() {
if (currentMap.rainOn == true) {
if (rainSetup == false) {
rainSetup = true;
world.attachMovie("blankMovie", "rainHolder", depth_world_rainHolder);
playSoundLoop("sound_ambienceRain", 9999, "ambienceRain");
x = 1;
while (x < rainDrops) {
numRainDrops++;
numRainSplash++;
world.rainHolder.attachMovie("rainDrop", "rainDrop" + numRainDrops, 50 + numRainDrops);
world.rainHolder.attachMovie("rainSplash", "rainSplash" + numRainSplash, 500 + numRainSplash);
world.rainHolder["rainDrop" + numRainDrops]._x = random(world.bg._width);
world.rainHolder["rainDrop" + numRainDrops]._y = random(200) - 500;
world.rainHolder["rainDrop" + numRainDrops].rainSplash = world.rainHolder["rainSplash" + numRainSplash];
world.rainHolder["rainDrop" + numRainDrops].onEnterFrame = function () {
this._x = this._x + 2;
this._y = this._y + 30;
if (this._y > (random(250) + 170)) {
this.rainSplash._x = this._x;
this.rainSplash._y = this._y;
this.rainSplash.gotoAndPlay(1);
this._y = random(200) - 500;
this._x = random(world.bg._width);
}
};
x++;
}
}
}
}
function launchSpecialAttack(type, targetX, targetY, owner) {
switch (type) {
case "artillery" :
artilleryStrike(targetX, targetY, owner);
break;
case "mortar" :
mortarStrike(targetX, targetY, owner);
break;
case "gas" :
if (owner == playerTeam.team) {
playVoice("gas", compTeam.team);
} else {
playVoice("gas", playerTeam.team);
}
gasStrike(targetX, targetY, owner);
break;
case "antiTank" :
antiTankStrike(targetX, targetY, owner);
break;
}
}
function playIncomingSound(soundType) {
if (random(6) == 0) {
playSound(("sound_incoming_" + soundType) + (random(3) + 1));
}
}
function artilleryStrike(targetX, targetY, ownerTeam) {
adjustStats("supportUsed", ownerTeam);
tempNumArtilleryRounds = numArtilleryRounds;
if (british_slot17_upgrade.active) {
tempNumArtilleryRounds = tempNumArtilleryRounds + british_slot17_upgrade.bonus;
}
if (british_slot21_upgrade.active) {
tempNumArtilleryRounds = tempNumArtilleryRounds + british_slot21_upgrade.bonus;
}
v = 0;
while (v < tempNumArtilleryRounds) {
artilleryRound(targetX, targetY, ownerTeam, random(30) + (v * 90));
v++;
}
}
function artilleryRound(targetX, targetY, ownerTeam, delay) {
specialRounds++;
world.attachMovie("artilleryStrike", "artyRound" + specialRounds, depth_world_artillery + specialRounds);
world["artyRound" + specialRounds].delayCount = delay;
world["artyRound" + specialRounds].onEnterFrame = function () {
if (_root.game.state != "paused") {
this.delayCount--;
if (this.delayCount < 0) {
this.play();
if (british_slot16_upgrade.active) {
this._x = targetX + ((random(250) - 125) * british_slot16_upgrade.bonus);
} else {
this._x = (targetX + random(250)) - 125;
}
this._y = world.ground + random(120);
this.ownerTeam = ownerTeam;
delete this.onEnterFrame;
}
}
};
}
function artilleryScorchDecal(targetX, targetY) {
decals++;
world.attachMovie("decal_artilleryScorch", "decal" + decals, depth_world_decals + decals);
world["decal" + decals]._xscale = (world["decal" + decals]._yscale = random(40) + 90);
world["decal" + decals]._alpha = random(30) + 70;
world["decal" + decals]._x = targetX;
world["decal" + decals]._y = targetY;
world["decal" + decals].alphaTo(0, 6, "easeOutSine", decalRemoveDelay, function () {
removeMovieClip(this);
});
}
function mortarStrike(targetX, targetY, ownerTeam) {
adjustStats("supportUsed", ownerTeam);
tempNumMortarRounds = numMortarRounds;
if (british_slot13_upgrade.active) {
tempNumMortarRounds = tempNumMortarRounds + british_slot13_upgrade.bonus;
}
v = 0;
while (v < tempNumMortarRounds) {
mortarRound(targetX, targetY, ownerTeam, random(20) + (v * 70));
v++;
}
}
function mortarRound(targetX, targetY, ownerTeam, delay) {
specialRounds++;
world.attachMovie("mortarStrike", "mortyRound" + specialRounds, depth_world_artillery + specialRounds);
world["mortyRound" + specialRounds].delayCount = delay;
world["mortyRound" + specialRounds].onEnterFrame = function () {
if (_root.game.state != "paused") {
this.delayCount--;
if (this.delayCount < 0) {
this.play();
if (british_slot12_upgrade.active) {
this._x = targetX + ((random(250) - 125) * british_slot12_upgrade.bonus);
} else {
this._x = (targetX + random(250)) - 125;
}
this._y = world.ground + random(120);
this.ownerTeam = ownerTeam;
delete this.onEnterFrame;
}
}
};
}
function mortarScorchDecal(targetX, targetY) {
decals++;
world.attachMovie("decal_artilleryScorch", "decal" + decals, depth_world_decals + decals);
world["decal" + decals]._xscale = (world["decal" + decals]._yscale = random(20) + 50);
world["decal" + decals]._alpha = random(20) + 80;
world["decal" + decals]._x = targetX;
world["decal" + decals]._y = targetY;
world["decal" + decals].alphaTo(0, 6, "easeOutSine", decalRemoveDelay, function () {
removeMovieClip(this);
});
}
function antiTankStrike(targetX, targetY, ownerTeam) {
adjustStats("supportUsed", ownerTeam);
v = 0;
while (v < numAntiTankRounds) {
antiTankRound(targetX, targetY, ownerTeam, random(20) + (v * 70));
v++;
}
}
function antiTankRound(targetX, targetY, ownerTeam, delay) {
specialRounds++;
world.attachMovie("antiTankStrike", "antiTank" + specialRounds, depth_world_artillery + specialRounds);
if (ownerTeam == "german") {
world["antiTank" + specialRounds]._xscale = -100;
}
world["antiTank" + specialRounds].delayCount = delay;
world["antiTank" + specialRounds].onEnterFrame = function () {
if (_root.game.state != "paused") {
this.delayCount--;
if (this.delayCount < 0) {
this.play();
if (british_slot12_upgrade.active) {
this._x = targetX + ((random(250) - 125) * british_slot12_upgrade.bonus);
} else {
this._x = (targetX + random(250)) - 125;
}
this._y = world.ground + random(120);
this.ownerTeam = ownerTeam;
delete this.onEnterFrame;
}
}
};
}
function gasStrike(targetX, targetY, ownerTeam) {
adjustStats("supportUsed", ownerTeam);
v = 0;
while (v < numGasRounds) {
setTimeout(gasRound, random(800) + (v * 1100), targetX, targetY, ownerTeam);
v++;
}
}
function gasRound(targetX, targetY, ownerTeam) {
specialRounds++;
world.attachMovie("gasStrikeAnim", "gasRound" + specialRounds, depth_world_artillery + specialRounds);
world["gasRound" + specialRounds]._x = (targetX + random(250)) - 125;
world["gasRound" + specialRounds]._y = world.ground + random(120);
world["gasRound" + specialRounds].ownerTeam = ownerTeam;
}
function gasCloudCollisions(teamName) {
if (activeGas.length > 0) {
for (v in activeGas) {
for (s in _root[teamName + "SquadsOnScreen"]) {
if (((activeGas[v].xTarget - _root[teamName + "SquadsOnScreen"][s].members[0]._x) > (-gasDetectRange)) && ((activeGas[v].xTarget - _root[teamName + "SquadsOnScreen"][s].members[0]._x) < gasDetectRange)) {
_root[teamName + "SquadsOnScreen"][s].nearGas = true;
}
if (_root[teamName + "SquadsOnScreen"][s].nearGas == true) {
if (((activeGas[v].hitTest(_root[teamName + "SquadsOnScreen"][s].members[0].collision) == true) && (_root[teamName + "SquadsOnScreen"][s].allMasksOn == false)) && (_root[teamName + "SquadsOnScreen"][s].type != "tank")) {
gasDamage = gasDamage;
if ((british_slot15_upgrade.active == true) || (german_slot15_upgrade.active == true)) {
gasDamage = gasDamage * british_slot15_upgrade.bonus;
}
_root[teamName + "SquadsOnScreen"][s].health = _root[teamName + "SquadsOnScreen"][s].health - gasDamage;
for (m in _root[teamName + "SquadsOnScreen"][s].members) {
if ((_root[teamName + "SquadsOnScreen"][s].health <= _root[teamName + "SquadsOnScreen"][s].members[m].health) && (_root[teamName + "SquadsOnScreen"][s].members[m].alive == true)) {
_root[teamName + "SquadsOnScreen"][s].members[m].alive = false;
adjustMorale(teamName, _root[teamName + "SquadsOnScreen"][s].type, "normal");
if (_root[teamName + "SquadsOnScreen"][s].members[m].position != "trench") {
_root[teamName + "SquadsOnScreen"][s].members[m].gotoAndPlay("standing_collapse");
} else {
_root[teamName + "SquadsOnScreen"][s].members[m].gotoAndPlay("trench_collapse");
}
setTimeout(fadeDeadSoldier, clearDeadSoldierTime, _root[teamName + "SquadsOnScreen"][s].members[m]);
sortDeadSoldiers(_root[teamName + "SquadsOnScreen"][s].members[m]);
_root[teamName + "SquadsOnScreen"][s].members[m].selectedRing.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members[m].healthBar.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members[m].officerStar.alphaTo(0, 0.3);
_root[teamName + "SquadsOnScreen"][s].members.splice(m, 1);
playSound("sound_soldierCough" + (random(5) + 1));
if (_root[teamName + "SquadsOnScreen"][s].members.length == 0) {
_root.trenches[_root[teamName + "SquadsOnScreen"][s].trenchNumRef]["slot" + _root[teamName + "SquadsOnScreen"][s].trenchSlotRef] = "empty";
_root[teamName + "SquadsOnScreen"].splice(s, 1);
adjustStats("unitLost", teamName);
}
}
}
}
}
}
}
}
}
function clearGas(parentName, gasCloudName) {
for (v in activeGas) {
if (parentName._name == activeGas[v]._name) {
activeGas.splice(v, 1);
break;
}
}
removeMovieClip(gasCloudName);
removeMovieClip(parentName);
if (activeGas[0]._name == undefined) {
hideGasMask();
for (v in _root[playerTeam.team + "SquadsOnScreen"]) {
_root[playerTeam.team + "SquadsOnScreen"][v].nearGas = false;
if (_root[playerTeam.team + "SquadsOnScreen"][v].gasMasksOn == true) {
_root[playerTeam.team + "SquadsOnScreen"][v].lastState = _root[playerTeam.team + "SquadsOnScreen"][v].state;
_root[playerTeam.team + "SquadsOnScreen"][v].state = "gasMasksOff";
}
}
}
}
function tankRound(targetX, targetY, ownerTeam) {
specialRounds++;
world.attachMovie("tankRound", "tankRound" + specialRounds, depth_world_artillery + specialRounds);
world["tankRound" + specialRounds]._x = targetX;
world["tankRound" + specialRounds]._y = targetY;
world["tankRound" + specialRounds].ownerTeam = ownerTeam;
}
function buildGameInterface() {
_root.attachMovie("hud", "hud", depth_HUD);
setupInterfaceExperience();
setupProgressBar();
setupHelp();
hud.experience.text = "XP: " + experiencePoints;
hud.level.text = "LEVEL: " + experienceLevel;
checkUnitNames();
hud.attachMovie("panArrow", "panArrow", depth_HUD_panArrow);
debugTools();
startBattle();
}
function setupCursor() {
_root.attachMovie("gameCursor", "gameCursor", depth_cursor);
Mouse.hide();
gameCursor.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
}
function showHand() {
gameCursor.gotoAndStop("hand");
}
function showArrow() {
gameCursor._visible = true;
gameCursor.gotoAndStop("arrow");
}
function showGasMask() {
if (hud.gasMask._visible == false) {
if (_root[playerTeam.team].gasMasksOn == true) {
hud.gasMask.mainButton.buttonText.text = "ON";
}
if (_root[playerTeam.team].gasMasksOn == false) {
hud.gasMask.mainButton.buttonText.text = "OFF";
}
hud.gasMask._alpha = 0;
hud.gasMask._visible = true;
hud.gasMask.alphaTo(100, 0.3);
hud.gasMask.mainButton.onRelease = (hud.gasMask.maskButton.onRelease = function () {
playClickSound();
for (g in _root[playerTeam.team + "SquadsOnScreen"]) {
if (_root[playerTeam.team + "SquadsOnScreen"][g].nearGas == true) {
_root[playerTeam.team + "SquadsOnScreen"][g].lastState = _root[playerTeam.team + "SquadsOnScreen"][g].state;
_root[playerTeam.team + "SquadsOnScreen"][g].state = "gasMasksOn";
}
}
});
}
}
function hideGasMask() {
hud.gasMask.alphaTo(0, 0.3, "linear", 0, function () {
this._visible = false;
});
}
function setupProgressBar() {
hud.progressBar.onRollOver = function () {
hud.progressBarToolTip._alpha = 0;
hud.progressBarToolTip._visible = true;
hud.progressBarToolTip.alphaTo(100, 0.6);
};
hud.progressBar.onRollOut = function () {
hud.progressBarToolTip.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
};
}
function updateProgressBar() {
for (s in britishSquadsOnScreen) {
if (britishSquadsOnScreen[s].members[0]._x > closestPlayerTeamSquadX) {
closestPlayerTeamSquad = britishSquadsOnScreen[s];
closestPlayerTeamSquadX = britishSquadsOnScreen[s].members[0]._x;
groundMoraleCheck(closestPlayerTeamSquadX, "british");
}
}
for (c in germanSquadsOnScreen) {
if (germanSquadsOnScreen[c].members[0]._x < closestCompTeamSquadX) {
closestCompTeamSquad = germanSquadsOnScreen[c];
closestCompTeamSquadX = germanSquadsOnScreen[c].members[0]._x;
groundMoraleCheck(closestCompTeamSquadX, "german");
}
}
if ((britishSquadsOnScreen == undefined) || (closestPlayerTeamSquad.members[0].alive == undefined)) {
hud.progressBar.playerTeamProgBar.colorTo(3342336, 0.2);
hud.progressBar.playerTeamProgBar.colorTo(null, 2, "easeOutSine", 1);
closestPlayerTeamSquad = undefined;
closestPlayerTeamSquadX = -1;
}
if ((germanSquadsOnScreen == undefined) || (closestCompTeamSquad.members[0].alive == undefined)) {
hud.progressBar.compTeamProgBar.colorTo(3342336, 0.2);
hud.progressBar.compTeamProgBar.colorTo(null, 2, "easeOutSine", 1);
closestCompTeamSquad = undefined;
closestCompTeamSquadX = world.bg._width;
}
progressBarPlayerScale = Math.round((closestPlayerTeamSquadX / (world.bg._width - 60)) * 100);
progressBarCompScale = Math.round(((closestCompTeamSquadX - 60) / world.bg._width) * 100);
progressBarCompScale = 100 - progressBarCompScale;
if ((playerTeam.team == "british") && (progressBarPlayerScale >= 50)) {
AIpanicMode = true;
}
if ((playerTeam.team == "british") && (progressBarPlayerScale < 50)) {
AIpanicMode = false;
}
if ((compTeam.team == "british") && (progressBarCompScale >= 50)) {
AIpanicMode = true;
}
if ((compTeam.team == "british") && (progressBarCompScale < 50)) {
AIpanicMode = false;
}
hud.progressBarToolTip.britishGroundTaken.text = progressBarPlayerScale + "%";
hud.progressBarToolTip.germanGroundTaken.text = progressBarCompScale + "%";
if ((progressBarPlayerScale != lastProgPlayerScale) || (progressBarCompScale != lastProgCompScale)) {
lastProgPlayerScale = progressBarPlayerScale;
lastProgCompScale = progressBarCompScale;
hud.progressBar.playerTeamProgBar.xScaleTo(progressBarPlayerScale, 5, "easeOutSine");
hud.progressBar.compTeamProgBar.xScaleTo(progressBarCompScale, 5, "easeOutSine");
}
}
function checkUnitNames() {
if (playerTeam.team == "german") {
slot2_unit.unitType = "Sturmtruppen";
slot3_unit.unitType = "Machine Gun Team";
slot6_unit.unitType = "A7V Tank";
}
if (playerTeam.team == "british") {
slot2_unit.unitType = "Assault Team";
slot3_unit.unitType = "Lewis Gunners";
slot6_unit.unitType = "Mark IV Tank";
}
}
function buttonSetup(btnName) {
hud["icon_" + btnName].gotoAndStop(playerTeam.team);
hud.hudBG.gotoAndStop(playerTeam.team);
hud.progressBar.casing.gotoAndStop(playerTeam.team);
hud["icon_" + btnName].icon._alpha = 0;
hud[btnName].rightDial._rotation = -180;
hud[btnName]._alpha = 0;
hud[btnName].unlocked = false;
for (v in currentMap.availableUnits) {
if (currentMap.availableUnits[v] == _root[btnName + "_unit"].name) {
hud[btnName].unlocked = true;
hud["lock_" + btnName]._alpha = 0;
hud["icon_" + btnName].icon._alpha = 100;
hud["icon_" + btnName].icon.gotoAndStop("colour");
hud[btnName].activated = true;
hud["highlight_" + btnName].alphaTo(55, 0);
hud[btnName].colorTo(12566199, 0.5, "linear");
hud[btnName].alphaTo(0, 0.3, "linear", 0.4);
}
}
allSlots.push(hud[btnName]);
hud[btnName].onRollOver = function () {
hud[btnName].useHandCursor = false;
if (hud[btnName].unlocked == true) {
hud.toolTip.backing._width = 10;
hud.toolTip.backing._height = 10;
hud.toolTip.desc._width = 10;
hud.toolTip.header.autoSize = "left";
hud.toolTip.header.text = _root[btnName + "_unit"].unitType;
hud.toolTip.desc.autoSize = "left";
hud.toolTip.desc.text = _root[btnName + "_unit"].description;
hud.toolTip.backing._width = hud.toolTip.desc._width + 20;
hud.toolTip.backing._height = hud.toolTip.desc._height + 20;
if (hud.toolTip.desc._width <= hud.toolTip.header._width) {
hud.toolTip.backing._width = hud.toolTip.header._width + 10;
}
hud.toolTip._alpha = 0;
hud.toolTip._visible = true;
hud.toolTip.alphaTo(100, 0.4, "easeOutSine", 0.5);
}
if ((hud[btnName].activated == true) && (hud[btnName].unlocked == true)) {
hud[btnName].useHandCursor = true;
hud["highlight_" + btnName].alphaTo(95, 0.8);
}
};
hud[btnName].onRollOut = (hud[btnName].onDragOut = function () {
hud.toolTip.stopTween();
hud.toolTip.alphaTo(0, 0.2);
if ((hud[btnName].activated == true) && (hud[btnName].unlocked == true)) {
hud["highlight_" + btnName].alphaTo(55, 0.8);
}
});
hud[btnName].onPress = (hud[btnName].onRelease = (hud[btnName].onReleaseOutside = function () {
if ((this.activated == true) && (this.unlocked == true)) {
this.activated = false;
_root.createSquad(playerTeam.team, _root[btnName + "_unit"].name);
_root.resetButtonTimers();
_root.showHelp();
}
}));
hud[btnName].onEnterFrame = function () {
if (((this.activated == false) && (this.unlocked == true)) && (game.state == "unpaused")) {
buttonTimer(btnName);
}
};
}
function buttonTimer(btnName) {
currentReinforceTime = _root[btnName + "_unit"].timer;
if (british_slot1_upgrade.active && (btnName != "slot6")) {
currentReinforceTime = currentReinforceTime * british_slot1_upgrade.bonus;
}
if (british_slot5_upgrade.active && (btnName != "slot6")) {
currentReinforceTime = currentReinforceTime * british_slot5_upgrade.bonus;
}
if (german_slot3_upgrade.active && (btnName != "slot6")) {
currentReinforceTime = currentReinforceTime * german_slot3_upgrade.bonus;
}
if (german_slot7_upgrade.active && (btnName != "slot6")) {
currentReinforceTime = currentReinforceTime * german_slot7_upgrade.bonus;
}
if (german_slot10_upgrade.active && (btnName == "slot6")) {
currentReinforceTime = currentReinforceTime * german_slot10_upgrade.bonus;
}
if (hud[btnName].unlocked == true) {
if ((hud[btnName].rightDial._rotation < 0) && (hud[btnName].activated == false)) {
hud[btnName].rightDial._rotation = hud[btnName].rightDial._rotation + (180 / (currentReinforceTime / 2));
}
if (((hud[btnName].rightDial._rotation >= 0) && (hud[btnName].leftDial._rotation > -180)) && (hud[btnName].activated == false)) {
hud[btnName].leftDial._rotation = hud[btnName].leftDial._rotation + (180 / (currentReinforceTime / 2));
}
if (((hud[btnName].leftDial._rotation < 0) && (hud[btnName].rightDial._rotation >= 0)) && (hud[btnName].activated == false)) {
hud[btnName].activated = true;
hud[btnName].rightDial._rotation = 0;
hud[btnName].leftDial._rotation = 180;
hud["icon_" + btnName].icon.gotoAndStop("colour");
hud["highlight_" + btnName].alphaTo(55, 0.3, "linear", 0.5);
hud[btnName].colorTo(10460563, 0.5, "linear");
hud[btnName].alphaTo(0, 0.3, "linear", 0.4);
}
}
}
function resetButtonTimers() {
for (bSlot in allSlots) {
if (allSlots[bSlot].unlocked == true) {
allSlots[bSlot].activated = false;
allSlots[bSlot].stopTween();
hud["icon_" + allSlots[bSlot]._name].icon.gotoAndStop("bw");
hud["highlight_" + allSlots[bSlot]._name].alphaTo(0, 0.8);
allSlots[bSlot].alphaTo(100, 0.1, "linear");
allSlots[bSlot].colorTo(null, 0.1, "linear");
allSlots[bSlot].rightDial._rotation = -179;
allSlots[bSlot].leftDial._rotation = 0;
}
}
}
function buttonSetup_fireSupport(btnName) {
hud[btnName].activated = false;
hud[btnName].rightDial._rotation = -180;
hud[btnName].useHandCursor = false;
supportSlots.push(hud[btnName]);
hud["icon_" + btnName]._visible = false;
hud[btnName].unlocked = false;
for (v in currentMap.availableUnits) {
if (currentMap.availableUnits[v] == _root[btnName + "_special"].name) {
hud["lock_" + btnName]._alpha = 0;
hud["icon_" + btnName]._visible = true;
hud[btnName]._visible = true;
hud[btnName].unlocked = true;
}
}
hud[btnName].onRollOver = function () {
if (hud[btnName].unlocked == true) {
hud.toolTip.backing._width = 10;
hud.toolTip.backing._height = 10;
hud.toolTip.desc._width = 10;
hud.toolTip.header.autoSize = "left";
hud.toolTip.header.text = _root[btnName + "_special"].unitType;
hud.toolTip.desc.autoSize = "left";
hud.toolTip.desc.text = _root[btnName + "_special"].description;
hud.toolTip.backing._width = hud.toolTip.desc._width + 20;
hud.toolTip.backing._height = hud.toolTip.desc._height + 20;
if (hud.toolTip.desc._width <= hud.toolTip.header._width) {
hud.toolTip.backing._width = hud.toolTip.header._width + 10;
}
hud.toolTip._alpha = 0;
hud.toolTip._visible = true;
hud.toolTip.alphaTo(100, 0.4, "easeOutSine", 0.5);
}
if ((hud[btnName].activated == true) && (hud[btnName].unlocked == true)) {
hud[btnName].useHandCursor = true;
hud["highlight_" + btnName].alphaTo(95, 0.8);
}
};
hud[btnName].onRollOut = (hud[btnName].onDragOut = function () {
hud.toolTip.stopTween();
hud.toolTip.alphaTo(0, 0.2);
if ((hud[btnName].activated == true) && (hud[btnName].unlocked == true)) {
hud["highlight_" + btnName].alphaTo(55, 0.8);
}
});
hud[btnName].onPress = (hud[btnName].onRelease = (hud[btnName].onReleaseOutside = function () {
if ((this.activated == true) && (hud[btnName].unlocked == true)) {
this.activated = false;
supportTargets++;
_root.world.attachMovie("interface_groundTarget", "supportTarget" + supportTargets, depth_world_target);
_root.world["supportTarget" + supportTargets]._y = _root.world.ground + 60;
_root.world["supportTarget" + supportTargets].onEnterFrame = function () {
_root.world["supportTarget" + supportTargets]._x = _root.world._xmouse;
};
_root.world["supportTarget" + supportTargets].onRelease = function () {
launchSpecialAttack(_root[btnName + "_special"].name, _root.world["supportTarget" + supportTargets]._x, _root.world.ground, playerTeam.team);
_root.world["supportTarget" + supportTargets].colorTo(16777215, 0.5, "linear");
_root.world["supportTarget" + supportTargets].colorTo(null, 0.5, "linear", 0.5);
_root.world["supportTarget" + supportTargets].alphaTo(0, 8, "linear", 0, function () {
removeMovieClip(this);
});
_root.world["supportTarget" + supportTargets].onRelease = null;
_root.world["supportTarget" + supportTargets].onEnterFrame = null;
resetSupportButtonTimers(btnName);
};
}
}));
hud[btnName].onEnterFrame = function () {
if ((this.activated == false) && (game.state == "unpaused")) {
_root.buttonTimer_supportButtons(btnName);
}
};
}
function buttonTimer_supportButtons(btnName) {
currentFireSupportTime = _root[btnName + "_special"].timer;
if (british_slot20_upgrade.active) {
currentFireSupportTime = currentFireSupportTime * british_slot20_upgrade.bonus;
}
if (hud[btnName].unlocked == true) {
if ((hud[btnName].rightDial._rotation < 0) && (hud[btnName].activated == false)) {
hud[btnName].rightDial._rotation = hud[btnName].rightDial._rotation + (180 / (currentFireSupportTime / 2));
}
if (((hud[btnName].rightDial._rotation >= 0) && (hud[btnName].leftDial._rotation > -180)) && (hud[btnName].activated == false)) {
hud[btnName].leftDial._rotation = hud[btnName].leftDial._rotation + (180 / (currentFireSupportTime / 2));
}
if (((hud[btnName].leftDial._rotation < 0) && (hud[btnName].rightDial._rotation >= 0)) && (hud[btnName].activated == false)) {
hud[btnName].activated = true;
hud[btnName].rightDial._rotation = 0;
hud[btnName].leftDial._rotation = 180;
hud["icon_" + btnName].gotoAndStop("colour");
hud[btnName].colorTo(10460563, 0.5, "linear");
hud[btnName].alphaTo(0, 0.3, "linear", 0.4);
}
}
}
function resetSupportButtonTimers(btnName) {
hud[btnName].activated = false;
hud[btnName].stopTween();
hud["icon_" + btnName].gotoAndStop("bw");
hud["highlight_" + btnName].alphaTo(0, 0.8);
hud[btnName].alphaTo(100, 0.1, "linear");
hud[btnName].colorTo(null, 0.1, "linear");
hud[btnName].rightDial._rotation = -179;
hud[btnName].leftDial._rotation = 0;
}
function soldierRollOvers(soldierRef) {
if (soldierRef.squadObjRef.team == playerTeam.team) {
soldierRef.useHandCursor = false;
soldierRef.onRollOver = function () {
for (m in soldierRef.squadObjRef.members) {
if (m == 0) {
soldierRef.squadObjRef.members[m].healthBar._visible = true;
soldierRef.squadObjRef.members[m].healthBar.alphaTo(100, 0.2);
if (soldierRef.squadObjRef.team == compTeam.team) {
}
}
soldierRef.squadObjRef.members[m].selectedRing._visible = true;
soldierRef.squadObjRef.members[m].selectedRing.alphaTo(30, 0.2);
}
};
soldierRef.onRollOut = function () {
for (m in soldierRef.squadObjRef.members) {
if (m == 0) {
soldierRef.squadObjRef.members[m].healthBar.alphaTo(0, 0.5, "linear", 1);
}
soldierRef.squadObjRef.members[m].selectedRing.alphaTo(0, 0.5, "linear", 1);
}
};
}
}
function initBattleStats() {
britishEnemiesKilled = 0;
germanEnemiesKilled = 0;
britishUnitsLost = 0;
germanUnitsLost = 0;
britishUnitsDeployed = 0;
germanUnitsDeployed = 0;
britishTrenchesTaken = 0;
germanTrenchesTaken = 0;
britishSupportUsed = 0;
germanSupportUsed = 0;
}
function winBattle() {
endBattle(playerTeam.team);
}
function startBattle() {
initBattleStats();
if (retry == true) {
}
if (retry == false) {
}
endOfBattle = false;
firstEnemyUnit = true;
experienceForMap = 0;
britishSquadsOnScreen = new Array();
germanSquadsOnScreen = new Array();
britishOfficers = new Array();
germanOfficers = new Array();
deadTanks = new Array();
groundMoraleIndexBritish = 0;
groundMoraleIndexGerman = 0;
cameraSetup();
assignMorale();
setupEnemyUnitGenerator();
setupEnemySupportGenerator();
loadScreen.alphaTo(0, 2, "easeOutSine", 4, function () {
playSoundLoop("sound_ambienceBattle", 9999, "ambience");
removeMovieClip(this);
});
game.state = "unpaused";
}
function endBattle(winner, winType) {
endOfBattle = true;
game.state = "endBattle";
playSound("sound_cheer");
if (playingSkirmish == false) {
removeMovieClip(_root.menu);
}
if (winner == playerTeam.team) {
sendKongMissionFinished(currentMap.mission);
sendKongBattleWon(winType);
career_wins++;
if (winType == "conquer") {
career_conquerWins++;
} else {
career_moraleWins++;
}
} else {
sendKongBattleLost(winType);
career_losses++;
if (winType == "conquer") {
career_conquerLosses++;
} else {
career_moraleLosses++;
}
}
if (winner == "british") {
for (b in britishSquadsOnScreen) {
britishSquadsOnScreen[b].state = "victory";
}
for (g in germanSquadsOnScreen) {
germanSquadsOnScreen[g].state = "defeated";
}
} else {
for (g in germanSquadsOnScreen) {
germanSquadsOnScreen[g].state = "victory";
}
for (b in britishSquadsOnScreen) {
britishSquadsOnScreen[b].state = "defeated";
}
}
if (playingSkirmish == false) {
sendMaxKongStats();
}
setTimeout(postBattleScreen, 6000, winner);
if (winner == playerTeam.team) {
if (winType == "conquer") {
showQuickMessage("ENEMY GROUND TAKEN, YOU WIN!", "center");
}
if (winType == "morale") {
showQuickMessage("THE ENEMY HAS SURRENDERED, YOU WIN!", "center");
}
playMusicLoop("music_winMusic", 30, "endBattleMusic");
music_endBattleMusic.volumeTo(100, 10);
} else {
if (winType == "conquer") {
showQuickMessage("GROUND LOST, YOU HAVE BEEN DEFEATED.", "center");
}
if (winType == "morale") {
showQuickMessage("MORALE DEPLETED, OUR MEN SURRENDERED.", "center");
}
playMusicLoop("music_lossMusic", 30, "endBattleMusic");
music_endBattleMusic.volumeTo(100, 10);
}
}
function unloadBattle() {
unloadMap();
removeMovieClip(hud);
showArrow();
}
function loadNextBattle(winner) {
if (winner == playerTeam.team) {
battleNum++;
retry = false;
} else {
retry = true;
}
currentMap = _root[(playerTeam.team + "_map") + battleNum];
}
function adjustStats(stat, targetTeam) {
switch (stat) {
case "kill" :
_root[targetTeam + "EnemiesKilled"]++;
break;
case "unitLost" :
_root[targetTeam + "UnitsLost"]++;
break;
case "unitDeployed" :
_root[targetTeam + "UnitsDeployed"]++;
break;
case "supportUsed" :
_root[targetTeam + "SupportUsed"]++;
}
}
function postBattleScreen(winner) {
if (playingSkirmish == false) {
removeMovieClip(_root.menu);
}
for (x in trenches) {
if (trenches[x].ownerTeam == "british") {
britishTrenchesTaken++;
}
if (trenches[x].ownerTeam == "german") {
germanTrenchesTaken++;
}
}
if (playerTeam.team == "british") {
career_trenchesTaken = career_trenchesTaken + britishTrenchesTaken;
} else {
career_trenchesTaken = career_trenchesTaken + germanTrenchesTaken;
}
_root.attachMovie("loadScreen", "loadScreen", depth_blackOut);
hud.onRelease = function () {
};
loadScreen._alpha = 0;
loadScreen.gotoAndStop("postBattle");
loadScreen.bg.gotoAndStop(playerTeam.team);
loadScreen.alphaTo(100, 2, "easeOutSine");
setTimeout(unloadBattle, 2000);
loadScreen.continueButton.buttonText.text = "CONTINUE";
loadScreen.continueButton.onRollOver = function () {
playRollOverSound();
this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
loadScreen.continueButton.onRollOut = function () {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
};
loadScreen.continueButton.onRelease = function () {
playClickSound();
music_endBattleMusic.volumeTo(0, 5, "easeOutSine", 0, function () {
loopambience.stop();
loopambienceRain.stop();
this.stop();
});
loadScreen.alphaTo(0, 1.2, "easeOutSine", 0, function () {
removeMovieClip(this);
});
if (playingSkirmish == false) {
loadNextBattle(winner);
loadMapScreenEndBattle();
game.state = "paused";
} else {
loadSkirmishEndBattle();
game.state = "paused";
}
initBattleStats();
};
playerBonusXP = 0;
if (winner == playerTeam.team) {
if (playerTeam.team == "british") {
killDifference = britishEnemiesKilled - germanEnemiesKilled;
if (killDifference <= 0) {
killDifference = 0;
}
playerBonusXP = Math.round(((britishTrenchesTaken + killDifference) + currentMap.mission) * 10);
if (playerBonusXP <= 0) {
playerBonusXP = 0;
}
}
if (playerTeam.team == "german") {
killDifference = germanEnemiesKilled - britishEnemiesKilled;
if (killDifference <= 0) {
killDifference = 0;
}
playerBonusXP = Math.round(((germanTrenchesTaken + killDifference) - germanSupportUsed) * 10);
if (playerBonusXP <= 0) {
playerBonusXP = 0;
}
}
career_bonusExpGained = career_bonusExpGained + playerBonusXP;
if ((currentMap.mission == 9) && (winner == playerTeam.team)) {
loadScreen.gotoAndStop("endGame");
game.state = "paused";
showEnding();
}
loadScreen.teamVictory.text = playerTeam.team.toUpperCase() + " VICTORY!";
loadScreen.bonusXP.text = "BONUS XP: " + playerBonusXP;
updateExperience("bonus", null);
} else {
loadScreen.teamVictory.text = playerTeam.team.toUpperCase() + " DEFEAT!";
loadScreen.bonusXP.text = "BONUS XP: 0";
}
if (playingSkirmish) {
loadScreen.bonusXP.text = "";
loadScreen.XPnote._visible = false;
}
loadScreen.brit_enemiesKilled.text = britishEnemiesKilled;
loadScreen.german_enemiesKilled.text = germanEnemiesKilled;
loadScreen.brit_unitsLost.text = britishUnitsLost;
loadScreen.german_unitsLost.text = germanUnitsLost;
loadScreen.brit_unitsDeployed.text = britishUnitsDeployed;
loadScreen.german_unitsDeployed.text = germanUnitsDeployed;
loadScreen.brit_trenchesTaken.text = britishTrenchesTaken;
loadScreen.german_trenchesTaken.text = germanTrenchesTaken;
loadScreen.brit_supportUsed.text = britishSupportUsed;
loadScreen.german_supportUsed.text = germanSupportUsed;
if (playerTeam.team == "british") {
career_supportUsed = career_supportUsed + britishSupportUsed;
} else {
career_supportUsed = career_supportUsed + germanSupportUsed;
}
if (britishEnemiesKilled > germanEnemiesKilled) {
loadScreen.brit_enemiesKilled.colorTo(10667612);
loadScreen.german_enemiesKilled.colorTo(9323331);
} else if (britishEnemiesKilled == germanEnemiesKilled) {
} else {
loadScreen.brit_enemiesKilled.colorTo(9323331);
loadScreen.german_enemiesKilled.colorTo(10667612);
}
if (britishUnitsLost > germanUnitsLost) {
loadScreen.brit_unitsLost.colorTo(9323331);
loadScreen.german_unitsLost.colorTo(10667612);
} else if (britishUnitsLost == germanUnitsLost) {
} else {
loadScreen.brit_unitsLost.colorTo(10667612);
loadScreen.german_unitsLost.colorTo(9323331);
}
if (britishUnitsDeployed > germanUnitsDeployed) {
loadScreen.brit_unitsDeployed.colorTo(10667612);
loadScreen.german_unitsDeployed.colorTo(9323331);
} else if (britishUnitsDeployed == germanUnitsDeployed) {
} else {
loadScreen.brit_unitsDeployed.colorTo(9323331);
loadScreen.german_unitsDeployed.colorTo(10667612);
}
if (britishTrenchesTaken > germanTrenchesTaken) {
loadScreen.brit_trenchesTaken.colorTo(10667612);
loadScreen.german_trenchesTaken.colorTo(9323331);
} else if (britishTrenchesTaken == germanTrenchesTaken) {
} else {
loadScreen.brit_trenchesTaken.colorTo(9323331);
loadScreen.german_trenchesTaken.colorTo(10667612);
}
if (britishSupportUsed > germanSupportUsed) {
loadScreen.brit_supportUsed.colorTo(9323331);
loadScreen.german_supportUsed.colorTo(10667612);
} else if (britishSupportUsed == germanSupportUsed) {
} else {
loadScreen.brit_supportUsed.colorTo(10667612);
loadScreen.german_supportUsed.colorTo(9323331);
}
}
function enemyMortar() {
AImortarTarget = random(britishSquadsOnScreen.length);
artStrike = new Object();
artStrike.x = britishSquadsOnScreen[AImortarTarget].members[0]._x + random(50);
_root.world.globalToLocal(artStrike);
setTimeout(mortarStrike, random(2000) + 5000, artStrike.x, world.ground, compTeam.team);
}
function campaignMapSetup(currentMapLoc) {
mapSectionFound = false;
_root.menu.mapScreen.header.autoSize = "center";
_root.menu.mapScreen.desc.autoSize = "center";
_root.menu.mapScreen.header.text = currentMapLoc.battleTitle;
_root.menu.mapScreen.desc.text = currentMapLoc.description;
if (playerTeam.team == "british") {
i = 0;
while (i < campaignMapSections.length) {
_root.menu.mapScreen.map[campaignMapSections[i]].backing._alpha = campaignMapSectionAlpha;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons_german"]._visible = false;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons"]._visible = false;
if ((currentMapLoc.mapSection == campaignMapSections[i]) && (mapSectionFound == false)) {
mapSectionFound = true;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons"]._visible = true;
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(10027008);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
}
if (mapSectionFound == false) {
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(16777215);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(british.teamColour, 2, "easeOutSine", 1);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
} else {
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(german.teamColour);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
}
i++;
}
}
if (playerTeam.team == "german") {
for (i in campaignMapSections) {
_root.menu.mapScreen.map[campaignMapSections[i]].backing._alpha = campaignMapSectionAlpha;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons_german"]._visible = false;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons"]._visible = false;
if ((currentMapLoc.mapSection == campaignMapSections[i]) && (mapSectionFound == false)) {
mapSectionFound = true;
_root.menu.mapScreen.map[campaignMapSections[i] + "_icons_german"]._visible = true;
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(10027008);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
}
if (mapSectionFound == false) {
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(16777215);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(german.teamColour, 2, "easeOutSine", 1);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
} else {
_root.menu.mapScreen.map[campaignMapSections[i]].backing.colorTo(british.teamColour);
_root.menu.mapScreen.map[campaignMapSections[i]].backing.blurTo(5, 1);
}
}
}
}
function playMap() {
currentMap = german_map9;
hideMenu();
buildMap(currentMap);
showLoadScreen();
}
function buildMap(mapName) {
_root.trenches = new Array();
_root.attachMovie(mapName.file, "world", depth_testMap);
world.ground = 170;
for (v in mapName.trenchPos) {
world.bg.attachMovie("trench", "trench" + v, depth_bg_trenches + v);
world.bg["trench" + v]._y = 135;
world.bg["trench" + v]._x = mapName.trenchPos[v];
world.bg["trench" + v].slot1 = "empty";
world.bg["trench" + v].slot2 = "empty";
world.bg["trench" + v].slot3 = "empty";
world.bg["trench" + v].locked = false;
world.bg["trench" + v].controlVisible = false;
world.bg["trench" + v].controlClipVisible = false;
world.bg["trench" + v].ownerTeam = undefined;
_root.trenches.push(world.bg["trench" + v]);
_root.trenchButtons(world.bg["trench" + v]);
}
world.bg.cacheAsBitmap = true;
_root.wire = new Array();
if (mapName.wire != undefined) {
x = 1;
while (x <= mapName.wire) {
w = 0;
while (w < 6) {
wireCount++;
world.attachMovie("wireFence", "wire" + wireCount, depth_world_wire + wireCount);
if (random(2) == 0) {
world["wire" + wireCount]._xscale = -100;
}
var _local3 = random(2) + 1;
world["wire" + wireCount].gotoAndStop(2);
world["wire" + wireCount]._x = ((mapName[("wire" + x) + "Pos"] + (w * 5)) + random(22)) - 11;
world["wire" + wireCount]._y = 180 + (w * 30);
world["wire" + wireCount].depth = world["wire" + wireCount]._y;
world["wire" + wireCount].ref = world["wire" + wireCount];
_root.wire.push(world["wire" + wireCount]);
w++;
}
x++;
}
}
currentMapMines_british = currentMap.britishMinesMax;
currentMapMines_german = currentMap.germanMinesMax;
rainEffect();
british.spawnPoint = -100;
german.spawnPoint = world.bg._width + 100;
currentMap = mapName;
}
function unloadMap() {
removeMovieClip(world);
}
function setUpgradesInfantry() {
british_slot1_upgrade.name = "RALLY";
british_slot1_upgrade.desc = "Reinforcements will arrive quicker for all infantry.";
british_slot1_upgrade.effect = "10% faster reinforcement";
british_slot1_upgrade.cost = 1;
british_slot1_upgrade.bonus = 0.9;
british_slot1_upgrade.unlocked = true;
british_slot1_upgrade.active = false;
british_slot2_upgrade.name = "BALLISTICS";
british_slot2_upgrade.desc = "All Infantry armed with rifles will inflict more damage.";
british_slot2_upgrade.effect = "+15% Damage to Rifles";
british_slot2_upgrade.cost = 1;
british_slot2_upgrade.bonus = 1.15;
british_slot2_upgrade.unlocked = true;
british_slot2_upgrade.active = false;
british_slot3_upgrade.name = "HARD HEADED";
british_slot3_upgrade.desc = "All Infantry soldiers gain a slight defensive bonus.";
british_slot3_upgrade.effect = "+10% to Defence";
british_slot3_upgrade.cost = 1;
british_slot3_upgrade.bonus = 0.9;
british_slot3_upgrade.unlocked = true;
british_slot3_upgrade.active = false;
british_slot4_upgrade.name = "MORALE BOOST";
british_slot4_upgrade.desc = "Your men recieve an extra ration of rum before each fight.";
british_slot4_upgrade.effect = "15% boost to Morale";
british_slot4_upgrade.cost = 1;
british_slot4_upgrade.bonus = 1.15;
british_slot4_upgrade.unlocked = true;
british_slot4_upgrade.active = false;
british_slot5_upgrade.name = "POST HASTE";
british_slot5_upgrade.desc = "Decreases the reinforcment time for all units even further.";
british_slot5_upgrade.effect = "15% faster reinforcement";
british_slot5_upgrade.cost = 2;
british_slot5_upgrade.bonus = 0.85;
british_slot5_upgrade.unlocked = false;
british_slot5_upgrade.active = false;
british_slot6_upgrade.name = "HIGH EXPLOSIVE";
british_slot6_upgrade.desc = "Our engineers have tweaked the Mills bomb to pack more of a punch.";
british_slot6_upgrade.effect = "Larger area of effect for grenades.";
british_slot6_upgrade.cost = 2;
british_slot6_upgrade.bonus = "larger explosive area";
british_slot6_upgrade.unlocked = false;
british_slot6_upgrade.active = false;
british_slot7_upgrade.name = "ENTRENCHED";
british_slot7_upgrade.desc = "Infantry have been trained in defending themselves better in the trenches.";
british_slot7_upgrade.effect = "+10% Defence when Entrenched";
british_slot7_upgrade.cost = 2;
british_slot7_upgrade.bonus = 0.9;
british_slot7_upgrade.unlocked = false;
british_slot7_upgrade.active = false;
british_slot8_upgrade.name = "OFFICER RALLY";
british_slot8_upgrade.desc = "Your officers will take command over larger numbers of men.";
british_slot8_upgrade.effect = "Larger bonus area";
british_slot8_upgrade.cost = 2;
british_slot8_upgrade.bonus = 1.15;
british_slot8_upgrade.unlocked = false;
british_slot8_upgrade.active = false;
british_slot9_upgrade.name = "RANGE TRAINING";
british_slot9_upgrade.desc = "Your Sharpshooters have spent time training on the range.";
british_slot9_upgrade.effect = "+50% Damage for Sharpshooters";
british_slot9_upgrade.cost = 3;
british_slot9_upgrade.bonus = 1.5;
british_slot9_upgrade.unlocked = false;
british_slot9_upgrade.active = false;
british_slot10_upgrade.name = "FIRE SUPPORT";
british_slot10_upgrade.desc = "Gunner crews are trained together to provide more deadly fire support.";
british_slot10_upgrade.effect = "+30% Damage for Lewis Gunners";
british_slot10_upgrade.cost = 3;
british_slot10_upgrade.bonus = 1.3;
british_slot10_upgrade.unlocked = false;
british_slot10_upgrade.active = false;
british_slot11_upgrade.name = "TANK COMMAND";
british_slot11_upgrade.desc = "Tanks deal more damage and take less.";
british_slot11_upgrade.effect = "+25% Damage and Defence";
british_slot11_upgrade.cost = 3;
british_slot11_upgrade.bonus = 1.25;
british_slot11_upgrade.unlocked = false;
british_slot11_upgrade.active = false;
}
function setUpgradesSupport() {
british_slot12_upgrade.name = "MORTAR ACCURACY";
british_slot12_upgrade.desc = "Mortar crews will fire far more accurately at designated targets.";
british_slot12_upgrade.effect = "+25% more Accurate";
british_slot12_upgrade.cost = 1;
british_slot12_upgrade.bonus = 0.75;
british_slot12_upgrade.unlocked = true;
british_slot12_upgrade.active = false;
british_slot13_upgrade.name = "MORTAR BARRAGE";
british_slot13_upgrade.desc = "Increases the amount of rounds fired in a single mortar strike.";
british_slot13_upgrade.effect = "Additional Rounds";
british_slot13_upgrade.cost = 1;
british_slot13_upgrade.bonus = 5;
british_slot13_upgrade.unlocked = true;
british_slot13_upgrade.active = false;
british_slot14_upgrade.name = "HEAVY MORTAR";
british_slot14_upgrade.desc = "Mortar shells are far more effective against tanks.";
british_slot14_upgrade.effect = "+30% Damage to Tanks";
british_slot14_upgrade.cost = 1;
british_slot14_upgrade.bonus = 1.3;
british_slot14_upgrade.unlocked = true;
british_slot14_upgrade.active = false;
british_slot15_upgrade.name = "TOXIC GAS";
british_slot15_upgrade.desc = "Our gas make up has been altered to be more effective.";
british_slot15_upgrade.effect = "+25% Damage";
british_slot15_upgrade.cost = 1;
british_slot15_upgrade.bonus = 1.25;
british_slot15_upgrade.unlocked = true;
british_slot15_upgrade.active = false;
british_slot16_upgrade.name = "ARTILLERY ACCURACY";
british_slot16_upgrade.desc = "Artillery crews fire more accurately on designated targets.";
british_slot16_upgrade.effect = "+25% more Accurate";
british_slot16_upgrade.cost = 2;
british_slot16_upgrade.bonus = 0.75;
british_slot16_upgrade.unlocked = false;
british_slot16_upgrade.active = false;
british_slot17_upgrade.name = "ARTILLERY BARRAGE";
british_slot17_upgrade.desc = "Increases the amount of rounds fired in a single artillery strike.";
british_slot17_upgrade.effect = "Additional Rounds";
british_slot17_upgrade.cost = 2;
british_slot17_upgrade.bonus = 3;
british_slot17_upgrade.unlocked = false;
british_slot17_upgrade.active = false;
british_slot18_upgrade.name = "HEAVY ARTILLERY";
british_slot18_upgrade.desc = "Artillery and Anti-Tank shells are more effective against hard targets.";
british_slot18_upgrade.effect = "+30% Damage to Tanks";
british_slot18_upgrade.cost = 2;
british_slot18_upgrade.bonus = 1.3;
british_slot18_upgrade.unlocked = false;
british_slot18_upgrade.active = false;
british_slot19_upgrade.name = "LINGERING GAS";
british_slot19_upgrade.desc = "Our gas has been reformulated to hang longer in the air.";
british_slot19_upgrade.effect = "+30% Duration";
british_slot19_upgrade.cost = 2;
british_slot19_upgrade.bonus = 1.3;
british_slot19_upgrade.unlocked = false;
british_slot19_upgrade.active = false;
british_slot20_upgrade.name = "RESUPPLY";
british_slot20_upgrade.desc = "All types of fire support resupply are shortened significantly.";
british_slot20_upgrade.effect = "+40% faster Resupply";
british_slot20_upgrade.cost = 3;
british_slot20_upgrade.bonus = 0.6;
british_slot20_upgrade.unlocked = false;
british_slot20_upgrade.active = false;
british_slot21_upgrade.name = "BARRAGE OF FIRE";
british_slot21_upgrade.desc = "Makes artillery strikes long and intense barrages which will decimate the enemy.";
british_slot21_upgrade.effect = "Additional Rounds";
british_slot21_upgrade.cost = 3;
british_slot21_upgrade.bonus = 10;
british_slot21_upgrade.unlocked = false;
british_slot21_upgrade.active = false;
british_slot22_upgrade.name = "ANTI-TANK BARRAGE";
british_slot22_upgrade.desc = "Anti-tank batteries will fire more rounds at enemy tanks.";
british_slot22_upgrade.effect = "Additional Rounds";
british_slot22_upgrade.cost = 3;
british_slot22_upgrade.bonus = 5;
british_slot22_upgrade.unlocked = false;
british_slot22_upgrade.active = false;
}
function setUpgradesInfantryGerman() {
german_slot1_upgrade.name = "BALLISTICS";
german_slot1_upgrade.desc = "All Infantry armed with rifles will inflict more damage.";
german_slot1_upgrade.effect = "+15% Damage to Rifles";
german_slot1_upgrade.cost = 1;
german_slot1_upgrade.bonus = 1.15;
german_slot1_upgrade.unlocked = true;
german_slot1_upgrade.active = false;
german_slot2_upgrade.name = "TRENCH ARMOUR";
german_slot2_upgrade.desc = "Our engineers have designed armor to protect our men better.";
german_slot2_upgrade.effect = "+10% to Defence";
german_slot2_upgrade.cost = 1;
german_slot2_upgrade.bonus = 0.9;
german_slot2_upgrade.unlocked = true;
german_slot2_upgrade.active = false;
german_slot3_upgrade.name = "REINFORCEMENTS";
german_slot3_upgrade.desc = "Additional reinforcements have been allotted to our fight";
german_slot3_upgrade.effect = "10% faster reinforcement";
german_slot3_upgrade.cost = 1;
german_slot3_upgrade.bonus = 0.9;
german_slot3_upgrade.unlocked = true;
german_slot3_upgrade.active = false;
german_slot4_upgrade.name = "FOR THE KAISER";
german_slot4_upgrade.desc = "Our men are inspired by the Kaiser.";
german_slot4_upgrade.effect = "15% boost to Morale";
german_slot4_upgrade.cost = 1;
german_slot4_upgrade.bonus = 1.15;
german_slot4_upgrade.unlocked = true;
german_slot4_upgrade.active = false;
german_slot5_upgrade.name = "MACHINE GUN TRENCH";
german_slot5_upgrade.desc = "Our Machine Gun teams have been training in operating in trenches.";
german_slot5_upgrade.effect = "+15% Damage when Entrenched";
german_slot5_upgrade.cost = 2;
german_slot5_upgrade.bonus = 1.15;
german_slot5_upgrade.unlocked = false;
german_slot5_upgrade.active = false;
german_slot6_upgrade.name = "ENTRENCH";
german_slot6_upgrade.desc = "Trenches are more secure now providing better cover.";
german_slot6_upgrade.effect = "+10% Defence when Entrenched";
german_slot6_upgrade.cost = 2;
german_slot6_upgrade.bonus = 0.9;
german_slot6_upgrade.unlocked = false;
german_slot6_upgrade.active = false;
german_slot7_upgrade.name = "RAPID DEPLOYMENT";
german_slot7_upgrade.desc = "Reinforcements arrive even faster.";
german_slot7_upgrade.effect = "15% faster reinforcement";
german_slot7_upgrade.cost = 2;
german_slot7_upgrade.bonus = 0.85;
german_slot7_upgrade.unlocked = false;
german_slot7_upgrade.active = false;
german_slot8_upgrade.name = "FOR THE FATHERLAND";
german_slot8_upgrade.desc = "Our men will die for our country.";
german_slot8_upgrade.effect = "20% boost to Morale";
german_slot8_upgrade.cost = 2;
german_slot8_upgrade.bonus = 1.2;
german_slot8_upgrade.unlocked = false;
german_slot8_upgrade.active = false;
german_slot9_upgrade.name = "STURMTRUPPEN";
german_slot9_upgrade.desc = "Our Sturmtruppen are a tool of destruction.";
german_slot9_upgrade.effect = "+30% Damage for Sturmtruppen";
german_slot9_upgrade.cost = 3;
german_slot9_upgrade.bonus = 1.3;
german_slot9_upgrade.unlocked = false;
german_slot9_upgrade.active = false;
german_slot10_upgrade.name = "INDUSTRIAL ACTION";
german_slot10_upgrade.desc = "Our engineers are able to supply us with Tanks much faster.";
german_slot10_upgrade.effect = "+25% faster reinforcement of Tanks";
german_slot10_upgrade.cost = 3;
german_slot10_upgrade.bonus = 0.75;
german_slot10_upgrade.unlocked = false;
german_slot10_upgrade.active = false;
german_slot11_upgrade.name = "GREAT LEADER";
german_slot11_upgrade.desc = "Our Officers provide great leadership to our men.";
german_slot11_upgrade.effect = "+30% Damage bonus to surrounding men";
german_slot11_upgrade.cost = 3;
german_slot11_upgrade.bonus = 1.3;
german_slot11_upgrade.unlocked = false;
german_slot11_upgrade.active = false;
}
function setUpgradesSupportGerman() {
german_slot12_upgrade.name = "MORTAR ACCURACY";
german_slot12_upgrade.desc = "Mortar crews will fire far more accurately at designated targets.";
german_slot12_upgrade.effect = "+25% more Accurate";
german_slot12_upgrade.cost = 1;
german_slot12_upgrade.bonus = 0.75;
german_slot12_upgrade.unlocked = true;
german_slot12_upgrade.active = false;
german_slot13_upgrade.name = "MORTAR BARRAGE";
german_slot13_upgrade.desc = "Increases the amount of rounds fired in a single mortar strike.";
german_slot13_upgrade.effect = "Additional Rounds";
german_slot13_upgrade.cost = 1;
german_slot13_upgrade.bonus = 5;
german_slot13_upgrade.unlocked = true;
german_slot13_upgrade.active = false;
german_slot14_upgrade.name = "HEAVY MORTAR";
german_slot14_upgrade.desc = "Mortar shells are far more effective against tanks.";
german_slot14_upgrade.effect = "+30% Damage to Tanks";
german_slot14_upgrade.cost = 1;
german_slot14_upgrade.bonus = 1.3;
german_slot14_upgrade.unlocked = true;
german_slot14_upgrade.active = false;
german_slot15_upgrade.name = "TOXIC GAS";
german_slot15_upgrade.desc = "Our gas make up has been altered to be more effective.";
german_slot15_upgrade.effect = "+25% Damage";
german_slot15_upgrade.cost = 1;
german_slot15_upgrade.bonus = 1.25;
german_slot15_upgrade.unlocked = true;
german_slot15_upgrade.active = false;
german_slot16_upgrade.name = "ARTILLERY ACCURACY";
german_slot16_upgrade.desc = "Artillery crews fire more accurately on designated targets.";
german_slot16_upgrade.effect = "+25% more Accurate";
german_slot16_upgrade.cost = 2;
german_slot16_upgrade.bonus = 0.75;
german_slot16_upgrade.unlocked = false;
german_slot16_upgrade.active = false;
german_slot17_upgrade.name = "ARTILLERY BARRAGE";
german_slot17_upgrade.desc = "Increases the amount of rounds fired in a single artillery strike.";
german_slot17_upgrade.effect = "Additional Rounds";
german_slot17_upgrade.cost = 2;
german_slot17_upgrade.bonus = 3;
german_slot17_upgrade.unlocked = false;
german_slot17_upgrade.active = false;
german_slot18_upgrade.name = "HEAVY ARTILLERY";
german_slot18_upgrade.desc = "Artillery and Anti-Tank shells are more effective against hard targets.";
german_slot18_upgrade.effect = "+30% Damage to Tanks";
german_slot18_upgrade.cost = 2;
german_slot18_upgrade.bonus = 1.3;
german_slot18_upgrade.unlocked = false;
german_slot18_upgrade.active = false;
german_slot19_upgrade.name = "LINGERING GAS";
german_slot19_upgrade.desc = "Our gas has been reformulated to hang longer in the air.";
german_slot19_upgrade.effect = "+30% Duration";
german_slot19_upgrade.cost = 2;
german_slot19_upgrade.bonus = 1.3;
german_slot19_upgrade.unlocked = false;
german_slot19_upgrade.active = false;
german_slot20_upgrade.name = "RESUPPLY";
german_slot20_upgrade.desc = "All types of fire support resupply are shortened significantly.";
german_slot20_upgrade.effect = "+40% faster Resupply";
german_slot20_upgrade.cost = 3;
german_slot20_upgrade.bonus = 0.6;
german_slot20_upgrade.unlocked = false;
german_slot20_upgrade.active = false;
german_slot21_upgrade.name = "BARRAGE OF FIRE";
german_slot21_upgrade.desc = "Makes artillery strikes long and intense barrages which will decimate the enemy.";
german_slot21_upgrade.effect = "Additional Rounds";
german_slot21_upgrade.cost = 3;
german_slot21_upgrade.bonus = 10;
german_slot21_upgrade.unlocked = false;
german_slot21_upgrade.active = false;
german_slot22_upgrade.name = "ANTI-TANK BARRAGE";
german_slot22_upgrade.desc = "Anti-tank batteries will fire more rounds at enemy tanks.";
german_slot22_upgrade.effect = "Additional Rounds";
german_slot22_upgrade.cost = 3;
german_slot22_upgrade.bonus = 5;
german_slot22_upgrade.unlocked = false;
german_slot22_upgrade.active = false;
}
function setupUpgradeInterface(team) {
if (playingContinue == false) {
setUpgradesInfantry();
setUpgradesSupport();
setUpgradesInfantryGerman();
setUpgradesSupportGerman();
resetUpgrades();
}
checkUpgrades(team);
_root.menu.upgrades.details._visible = false;
}
function updateUpgradeButtons() {
v = 1;
while (v <= numUpgradeButtons) {
_root.menu.upgrades["slot" + v].slotNumber.text = v;
_root.menu.upgrades["slot" + v].objectRef = _root[((playerTeam.team + "_slot") + v) + "_upgrade"];
if (_root.menu.upgrades["slot" + v].objectRef.active) {
_root.menu.upgrades["slot" + v].colorTransformTo(235, 0, 218, 0, 156, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.upgrades["icon_slot" + v].gotoAndStop("colour");
}
if (_root.menu.upgrades["slot" + v].objectRef.unlocked && (_root.menu.upgrades["slot" + v].objectRef.active == false)) {
_root.menu.upgrades["slot" + v].colorTransformTo(245, 0, 250, 0, 235, 0, 100, 0, 0.4, "easeOutSine");
}
_root.menu.upgrades["slot" + v].onRollOver = function () {
_root.menu.upgrades.details._visible = true;
_root.menu.upgrades.details.upgradeName.text = this.objectRef.name;
_root.menu.upgrades.details.upgradeCost.text = "Cost: " + this.objectRef.cost;
_root.menu.upgrades.details.upgradeDesc.text = this.objectRef.desc;
_root.menu.upgrades.details.upgradeEffect.text = "Effect: " + this.objectRef.effect;
_root.menu.upgrades.details._x = this._x;
if (this._x <= -320) {
_root.menu.upgrades.details._x = this._x + 75;
}
if (this._x >= 320) {
_root.menu.upgrades.details._x = this._x - 75;
}
_root.menu.upgrades.details._y = this._y;
_root.menu.upgrades.details.alphaTo(100, 0.3, "easeOutSine");
if ((this.objectRef.unlocked == true) && (this.objectRef.active == false)) {
this.colorTransformTo(250, 0, 250, 0, 250, 0, 100, 0, 0.4, "easeOutSine");
}
};
_root.menu.upgrades["slot" + v].onRollOut = function () {
_root.menu.upgrades.details.alphaTo(0, 0.3, "easeOutSine", 0, function () {
this._visible = false;
});
if ((this.objectRef.unlocked == true) && (this.objectRef.active == false)) {
this.colorTransformTo(245, 0, 250, 0, 235, 0, 100, 0, 0.4, "easeOutSine");
}
};
_root.menu.upgrades["slot" + v].onRelease = function () {
buyUpgrade(this);
};
v++;
}
}
function checkUpgrades(teamName) {
if (_root[teamName + "_slot1_upgrade"].active) {
_root[teamName + "_slot5_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot2_upgrade"].active) {
_root[teamName + "_slot6_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot3_upgrade"].active) {
_root[teamName + "_slot7_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot4_upgrade"].active) {
_root[teamName + "_slot8_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot1_upgrade"].active && (_root[teamName + "_slot5_upgrade"].active)) {
_root[teamName + "_slot9_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot2_upgrade"].active && (_root[teamName + "_slot6_upgrade"].active)) {
_root[teamName + "_slot9_upgrade"].unlocked = true;
_root[teamName + "_slot10_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot3_upgrade"].active && (_root[teamName + "_slot7_upgrade"].active)) {
_root[teamName + "_slot10_upgrade"].unlocked = true;
_root[teamName + "_slot11_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot4_upgrade"].active && (_root[teamName + "_slot8_upgrade"].active)) {
_root[teamName + "_slot11_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot12_upgrade"].active) {
_root[teamName + "_slot16_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot13_upgrade"].active) {
_root[teamName + "_slot17_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot14_upgrade"].active) {
_root[teamName + "_slot18_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot15_upgrade"].active) {
_root[teamName + "_slot19_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot12_upgrade"].active && (_root[teamName + "_slot16_upgrade"].active)) {
_root[teamName + "_slot20_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot13_upgrade"].active && (_root[teamName + "_slot17_upgrade"].active)) {
_root[teamName + "_slot20_upgrade"].unlocked = true;
_root[teamName + "_slot21_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot14_upgrade"].active && (_root[teamName + "_slot18_upgrade"].active)) {
_root[teamName + "_slot21_upgrade"].unlocked = true;
_root[teamName + "_slot22_upgrade"].unlocked = true;
}
if (_root[teamName + "_slot15_upgrade"].active && (_root[teamName + "_slot19_upgrade"].active)) {
_root[teamName + "_slot22_upgrade"].unlocked = true;
}
updateUpgradeButtons();
}
function buyUpgrade(upgradeSlot) {
if ((upgradeSlot.objectRef.unlocked && (upgradeSlot.objectRef.active == false)) && (upgradePoints >= upgradeSlot.objectRef.cost)) {
upgradePoints = upgradePoints - upgradeSlot.objectRef.cost;
upgradeSlot.objectRef.active = true;
checkUpgrades(playerTeam.team);
hud.upgrades.upgradePointsText.text = upgradePoints;
_root.menu.upgrades.upgradePointsText.text = upgradePoints;
showQuickMessage("UPGRADE PURCHASED");
saveGame();
}
}
function resetUpgrades() {
x = 1;
while (x <= 22) {
_root[("british_slot" + x) + "_upgrade"].active = false;
_root[("german_slot" + x) + "_upgrade"].active = false;
x++;
}
}
function sortSoldierDepths() {
var _local4;
var _local1 = new Array();
for (v in britishSquadsOnScreen) {
for (m in britishSquadsOnScreen[v].members) {
britishSquadsOnScreen[v].members[m].depth = britishSquadsOnScreen[v].members[m]._y;
_local1.push(britishSquadsOnScreen[v].members[m]);
}
}
for (v in germanSquadsOnScreen) {
for (m in germanSquadsOnScreen[v].members) {
germanSquadsOnScreen[v].members[m].depth = germanSquadsOnScreen[v].members[m]._y;
_local1.push(germanSquadsOnScreen[v].members[m]);
}
}
for (v in wire) {
_local1.push(wire[v]);
}
for (v in deadTanks) {
deadTanks[v].members[0].depth = deadTanks[v].members[0]._y;
_local1.push(deadTanks[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].ref.swapDepths(_local3 + depth_world_soldiersSorted);
_local3++;
}
}
function sortDeadSoldiers(soldierRef) {
soldierRef.swapDepths(soldierRef.depth + _root.depth_world_deadSoldiers);
}
function showTrenchButton(trenchName) {
if (trenchName.controlClipVisible == false) {
trenchName.mainTrenchButton._visible = true;
}
trenchName.controlVisible = true;
trenchName.mainTrenchButton.unitIcon._visible = false;
trenchName.mainTrenchButton.healthBar._visible = false;
trenchName.mainTrenchButton.lockedIcon._visible = false;
trenchName.mainTrenchButton.onSwitch._visible = true;
if (trenchName.locked == true) {
trenchName.mainTrenchButton.gotoAndStop("locked");
trenchName.mainTrenchButton.lockedIcon._visible = true;
}
if (trenchName.locked == false) {
trenchName.mainTrenchButton.gotoAndStop("on");
}
trenchName.mainTrenchButton.onRelease = function () {
showTrenchControls(trenchName);
hideTrenchButton(trenchName);
};
trenchName.mainTrenchButton.onRollOver = function () {
if (trenchName.locked == false) {
this.gotoAndStop("on");
}
this.backing.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
trenchName.mainTrenchButton.onRollOut = function () {
if (trenchName.locked == false) {
this.gotoAndStop("off");
}
this.backing.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
};
}
function hideTrenchButton(trenchName) {
trenchButtonVisible = false;
trenchName.controlVisible = false;
trenchName.mainTrenchButton._visible = false;
}
function updateTrenchInterface(trenchName) {
updateTrenchHealthBars();
trenchName.controlClip.button1.unitIcon.gotoAndStop(trenchName.slot1.type);
trenchName.controlClip.button2.unitIcon.gotoAndStop(trenchName.slot2.type);
trenchName.controlClip.button3.unitIcon.gotoAndStop(trenchName.slot3.type);
if (trenchName.slot1 == "empty") {
trenchName.controlClip.button1.unitIcon.gotoAndStop("empty");
}
if (trenchName.slot2 == "empty") {
trenchName.controlClip.button2.unitIcon.gotoAndStop("empty");
}
if (trenchName.slot3 == "empty") {
trenchName.controlClip.button3.unitIcon.gotoAndStop("empty");
}
}
function updateTrenchHealthBars() {
for (t in trenches) {
trenches[t].controlClip.button1.healthBar.bar._xscale = Math.round((trenches[t].slot1.members.length / (trenches[t].slot1.totalHealth / trenches[t].slot1.minHealth)) * 100);
trenches[t].controlClip.button2.healthBar.bar._xscale = Math.round((trenches[t].slot2.members.length / (trenches[t].slot2.totalHealth / trenches[t].slot2.minHealth)) * 100);
trenches[t].controlClip.button3.healthBar.bar._xscale = Math.round((trenches[t].slot3.members.length / (trenches[t].slot3.totalHealth / trenches[t].slot3.minHealth)) * 100);
if (trenches[t].slot1.totalHealth == undefined) {
trenches[t].controlClip.button1.healthBar.bar._xscale = 1;
}
if (trenches[t].slot2.totalHealth == undefined) {
trenches[t].controlClip.button2.healthBar.bar._xscale = 1;
}
if (trenches[t].slot3.totalHealth == undefined) {
trenches[t].controlClip.button3.healthBar.bar._xscale = 1;
}
}
}
function showTrenchControls(trenchName) {
if (((trenchName.slot1.team != compTeam.team) && (trenchName.slot2.team != compTeam.team)) && (trenchName.slot3.team != compTeam.team)) {
trenchName.controlClipVisible = true;
trenchInterfaceVisible = true;
tcc++;
world.attachMovie("trenchInterface", "trenchControls" + tcc, depth_world_trenchHUD + tcc);
trenchName.controlClip = world["trenchControls" + tcc];
world["trenchControls" + tcc].gotoAndStop(playerTeam.team);
world["trenchControls" + tcc]._x = trenchName._x;
world["trenchControls" + tcc]._y = trenchName._y + 145;
world["trenchControls" + tcc]._alpha = 0;
world["trenchControls" + tcc].alphaTo(100, 0.1);
world["trenchControls" + tcc].button1.unitIcon.gotoAndStop(trenchName.slot1.type);
world["trenchControls" + tcc].button1.unitIcon._visible = true;
world["trenchControls" + tcc].button1.lockedIcon._visible = false;
world["trenchControls" + tcc].button1.onSwitch._visible = false;
world["trenchControls" + tcc].button2.unitIcon.gotoAndStop(trenchName.slot2.type);
world["trenchControls" + tcc].button2.unitIcon._visible = true;
world["trenchControls" + tcc].button2.lockedIcon._visible = false;
world["trenchControls" + tcc].button2.onSwitch._visible = false;
world["trenchControls" + tcc].button3.unitIcon.gotoAndStop(trenchName.slot3.type);
world["trenchControls" + tcc].button3.unitIcon._visible = true;
world["trenchControls" + tcc].button3.lockedIcon._visible = false;
world["trenchControls" + tcc].button3.onSwitch._visible = false;
world["trenchControls" + tcc].button4.unitIcon._visible = false;
world["trenchControls" + tcc].button4.healthBar._visible = false;
world["trenchControls" + tcc].button4.onSwitch._visible = false;
if (trenchName.locked) {
world["trenchControls" + tcc].button4.lockedIcon.gotoAndStop("lock");
} else {
world["trenchControls" + tcc].button4.lockedIcon.gotoAndStop("unlock");
}
world["trenchControls" + tcc].button5.unitIcon._visible = false;
world["trenchControls" + tcc].button5.healthBar._visible = false;
world["trenchControls" + tcc].button5.lockedIcon.gotoAndStop("cancel");
world["trenchControls" + tcc].button5.lockedIcon._visible = true;
world["trenchControls" + tcc].button5.onSwitch._visible = false;
world["trenchControls" + tcc].button1.onRollOver = (world["trenchControls" + tcc].button2.onRollOver = (world["trenchControls" + tcc].button3.onRollOver = (world["trenchControls" + tcc].button4.onRollOver = (world["trenchControls" + tcc].button5.onRollOver = function () {
this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}))));
world["trenchControls" + tcc].button1.onRollOut = (world["trenchControls" + tcc].button2.onRollOut = (world["trenchControls" + tcc].button3.onRollOut = (world["trenchControls" + tcc].button4.onRollOut = (world["trenchControls" + tcc].button5.onRollOut = function () {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
}))));
world["trenchControls" + tcc].button5.onRelease = function () {
hideTrenchControls(trenchName);
};
world["trenchControls" + tcc].button4.onRelease = function () {
if (trenchName.locked == false) {
showQuickMessage("LOCKED TRENCH");
trenchName.locked = true;
trenchName.controlClip.button4.lockedIcon.gotoAndStop("lock");
} else {
showQuickMessage("UNLOCKED TRENCH");
trenchName.locked = false;
trenchName.controlClip.button4.lockedIcon.gotoAndStop("unlock");
}
};
world["trenchControls" + tcc].button1.onRelease = function () {
allInTrench = true;
if (trenchName.slot1.state == "entrench") {
for (m in trenchName.slot1.members) {
if (trenchName.slot1.members[m].inTrench == false) {
allInTrench = false;
trenchName.slot1.passingTrench = true;
trenchName.slot1 = "empty";
_root.updateTrenchInterface(trenchName);
}
}
if (allInTrench && (trenchName.slot1.state != "exitTrench")) {
trenchName.slot1.state = "exitTrench";
trenchName.slot1.inTrench = false;
trenchName.slot1 = "empty";
_root.updateTrenchInterface(trenchName);
_root.checkForEmptyTrench(trenchName);
}
}
};
world["trenchControls" + tcc].button2.onRelease = function () {
allInTrench = true;
if (trenchName.slot2.state == "entrench") {
for (m in trenchName.slot2.members) {
if (trenchName.slot2.members[m].inTrench == false) {
allInTrench = false;
trenchName.slot2.passingTrench = true;
trenchName.slot2 = "empty";
_root.updateTrenchInterface(trenchName);
}
}
if (allInTrench && (trenchName.slot2.state != "exitTrench")) {
trenchName.slot2.state = "exitTrench";
trenchName.slot2.inTrench = false;
trenchName.slot2 = "empty";
_root.updateTrenchInterface(trenchName);
_root.checkForEmptyTrench(trenchName);
}
}
};
world["trenchControls" + tcc].button3.onRelease = function () {
allInTrench = true;
if (trenchName.slot3.state == "entrench") {
for (m in trenchName.slot3.members) {
if (trenchName.slot3.members[m].inTrench == false) {
allInTrench = false;
trenchName.slot3.passingTrench = true;
trenchName.slot3 = "empty";
_root.updateTrenchInterface(trenchName);
}
}
if (allInTrench && (trenchName.slot3.state != "exitTrench")) {
trenchName.slot3.state = "exitTrench";
trenchName.slot3.inTrench = false;
trenchName.slot3 = "empty";
playVoice("advance", playerTeam.team);
_root.updateTrenchInterface(trenchName);
_root.checkForEmptyTrench(trenchName);
}
}
};
}
}
function hideTrenchControls(trenchName) {
trenchName.controlClipVisible = false;
trenchName.controlClip.alphaTo(0, 0.2, "easeOutSine", 0, function () {
removeMovieClip(this);
});
showTrenchButton(trenchName);
}
function checkForEmptyTrench(trenchName) {
if (((trenchName.slot1 == "empty") && (trenchName.slot2 == "empty")) && (trenchName.slot3 == "empty")) {
trenchName.controlClipVisible = false;
hideTrenchButton(trenchName);
}
}
function assignMorale() {
playerMorale = currentMap.friendlyMorale;
playerMoraleMax = currentMap.friendlyMorale;
if ((playerTeam.team == "british") && (british_slot4_upgrade.active == true)) {
playerMoraleMax = playerMoraleMax * british_slot4_upgrade.bonus;
playerMorale = playerMoraleMax;
}
if ((playerTeam.team == "german") && (german_slot4_upgrade.active == true)) {
playerMoraleMax = playerMoraleMax * german_slot4_upgrade.bonus;
playerMorale = playerMoraleMax;
}
if ((playerTeam.team == "german") && (german_slot8_upgrade.active == true)) {
playerMoraleMax = playerMoraleMax * german_slot8_upgrade.bonus;
playerMorale = playerMoraleMax;
}
compMorale = currentMap.enemyMorale;
compMoraleMax = currentMap.enemyMorale;
}
function adjustMorale(teamName, squadType, attackType, attackOwner) {
if (attackOwner == teamName) {
if (teamName == playerTeam.team) {
playerMorale = playerMorale - moraleCost.friendlyFire;
} else if (teamName == compTeam.team) {
compMorale = compMorale - moraleCost.friendlyFire;
}
}
switch (squadType) {
case "officer" :
if ((teamName == playerTeam.team) && (attackType == "normal")) {
playerMorale = playerMorale - moraleCost.officer;
career_moraleLost = career_moraleLost + moraleCost.officer;
} else if ((teamName == compTeam.team) && (attackType == "normal")) {
compMorale = compMorale - moraleCost.officer;
}
if ((teamName == playerTeam.team) && (attackType == "explosive")) {
playerMorale = playerMorale - (moraleCost.officer * 1.3);
career_moraleLost = career_moraleLost + (moraleCost.officer * 1.3);
} else if ((teamName == compTeam.team) && (attackType == "explosive")) {
compMorale = compMorale - (moraleCost.officer * 1.3);
}
break;
case "tank" :
if (teamName == playerTeam.team) {
playerMorale = playerMorale - moraleCost.tank;
compMorale = compMorale + moraleCost.tankKilled;
} else if (teamName == compTeam.team) {
compMorale = compMorale - moraleCost.tank;
playerMorale = playerMorale + moraleCost.tankKilled;
}
break;
case "ground" :
if (teamName == playerTeam.team) {
playerMorale = playerMorale * 1.05;
} else if (teamName == compTeam.team) {
compMorale = compMorale * 1.05;
}
break;
case "regen" :
if (teamName == playerTeam.team) {
playerMorale = playerMorale * _root["moraleRegen_" + teamName];
} else if (teamName == compTeam.team) {
compMorale = compMorale * _root["moraleRegen_" + teamName];
}
break;
default :
if ((teamName == playerTeam.team) && (attackType == "normal")) {
playerMorale = playerMorale - moraleCost.soldier;
compMorale = compMorale + (moraleCost.soldier / 2);
career_moraleLost = career_moraleLost + moraleCost.soldier;
} else if ((teamName == compTeam.team) && (attackType == "normal")) {
compMorale = compMorale - moraleCost.soldier;
playerMorale = playerMorale + (moraleCost.soldier / 2);
career_moraleGained = career_moraleGained + (moraleCost.soldier / 2);
}
if ((teamName == playerTeam.team) && (attackType == "explosive")) {
playerMorale = playerMorale - (moraleCost.soldier * 1.3);
compMorale = compMorale + moraleCost.soldier;
career_moraleLost = career_moraleLost + (moraleCost.soldier * 1.3);
} else {
if (!((teamName == compTeam.team) && (attackType == "explosive"))) {
break;
}
compMorale = compMorale - (moraleCost.soldier * 1.3);
playerMorale = playerMorale + moraleCost.soldier;
career_moraleGained = career_moraleGained + moraleCost.soldier;
}
}
if (playerMorale > playerMoraleMax) {
playerMorale = playerMoraleMax;
}
if (compMorale > compMoraleMax) {
compMorale = compMoraleMax;
}
if ((((compMorale / compMoraleMax) * 100) <= 30) && (((compMorale / compMoraleMax) * 100) >= 25)) {
showQuickMessage("ENEMY MORALE IS LOW!");
}
if ((((compMorale / compMoraleMax) * 100) <= 10) && (((compMorale / compMoraleMax) * 100) >= 5)) {
showQuickMessage("ENEMY IS AT BREAKING POINT!");
}
if ((((playerMorale / playerMoraleMax) * 100) <= 30) && (((playerMorale / playerMoraleMax) * 100) >= 25)) {
showQuickMessage("MORALE IS LOW!");
}
if ((((playerMorale / playerMoraleMax) * 100) <= 10) && (((playerMorale / playerMoraleMax) * 100) >= 5)) {
showQuickMessage("OUR UNITS ARE AT BREAKING POINT!");
}
}
function moraleRegen(teamName) {
if (teamName == "german") {
currentGroundMade = hud.progressBar.compTeamProgBar._xscale;
} else {
currentGroundMade = hud.progressBar.playerTeamProgBar._xscale;
}
if ((currentGroundMade >= 0) && (currentGroundMade < 10)) {
_root["moraleRegen_" + teamName] = 1.005;
}
if ((currentGroundMade >= 11) && (currentGroundMade < 20)) {
_root["moraleRegen_" + teamName] = 1.0075;
}
if ((currentGroundMade >= 21) && (currentGroundMade < 30)) {
_root["moraleRegen_" + teamName] = 1.01;
}
if ((currentGroundMade >= 31) && (currentGroundMade < 40)) {
_root["moraleRegen_" + teamName] = 1.0125;
}
if ((currentGroundMade >= 41) && (currentGroundMade < 50)) {
_root["moraleRegen_" + teamName] = 1.015;
}
if ((currentGroundMade >= 51) && (currentGroundMade < 60)) {
_root["moraleRegen_" + teamName] = 1.02;
}
if ((currentGroundMade >= 61) && (currentGroundMade < 70)) {
_root["moraleRegen_" + teamName] = 1.025;
}
if ((currentGroundMade >= 71) && (currentGroundMade < 80)) {
_root["moraleRegen_" + teamName] = 1.03;
}
if ((currentGroundMade >= 81) && (currentGroundMade < 100)) {
_root["moraleRegen_" + teamName] = 1.035;
}
adjustMorale(teamName, "regen", null, null);
}
function updateMoraleBar() {
if (playerMorale >= playerMoraleMax) {
playerMorale = playerMoraleMax;
}
if (compMorale >= compMoraleMax) {
compMorale = compMoraleMax;
}
if (playerMorale <= 0) {
endBattle(compTeam.team, "morale");
}
if (compMorale <= 0) {
endBattle(playerTeam.team, "morale");
}
if (playerTeam.team == "british") {
moraleBarBritishScale = Math.round((playerMorale / playerMoraleMax) * 100);
moraleBarGermanScale = Math.round((compMorale / compMoraleMax) * 100);
}
if (playerTeam.team == "german") {
moraleBarBritishScale = Math.round((compMorale / compMoraleMax) * 100);
moraleBarGermanScale = Math.round((playerMorale / playerMoraleMax) * 100);
}
hud.progressBarToolTip.britishMorale.text = moraleBarBritishScale + "%";
hud.progressBarToolTip.germanMorale.text = moraleBarGermanScale + "%";
if ((moraleBarBritishScale != lastmoraleBarBritishScale) || (moraleBarGermanScale != lastmoraleBarGermanScale)) {
lastmoraleBarBritishScale = moraleBarBritishScale;
lastmoraleBarGermanScale = moraleBarGermanScale;
hud.progressBar.britishMoraleBar.xScaleTo(moraleBarBritishScale, 5, "linear");
hud.progressBar.germanMoraleBar.xScaleTo(moraleBarGermanScale, 5, "linear");
if (lastmoraleBarBritishScale <= 35) {
hud.progressBar.britishMoraleBar.colorTo(3342336, 2);
}
if (lastmoraleBarGermanScale <= 35) {
hud.progressBar.germanMoraleBar.colorTo(3342336, 2);
}
if (lastmoraleBarBritishScale <= 15) {
hud.progressBar.britishMoraleBar.colorTo(10027008, 2);
}
if (lastmoraleBarGermanScale <= 15) {
hud.progressBar.germanMoraleBar.colorTo(10027008, 2);
}
if (lastmoraleBarBritishScale > 30) {
hud.progressBar.britishMoraleBar.colorTo(null, 2);
}
if (lastmoraleBarGermanScale > 30) {
hud.progressBar.germanMoraleBar.colorTo(null, 2);
}
}
}
function groundMoraleCheck(forwardTeamX, teamName) {
if (teamName == "british") {
var _local1 = (forwardTeamX / world.bg._width) * 100;
}
if (teamName == "german") {
var _local1 = (forwardTeamX / world.bg._width) * 100;
_local1 = 100 - _local1;
}
if ((teamName == "british") && (_local1 > groundMorale[groundMoraleIndexBritish])) {
groundMoraleIndexBritish++;
adjustMorale(teamName, "ground", null, null);
}
if ((teamName == "german") && (_local1 > groundMorale[groundMoraleIndexGerman])) {
groundMoraleIndexGerman++;
adjustMorale(teamName, "ground", null, null);
}
}
function throwGrenade(targetSquad, owner, ourTeam) {
grenNumber++;
world.attachMovie("handGrenade", "gren" + grenNumber, depth_world_grenade + grenNumber);
if (ourTeam == "british") {
world["gren" + grenNumber]._x = (targetSquad._x - 30) + (random(40) - 20);
} else {
world["gren" + grenNumber]._x = (targetSquad._x + 30) + (random(40) - 20);
}
if (targetSquad.type != "tank") {
world["gren" + grenNumber]._y = targetSquad._y + (random(20) + 10);
} else {
world["gren" + grenNumber]._y = targetSquad._y + (random(10) - 5);
}
world["gren" + grenNumber].ownerTeam = ourTeam;
grenAdj = owner._x - targetSquad._x;
grenOpp = -1 * (owner._y - targetSquad._y);
grenadeAngle = Math.atan2(grenOpp, grenAdj);
grenadeAngle = Math.round((grenadeAngle / Math.PI) * 180);
world["gren" + grenNumber]._rotation = -1 * grenadeAngle;
if (ourTeam == "british") {
world["gren" + grenNumber]._yscale = -100;
}
var _local3 = "throw" + (random(2) + 1);
world["gren" + grenNumber].gotoAndPlay(_local3);
}
function playVoice(voiceType, teamName) {
switch (voiceType) {
case "advance" :
if (random(6) == 0) {
setTimeout(playSound, random(600) + 100, (("sound_voice_" + teamName) + "_advance") + (random(sounds_advance) + 1));
}
break;
case "attack" :
if (random(20) == 0) {
setTimeout(playSound, random(600) + 100, (("sound_voice_" + teamName) + "_attack") + (random(sounds_attack) + 1));
}
break;
case "sniper" :
if (random(3) == 0) {
setTimeout(playSound, random(600) + 100, (("sound_voice_" + teamName) + "_sniper") + (random(sounds_sniper) + 1));
}
break;
case "incoming" :
if (random(20) == 0) {
setTimeout(playSound, random(600) + 400, (("sound_voice_" + teamName) + "_incoming") + (random(sounds_incoming) + 1));
}
break;
case "machineGun" :
if (random(20) == 0) {
setTimeout(playSound, random(10) + 100, (("sound_voice_" + teamName) + "_machineGun") + (random(sounds_MG) + 1));
}
break;
case "gas" :
if (random(4) == 0) {
setTimeout(playSound, random(10) + 100, ("sound_voice_" + teamName) + "_gas1");
}
break;
case "tank" :
if (random(10) != 0) {
break;
}
setTimeout(playSound, random(900) + 100, (("sound_voice_" + teamName) + "_tank") + (random(sounds_tank) + 1));
}
}
function checkForUnlocks() {
unlocksInQueue = false;
unlockQueue = new Array();
if (currentMap.unlocks != undefined) {
for (v in currentMap.unlocks) {
unlocksInQueue = true;
unlockQueue.push(currentMap.unlocks[v]);
}
}
}
function displayUnlockDialog() {
udc++;
_root.attachMovie("unlockDialog", "unlockDialog" + udc, depth_unlockDialog + udc);
_root["unlockDialog" + udc].blackOut._alpha = 8;
_root["unlockDialog" + udc].backing._alpha = 8;
_root["unlockDialog" + udc].icon._alpha = 0;
_root["unlockDialog" + udc].textBoxes._alpha = 0;
_root["unlockDialog" + udc].mainButton._alpha = 0;
_root["unlockDialog" + udc].blackOut.alphaTo(60, 0.8, "easeOutSine");
_root["unlockDialog" + udc].backing.alphaTo(100, 0.6, "easeOutSine");
_root["unlockDialog" + udc].icon.alphaTo(100, 0.6, "easeOutSine", 0.4);
_root["unlockDialog" + udc].textBoxes.alphaTo(100, 0.6, "easeOutSine", 0.4);
_root["unlockDialog" + udc].mainButton.alphaTo(100, 0.6, "easeOutSine", 0.6);
_root["unlockDialog" + udc]._x = Stage.width / 2;
_root["unlockDialog" + udc]._y = Stage.height / 2;
if ((((unlockQueue[0] == "mortar") || (unlockQueue[0] == "artillery")) || (unlockQueue[0] == "gas")) || (unlockQueue[0] == "antiTank")) {
_root["unlockDialog" + udc].textBoxes.headerText.text = "NEW SUPPORT AVAILABLE";
}
_root["unlockDialog" + udc].textBoxes.unitHeader.text = unlockQueue[0].toUpperCase();
_root["unlockDialog" + udc].icon.gotoAndStop(playerTeam.team);
_root["unlockDialog" + udc].icon.icons.gotoAndStop(unlockQueue[0]);
_root["unlockDialog" + udc].textBoxes.description.text = _root[playerTeam.team][unlockQueue[0]].unlockDescription;
unlockQueue.splice(0, 1);
}
function unlockInterfaceButton(btnName) {
_root["unlockDialog" + udc].mainButton.buttonText.text = "OK";
_root["unlockDialog" + udc].mainButton.onRelease = function () {
playClickSound();
hideUnlockDialog(_root["unlockDialog" + udc]);
if (unlockQueue.length >= 1) {
displayUnlockDialog();
}
};
_root["unlockDialog" + udc].mainButton.onRollOver = function () {
this.backing.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
_root["unlockDialog" + udc].mainButton.onRollOut = function () {
this.backing.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, "easeOutSine");
};
}
function hideUnlockDialog(unlockDialogName) {
unlockDialogName.alphaTo(0, 0.1, "easeOutSine", 0, function () {
removeMovieClip(this);
});
}
function setupConsole() {
_root.attachMovie("systemConsole", "systemConsole", depth_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();
return;
case 13 :
executeCommand();
}
};
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) {
_root[_root.systemConsole.consoleInput.text]();
if (_root[_root.systemConsole.consoleInput.text] == undefined) {
_root.systemConsole.consoleHistory.text = _root.systemConsole.consoleHistory.text + "Undefined Function\r";
} else {
_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 resetExperience() {
experiencePoints = 0;
experienceLevel = 0;
experienceGained = 0;
}
function updateExperience(unitType, soldier) {
if (((retry == false) && (playingSkirmish == false)) || ((playingSkirmish == false) && (unitType == "bonus"))) {
hudRef = hud.upgrades.experience;
experienceGained = 0;
switch (unitType) {
case "bonus" :
experiencePoints = experiencePoints + playerBonusXP;
experienceGained = playerBonusXP;
break;
case "riflemen" :
experiencePoints = experiencePoints + 1;
experienceGained = 1;
break;
case "assault" :
experiencePoints = experiencePoints + 2;
experienceGained = 2;
break;
case "machineGun" :
experiencePoints = experiencePoints + 5;
experienceGained = 5;
break;
case "sniper" :
experiencePoints = experiencePoints + 5;
experienceGained = 5;
break;
case "officer" :
experiencePoints = experiencePoints + 10;
experienceGained = 10;
break;
case "tank" :
experiencePoints = experiencePoints + 15;
experienceGained = 15;
}
career_experienceGained = career_experienceGained + experienceGained;
xpCount++;
world.attachMovie("xpIcon", "xpIcon" + xpCount, depth_world_xpIcons + xpCount);
world["xpIcon" + xpCount].exp.text = experienceGained;
world["xpIcon" + xpCount]._alpha = 0;
if (soldier.inTrench == true) {
if (playerTeam.team == "british") {
world["xpIcon" + xpCount]._x = soldier._x - 30;
} else {
world["xpIcon" + xpCount]._x = soldier._x + 30;
}
} else {
world["xpIcon" + xpCount]._x = soldier._x;
}
world["xpIcon" + xpCount]._y = soldier._y - 30;
var _local3 = soldier._y - 60;
world["xpIcon" + xpCount].ySlideTo(_local3, 4, "easeOutSine");
world["xpIcon" + xpCount].alphaTo(100, 1, "easeOutSine");
world["xpIcon" + xpCount].alphaTo(0, 1, "easeOutSine", 1, function () {
removeMovieClip(this);
});
while (experiencePoints > experienceIntervals[experienceLevel]) {
if (experienceLevel < experienceIntervals.length) {
experienceLevel++;
upgradePoints++;
hud.upgrades.upgradePointsText.text = upgradePoints;
hud.upgrades.experience.whiteOut.colorTo(13030847, 0);
hud.upgrades.experience.whiteOut.alphaTo(100, 1, "easeOutSine");
hud.upgrades.experience.whiteOut.alphaTo(0, 2, "easeOutSine", 3);
hud.upgrades.upgradeButton.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 1);
hud.upgrades.upgradeButton.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 1, "easeOutSine", 2);
hud.upgrades.experience.rightDial._rotation = -180;
hud.upgrades.experience.leftDial._rotation = 0;
} else {
hud.upgrades.upgradePointsText.text = "X";
showQuickMessage("MAXIMUM UPGRADE POINTS ACHIEVED");
}
}
hud.experience.text = "XP: " + experiencePoints;
hud.level.text = "LEVEL: " + experienceLevel;
hud.upgrades.upgradePointsText.text = upgradePoints;
if (hudRef.rightDial._rotation < 0) {
hudRef.rightDial._rotation = hudRef.rightDial._rotation + Math.round((180 / (experienceIntervals[experienceLevel] / 2)) * experienceGained);
}
if ((hudRef.rightDial._rotation >= 0) && (hudRef.leftDial._rotation > -180)) {
hudRef.leftDial._rotation = hudRef.leftDial._rotation + Math.round((180 / (experienceIntervals[experienceLevel] / 2)) * experienceGained);
}
if ((hudRef.leftDial._rotation < 0) && (hudRef.rightDial._rotation >= 0)) {
}
hud.upgrades.upgradePointsText.text = upgradePoints;
}
}
function setupInterfaceExperience() {
if (playingSkirmish == true) {
hud.upgrades._visible = false;
}
hudRef = hud.upgrades.experience;
hud.upgrades.upgradePointsText.text = upgradePoints;
hud.upgrades.experience.rightDial._rotation = -180;
hudRef.rightDial._rotation = hudRef.rightDial._rotation + ((180 / (experienceIntervals[experienceLevel] / 2)) * experiencePoints);
if ((hudRef.rightDial._rotation >= 0) && (hudRef.leftDial._rotation > -180)) {
hudRef.rightDial._rotation = 0;
hudRef.leftDial._rotation = hudRef.leftDial._rotation + ((180 / (experienceIntervals[experienceLevel] / 2)) * (experiencePoints - (experienceIntervals[experienceLevel] / 2)));
}
hud.upgrades.upgradeButton.onRelease = function () {
loadUpgradeScreenInGame();
};
}
function setupSkirmishMapDefaults() {
skirmishMap.name = "skirmish";
skirmishMap.mission = 1;
skirmishMap.battleTitle = "SKIRMISH";
skirmishMap.description = "";
skirmishMap.mapSection = "section1";
skirmishMap.sectionNumber = 1;
skirmishMap.friendlyMorale = 1000;
skirmishMap.enemyMorale = 1000;
skirmishMap.file = "skirmishMap_medium";
skirmishMap.mapWidth = 1300;
skirmishMap.trenchPos = new Array();
skirmishMap.wire = 0;
skirmishMap.wire1Pos = 0;
skirmishMap.wire2Pos = 0;
skirmishMap.wire3Pos = 0;
skirmishMap.wire4Pos = 0;
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
skirmishMap.britishMinesMax = 0;
skirmishMap.germanMinesMax = 0;
skirmishMap.unlocks = new Array();
skirmishMap.availableUnits = new Array("riflemen");
skirmishMap.enemyRate = 15;
skirmishMap.enemyUnits = new Array("riflemen");
skirmishMap.enemySupport = new Array();
skirmishMap.enemySupportRate = 30;
skirmishMap.enemyMood = "balanced";
}
function buttonSetup_skirmish(btnName) {
menu.skirmish[btnName].buttonSelected = false;
if (((((btnName == "british") || (btnName == "medium")) || (btnName == "riflemen")) || (btnName == "AI_balanced")) || (btnName == "map_medium")) {
menu.skirmish[btnName].buttonSelected = true;
_root.menu.skirmish[btnName].colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
menu.skirmish[btnName].onRollOver = function () {
if (menu.skirmish[btnName].buttonSelected == false) {
this.colorTransformTo(140, 0, 140, 0, 140, 0, 100, 0, 0.4, "easeOutSine");
}
};
menu.skirmish[btnName].onRollOut = function () {
if (menu.skirmish[btnName].buttonSelected == false) {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
}
};
menu.skirmish[btnName].onRelease = function () {
playClickSound();
switch (btnName) {
case "launch" :
skirmishMapSettings();
currentMap = skirmishMap;
moveMenu();
buildMap(currentMap);
showLoadScreen();
_root.playingSkirmish = true;
break;
case "backToMainButt" :
_root.skirmishToMainMenu();
break;
case "british" :
_root.menu.skirmish.british.buttonSelected = true;
_root.menu.skirmish.german.buttonSelected = false;
_root.menu.skirmish.british.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.german.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "german" :
_root.menu.skirmish.british.buttonSelected = false;
_root.menu.skirmish.german.buttonSelected = true;
_root.menu.skirmish.german.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.british.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "easy" :
_root.menu.skirmish.easy.buttonSelected = true;
_root.menu.skirmish.medium.buttonSelected = false;
_root.menu.skirmish.hard.buttonSelected = false;
_root.menu.skirmish.easy.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.hard.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "medium" :
_root.menu.skirmish.easy.buttonSelected = false;
_root.menu.skirmish.medium.buttonSelected = true;
_root.menu.skirmish.hard.buttonSelected = false;
_root.menu.skirmish.medium.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.easy.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.hard.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "hard" :
_root.menu.skirmish.easy.buttonSelected = false;
_root.menu.skirmish.medium.buttonSelected = false;
_root.menu.skirmish.hard.buttonSelected = true;
_root.menu.skirmish.hard.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.easy.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "riflemen" :
addRemoveSkirmishUnits(btnName, "riflemen");
break;
case "assault" :
addRemoveSkirmishUnits(btnName, "assault");
break;
case "machineGun" :
addRemoveSkirmishUnits(btnName, "machineGun");
break;
case "sniper" :
addRemoveSkirmishUnits(btnName, "sniper");
break;
case "officer" :
addRemoveSkirmishUnits(btnName, "officer");
break;
case "tank" :
addRemoveSkirmishUnits(btnName, "tank");
break;
case "mortar" :
addRemoveSkirmishUnits(btnName, "mortar");
break;
case "artillery" :
addRemoveSkirmishUnits(btnName, "artillery");
break;
case "gas" :
addRemoveSkirmishUnits(btnName, "gas");
break;
case "antiTank" :
addRemoveSkirmishUnits(btnName, "antiTank");
break;
case "AI_aggressive" :
_root.skirmishMap.enemyMood = "aggressive";
_root.menu.skirmish.AI_aggressive.buttonSelected = true;
_root.menu.skirmish.AI_defensive.buttonSelected = false;
_root.menu.skirmish.AI_balanced.buttonSelected = false;
_root.menu.skirmish.AI_aggressive.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_defensive.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_balanced.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "AI_defensive" :
_root.skirmishMap.enemyMood = "defensive";
_root.menu.skirmish.AI_aggressive.buttonSelected = false;
_root.menu.skirmish.AI_defensive.buttonSelected = true;
_root.menu.skirmish.AI_balanced.buttonSelected = false;
_root.menu.skirmish.AI_aggressive.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_defensive.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_balanced.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "AI_balanced" :
_root.skirmishMap.enemyMood = "balanced";
_root.menu.skirmish.AI_aggressive.buttonSelected = false;
_root.menu.skirmish.AI_defensive.buttonSelected = false;
_root.menu.skirmish.AI_balanced.buttonSelected = true;
_root.menu.skirmish.AI_aggressive.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_defensive.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.AI_balanced.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
break;
case "map_short" :
_root.skirmishMap.file = "skirmishMap_short";
_root.menu.skirmish.map_short.buttonSelected = true;
_root.menu.skirmish.map_medium.buttonSelected = false;
_root.menu.skirmish.map_long.buttonSelected = false;
_root.menu.skirmish.map_short.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_long.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "map_medium" :
_root.skirmishMap.file = "skirmishMap_medium";
_root.menu.skirmish.map_short.buttonSelected = false;
_root.menu.skirmish.map_medium.buttonSelected = true;
_root.menu.skirmish.map_long.buttonSelected = false;
_root.menu.skirmish.map_short.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_medium.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_long.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "map_long" :
_root.skirmishMap.file = "skirmishMap_long";
_root.menu.skirmish.map_short.buttonSelected = false;
_root.menu.skirmish.map_medium.buttonSelected = false;
_root.menu.skirmish.map_long.buttonSelected = true;
_root.menu.skirmish.map_short.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.map_long.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
break;
case "mines_few" :
_root.menu.skirmish.mines_few.buttonSelected = true;
_root.menu.skirmish.mines_medium.buttonSelected = false;
_root.menu.skirmish.mines_many.buttonSelected = false;
_root.menu.skirmish.mines_few.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_many.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "mines_medium" :
_root.menu.skirmish.mines_few.buttonSelected = false;
_root.menu.skirmish.mines_medium.buttonSelected = true;
_root.menu.skirmish.mines_many.buttonSelected = false;
_root.menu.skirmish.mines_few.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_medium.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_many.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "mines_many" :
_root.menu.skirmish.mines_few.buttonSelected = false;
_root.menu.skirmish.mines_medium.buttonSelected = false;
_root.menu.skirmish.mines_many.buttonSelected = true;
_root.menu.skirmish.mines_few.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.menu.skirmish.mines_many.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
};
}
function addRemoveSkirmishUnits(btnName, unitName) {
if (menu.skirmish[btnName].buttonSelected == false) {
menu.skirmish[btnName].buttonSelected = true;
_root.skirmishMap.availableUnits.push(unitName);
if ((((unitName == "mortar") || (unitName == "gas")) || (unitName == "artillery")) || (unitName == "antiTank")) {
_root.skirmishMap.enemySupport.push(unitName);
} else {
_root.skirmishMap.enemyUnits.push(unitName);
}
_root.menu.skirmish[unitName].colorTransformTo(220, 0, 220, 0, 220, 0, 220, 0, 0.4, "easeOutSine");
} else {
menu.skirmish[btnName].buttonSelected = false;
_root.menu.skirmish[unitName].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
for (x in _root.skirmishMap.availableUnits) {
if (_root.skirmishMap.availableUnits[x] == unitName) {
_root.skirmishMap.availableUnits.splice(x, 1);
}
}
for (x in _root.skirmishMap.enemyUnits) {
if (_root.skirmishMap.enemyUnits[x] == unitName) {
_root.skirmishMap.enemyUnits.splice(x, 1);
}
}
for (x in _root.skirmishMap.enemySupport) {
if (_root.skirmishMap.enemySupport[x] == unitName) {
_root.skirmishMap.enemySupport.splice(x, 1);
}
}
}
}
function saveSkirmishSettings() {
}
function skirmishMapSettings() {
initBattleStats();
if (_root.menu.skirmish.british.buttonSelected == true) {
playerTeam.team = "british";
compTeam.team = "german";
} else {
playerTeam.team = "german";
compTeam.team = "british";
}
if (_root.menu.skirmish.easy.buttonSelected == true) {
skirmishMap.enemyRate = 20;
skirmishMap.enemySupportRate = 30;
}
if (_root.menu.skirmish.medium.buttonSelected == true) {
skirmishMap.enemyRate = 15;
skirmishMap.enemySupportRate = 25;
}
if (_root.menu.skirmish.hard.buttonSelected == true) {
skirmishMap.enemyRate = 10;
skirmishMap.enemySupportRate = 20;
}
skirmishTrenchNum = _root.menu.skirmish.trenches.text;
if (((((skirmishTrenchNum != 1) && (skirmishTrenchNum != 2)) && (skirmishTrenchNum != 3)) && (skirmishTrenchNum != 4)) && (skirmishTrenchNum != 5)) {
skirmishTrenchNum = 0;
}
skirmishWireNum = _root.menu.skirmish.wire.text;
if ((((skirmishWireNum != 1) && (skirmishWireNum != 2)) && (skirmishWireNum != 3)) && (skirmishWireNum != 4)) {
skirmishWireNum = 0;
}
skirmishMap.wire = skirmishWireNum;
if (skirmishMap.file == "skirmishMap_short") {
skirmishMap.mapWidth = 800;
skirmishMap.trenchPos = new Array();
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
switch (skirmishTrenchNum) {
case "1" :
skirmishMap.trenchPos = new Array("600");
skirmishMap.wire1Pos = 300;
skirmishMap.wire2Pos = 750;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 950;
break;
case "2" :
skirmishMap.trenchPos = new Array("300", "900");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 700;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 1000;
break;
case "3" :
skirmishMap.trenchPos = new Array("300", "600", "900");
skirmishMap.wire1Pos = 450;
skirmishMap.wire2Pos = 750;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 1000;
break;
case "4" :
skirmishMap.trenchPos = new Array("300", "500", "700", "900");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 800;
skirmishMap.wire3Pos = 600;
skirmishMap.wire4Pos = 1600;
break;
case "5" :
skirmishMap.trenchPos = new Array("300", "450", "600", "750", "900");
skirmishMap.wire1Pos = 520;
skirmishMap.wire2Pos = 680;
skirmishMap.wire3Pos = 375;
skirmishMap.wire4Pos = 825;
}
}
if (skirmishMap.file == "skirmishMap_medium") {
skirmishMap.mapWidth = 1300;
skirmishMap.trenchPos = new Array();
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
switch (skirmishTrenchNum) {
case "1" :
skirmishMap.trenchPos = new Array("750");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 800;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 950;
break;
case "2" :
skirmishMap.trenchPos = new Array("300", "1100");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 700;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 1000;
break;
case "3" :
skirmishMap.trenchPos = new Array("300", "650", "1100");
skirmishMap.wire1Pos = 450;
skirmishMap.wire2Pos = 900;
skirmishMap.wire3Pos = 200;
skirmishMap.wire4Pos = 1000;
break;
case "4" :
skirmishMap.trenchPos = new Array("200", "550", "850", "1100");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 800;
skirmishMap.wire3Pos = 600;
skirmishMap.wire4Pos = 1600;
break;
case "5" :
skirmishMap.trenchPos = new Array("300", "500", "700", "900", "1100");
skirmishMap.wire1Pos = 580;
skirmishMap.wire2Pos = 780;
skirmishMap.wire3Pos = 375;
skirmishMap.wire4Pos = 825;
}
}
if (skirmishMap.file == "skirmishMap_long") {
skirmishMap.mapWidth = 1800;
skirmishMap.trenchPos = new Array();
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
switch (skirmishTrenchNum) {
case "1" :
skirmishMap.trenchPos = new Array("1000");
skirmishMap.wire1Pos = 800;
skirmishMap.wire2Pos = 1200;
skirmishMap.wire3Pos = 400;
skirmishMap.wire4Pos = 1500;
break;
case "2" :
skirmishMap.trenchPos = new Array("300", "1700");
skirmishMap.wire1Pos = 450;
skirmishMap.wire2Pos = 1300;
skirmishMap.wire3Pos = 850;
skirmishMap.wire4Pos = 1100;
break;
case "3" :
skirmishMap.trenchPos = new Array("300", "1000", "1700");
skirmishMap.wire1Pos = 450;
skirmishMap.wire2Pos = 1500;
skirmishMap.wire3Pos = 850;
skirmishMap.wire4Pos = 1100;
break;
case "4" :
skirmishMap.trenchPos = new Array("300", "800", "1300", "1700");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 1500;
skirmishMap.wire3Pos = 900;
skirmishMap.wire4Pos = 1100;
break;
case "5" :
skirmishMap.trenchPos = new Array("300", "600", "900", "1300", "1700");
skirmishMap.wire1Pos = 400;
skirmishMap.wire2Pos = 1500;
skirmishMap.wire3Pos = 800;
skirmishMap.wire4Pos = 1100;
}
}
if (_root.menu.skirmish.mines_few.buttonSelected == true) {
randomMineSpot1 = random(skirmishMap.mapWidth) + 200;
randomMineSpot2 = random(skirmishMap.mapWidth) + 200;
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
skirmishMap.britishMines.push(randomMineSpot1);
skirmishMap.germanMines.push(randomMineSpot2);
skirmishMap.britishMinesMax = 5;
skirmishMap.germanMinesMax = 5;
}
if (_root.menu.skirmish.mines_medium.buttonSelected == true) {
randomMineSpot1 = random(skirmishMap.mapWidth) + 200;
randomMineSpot2 = random(skirmishMap.mapWidth) + 200;
randomMineSpot3 = random(skirmishMap.mapWidth) + 200;
randomMineSpot4 = random(skirmishMap.mapWidth) + 200;
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
skirmishMap.britishMines.push(randomMineSpot1, randomMineSpot2);
skirmishMap.germanMines.push(randomMineSpot3, randomMineSpot4);
skirmishMap.britishMinesMax = 12;
skirmishMap.germanMinesMax = 12;
}
if (_root.menu.skirmish.mines_many.buttonSelected == true) {
randomMineSpot1 = random(skirmishMap.mapWidth) + 200;
randomMineSpot2 = random(skirmishMap.mapWidth) + 200;
randomMineSpot3 = random(skirmishMap.mapWidth) + 200;
randomMineSpot4 = random(skirmishMap.mapWidth) + 200;
randomMineSpot5 = random(skirmishMap.mapWidth) + 200;
randomMineSpot6 = random(skirmishMap.mapWidth) + 200;
randomMineSpot7 = random(skirmishMap.mapWidth) + 200;
randomMineSpot8 = random(skirmishMap.mapWidth) + 200;
skirmishMap.britishMines = new Array();
skirmishMap.germanMines = new Array();
skirmishMap.britishMines.push(randomMineSpot1, randomMineSpot2, randomMineSpot3, randomMineSpot4);
skirmishMap.germanMines.push(randomMineSpot5, randomMineSpot6, randomMineSpot7, randomMineSpot8);
skirmishMap.britishMinesMax = 30;
skirmishMap.germanMinesMax = 30;
}
}
function loadInGameMenu() {
game.state = "paused";
stopAllSoldiers();
_root.hud.attachMovie("inGameMenu", "inGameMenu", depth_HUD_inGameMenu);
_root.hud.inGameMenu._x = Stage.width / 2;
_root.hud.inGameMenu._y = (Stage.height / 2) - 25;
_root.hud.inGameMenu.backing.alphaTo(60, 1);
if (soundEffectsOn == true) {
_root.hud.inGameMenu.sound_on.activated = true;
_root.hud.inGameMenu.sound_on.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
if (soundEffectsOn == false) {
_root.hud.inGameMenu.sound_off.activated = true;
_root.hud.inGameMenu.sound_off.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
if (_quality == "LOW") {
_root.hud.inGameMenu.low.activated = true;
_root.hud.inGameMenu.low.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
if (_quality == "MEDIUM") {
_root.hud.inGameMenu.medium.activated = true;
_root.hud.inGameMenu.medium.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
if (_quality == "HIGH") {
_root.hud.inGameMenu.high.activated = true;
_root.hud.inGameMenu.high.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
}
}
function hideInGameMenu() {
_root.hud.inGameMenu.alphaTo(0, 1, "linear", 0, function () {
if (game.state != "endBattle") {
game.state = "unpaused";
startAllSoldiers();
}
removeMovieClip(this);
});
}
function buttonSetup_inGameMenu(btnName) {
_root.hud.inGameMenu[btnName].activated = false;
_root.hud.inGameMenu[btnName].onRollOver = function () {
playRollOverSound();
this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, "easeOutSine");
};
_root.hud.inGameMenu[btnName].onRollOut = function () {
if (this.activated == false) {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
}
};
_root.hud.inGameMenu[btnName].onRelease = function () {
playClickSound();
switch (btnName) {
case "low" :
_root._quality = "LOW";
this.activated = true;
_root.hud.inGameMenu.medium.activated = false;
_root.hud.inGameMenu.high.activated = false;
_root.hud.inGameMenu.medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.hud.inGameMenu.high.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "medium" :
_root._quality = "MEDIUM";
this.activated = true;
_root.hud.inGameMenu.low.activated = false;
_root.hud.inGameMenu.high.activated = false;
_root.hud.inGameMenu.low.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.hud.inGameMenu.high.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "high" :
_root._quality = "HIGH";
this.activated = true;
_root.hud.inGameMenu.medium.activated = false;
_root.hud.inGameMenu.low.activated = false;
_root.hud.inGameMenu.medium.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
_root.hud.inGameMenu.low.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "sound_on" :
soundEffectsOn = true;
this.activated = true;
_root.hud.inGameMenu.sound_off.activated = false;
_root.hud.inGameMenu.sound_off.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "sound_off" :
soundEffectsOn = false;
this.activated = true;
_root.hud.inGameMenu.sound_on.activated = false;
_root.hud.inGameMenu.sound_on.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
break;
case "quitBattle" :
hideInGameMenu();
endBattle(compTeam.team, "morale");
stopAllSounds();
break;
case "quitToMenu" :
loopambienceRain.stop();
loopambience.stop();
game.state = "paused";
unloadMap();
removeMovieClip(hud);
loadMenu();
stopAllSounds();
break;
case "close" :
saveGameSettings();
hideInGameMenu();
}
};
}
function setupHelp() {
if ((helpArrayIndex > 0) || (helpEnabled == false)) {
hud.help.unitHelp._visible = false;
}
hud.help.unitHelp.header.text = "CREATE UNITS HERE";
hud.help.unitHelp.desc.text = "Click the portraits to create units. Deploying a unit will reset ALL timers.";
hud.help.progressBar.gotoAndStop("flipped");
hud.help.progressBar.header.text = "GROUND TAKEN";
hud.help.progressBar.desc.text = "The top bar shows the ground taken by your army. Move your men to the enemy's end of the battlefield to win.";
hud.help.morale.gotoAndStop("flipped");
hud.help.morale.header.text = "MORALE BAR";
hud.help.morale.desc.text = "Seeing men die around them will make your army lose morale. Lose enough morale and your army may surrender.";
hud.help.upgrades.header.text = "UPGRADES";
hud.help.upgrades.desc.text = "Killing enemies and winning battles will earn you XP. Earn enough XP and you'll be awarded an upgrade point.";
hud.help.support.header.text = "FIRE SUPPORT";
hud.help.support.desc.text = "To use your fire support items, click the icon, then click the red target on the map.";
hud.help.progressBar._alpha = 0;
hud.help.morale._visible = false;
hud.help.morale._alpha = 0;
hud.help.upgrades._visible = false;
hud.help.upgrades._alpha = 0;
hud.help.support._visible = false;
hud.help.support._alpha = 0;
hud.help.support.closeButton.onRelease = (hud.help.unitHelp.closeButton.onRelease = (hud.help.progressBar.closeButton.onRelease = (hud.help.morale.closeButton.onRelease = (hud.help.upgrades.closeButton.onRelease = function () {
playClickSound();
this._parent.alphaTo(0, 0.6, "easeOutSine", 0, function () {
this._visible = false;
});
}))));
}
function showHelp() {
helpCountdown--;
if ((helpCountdown <= 0) && (helpEnabled == true)) {
if ((helpArrayIndex < 3) || ((helpArrayIndex == 3) && (currentMap.mission >= 2))) {
hud.help[helpArray[helpArrayIndex]]._visible = true;
hud.help[helpArray[helpArrayIndex]].alphaTo(100, 0.8, "easeOutSine");
hud.help[helpArray[helpArrayIndex]].alphaTo(0, 0.8, "easeOutSine", 30);
helpArrayIndex++;
helpCountdown = helpCountdownMax;
saveGameSettings();
}
if (helpArrayIndex > helpArray.length) {
helpEnabled = false;
saveGameSettings();
}
}
}
function resetDepthVariables() {
squadNumber = 0;
soldierNumber = 0;
particleCount = depth_particles;
xpCount = 0;
grenNumber = 0;
grenadeCollisions = 0;
wireCount = 0;
soundEffects = 0;
specialRounds = 0;
decals = 0;
gasCollisions = 0;
}
function resetCareerStats() {
career_soldiersKilled = 0;
career_soldiersLost = 0;
career_trenchesTaken = 0;
career_supportUsed = 0;
career_wins = 0;
career_losses = 0;
career_moraleWins = 0;
career_moraleLosses = 0;
career_conquerWins = 0;
career_conquerLosses = 0;
career_moraleGained = 0;
career_moraleLost = 0;
career_experienceGained = 0;
career_bonusExpGained = 0;
career_riflemenDeployed = 0;
career_assaultDeployed = 0;
career_machineGunDeployed = 0;
career_sniperDeployed = 0;
career_officerDeployed = 0;
career_tankDeployed = 0;
}
function showEnding() {
loadScreen.gotoAndStop("endGame");
switch (random(5) + 1) {
case 1 :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " ARMY LED TO GLORIOUS VICTORY";
break;
case 2 :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " ARMY CONQUERS ALL";
break;
case 3 :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " FORCES VICTORIOUS";
break;
case 4 :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " ARMED FORCES SURGE TO VICTORY";
break;
case 5 :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " MEN LED TO VICTORY IN EUROPE";
break;
default :
loadScreen.ending.paper.headLine.text = playerTeam.team.toUpperCase() + " ARMY LED TO GLORIOUS VICTORY";
}
loadScreen.campaignStats.end_soldiersKilled.text = career_soldiersKilled;
loadScreen.campaignStats.end_soldiersLost.text = career_soldiersLost;
loadScreen.campaignStats.end_trenchesTaken.text = career_trenchesTaken;
loadScreen.campaignStats.end_supportUsed.text = career_supportUsed;
loadScreen.campaignStats.end_wins.text = career_wins;
loadScreen.campaignStats.end_losses.text = career_losses;
loadScreen.campaignStats.end_moraleWins.text = career_moraleWins;
loadScreen.campaignStats.end_moraleLosses.text = career_moraleLosses;
loadScreen.campaignStats.end_conquerWins.text = career_conquerWins;
loadScreen.campaignStats.end_conquerLosses.text = career_conquerLosses;
loadScreen.campaignStats.end_xpGained.text = career_experienceGained;
loadScreen.campaignStats.end_bonusXPGained.text = career_bonusExpGained;
loadScreen.campaignStats.end_riflemen.text = career_riflemenDeployed;
loadScreen.campaignStats.end_assault.text = career_assaultDeployed;
loadScreen.campaignStats.end_machineGun.text = career_machineGunDeployed;
loadScreen.campaignStats.end_sniper.text = career_sniperDeployed;
loadScreen.campaignStats.end_officer.text = career_officerDeployed;
loadScreen.campaignStats.end_tank.text = career_tankDeployed;
}
function sendKongStat(statName, stat) {
_root.kongregateStats.submit(statName, stat);
}
function sendMaxKongStats() {
sendKongStat("Soldiers Killed", career_soldiersKilled);
sendKongStat("Soldiers Lost", career_soldiersLost);
sendKongStat("Trenches Taken", career_trenchesTaken);
sendKongStat("Support Used", career_supportUsed);
sendKongStat("Riflemen Deployed", career_riflemenDeployed);
sendKongStat("Assault Deployed", career_assaultDeployed);
sendKongStat("Machine Gun Deployed", career_machineGunDeployed);
sendKongStat("Sharpshooter Deployed", career_sniperDeployed);
sendKongStat("Officer Deployed", career_officerDeployed);
sendKongStat("Tank Deployed", career_tankDeployed);
}
function sendKongMissionFinished(missionNum) {
sendKongStat("Completed Mission " + missionNum, 1);
}
function sendKongBattleWon(winType) {
sendKongStat("Battles Won", 1);
if (winType == "conquer") {
sendKongStat("Conquer Wins", 1);
} else {
sendKongStat("Morale Wins", 1);
}
}
function sendKongBattleLost(winType) {
sendKongStat("Battles Lost", 1);
if (winType == "conquer") {
sendKongStat("Conquer Losses", 1);
} else {
sendKongStat("Morale Losses", 1);
}
}
function slowEnterFrame() {
slowEFcount--;
if (slowEFcount <= 0) {
removeAd();
enemyUnitGenerator();
enemySupportGenerator();
sortSoldierDepths();
updateProgressBar();
updateMoraleBar();
enemyUnitAI();
slowEFcount = slowEFcountMax;
}
}
function mediumEnterFrame() {
mediumEFcount--;
if (mediumEFcount <= 0) {
findMines("german");
findMines("british");
findWire("german");
findWire("british");
findOfficer("german");
findOfficer("british");
updateTrenchHealthBars();
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_sound_tanks = 60;
var depth_menu = 850000;
var depth_gameMenu = 855000;
var depth_menu_upgrades = 860000;
var depth_dialog = 950000;
var depth_unlockDialog = 960000;
var depth_blackOut = 1500000;
var depth_cursor = 1550000;
var depth_console = 1600000;
var depth_HUD = 900000;
var depth_HUD_upgrades = 910000;
var depth_HUD_inGameMenu = 920000;
var depth_HUD_panArrow = 1000;
var depth_HUD_fps = 1001;
var depth_HUD_quickMessage = 1002;
var depth_HUD_console = 5000;
var depth_world = 1000;
var depth_world_decals = 1500;
var depth_world_deadSoldiers = 10000;
var depth_world_wire = 15000;
var depth_world_soldiers = 20000;
var depth_world_soldiersSorted = 30000;
var depth_world_grenade = 400000;
var depth_world_artillery = 500000;
var depth_world_rainHolder = 700000;
var depth_world_trenchHUD = 750000;
var depth_world_target = 900000;
var depth_world_xpIcons = 950000;
var depth_bg_trenches = 100;
var depth_particles = 480000;
var depth_bounceParticles = 680000;
var saveGameExists = false;
saveGameData = SharedObject.getLocal("ConArtists_Warfare1917");
checkForSaveGame();
initDialogBoxes();
var quickMessageTime = 0;
var soundEffects = 0;
var soundEffectsOn = true;
var musicOn = true;
var playingContinue;
var xpBarText;
var prevExpLevel = 0;
var xpSoFar = 0;
var nextXPLevel = 0;
var updateFPScountMax = 20;
var updateFPScount = updateFPScountMax;
var panSpeed = 20;
var panBuffer = 80;
var panInterfaceBlock = (Stage.height - 80);
var camera;
camera.state = "free";
var a = 0;
british = new Object();
british.name = "british";
british.teamColour = "0x666600";
british.spawnPoint = -100;
british.gasMasksOn = false;
german = new Object();
german.name = "german";
german.teamColour = "0x222222";
german.spawnPoint = 1700;
german.gasMasksOn = false;
playerTeam = new Object();
playerTeam.team = "empty";
compTeam = new Object();
compTeam.team = "empty";
british.base = new Object();
british.base.health = 0;
british.base.speed = 0;
british.base.units = ["base"];
british.artillery = new Object();
british.artillery.name = "Artillery";
british.artillery.description = "Artillery";
british.artillery.unlockDescription = "Devastating heavy rounds that will destroy anything in their way.";
british.artillery.damage = 500;
british.artillery.timer = 400;
british.mortar = new Object();
british.mortar.name = "Mortar";
british.mortar.description = "Mortar";
british.mortar.unlockDescription = "Explosive rounds good for hitting large numbers of infantry in the open.";
british.mortar.damage = 250;
british.tankShell = new Object();
british.tankShell.name = "Riflemen";
british.tankShell.description = "Riflemen";
british.tankShell.damage = 200;
british.grenade = new Object();
british.grenade.name = "Grenade";
british.grenade.description = "Grenade";
british.grenade.damage = 65;
british.gas = new Object();
british.gas.name = "Gas";
british.gas.description = "Gas";
british.gas.unlockDescription = "Gas rounds are a long lasting area attack. Best used on men in entrenched positions.";
british.gas.duration = 450;
british.antiTank = new Object();
british.antiTank.name = "AntiTank";
british.antiTank.description = "AntiTank";
british.antiTank.unlockDescription = "Direct fire rounds for taking out tanks.";
british.antiTank.damage = 450;
british.mine = new Object();
british.mine.name = "Mine";
british.mine.description = "Mine";
british.mine.unlockDescription = "Gas rounds are a long lasting area attack. Best used on men in entrenched positions.";
british.mine.damage = 150;
british.riflemen = new Object();
british.riflemen.name = "Riflemen";
british.riflemen.description = "Riflemen";
british.riflemen.unlockDescription = "British riflemen are the core of your infantry. Good in most situations.";
british.riflemen.units = ["rifleman", "rifleman", "rifleman", "rifleman", "rifleman", "rifleman"];
british.riflemen.range = 450;
british.riflemen.speed = 1.8;
british.riflemen.soldierHealth = 40;
british.riflemen.health = (british.riflemen.units.length + 1) * british.riflemen.soldierHealth;
british.rifleman = new Object();
british.rifleman.mainWeapon = "enfield";
british.rifleman.damage = 15;
british.rifleman.firePose = "rifle";
british.rifleman.health = 10;
british.assault = new Object();
british.assault.name = "Assault Team";
british.assault.description = "Assault Team";
british.assault.unlockDescription = "Using rush tactics and mills bombs, Assault Teams are best at clearing trenches.";
british.assault.units = ["grenadier", "grenadier", "grenadier", "grenadier"];
british.assault.range = 450;
british.assault.speed = 2.1;
british.assault.soldierHealth = 150;
british.assault.health = (british.assault.units.length + 1) * british.assault.soldierHealth;
british.grenadier = new Object();
british.grenadier.mainWeapon = "enfield";
british.grenadier.secondWeapon = "grenade";
british.grenadier.damage = 12;
british.grenadier.firePose = "rifle";
british.grenadier.health = 10;
british.machineGun = new Object();
british.machineGun.name = "Machine Gun Team";
british.machineGun.description = "The Lewis Gunneroos";
british.machineGun.unlockDescription = "Carrying the Lewis Gun, these teams are your defensive backbone. Keep them entrenched.";
british.machineGun.mainWeapon = "enfield";
british.machineGun.units = ["machineGunner", "rifleman", "rifleman"];
british.machineGun.range = 450;
british.machineGun.speed = 1.5;
british.machineGun.soldierHealth = 70;
british.machineGun.health = (british.machineGun.units.length + 1) * british.machineGun.soldierHealth;
british.machineGunner = new Object();
british.machineGunner.mainWeapon = "lewis";
british.machineGunner.firePose = "machineGun";
british.machineGunner.damage = 5;
british.mgAssist = new Object();
british.mgAssist.mainWeapon = "pistol";
british.mgAssist.firePose = "pistol";
british.mgAssist.damage = 1.25;
british.sniper = new Object();
british.sniper.name = "Sharpshooter";
british.sniper.description = "British Sharpshooter";
british.sniper.unlockDescription = "These men are the best shots in the company. Devastating to enemy machine gun teams.";
british.sniper.mainWeapon = "enfieldSniper";
british.sniper.units = ["sharpShooter"];
british.sniper.range = 600;
british.sniper.speed = 1.65;
british.sniper.soldierHealth = 90;
british.sniper.health = (british.sniper.units.length + 1) * british.sniper.soldierHealth;
british.sharpShooter = new Object();
british.sharpShooter.mainWeapon = "enfieldSniper";
british.sharpShooter.firePose = "sniper";
british.sharpShooter.damage = 70;
british.spotter = new Object();
british.spotter.mainWeapon = "pistol";
british.spotter.health = 10;
british.officer = new Object();
british.officer.name = "officer";
british.officer.description = "Officer";
british.officer.unlockDescription = "Officers inspire their men, providing them with an accuracy bonus when close.";
british.officer.units = ["lieutenant"];
british.officer.range = 450;
british.officer.mainWeapon = "pistol";
british.officer.speed = 1.5;
british.officer.soldierHealth = 115;
british.officer.health = (british.officer.units.length + 1) * british.officer.soldierHealth;
british.lieutenant = new Object();
british.lieutenant.mainWeapon = "pistol";
british.lieutenant.firePose = "pistol";
british.lieutenant.damage = 6;
british.tank = new Object();
british.tank.name = "tank";
british.tank.description = "Tank Mark IV";
british.tank.unlockDescription = "'Land-ships' are a fearsome sight to the Fritz. Blazing machine guns and cannons, hurrah!";
british.tank.units = ["tankMarkIV"];
british.tank.range = 650;
british.tank.mainWeapon = "mainGun";
british.tank.secondaryWeapon = "tankMG";
british.tank.speed = 0.5;
british.tank.soldierHealth = 850;
british.tank.health = british.tank.units.length * british.tank.soldierHealth;
british.tankMarkIV = new Object();
british.tankMarkIV.mainWeapon = "tankMG";
british.tankMarkIV.damage = 4;
german.base = new Object();
german.base.health = 0;
german.base.speed = 0;
german.base.units = ["base"];
german.artillery = new Object();
german.artillery.name = "Artillery";
german.artillery.description = "Artillery";
german.artillery.unlockDescription = "Heavy artillery rounds for taking out all types of targets.";
german.artillery.damage = 500;
german.mortar = new Object();
german.mortar.name = "Mortar";
german.mortar.description = "Mortar";
german.mortar.unlockDescription = "Indirect medium explosive fire.";
german.mortar.damage = 250;
german.tankShell = new Object();
german.tankShell.name = "Riflemen";
german.tankShell.description = "Riflemen";
german.tankShell.damage = 200;
german.grenade = new Object();
german.grenade.name = "Grenade";
german.grenade.description = "Grenade";
german.grenade.damage = 65;
german.gas = new Object();
german.gas.name = "Gas";
german.gas.description = "Gas";
german.gas.unlockDescription = "Toxic gases used to disable enemies. Best used on entrenched soldiers.";
german.gas.duration = 350;
german.antiTank = new Object();
german.antiTank.name = "AntiTank";
german.antiTank.description = "Anti-Tank";
german.antiTank.unlockDescription = "Direct fire rounds for taking out tanks.";
german.antiTank.damage = 450;
german.mine = new Object();
german.mine.name = "Mine";
german.mine.description = "Mine";
german.mine.unlockDescription = "Gas rounds are a long lasting area attack. Best used on men in entrenched positions.";
german.mine.damage = 150;
german.riflemen = new Object();
german.riflemen.name = "Riflemen";
german.riflemen.description = "Riflemen";
german.riflemen.units = ["rifleman", "rifleman", "rifleman", "rifleman", "rifleman"];
german.riflemen.range = 450;
german.riflemen.speed = 1.8;
german.riflemen.morale = 100;
german.riflemen.unlockDescription = "Our riflemen are excellent all round soldiers.";
german.riflemen.soldierHealth = 45;
german.riflemen.health = (german.riflemen.units.length + 1) * german.riflemen.soldierHealth;
german.rifleman = new Object();
german.rifleman.mainWeapon = "mauser";
german.rifleman.firePose = "rifle";
german.rifleman.damage = 15;
german.rifleman.health = 0;
german.assault = new Object();
german.assault.name = "Assault Team";
german.assault.description = "Sturmtruppen";
german.assault.units = ["grenadier", "grenadier", "grenadier", "grenadier"];
german.assault.range = 450;
german.assault.speed = 2.1;
german.assault.soldierHealth = 165;
german.assault.health = (german.assault.units.length + 1) * german.assault.soldierHealth;
german.assault.unlockDescription = "Sturmtruppen or Assault Troops are trained in assaulting trenches.";
german.grenadier = new Object();
german.grenadier.mainWeapon = "mauser";
german.grenadier.secondWeapon = "grenade";
german.grenadier.damage = 15;
german.grenadier.firePose = "rifle";
german.grenadier.health = 10;
german.machineGun = new Object();
german.machineGun.name = "Machine Gun Team";
german.machineGun.description = "Machine Gun Team";
german.machineGun.mainWeapon = "Lewis Gun";
german.machineGun.units = ["machineGunner", "rifleman", "rifleman"];
german.machineGun.range = 450;
german.machineGun.speed = 1.5;
german.machineGun.soldierHealth = 70;
german.machineGun.health = (german.machineGun.units.length + 1) * german.machineGun.soldierHealth;
german.machineGun.unlockDescription = "Machine gun teams are best entrenched in defensive positions.";
german.machineGunner = new Object();
german.machineGunner.mainWeapon = "lewis";
german.machineGunner.firePose = "machineGun";
german.machineGunner.damage = 6;
german.machineGunner.health = 10;
german.mgAssist = new Object();
german.mgAssist.mainWeapon = "pistol";
german.mgAssist.health = 10;
german.sniper = new Object();
german.sniper.name = "Sharpshooter";
german.sniper.description = "German Sharpshooter";
german.sniper.mainWeapon = "enfieldSniper";
german.sniper.units = ["sharpShooter"];
german.sniper.range = 600;
german.sniper.speed = 1.65;
german.sniper.unlockDescription = "The sharpshooter is a deadly tool against enemies at long range.";
german.sniper.soldierHealth = 90;
german.sniper.health = (german.sniper.units.length + 1) * german.sniper.soldierHealth;
german.sharpShooter = new Object();
german.sharpShooter.mainWeapon = "mauserSniper";
german.sharpShooter.firePose = "sniper";
german.sharpShooter.damage = 70;
german.spotter = new Object();
german.spotter.mainWeapon = "pistol";
german.spotter.health = 10;
german.officer = new Object();
german.officer.name = "officer";
german.officer.description = "Officer";
german.officer.units = ["lieutenant"];
german.officer.range = 450;
german.officer.mainWeapon = "pistol";
german.officer.speed = 1.5;
german.officer.unlockDescription = "Our officers provide a boost to the morale of the men.";
german.officer.soldierHealth = 115;
german.officer.health = (german.officer.units.length + 1) * german.officer.soldierHealth;
german.lieutenant = new Object();
german.lieutenant.mainWeapon = "pistol";
german.lieutenant.firePose = "pistol";
german.lieutenant.damage = 6;
german.tank = new Object();
german.tank.name = "tank";
german.tank.description = "A7V Tank";
german.tank.units = ["tankMarkIV"];
german.tank.range = 650;
german.tank.mainWeapon = "mainGun";
german.tank.secondaryWeapon = "tankMG";
german.tank.speed = 0.5;
german.tank.unlockDescription = "Our answer to the Mark IV. Devastating to infantry.";
german.tank.soldierHealth = 850;
german.tank.health = german.tank.units.length * german.tank.soldierHealth;
german.tankMarkIV = new Object();
german.tankMarkIV.mainWeapon = "tankMG";
german.tankMarkIV.damage = 4;
var squadNumber = 0;
var soldierNumber = 0;
var britishSquadsOnScreen = new Array();
var germanSquadsOnScreen = new Array();
var britishOfficers = new Array();
var germanOfficers = new Array();
british.squadLeaders = new Array();
german.squadLeaders = new Array();
var conquerWinArea = 150;
var squadLocalX = 0;
var squadGlobalX = 0;
var squadLocalPoint = new Object();
var currentSquadProx = 0;
var targetingBuffer = 120;
var officerInfluence = 150;
var officerFound = false;
var trenchBoundary = 120;
var wireSpeedMod = 1.5;
var mineBoundary = 60;
var mineEnemyName;
var mineDeathChance = 16;
var mineVictim = 0;
var currentMapMines_british = 0;
var currentMapMines_german = 0;
var firstEnemyUnit = true;
var enemyUnitRate = 0;
var enemyUnitRateMax = 0;
var enemyUnitWave = 0;
var randomEnemyUnit = 0;
var AIpanicMode = false;
var enemySupportRate = 0;
var enemySupportRateMax = 0;
var enemySupportWave = 0;
var closestSupportTargetX = 0;
var enemySupportTarget = null;
var squadToHit = 0;
var squadMemberNumberToHit = 0;
var showBulletDustChance = 8;
var trenchDefence = 0.2;
var trenchBonus = 1.3;
var officerBonus = 1.5;
var explosiveDamage = 0;
var clearDeadSoldierTime = 15000;
var explosionSurvivalChance = 10;
var deadTanks = new Array();
var particleCount = depth_particles;
var bounceParticleCount = depth_bounceParticles;
var randomLimb = 0;
var randomSound = null;
var flashRandomDelay = 0;
var rainSetup = false;
var rainDrops = 130;
var numRainDrops = 0;
var numRainSplash = 0;
var specialRounds = 0;
var decals = 0;
var numArtilleryRounds = 8;
var numMortarRounds = 8;
var numGasRounds = 2;
var numAntiTankRounds = 5;
var tempNumMortarRounds = 0;
var tempNumArtilleryRounds = 0;
var tempNumGasRounds = 0;
var tempNumAntiTankRounds = 0;
var decalRemoveDelay = 15;
var gasCollisions = 0;
var gasDamage = 0.4;
var activeGas = new Array();
var gasDetectRange = 400;
var closestPlayerTeamSquadX = -1;
var closestCompTeamSquadX = world.bg._width;
var progressBarPlayerScale = 0;
var progressBarCompScale = 0;
var lastProgPlayerScale = 0;
var lastProgCompScale = 0;
var supportTargets = 0;
var currentFireSupportTime = 0;
var enemyTeamInterfaceColour = "0x888888";
slot1_unit = new Object();
slot1_unit.name = "riflemen";
slot1_unit.unitType = "Riflemen";
slot1_unit.description = "Good vs Infantry. \rWeak vs Armor.";
slot1_unit.timer = 300;
slot2_unit = new Object();
slot2_unit.name = "assault";
slot2_unit.unitType = "Assault Team";
slot2_unit.description = "Strong vs Entrenched.\rAverage vs Armor.";
slot2_unit.timer = 420;
slot3_unit = new Object();
slot3_unit.name = "machineGun";
slot3_unit.unitType = "Lewis Gunners";
slot3_unit.description = "Good vs Infantry \rwhen entrenched.";
slot3_unit.timer = 600;
slot4_unit = new Object();
slot4_unit.name = "sniper";
slot4_unit.unitType = "Sharpshooter";
slot4_unit.description = "Strong vs Infantry \rat long range.";
slot4_unit.timer = 800;
slot5_unit = new Object();
slot5_unit.name = "officer";
slot5_unit.unitType = "Officer";
slot5_unit.description = "Adds morale. \rDamage bonus to soldiers.";
slot5_unit.timer = 600;
slot6_unit = new Object();
slot6_unit.name = "tank";
slot6_unit.unitType = "Mark IV Tank";
slot6_unit.description = "Strong vs All. Weak vs Fire support.";
slot6_unit.timer = 1800;
var allSlots = new Array();
supportSlot1_special = new Object();
supportSlot1_special.name = "mortar";
supportSlot1_special.unitType = "Mortar Strike";
supportSlot1_special.description = "Medium explosive.\rGood vs exposed infantry.";
supportSlot1_special.timer = 2000;
supportSlot2_special = new Object();
supportSlot2_special.name = "artillery";
supportSlot2_special.unitType = "Artillery Strike";
supportSlot2_special.description = "Heavy bombardment.\rGood vs All units.";
supportSlot2_special.timer = 4000;
supportSlot3_special = new Object();
supportSlot3_special.name = "gas";
supportSlot3_special.unitType = "Gas";
supportSlot3_special.description = "Poison gas attack.\rGood vs Infantry.";
supportSlot3_special.timer = 2500;
supportSlot4_special = new Object();
supportSlot4_special.name = "antiTank";
supportSlot4_special.unitType = "Anti-Tank";
supportSlot4_special.description = "Anti-tank cannon.\rDirect fire.";
supportSlot4_special.timer = 1500;
var supportSlots = new Array();
var retry = false;
var lastMap;
var createEnemyUnits = true;
var battleNum = 1;
var britishEnemiesKilled = 0;
var germanEnemiesKilled = 0;
var britishUnitsLost = 0;
var germanUnitsLost = 0;
var britishUnitsDeployed = 0;
var germanUnitsDeployed = 0;
var britishTrenchesTaken = 0;
var germanTrenchesTaken = 0;
var britishSupportUsed = 0;
var germanSupportUsed = 0;
var endOfBattle = false;
var playerBonusXP = 0;
var killDifference = 0;
var AImortarTarget = 0;
var mapSectionFound = false;
var campaignMapSectionAlpha = 35;
var campaignMapSections = new Array("section1", "section2", "section3", "section4", "section5", "section6", "section7", "section8", "section9", "section10");
var currentMap;
var currentMapNumber = 1;
var british_map1 = new Object();
british_map1.name = "british_map1";
british_map1.mission = 1;
british_map1.battleTitle = "TO THE TRENCHES";
british_map1.description = "The stretch of open ground beyond our trench should lead to a swift victory.";
british_map1.mapSection = "section1";
british_map1.sectionNumber = 1;
british_map1.bonusXP = 25;
british_map1.rainOn = false;
british_map1.friendlyMorale = 100;
british_map1.enemyMorale = 35;
british_map1.file = "map_british_1";
british_map1.trenchPos = new Array("200");
british_map1.wire = 0;
british_map1.wire1Pos = 0;
british_map1.britishMines = new Array();
british_map1.germanMines = new Array();
british_map1.britishMinesMax = 0;
british_map1.germanMinesMax = 0;
british_map1.unlocks = new Array();
british_map1.availableUnits = new Array("riflemen");
british_map1.enemyRate = 12;
british_map1.enemyUnits = new Array("riflemen", "riflemen", "riflemen", "assault");
british_map1.enemySupport = new Array();
british_map1.enemySupportRate = 20;
british_map1.enemyMood = "defensive";
var british_map2 = new Object();
british_map2.name = "british_map2";
british_map2.mission = 2;
british_map2.battleTitle = "DOWNPOUR";
british_map2.description = "The enemy is dug in here, use our assault teams to drive Fritz out!";
british_map2.mapSection = "section2";
british_map2.sectionNumber = 2;
british_map2.bonusXP = 50;
british_map2.rainOn = true;
british_map2.friendlyMorale = 80;
british_map2.enemyMorale = 50;
british_map2.file = "map_british_2";
british_map2.trenchPos = new Array("300", "1048");
british_map2.wire = 0;
british_map2.unlocks = new Array("assault", "mortar");
british_map2.availableUnits = new Array("riflemen", "assault", "mortar");
british_map2.enemyRate = 12;
british_map2.enemyUnits = new Array("machineGun", "riflemen", "riflemen", "assault", "riflemen");
british_map2.enemySupport = new Array("mortar", "mortar");
british_map2.enemySupportRate = 25;
british_map2.enemyMood = "balanced";
var british_map3 = new Object();
british_map3.name = "british_map3";
british_map3.mission = 3;
british_map3.battleTitle = "TAKE COVER!";
british_map3.description = "The rain has cleared but now it's raining shells. Fritz has started bombarding us.";
british_map3.mapSection = "section3";
british_map3.sectionNumber = 3;
british_map3.bonusXP = 100;
british_map3.friendlyMorale = 90;
british_map3.enemyMorale = 90;
british_map3.file = "map_british_3";
british_map3.trenchPos = new Array("290", "1360");
british_map3.wire = 1;
british_map3.wire1Pos = 800;
british_map3.unlocks = new Array("machineGun");
british_map3.availableUnits = new Array("riflemen", "assault", "mortar", "machineGun");
british_map3.enemyRate = 15;
british_map3.enemyUnits = new Array("machineGun", "riflemen", "riflemen", "assault", "riflemen", "riflemen", "riflemen");
british_map3.enemySupport = new Array("mortar", "mortar");
british_map3.enemySupportRate = 25;
british_map3.enemyMood = "balanced";
var british_map4 = new Object();
british_map4.name = "british_map4";
british_map4.mission = 4;
british_map4.battleTitle = "NO MAN'S LAND";
british_map4.description = "Fritz has started entrenching heavily. Wire and mines are deadly, be careful.";
british_map4.mapSection = "section4";
british_map4.sectionNumber = 4;
british_map4.bonusXP = 150;
british_map4.friendlyMorale = 100;
british_map4.enemyMorale = 100;
british_map4.file = "map_british_4";
british_map4.trenchPos = new Array("540", "1360");
british_map4.wire = 2;
british_map4.wire1Pos = 1150;
british_map4.wire2Pos = 850;
british_map4.britishMines = new Array();
british_map4.germanMines = new Array(900, 960);
british_map4.britishMinesMax = 0;
british_map4.germanMinesMax = 5;
british_map4.unlocks = new Array();
british_map4.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar");
british_map4.enemyRate = 15;
british_map4.enemyUnits = new Array("machineGun", "riflemen", "riflemen", "riflemen", "assault", "sniper");
british_map4.enemySupport = new Array("mortar", "mortar");
british_map4.enemySupportRate = 25;
british_map4.enemyMood = "balanced";
var british_map5 = new Object();
british_map5.name = "british_map5";
british_map5.mission = 5;
british_map5.battleTitle = "HEAVY GUNS";
british_map5.description = "Our fire support is in place now. Hit them with everything we've got.";
british_map5.mapSection = "section5";
british_map5.sectionNumber = 5;
british_map5.bonusXP = 250;
british_map5.friendlyMorale = 90;
british_map5.enemyMorale = 90;
british_map5.file = "map_british_5";
british_map5.trenchPos = new Array("230", "800", "1380");
british_map5.wire = 1;
british_map5.wire1Pos = 660;
british_map5.britishMines = new Array(400, 450);
british_map5.germanMines = new Array(900, 1000);
british_map5.britishMinesMax = 10;
british_map5.germanMinesMax = 10;
british_map5.unlocks = new Array("artillery", "sniper");
british_map5.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar", "artillery", "sniper");
british_map5.enemyRate = 10;
british_map5.enemyUnits = new Array("machineGun", "riflemen", "riflemen", "riflemen", "assault", "sniper");
british_map5.enemySupport = new Array("mortar", "artillery");
british_map5.enemySupportRate = 25;
british_map5.enemyMood = "balanced";
var british_map6 = new Object();
british_map6.name = "british_map6";
british_map6.mission = 6;
british_map6.battleTitle = "YELLOW CROSS";
british_map6.description = "Our fire support is in place now. Hit them with everything we've got.";
british_map6.mapSection = "section6";
british_map6.sectionNumber = 6;
british_map6.bonusXP = 450;
british_map6.friendlyMorale = 90;
british_map6.enemyMorale = 90;
british_map6.file = "map_british_6";
british_map6.trenchPos = new Array("230", "950", "1380");
british_map6.wire = 2;
british_map6.wire1Pos = 800;
british_map6.wire2Pos = 1100;
british_map6.britishMines = new Array(800, 850);
british_map6.germanMines = new Array(1100, 1100);
british_map6.britishMinesMax = 5;
british_map6.germanMinesMax = 5;
british_map6.unlocks = new Array("officer", "gas");
british_map6.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar", "artillery", "sniper", "officer", "gas");
british_map6.enemyRate = 13;
british_map6.enemyUnits = new Array("machineGun", "riflemen", "riflemen", "riflemen", "assault", "sniper", "officer");
british_map6.enemySupport = new Array("mortar", "artillery", "gas");
british_map6.enemySupportRate = 25;
british_map6.enemyMood = "balanced";
var british_map7 = new Object();
british_map7.name = "british_map7";
british_map7.mission = 7;
british_map7.battleTitle = "LAND-SHIPS";
british_map7.description = "Our fire support is in place now. Hit them with everything we've got.";
british_map7.mapSection = "section7";
british_map7.sectionNumber = 7;
british_map7.bonusXP = 600;
british_map7.rainOn = true;
british_map7.friendlyMorale = 80;
british_map7.enemyMorale = 80;
british_map7.file = "map_british_7";
british_map7.trenchPos = new Array();
british_map7.wire = 2;
british_map7.wire1Pos = 800;
british_map7.wire2Pos = 1100;
british_map7.britishMines = new Array();
british_map7.germanMines = new Array();
british_map7.britishMinesMax = 0;
british_map7.germanMinesMax = 0;
british_map7.unlocks = new Array("tank");
british_map7.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar", "artillery", "sniper", "officer", "gas", "tank");
british_map7.enemyRate = 12;
british_map7.enemyUnits = new Array("tank", "assault", "riflemen", "assault", "riflemen", "assault", "assault", "officer");
british_map7.enemySupport = new Array("mortar", "artillery", "gas");
british_map7.enemySupportRate = 25;
british_map7.enemyMood = "balanced";
var british_map8 = new Object();
british_map8.name = "british_map8";
british_map8.mission = 8;
british_map8.battleTitle = "EXPLODING GROUND";
british_map8.description = "There is a mess of trenches and mines between us and the German line.";
british_map8.mapSection = "section8";
british_map8.sectionNumber = 8;
british_map8.bonusXP = 50;
british_map8.friendlyMorale = 70;
british_map8.enemyMorale = 110;
british_map8.file = "map_british_8";
british_map8.trenchPos = new Array("410", "800", "1150", "1505");
british_map8.wire = 4;
british_map8.wire1Pos = 500;
british_map8.wire2Pos = 950;
british_map8.wire3Pos = 1250;
british_map8.wire4Pos = 1400;
british_map8.britishMines = new Array();
british_map8.germanMines = new Array(1250, 1200);
british_map8.britishMinesMax = 0;
british_map8.germanMinesMax = 10;
british_map8.unlocks = new Array("antiTank");
british_map8.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar", "artillery", "sniper", "officer", "gas", "tank", "antiTank");
british_map8.enemyRate = 12;
british_map8.enemyUnits = new Array("tank", "assault", "assault", "riflemen", "riflemen", "assault");
british_map8.enemySupport = new Array("mortar", "artillery", "gas");
british_map8.enemySupportRate = 20;
british_map8.enemyMood = "aggressive";
var british_map9 = new Object();
british_map9.name = "british_map9";
british_map9.mission = 9;
british_map9.battleTitle = "THE LAST STAND";
british_map9.description = "Take this ground and we have won this once and for all.";
british_map9.mapSection = "section9";
british_map9.sectionNumber = 9;
british_map9.bonusXP = 50;
british_map9.friendlyMorale = 70;
british_map9.enemyMorale = 160;
british_map9.file = "map_british_9";
british_map9.trenchPos = new Array("1130", "1376");
british_map9.wire = 4;
british_map9.wire1Pos = 400;
british_map9.wire2Pos = 550;
british_map9.wire3Pos = 750;
british_map9.wire4Pos = 900;
british_map9.britishMines = new Array();
british_map9.germanMines = new Array(500, 800, 1000);
british_map9.britishMinesMax = 0;
british_map9.germanMinesMax = 20;
british_map9.unlocks = new Array();
british_map9.availableUnits = new Array("riflemen", "assault", "machineGun", "mortar", "artillery", "sniper", "officer", "gas", "tank", "antiTank");
british_map9.enemyRate = 10;
british_map9.enemyUnits = new Array("assault", "riflemen", "assault", "tank", "sniper", "assault", "machineGun", "officer", "tank");
british_map9.enemySupport = new Array("antiTank", "mortar", "artillery", "gas", "antiTank");
british_map9.enemySupportRate = 25;
british_map9.enemyMood = "aggressive";
var german_map1 = new Object();
german_map1.name = "german_map1";
german_map1.mission = 1;
german_map1.battleTitle = "FORWARD!";
german_map1.description = "Make your way across this open field and take that trench.";
german_map1.rainOn = true;
german_map1.mapSection = "section10";
german_map1.sectionNumber = 10;
german_map1.friendlyMorale = 150;
german_map1.enemyMorale = 60;
german_map1.file = "map_german_1";
german_map1.trenchPos = new Array("300");
german_map1.wire = 1;
german_map1.wire1Pos = 500;
german_map1.britishMines = new Array(450, 455);
german_map1.germanMines = new Array(1100, 1150);
german_map1.britishMinesMax = 4;
german_map1.germanMinesMax = 5;
german_map1.unlocks = new Array("assault");
german_map1.availableUnits = new Array("riflemen", "assault");
german_map1.enemyRate = 20;
german_map1.enemyUnits = new Array("riflemen", "riflemen", "riflemen", "assault");
german_map1.enemySupport = new Array();
german_map1.enemySupportRate = 10;
german_map1.enemyMood = "aggressive";
var german_map2 = new Object();
german_map2.name = "german_map2";
german_map2.mission = 2;
german_map2.battleTitle = "TOMMY'S LONG RUN";
german_map2.description = "Hold the line here, Tommy has a long way to come.";
german_map2.rainOn = true;
german_map2.mapSection = "section9";
german_map2.sectionNumber = 9;
german_map2.friendlyMorale = 90;
german_map2.enemyMorale = 110;
german_map2.file = "map_german_2";
german_map2.trenchPos = new Array("1050");
german_map2.wire = 1;
german_map2.wire1Pos = 850;
german_map2.britishMines = new Array();
german_map2.germanMines = new Array(700, 750);
german_map2.britishMinesMax = 1;
german_map2.germanMinesMax = 10;
german_map2.unlocks = new Array("machineGun");
german_map2.availableUnits = new Array("riflemen", "assault", "machineGun");
german_map2.enemyRate = 11;
german_map2.enemyUnits = new Array("riflemen", "assault", "riflemen", "assault", "machineGun");
german_map2.enemySupport = new Array("mortar", "mortar");
german_map2.enemySupportRate = 20;
german_map2.enemyMood = "aggressive";
var german_map3 = new Object();
german_map3.name = "german_map3";
german_map3.mission = 3;
german_map3.battleTitle = "HEAVY DEFENCE";
german_map3.description = "We have the advantage, stem the flow of attacks and force them to quit.";
german_map3.rainOn = false;
german_map3.mapSection = "section8";
german_map3.sectionNumber = 8;
german_map3.friendlyMorale = 100;
german_map3.enemyMorale = 100;
german_map3.file = "map_german_3";
german_map3.trenchPos = new Array("220", "1130", "1360");
german_map3.wire = 2;
german_map3.wire1Pos = 550;
german_map3.wire1Pos = 850;
german_map3.britishMines = new Array();
german_map3.germanMines = new Array(700, 750);
german_map3.britishMinesMax = 1;
german_map3.germanMinesMax = 5;
german_map3.unlocks = new Array("officer");
german_map3.availableUnits = new Array("riflemen", "assault", "machineGun", "officer");
german_map3.enemyRate = 10;
german_map3.enemyUnits = new Array("riflemen", "assault", "officer", "riflemen", "assault", "machineGun");
german_map3.enemySupport = new Array("mortar", "artillery");
german_map3.enemySupportRate = 22;
german_map3.enemyMood = "aggressive";
var german_map4 = new Object();
german_map4.name = "german_map4";
german_map4.mission = 4;
german_map4.battleTitle = "CLOSE LINES";
german_map4.description = "The lines here are tight. Be careful not to hit our own with mortars.";
german_map4.rainOn = false;
german_map4.mapSection = "section7";
german_map4.sectionNumber = 7;
german_map4.friendlyMorale = 90;
german_map4.enemyMorale = 100;
german_map4.file = "map_german_4";
german_map4.trenchPos = new Array("625", "950");
german_map4.wire = 2;
german_map4.wire1Pos = 550;
german_map4.wire1Pos = 850;
german_map4.britishMines = new Array(300, 350);
german_map4.germanMines = new Array(700, 750);
german_map4.britishMinesMax = 5;
german_map4.germanMinesMax = 5;
german_map4.unlocks = new Array("mortar");
german_map4.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar");
german_map4.enemyRate = 14;
german_map4.enemyUnits = new Array("riflemen", "assault", "officer", "riflemen", "sniper", "assault", "machineGun");
german_map4.enemySupport = new Array("mortar", "artillery");
german_map4.enemySupportRate = 22;
german_map4.enemyMood = "aggressive";
var german_map5 = new Object();
german_map5.name = "german_map5";
german_map5.mission = 5;
german_map5.battleTitle = "IMPENETRABLE";
german_map5.description = "Our two lines must not be broken!";
german_map5.rainOn = false;
german_map5.mapSection = "section6";
german_map5.sectionNumber = 6;
german_map5.friendlyMorale = 80;
german_map5.enemyMorale = 100;
german_map5.file = "map_german_5";
german_map5.trenchPos = new Array("350", "1345", "1642");
german_map5.wire = 2;
german_map5.wire1Pos = 500;
german_map5.wire2Pos = 850;
german_map5.britishMines = new Array(400, 450);
german_map5.germanMines = new Array(500, 750);
german_map5.britishMinesMax = 10;
german_map5.germanMinesMax = 5;
german_map5.unlocks = new Array("artillery");
german_map5.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar", "artillery");
german_map5.enemyRate = 13;
german_map5.enemyUnits = new Array("riflemen", "assault", "riflemen", "sniper", "assault", "officer", "machineGun");
german_map5.enemySupport = new Array("mortar", "artillery", "gas");
german_map5.enemySupportRate = 22;
german_map5.enemyMood = "aggressive";
var german_map6 = new Object();
german_map6.name = "german_map6";
german_map6.mission = 6;
german_map6.battleTitle = "GAINING GROUND";
german_map6.description = "Our command has demanded that we take more ground.";
german_map6.rainOn = false;
german_map6.mapSection = "section5";
german_map6.sectionNumber = 5;
german_map6.friendlyMorale = 80;
german_map6.enemyMorale = 100;
german_map6.file = "map_german_6";
german_map6.trenchPos = new Array("220", "460", "1332");
german_map6.wire = 2;
german_map6.wire1Pos = 520;
german_map6.wire2Pos = 850;
german_map6.britishMines = new Array(650, 850, 950);
german_map6.germanMines = new Array(1500, 1550);
german_map6.britishMinesMax = 10;
german_map6.germanMinesMax = 5;
german_map6.unlocks = new Array("sniper");
german_map6.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar", "artillery", "sniper");
german_map6.enemyRate = 10;
german_map6.enemyUnits = new Array("riflemen", "assault", "riflemen", "sniper", "assault", "officer", "machineGun");
german_map6.enemySupport = new Array("mortar", "artillery");
german_map6.enemySupportRate = 25;
german_map6.enemyMood = "aggressive";
var german_map7 = new Object();
german_map7.name = "german_map7";
german_map7.mission = 7;
german_map7.battleTitle = "METAL GIANTS";
german_map7.description = "The ground shakes. Distant rumbling.";
german_map7.rainOn = false;
german_map7.mapSection = "section4";
german_map7.sectionNumber = 4;
german_map7.friendlyMorale = 80;
german_map7.enemyMorale = 100;
german_map7.file = "map_german_7";
german_map7.trenchPos = new Array("1650");
german_map7.wire = 4;
german_map7.wire1Pos = 500;
german_map7.wire2Pos = 900;
german_map7.wire3Pos = 1300;
german_map7.britishMines = new Array(650, 850, 950);
german_map7.germanMines = new Array(750, 1150);
german_map7.britishMinesMax = 5;
german_map7.germanMinesMax = 10;
german_map7.unlocks = new Array("gas", "antiTank");
german_map7.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar", "artillery", "sniper", "gas", "antiTank");
german_map7.enemyRate = 13;
german_map7.enemyUnits = new Array("assault", "tank", "riflemen", "officer", "machineGun", "assault", "assault", "riflemen");
german_map7.enemySupport = new Array("mortar", "artillery");
german_map7.enemySupportRate = 22;
german_map7.enemyMood = "aggressive";
var german_map8 = new Object();
german_map8.name = "german_map8";
german_map8.mission = 8;
german_map8.battleTitle = "CLASH OF TITANS";
german_map8.description = "We have a response to the British Land Ships now.";
german_map8.rainOn = true;
german_map8.mapSection = "section3";
german_map8.sectionNumber = 3;
german_map8.friendlyMorale = 80;
german_map8.enemyMorale = 150;
german_map8.file = "map_german_8";
german_map8.trenchPos = new Array();
german_map8.wire = 4;
german_map8.wire1Pos = 500;
german_map8.wire2Pos = 900;
german_map8.wire3Pos = 1300;
german_map8.wire4Pos = 1700;
german_map8.britishMines = new Array(450, 850, 1500);
german_map8.germanMines = new Array(750, 1150, 1400);
german_map8.britishMinesMax = 15;
german_map8.germanMinesMax = 15;
german_map8.unlocks = new Array("tank");
german_map8.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar", "artillery", "sniper", "tank", "antiTank", "gas");
german_map8.enemyRate = 8;
german_map8.enemyUnits = new Array("tank", "assault", "tank", "assault", "assault", "machineGun");
german_map8.enemySupport = new Array("mortar", "artillery", "gas", "antiTank");
german_map8.enemySupportRate = 22;
german_map8.enemyMood = "aggressive";
var german_map9 = new Object();
german_map9.name = "german_map9";
german_map9.mission = 9;
german_map9.battleTitle = "THE LAST LINE";
german_map9.description = "Hold off the Tommies here and we will have won.";
german_map9.rainOn = false;
german_map9.mapSection = "section2";
german_map9.sectionNumber = 2;
german_map9.friendlyMorale = 80;
german_map9.enemyMorale = 160;
german_map9.file = "map_german_9";
german_map9.trenchPos = new Array("1300");
german_map9.wire = 4;
german_map9.wire1Pos = 500;
german_map9.wire2Pos = 900;
german_map9.wire3Pos = 1000;
german_map9.britishMines = new Array();
german_map9.germanMines = new Array(750, 1150);
german_map9.britishMinesMax = 0;
german_map9.germanMinesMax = 10;
german_map9.unlocks = new Array();
german_map9.availableUnits = new Array("riflemen", "assault", "machineGun", "officer", "mortar", "artillery", "sniper", "tank", "gas", "antiTank");
german_map9.enemyRate = 8;
german_map9.enemyUnits = new Array("tank", "assault", "assault", "assault", "assault");
german_map9.enemySupport = new Array("artillery", "antiTank", "mortar", "antiTank", "gas");
german_map9.enemySupportRate = 22;
german_map9.enemyMood = "aggressive";
var wireCount = 0;
var british_slot1_upgrade = new Object();
var british_slot2_upgrade = new Object();
var british_slot3_upgrade = new Object();
var british_slot4_upgrade = new Object();
var british_slot5_upgrade = new Object();
var british_slot6_upgrade = new Object();
var british_slot7_upgrade = new Object();
var british_slot8_upgrade = new Object();
var british_slot9_upgrade = new Object();
var british_slot10_upgrade = new Object();
var british_slot11_upgrade = new Object();
var british_slot12_upgrade = new Object();
var british_slot13_upgrade = new Object();
var british_slot14_upgrade = new Object();
var british_slot15_upgrade = new Object();
var british_slot16_upgrade = new Object();
var british_slot17_upgrade = new Object();
var british_slot18_upgrade = new Object();
var british_slot19_upgrade = new Object();
var british_slot20_upgrade = new Object();
var british_slot21_upgrade = new Object();
var british_slot22_upgrade = new Object();
var german_slot1_upgrade = new Object();
var german_slot2_upgrade = new Object();
var german_slot3_upgrade = new Object();
var german_slot4_upgrade = new Object();
var german_slot5_upgrade = new Object();
var german_slot6_upgrade = new Object();
var german_slot7_upgrade = new Object();
var german_slot8_upgrade = new Object();
var german_slot9_upgrade = new Object();
var german_slot10_upgrade = new Object();
var german_slot11_upgrade = new Object();
var german_slot12_upgrade = new Object();
var german_slot13_upgrade = new Object();
var german_slot14_upgrade = new Object();
var german_slot15_upgrade = new Object();
var german_slot16_upgrade = new Object();
var german_slot17_upgrade = new Object();
var german_slot18_upgrade = new Object();
var german_slot19_upgrade = new Object();
var german_slot20_upgrade = new Object();
var german_slot21_upgrade = new Object();
var german_slot22_upgrade = new Object();
var numUpgradeButtons = 24;
var currentUpgradeSlot;
var upgradeButtons = new Array();
var currentUpgradeObj = new Object();
var upgradePoints = 0;
var overTrenchButtons;
var overTrenchButtonBacking;
var allInTrench;
var trenchButtonVisible = false;
var trenchInterfaceVisible = false;
var tcc = 0;
var playerMorale = 0;
var playerMoraleMax = 0;
var lastmoraleBarBritishScale = 0;
var compMorale = 0;
var compMoraleMax = 0;
var lastmoraleBarGermanScale = 0;
var moraleBarBritishScale = 2;
var moraleBarGermanScale = 2;
var currentGroundMoraleIndex = 0;
var moraleRegen_german = 0;
var moraleRegen_british = 0;
var currentGroundMade = 0;
var moraleCost = new Object();
moraleCost.soldier = 2;
moraleCost.officer = 5;
moraleCost.tank = 40;
moraleCost.tankKilled = 20;
moraleCost.friendlyFire = 10;
moraleCost.officerBonus = 10;
moraleCost.tankBonus = 10;
var groundMoraleIndexBritish = 0;
var groundMoraleIndexGerman = 0;
var groundMorale = new Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 95);
var grenNumber = 0;
var grenadeAngle;
var grenAdj;
var grenOpp;
var grenadeCollisions = 0;
var sounds_advance = 6;
var sounds_attack = 3;
var sounds_sniper = 3;
var sounds_incoming = 4;
var sounds_MG = 3;
var sounds_tank = 2;
var unlockQueue = new Array();
var unlocksInQueue = false;
var udc = 0;
var experiencePoints = 0;
var experienceLevel = 0;
var experienceGained = 0;
var xpCount = 0;
var experienceIntervals = new Array(15, 45, 90, 150, 225, 315, 420, 540, 675, 825, 990, 1170, 1390, 1615, 1855, 2110, 2880, 3165, 3465);
var playingSkirmish = false;
var skirmishMap = new Object();
setupSkirmishMapDefaults();
var randomiseUnits = 3;
var randomMineSpot1 = 0;
var randomMineSpot2 = 0;
var randomMineSpot3 = 0;
var randomMineSpot4 = 0;
var randomMineSpot5 = 0;
var randomMineSpot6 = 0;
var randomMineSpot7 = 0;
var randomMineSpot8 = 0;
var helpEnabled = true;
var helpArray = new Array("progressBar", "morale", "upgrades", "support");
var helpArrayIndex = 0;
var helpCountdownMax = 4;
var helpCountdown = helpCountdownMax;
var career_soldiersKilled = 0;
var career_soldiersLost = 0;
var career_trenchesTaken = 0;
var career_supportUsed = 0;
var career_wins = 0;
var career_losses = 0;
var career_moraleGained = 0;
var career_moraleLost = 0;
var career_experienceGained = 0;
var career_bonusExpGained = 0;
var career_riflemenDeployed = 0;
var career_assaultDeployed = 0;
var career_machineGunDeployed = 0;
var career_sniperDeployed = 0;
var career_officerDeployed = 0;
var career_tankDeployed = 0;
var career_conquerWins = 0;
var career_conquerLosses = 0;
var career_moraleWins = 0;
var career_moraleLosses = 0;
_root.kongregateServices.connect();
game = new Object();
game.state = "paused";
if (intoMenu == true) {
setupSound();
loadGameSettings();
loadGameInfo();
loadMenu();
}
_root.onEnterFrame = function () {
if (game.state == "unpaused") {
slowEnterFrame();
mediumEnterFrame();
cameraControl();
gasCloudCollisions("german");
gasCloudCollisions("british");
squadAI("german");
squadAI("british");
}
if (game.state == "endBattle") {
cameraControl();
squadAI("german");
squadAI("british");
}
};
Stage.showMenu = false;
adBox._visible = false;
mainAd._visible = false;
removeAd();
Symbol 40 MovieClip Frame 1
stop();
Instance of Symbol 38 MovieClip in Symbol 40 MovieClip Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, "easeOutSine");
};
this.onRollOut = function () {
this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, "easeOutSine");
};
this.onRelease = function () {
getURL ("http://armorgames.com/play/2267/warfare-1917", "_blank");
};
}
Symbol 44 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 54 MovieClip in Symbol 55 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
getURL ("http://armorgames.com/", "_blank");
};
}
Symbol 89 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 225
_root.gotoAndPlay("conArtistsLogo");
Symbol 127 MovieClip Frame 333
_root.gotoAndPlay("main");
Symbol 222 MovieClip Frame 1
stop();
Symbol 230 MovieClip [particle_dustShaft] Frame 10
stop();
Symbol 305 MovieClip [particle_fireball] Frame 13
stop();
Symbol 309 MovieClip [particle_cloudDust] Frame 9
stop();
Symbol 310 MovieClip [particle_fireball_mortar] Frame 10
stop();
Symbol 311 MovieClip [particle_dustShaft_mortar] Frame 11
stop();
Symbol 314 MovieClip [particle_dirt2_mortar] Frame 6
stop();
Symbol 315 MovieClip [particle_cloudDust_mortar] Frame 9
stop();
Symbol 319 MovieClip [particle_sparks] Frame 9
stop();
Symbol 323 MovieClip [particle_cloudDust_white] Frame 15
stop();
Symbol 326 MovieClip [particle_cloudDust_bullet] Frame 9
stop();
Symbol 327 MovieClip [particle_dustShaft_bullet] Frame 2
stop();
Symbol 334 MovieClip [artilleryStrike] Frame 1
stop();
Instance of Symbol 330 MovieClip in Symbol 334 MovieClip [artilleryStrike] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 334 MovieClip [artilleryStrike] Frame 2
_root.playSound("sound_artillery_fire");
Symbol 334 MovieClip [artilleryStrike] Frame 47
_root.playIncomingSound("artillery");
Symbol 334 MovieClip [artilleryStrike] Frame 152
this.attachMovie("artilleryStrikeCollision", "collision", 500);
this.collision._visible = false;
_root.artilleryExplosion(this._x, this._y);
_root.artilleryScorchDecal(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "artillery");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "artillery");
Symbol 334 MovieClip [artilleryStrike] Frame 156
stop();
removeMovieClip(this);
Instance of Symbol 304 MovieClip in Symbol 338 MovieClip [particle_fireball_tank] Frame 1
onClipEvent (load) {
this._rotation = random(360);
this._xscale = (this._yscale = random(60) + 40);
}
Symbol 338 MovieClip [particle_fireball_tank] Frame 50
stop();
removeMovieClip(this);
Symbol 339 MovieClip [gasStrikeAnim] Frame 1
_root.playSound("sound_mortar_fire");
Instance of Symbol 330 MovieClip in Symbol 339 MovieClip [gasStrikeAnim] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 339 MovieClip [gasStrikeAnim] Frame 152
_root.gasCollisions++;
this.attachMovie("gasStrikeCollision", "collision" + _root.gasCollisions, 500 + _root.gasCollisions);
this["collision" + _root.gasCollisions]._visible = false;
this.xTarget = this._x;
this.yTarget = this._y;
_root.activeGas.push(this);
_root.gasExplosion(this._x, this._y, this, this["collision" + _root.gasCollisions], this.ownerTeam);
Symbol 339 MovieClip [gasStrikeAnim] Frame 154
stop();
Symbol 339 MovieClip [gasStrikeAnim] Frame 156
removeMovieClip(this);
Symbol 343 MovieClip [gasCloud] Frame 11
stop();
Symbol 344 MovieClip [particle_dustShaft_grenade] Frame 11
stop();
Symbol 345 MovieClip [particle_cloudDust_grenade] Frame 9
stop();
Symbol 346 MovieClip [particle_fireball_grenade] Frame 10
stop();
Symbol 347 MovieClip [particle_dirt2_grenade] Frame 6
stop();
Symbol 348 MovieClip [antiTankStrike] Frame 1
stop();
Instance of Symbol 330 MovieClip in Symbol 348 MovieClip [antiTankStrike] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 348 MovieClip [antiTankStrike] Frame 2
_root.playSound("sound_artillery_fire");
Symbol 348 MovieClip [antiTankStrike] Frame 82
this.attachMovie("antiTankStrikeCollision", "collision", 500);
this.collision._visible = false;
_root.mortarExplosion(this._x, this._y);
_root.artilleryScorchDecal(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "antiTank");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "antiTank");
Symbol 348 MovieClip [antiTankStrike] Frame 86
stop();
removeMovieClip(this);
Symbol 350 MovieClip [mineStrike] Frame 1
_root.playSound("sound_mine_click");
Instance of Symbol 330 MovieClip in Symbol 350 MovieClip [mineStrike] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 350 MovieClip [mineStrike] Frame 16
this.attachMovie("mortarStrikeCollision", "collision", 500);
this.collision._visible = false;
_root.mineExplosion(this._x, this._y);
_root.mortarScorchDecal(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "mine");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "mine");
Symbol 350 MovieClip [mineStrike] Frame 20
stop();
removeMovieClip(this);
Symbol 351 MovieClip [mortarStrike] Frame 1
stop();
Instance of Symbol 330 MovieClip in Symbol 351 MovieClip [mortarStrike] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 351 MovieClip [mortarStrike] Frame 2
_root.playSound("sound_mortar_fire");
Symbol 351 MovieClip [mortarStrike] Frame 50
_root.playIncomingSound("mortar");
Symbol 351 MovieClip [mortarStrike] Frame 101
this.attachMovie("mortarStrikeCollision", "collision", 600);
this.collision._visible = false;
_root.mortarExplosion(this._x, this._y);
_root.mortarScorchDecal(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "mortar");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "mortar");
Symbol 351 MovieClip [mortarStrike] Frame 105
stop();
removeMovieClip(this);
Instance of Symbol 330 MovieClip in Symbol 352 MovieClip [tankRound] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 352 MovieClip [tankRound] Frame 6
this.attachMovie("tankStrikeCollision", "collision", 600);
this.collision._visible = false;
_root.mortarExplosion(this._x, this._y);
_root.mortarScorchDecal(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "tankShell");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "tankShell");
Symbol 352 MovieClip [tankRound] Frame 10
stop();
removeMovieClip(this);
Symbol 364 MovieClip Frame 1
stop();
Symbol 374 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 420 MovieClip Frame 1
stop();
Instance of Symbol 416 MovieClip in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(random(10) + 1);
}
Instance of Symbol 418 MovieClip "bloodSplat" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 432 MovieClip Frame 1
stop();
Instance of Symbol 418 MovieClip "bloodSplat" in Symbol 432 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 444 MovieClip Frame 1
stop();
Symbol 450 MovieClip Frame 1
stop();
Instance of Symbol 447 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 454 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 4
stop();
Symbol 538 MovieClip Frame 1
stop();
Instance of Symbol 447 MovieClip in Symbol 538 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 537 MovieClip in Symbol 538 MovieClip Frame 2
onClipEvent (load) {
this._visible = false;
if (random(2) == 0) {
this._visible = true;
this._xscale = random(90) + 130;
this._rotation = this._rotation + (random(4) - 2);
}
}
Symbol 568 MovieClip Frame 4
stop();
Symbol 569 MovieClip Frame 1
stop();
Instance of Symbol 447 MovieClip in Symbol 569 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 568 MovieClip in Symbol 569 MovieClip Frame 2
onClipEvent (load) {
this._visible = false;
if (random(2) == 0) {
this._visible = true;
this._xscale = random(90) + 130;
this._rotation = this._rotation + (random(4) - 2);
}
}
Symbol 614 MovieClip Frame 32
stop();
Instance of Symbol 457 MovieClip "selectedRing" in Symbol 647 MovieClip [soldier] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 48 MovieClip "collision" in Symbol 647 MovieClip [soldier] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 48 MovieClip "backing" in Symbol 647 MovieClip [soldier] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 462 MovieClip "healthBar" in Symbol 647 MovieClip [soldier] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 19
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 38
if ((((this.alive == true) && (this.changingToFire == false)) && (this.enteringTrench == false)) && (_root.game.state != "endBattle")) {
gotoAndPlay ("rifle_run");
} else {
stop();
this.moveAnim = false;
}
Symbol 647 MovieClip [soldier] Frame 40
play();
this.animating = true;
Symbol 647 MovieClip [soldier] Frame 61
gotoAndPlay ("victoryStandingLoop");
Symbol 647 MovieClip [soldier] Frame 63
play();
this.animating = true;
Symbol 647 MovieClip [soldier] Frame 81
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 85
play();
this.animating = true;
this.changingPosition = true;
this.inPosition = false;
Symbol 647 MovieClip [soldier] Frame 116
head.gasMask._visible = true;
Symbol 647 MovieClip [soldier] Frame 128
this.animating = false;
this.gasMaskOn = true;
this.changingPosition = false;
stop();
Symbol 647 MovieClip [soldier] Frame 132
play();
this.animating = true;
this.changingPosition = true;
this.inPosition = false;
Symbol 647 MovieClip [soldier] Frame 137
head.gasMask._visible = false;
Symbol 647 MovieClip [soldier] Frame 168
this.animating = false;
this.gasMaskOff = true;
this.changingPosition = false;
stop();
Symbol 647 MovieClip [soldier] Frame 175
this.animating = true;
this.changingToEntrench = true;
this.inFiringPosition = false;
selectedRing.stopTween();
selectedRing._alpha = 0;
healthBar.stopTween();
healthBar._alpha = 0;
Symbol 647 MovieClip [soldier] Frame 195
this.inTrench = true;
this.changingToEntrench = false;
this.enteringTrench = false;
this.position = "trench";
Symbol 647 MovieClip [soldier] Frame 217
this.animating = false;
this.inFiringPosition = true;
stop();
Symbol 647 MovieClip [soldier] Frame 219
this.animating = true;
this.changingToEntrench = true;
this.inFiringPosition = false;
selectedRing.stopTween();
selectedRing._alpha = 0;
healthBar.stopTween();
healthBar._alpha = 0;
Symbol 647 MovieClip [soldier] Frame 239
this.inTrench = true;
this.changingToEntrench = false;
this.enteringTrench = false;
this.position = "trench";
Symbol 647 MovieClip [soldier] Frame 261
this.animating = false;
this.inFiringPosition = true;
stop();
Symbol 647 MovieClip [soldier] Frame 265
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
play();
Symbol 647 MovieClip [soldier] Frame 317
this.animating = false;
this.firing = false;
stop();
Symbol 647 MovieClip [soldier] Frame 319
this.animating = true;
selectedRing.stopTween();
selectedRing._alpha = 0;
healthBar.stopTween();
healthBar._alpha = 0;
this.changingToMove = true;
Instance of Symbol 457 MovieClip "selectedRing" in Symbol 647 MovieClip [soldier] Frame 319
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 340
this.animating = false;
this.exitedTrench = true;
this.inTrench = false;
this.position = "standing";
this.changingToMove = false;
stop();
Symbol 647 MovieClip [soldier] Frame 353
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
play();
Symbol 647 MovieClip [soldier] Frame 450
this.animating = false;
this.firing = false;
stop();
Symbol 647 MovieClip [soldier] Frame 451
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 544
this.firing = false;
stop();
Symbol 647 MovieClip [soldier] Frame 545
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 548
this.animating = false;
this.firing = false;
stop();
Symbol 647 MovieClip [soldier] Frame 566
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 596
gotoAndPlay ("victoryLoopTrench");
Symbol 647 MovieClip [soldier] Frame 600
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 617
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 620
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 747
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 750
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 767
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 769
this.animating = true;
this.moveAnim = false;
this.inMovingPosition = false;
this.changingToFire = true;
Instance of Symbol 48 MovieClip "collision" in Symbol 647 MovieClip [soldier] Frame 769
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 784
this.animating = false;
this.position = "prone";
this.inFiringPosition = true;
this.changingToFire = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 787
this.animating = true;
this.changingToMove = true;
play();
Symbol 647 MovieClip [soldier] Frame 816
stop();
this.animating = false;
this.position = "standing";
this.inMovingPosition = true;
this.changingToMove = false;
Symbol 647 MovieClip [soldier] Frame 821
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 888
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 894
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 897
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 914
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 984
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 985
this.animating = true;
Instance of Symbol 48 MovieClip "rangeFinder" in Symbol 647 MovieClip [soldier] Frame 985
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 1001
stop();
this.animating = false;
Symbol 647 MovieClip [soldier] Frame 1003
this.animating = true;
this.moveAnim = false;
this.inMovingPosition = false;
this.changingToFire = true;
Symbol 647 MovieClip [soldier] Frame 1011
stop();
this.animating = false;
this.position = "crouch";
this.inFiringPosition = true;
this.changingToFire = false;
Symbol 647 MovieClip [soldier] Frame 1022
this.animating = true;
this.changingToMove = true;
play();
Symbol 647 MovieClip [soldier] Frame 1030
this.position = "standing";
this.animating = false;
this.inMovingPosition = true;
this.changingToMove = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1038
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1119
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1120
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1123
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1140
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1215
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1216
this.animating = true;
play();
Instance of Symbol 48 MovieClip "rangeFinder" in Symbol 647 MovieClip [soldier] Frame 1216
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 614 MovieClip in Symbol 647 MovieClip [soldier] Frame 1216
onClipEvent (load) {
this._y = this._y + (random(10) - 5);
}
Symbol 647 MovieClip [soldier] Frame 1248
stop();
this.animating = false;
Symbol 647 MovieClip [soldier] Frame 1249
this.animating = true;
this.moveAnim = false;
this.inMovingPosition = false;
this.changingToFire = true;
Symbol 647 MovieClip [soldier] Frame 1254
this.position = "standing";
this.animating = false;
this.inFiringPosition = true;
this.changingToFire = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1268
stop();
Symbol 647 MovieClip [soldier] Frame 1278
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1346
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1350
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1382
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1386
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1389
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1409
this.animating = true;
this.firing = true;
this.moveAnim = false;
weapon.muzzleFlash.play();
tracer.play();
Symbol 647 MovieClip [soldier] Frame 1476
this.firing = false;
this.animating = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1477
this.animating = true;
this.changingToMove = true;
play();
Symbol 647 MovieClip [soldier] Frame 1482
this.position = "standing";
this.animating = false;
this.inMovingPosition = true;
this.changingToMove = false;
stop();
Symbol 647 MovieClip [soldier] Frame 1494
this.animating = true;
this.throwingGrenade = true;
this.firing = true;
play();
Symbol 647 MovieClip [soldier] Frame 1514
_root.throwGrenade(this.squadObjRef.enemyTarget.members[0], this, this.team);
Symbol 647 MovieClip [soldier] Frame 1535
this.throwingGrenade = false;
this.animating = false;
this.firing = false;
gotoAndPlay ("rifle_fire_standing");
Symbol 647 MovieClip [soldier] Frame 1541
this.animating = true;
play();
Instance of Symbol 444 MovieClip "helmet" in Symbol 647 MovieClip [soldier] Frame 1541
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 454 MovieClip "weapon" in Symbol 647 MovieClip [soldier] Frame 1541
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 48 MovieClip "rangeFinder" in Symbol 647 MovieClip [soldier] Frame 1541
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 1586
stop();
this.animating = false;
this.cacheAsBitmap = true;
Symbol 647 MovieClip [soldier] Frame 1588
this.animating = true;
play();
Symbol 647 MovieClip [soldier] Frame 1748
stop();
this.cacheAsBitmap = true;
Symbol 647 MovieClip [soldier] Frame 1754
this.animating = true;
play();
Instance of Symbol 614 MovieClip in Symbol 647 MovieClip [soldier] Frame 1754
onClipEvent (load) {
this._y = this._y + (random(20) - 10);
}
Symbol 647 MovieClip [soldier] Frame 1779
stop();
this.animating = false;
this.cacheAsBitmap = true;
Symbol 647 MovieClip [soldier] Frame 1782
this.animating = true;
play();
Instance of Symbol 444 MovieClip "helmet" in Symbol 647 MovieClip [soldier] Frame 1782
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 454 MovieClip "weapon" in Symbol 647 MovieClip [soldier] Frame 1782
onClipEvent (load) {
this._visible = false;
}
Symbol 647 MovieClip [soldier] Frame 1793
stop();
this.animating = false;
this.cacheAsBitmap = true;
Symbol 659 MovieClip Frame 1
_root.playSound("sound_tankExplosion");
_root.playSound("sound_tankExplosion_indivExplosion");
Symbol 659 MovieClip Frame 10
_root.playSound("sound_tankExplosion_indivExplosion");
Symbol 659 MovieClip Frame 26
_root.playSound("sound_tankExplosion_indivExplosion");
Symbol 659 MovieClip Frame 53
_root.playSound("sound_tankExplosion_indivExplosion");
Symbol 659 MovieClip Frame 78
_root.playSound("sound_tankExplosion_indivExplosion");
Symbol 659 MovieClip Frame 93
stop();
Symbol 660 MovieClip Frame 1
stop();
Symbol 668 MovieClip Frame 1
stop();
Symbol 668 MovieClip Frame 7
_parent.firingSecondary = true;
Symbol 668 MovieClip Frame 10
_parent.firingSecondary = false;
Symbol 670 MovieClip Frame 41
stop();
Symbol 671 MovieClip Frame 1
stop();
Symbol 671 MovieClip Frame 7
_parent.firing = true;
Symbol 671 MovieClip Frame 103
_parent.firing = false;
Symbol 678 MovieClip Frame 1
stop();
Instance of Symbol 330 MovieClip in Symbol 678 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 831 MovieClip Frame 1
stop();
Instance of Symbol 831 MovieClip "fireAnim3" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
this._x = this._x + (random(60) - 20);
this._xscale = random(60) + 70;
this._yscale = random(60) + 70;
}
Instance of Symbol 831 MovieClip "fireAnim1" in Symbol 832 MovieClip Frame 1
onClipEvent (load) {
this._x = this._x + (random(60) - 20);
this._xscale = random(60) + 70;
this._yscale = random(60) + 70;
}
Symbol 837 MovieClip Frame 1
stop();
Instance of Symbol 831 MovieClip "fireAnim3" in Symbol 840 MovieClip Frame 1
onClipEvent (load) {
this._x = this._x + (random(60) - 20);
this._xscale = random(60) + 70;
this._yscale = random(60) + 70;
}
Instance of Symbol 831 MovieClip "fireAnim2" in Symbol 840 MovieClip Frame 1
onClipEvent (load) {
this._x = this._x + (random(60) - 20);
this._xscale = random(60) + 70;
this._yscale = random(60) + 70;
}
Symbol 841 MovieClip [tank] Frame 1
stop();
this.animating = false;
Instance of Symbol 48 MovieClip "collision" in Symbol 841 MovieClip [tank] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 462 MovieClip "healthBar" in Symbol 841 MovieClip [tank] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 832 MovieClip "damageClip" in Symbol 841 MovieClip [tank] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 841 MovieClip [tank] Frame 18
this.animating = false;
Instance of Symbol 840 MovieClip "damageClip" in Symbol 841 MovieClip [tank] Frame 18
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 853 MovieClip "continueCampaign" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "newCampaign" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "options" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "playMoreGames" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "howToPlay" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "skirmish" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "credits" in Symbol 857 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mainMenu(this._name);
}
Instance of Symbol 853 MovieClip "low" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "medium" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "high" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "effectsOff" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "effectsOn" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "musicOff" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 853 MovieClip "musicOn" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_options(this._name);
}
Instance of Symbol 866 MovieClip "backButton" in Symbol 867 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_optionsBack(this._name);
}
Symbol 884 MovieClip Frame 1
stop();
Symbol 891 MovieClip Frame 1
stop();
Instance of Symbol 876 MovieClip "british" in Symbol 900 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_campaignSelect(this._name);
}
Instance of Symbol 884 MovieClip "german" in Symbol 900 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_campaignSelect(this._name);
}
Instance of Symbol 966 MovieClip "launch" in Symbol 980 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mapScreen(this._name);
}
Instance of Symbol 970 MovieClip "upgrades" in Symbol 980 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mapScreen(this._name);
}
Instance of Symbol 979 MovieClip "backToMainButt" in Symbol 980 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_mapScreen(this._name);
}
Symbol 995 Button
on (release) {
getURL ("mailto:con@armorgames.com");
}
Instance of Symbol 866 MovieClip "backButton" in Symbol 996 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "CLOSE";
this.onRollOver = function () {
_root.playRollOverSound();
};
this.onRelease = function () {
_root.playClickSound();
_root.hideCredits();
};
}
Instance of Symbol 866 MovieClip "backButton" in Symbol 1011 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "CLOSE";
this.onRollOver = function () {
_root.playRollOverSound();
};
this.onRelease = function () {
_root.playClickSound();
_root.hideInstructions();
};
}
Instance of Symbol 979 MovieClip "backToMainButt" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 966 MovieClip "launch" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "british" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "german" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "easy" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "medium" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "hard" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "riflemen" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "assault" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "machineGun" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "sniper" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "officer" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "tank" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "mortar" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "artillery" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "gas" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "antiTank" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "AI_aggressive" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "AI_defensive" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "AI_balanced" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "map_short" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "map_medium" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "map_long" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "mines_few" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "mines_medium" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Instance of Symbol 1019 MovieClip "mines_many" in Symbol 1055 MovieClip Frame 1
onClipEvent (load) {
_root.buttonSetup_skirmish(this._name);
}
Symbol 1056 MovieClip Frame 97
stop();
removeMovieClip(this);
Instance of Symbol 847 MovieClip "bg" in Symbol 1057 MovieClip [menu] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
this.onRelease = function () {
};
}
Instance of Symbol 867 MovieClip "options" in Symbol 1057 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 900 MovieClip "teamSelect" in Symbol 1057 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 996 MovieClip "credits" in Symbol 1057 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1011 MovieClip "instructions" in Symbol 1057 MovieClip [menu] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 48 MovieClip "blackOut" in Symbol 1062 MovieClip [dialogBox] Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.useHandCursor = false;
}
Symbol 1077 MovieClip Frame 1
stop();
Symbol 1081 MovieClip Frame 1
stop();
Symbol 1085 MovieClip Frame 1
stop();
Symbol 1089 MovieClip Frame 1
stop();
Symbol 1093 MovieClip Frame 1
stop();
Symbol 1097 MovieClip Frame 1
stop();
Symbol 1101 MovieClip Frame 1
stop();
Symbol 1105 MovieClip Frame 1
stop();
Symbol 1109 MovieClip Frame 1
stop();
Symbol 1119 MovieClip Frame 1
stop();
Symbol 1129 MovieClip Frame 1
stop();
Symbol 1133 MovieClip Frame 1
stop();
Symbol 1137 MovieClip Frame 1
stop();
Symbol 1141 MovieClip Frame 1
stop();
Symbol 1145 MovieClip Frame 1
stop();
Symbol 1149 MovieClip Frame 1
stop();
Symbol 1153 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 1
stop();
Symbol 1175 MovieClip Frame 1
stop();
Symbol 1179 MovieClip Frame 1
stop();
Symbol 1184 MovieClip Frame 1
stop();
Symbol 1188 MovieClip Frame 1
stop();
Symbol 1192 MovieClip Frame 1
stop();
Symbol 1196 MovieClip Frame 1
stop();
Symbol 1200 MovieClip Frame 1
stop();
Symbol 1201 MovieClip [upgrades] Frame 1
stop();
Instance of Symbol 48 MovieClip "backing" in Symbol 1201 MovieClip [upgrades] Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.useHandCursor = false;
}
Symbol 1220 MovieClip Frame 1
stop();
Symbol 1231 MovieClip Frame 1
stop();
Symbol 1232 MovieClip Frame 1
stop();
Instance of Symbol 48 MovieClip "blackOut" in Symbol 1237 MovieClip [unlockDialog] Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.useHandCursor = false;
}
Instance of Symbol 866 MovieClip "mainButton" in Symbol 1237 MovieClip [unlockDialog] Frame 1
onClipEvent (load) {
_root.unlockInterfaceButton(this._name);
}
Instance of Symbol 48 MovieClip "backing" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.useHandCursor = false;
}
Instance of Symbol 1242 MovieClip "close" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "CLOSE";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1244 MovieClip "low" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "LOW";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1244 MovieClip "medium" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "MED";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1244 MovieClip "high" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "HIGH";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1244 MovieClip "sound_on" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "ON";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1244 MovieClip "sound_off" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "OFF";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1247 MovieClip "quitToMenu" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "QUIT TO MAIN MENU";
_root.buttonSetup_inGameMenu(this._name);
}
Instance of Symbol 1247 MovieClip "quitBattle" in Symbol 1250 MovieClip [inGameMenu] Frame 1
onClipEvent (load) {
this.buttonText.text = "QUIT BATTLE";
_root.buttonSetup_inGameMenu(this._name);
}
Symbol 1254 MovieClip [gameCursor] Frame 1
stop();
Symbol 1259 MovieClip Frame 1
stop();
Instance of Symbol 1293 MovieClip in Symbol 1332 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "PLAY MORE GAMES";
this.onRelease = function () {
getURL ("http://armorgames.com", "_blank");
};
}
Instance of Symbol 1293 MovieClip in Symbol 1332 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "MAIN MENU";
this.onRelease = function () {
_root.saveGame();
_root.loadMenu();
_root.loadScreen.alphaTo(0, 1, "linear", 0, function () {
removeMovieClip(this);
});
};
}
Instance of Symbol 1293 MovieClip "viewStats" in Symbol 1343 MovieClip Frame 1
onClipEvent (load) {
this.buttonText.text = "CAMPAIGN STATS";
this.onRelease = function () {
_root.music_endBattleMusic.volumeTo(0, 5, "easeOutSine", 0, function () {
loopambience.stop();
loopambienceRain.stop();
this.stop();
});
_root.loadScreen.campaignStats._visible = true;
_root.loadScreen.ending.alphaTo(0, 2, "easeOutSine", 0, function () {
_root.loadScreen.ending._visible = false;
});
};
}
Instance of Symbol 1343 MovieClip in Symbol 1344 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
this.alphaTo(100, 0.5, "linear", 4);
}
Symbol 1344 MovieClip Frame 79
stop();
Symbol 1345 MovieClip [loadScreen] Frame 1
stop();
Instance of Symbol 1259 MovieClip "bg" in Symbol 1345 MovieClip [loadScreen] Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.useHandCursor = false;
};
}
Instance of Symbol 1332 MovieClip "campaignStats" in Symbol 1345 MovieClip [loadScreen] Frame 21
onClipEvent (load) {
this._visible = false;
}
Symbol 1369 MovieClip Frame 1
stop();
Symbol 1378 MovieClip Frame 1
stop();
Symbol 1386 MovieClip Frame 1
stop();
Symbol 1387 MovieClip Frame 1
stop();
Symbol 1388 MovieClip Frame 1
stop();
Symbol 1389 MovieClip [trenchInterface] Frame 1
stop();
Symbol 1396 MovieClip Frame 1
stop();
Symbol 1397 MovieClip [handGrenade] Frame 1
stop();
Instance of Symbol 1396 MovieClip in Symbol 1397 MovieClip [handGrenade] Frame 1
onClipEvent (load) {
if (_parent.ownerTeam == "german") {
this.gotoAndStop("stick");
}
}
Symbol 1397 MovieClip [handGrenade] Frame 2
play();
Symbol 1397 MovieClip [handGrenade] Frame 41
_root.grenadeCollisions++;
this.attachMovie("grenadeStrikeCollision", "collision", 500 + _root.grenadeCollisions);
this.collision._visible = false;
if (_root[_root.playerTeam.team + "_slot6_upgrade"].active == true) {
this.collision._width = this.collision._width * 3;
}
_root.grenadeExplosion(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "grenade");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "grenade");
Symbol 1397 MovieClip [handGrenade] Frame 46
stop();
removeMovieClip(this);
Symbol 1397 MovieClip [handGrenade] Frame 48
play();
Symbol 1397 MovieClip [handGrenade] Frame 83
_root.grenadeCollisions++;
this.attachMovie("grenadeStrikeCollision", "collision", 500 + _root.grenadeCollisions);
this.collision._visible = false;
if (_root[_root.playerTeam.team + "_slot6_upgrade"].active == true) {
this.collision._width = this.collision._width * 3;
}
_root.grenadeExplosion(this._x, this._y);
_root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, "grenade");
_root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, "grenade");
Symbol 1397 MovieClip [handGrenade] Frame 89
stop();
removeMovieClip(this);
Symbol 1403 MovieClip Frame 1
this.gotoAndStop(random(2) + 1);
Instance of Symbol 1421 MovieClip "fullBlock" in Symbol 1422 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1421 MovieClip "whiteOut" in Symbol 1422 MovieClip Frame 1
/* no clip actions */
Symbol 1430 MovieClip Frame 1
stop();
Symbol 1433 MovieClip Frame 1
stop();
Symbol 1436 MovieClip Frame 1
stop();
Symbol 1442 MovieClip Frame 1
stop();
Symbol 1446 MovieClip Frame 1
stop();
Symbol 1447 MovieClip Frame 1
stop();
Symbol 1451 MovieClip Frame 1
stop();
Symbol 1453 MovieClip Frame 1
stop();
Symbol 1454 MovieClip Frame 1
stop();
Symbol 1458 MovieClip Frame 1
stop();
Symbol 1460 MovieClip Frame 1
stop();
Symbol 1461 MovieClip Frame 1
stop();
Symbol 1465 MovieClip Frame 1
stop();
Symbol 1467 MovieClip Frame 1
stop();
Symbol 1468 MovieClip Frame 1
stop();
Symbol 1470 MovieClip Frame 1
stop();
Symbol 1472 MovieClip Frame 1
stop();
Symbol 1473 MovieClip Frame 1
stop();
Symbol 1475 MovieClip Frame 1
stop();
Symbol 1477 MovieClip Frame 1
stop();
Symbol 1478 MovieClip Frame 1
stop();
Symbol 1481 MovieClip Frame 1
stop();
Symbol 1490 MovieClip Frame 1
stop();
Symbol 1522 MovieClip Frame 1
stop();
Instance of Symbol 1421 MovieClip "highlight_slot1" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1421 MovieClip "highlight_slot2" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1421 MovieClip "highlight_slot3" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1421 MovieClip "highlight_slot4" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1421 MovieClip "highlight_slot5" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1421 MovieClip "highlight_slot6" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1422 MovieClip "slot1" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "slot2" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "slot3" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "slot4" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "slot5" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "slot6" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup(this._name);
}
Instance of Symbol 1422 MovieClip "supportSlot1" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup_fireSupport(this._name);
}
Instance of Symbol 1422 MovieClip "supportSlot2" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup_fireSupport(this._name);
}
Instance of Symbol 1422 MovieClip "supportSlot3" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup_fireSupport(this._name);
}
Instance of Symbol 1422 MovieClip "supportSlot4" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup_fireSupport(this._name);
}
Instance of Symbol 1499 MovieClip "menuButton" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
_root.buttonSetup_hudMenuButton(this._name);
}
Instance of Symbol 1510 MovieClip "progressBarToolTip" in Symbol 1524 MovieClip [hud] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1513 MovieClip "toolTip" in Symbol 1524 MovieClip [hud] 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;
}
};
}
Instance of Symbol 1386 MovieClip "mainTrenchButton" in Symbol 1529 MovieClip [trench] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1533 MovieClip Frame 1
stop();
Symbol 1533 MovieClip Frame 41
gotoAndPlay(random(100) + 50);
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1546 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Symbol 1553 MovieClip [rainSplash] Frame 5
stop();
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1584 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1584 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash3" in Symbol 1584 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1589 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1589 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash3" in Symbol 1589 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1601 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1614 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1614 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash3" in Symbol 1614 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1617 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1617 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash3" in Symbol 1617 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1622 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1622 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1626 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash3" in Symbol 1626 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1632 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1636 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1636 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Instance of Symbol 1533 MovieClip "flash1" in Symbol 1636 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(300));
}
Symbol 1711 MovieClip Frame 1
stop();
Instance of Symbol 311 MovieClip [particle_dustShaft_mortar] in Symbol 1711 MovieClip Frame 2
onClipEvent (load) {
if (random(2) > 0) {
this._xscale = -100;
}
}
Instance of Symbol 327 MovieClip [particle_dustShaft_bullet] in Symbol 1711 MovieClip Frame 2
onClipEvent (load) {
if (random(2) > 0) {
this._xscale = -100;
}
}
Instance of Symbol 344 MovieClip [particle_dustShaft_grenade] in Symbol 1711 MovieClip Frame 2
onClipEvent (load) {
if (random(2) > 0) {
this._xscale = -100;
}
}