STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/43689596?noj=FRM43689596-22DC" width="1" height="1"></div>

warfare-1944.swf

This is the info page for
Flash #130585

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 2 adBox { } movieClip 4 deployBlock { } movieClip 6 tankStrikeCollision { } movieClip 7 mortarStrikeCollision { } movieClip 8 artilleryStrikeCollision { } movieClip 15 midground_map_british_town2 { } movieClip 18 panArrow { } movieClip 19 blankMovie { } movieClip 21 smokeStrikeCollision { } movieClip 23 blankBlock { } // unknown tag 88 length 62 movieClip 28 { } movieClip 29 adMessage { } frame 1 { _global.$createTweenController = function () { var v3 = _root.createEmptyMovieClip('__tweenController__', 123432); v3.$_tweenPropList = new Array(); v3.$_tTime = getTimer(); v3.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 v7 = [prop]; var v11 = [mtarget[prop]]; var v9 = [propDest]; } else { var v7 = []; var v11 = []; var v9 = []; for (var v32 in prop) { v11.push(mtarget[prop[v32]]); } for (v32 in prop) { v7.push(prop[v32]); } for (v32 in propDest) { v9.push(propDest[v32]); } } var v12 = false; if (_root.__tweenController__ == undefined) { _global.$createTweenController(); } var v4 = _root.__tweenController__.$_tweenPropList; var v8 = _root.__tweenController__.$_tTime; for (v32 in v11) { if (v9[v32] != undefined && !mtarget.$_isTweenLocked) { if (mtarget.$_tweenCount > 0) { var v3 = 0; while (v3 < v4.length) { if (v4[v3]._targ == mtarget && v4[v3]._prop == v7[v32]) { if (v8 + delay * 1000 < v4[v3]._timeDest) { v4.splice(v3, 1); --v3; --mtarget.$_tweenCount; } } ++v3; } } v4.push({'_prop': v7[v32], '_targ': mtarget, '_propStart': undefined, '_propDest': v9[v32], '_timeStart': v8, '_timeDest': v8 + timeSeconds * 1000, '_animType': animType, '_extra1': extra1, '_extra2': extra2, '_extras': extras, '_delay': delay, '_isPaused': false, '_timePaused': 0, '_callback': v12 ? undefined : callback}); mtarget.$_tweenCount = mtarget.$_tweenCount > 0 ? mtarget.$_tweenCount + 1 : 1; v12 = true; } } ASSetPropFlags(mtarget, '$_tweenCount', 1, 0); }; ASSetPropFlags(_global, '$addTween', 1, 0); _global.$updateTweens = function () { this.$_tTime = getTimer(); var v8 = this.$_tTime; var v6 = 0; while (v6 < this.$_tweenPropList.length) { var v3 = this.$_tweenPropList[v6]; if (v3._targ.toString() == undefined) { this.$_tweenPropList.splice(v6, 1); --v6; } else { if (v3._timeStart + v3._delay * 1000 <= v8 && !v3._isPaused) { if (v3._propStart == undefined) { if (v3._prop.substr(0, 10) == '__special_') { if (v3._prop == '__special_mc_frame__') { v3._propStart = v3._targ._currentframe; } else { if (v3._prop == '__special_mc_ra__') { v3._propStart = ((new Color(v3._targ)).getTransform()).ra; } else { if (v3._prop == '__special_mc_rb__') { v3._propStart = ((new Color(v3._targ)).getTransform()).rb; } else { if (v3._prop == '__special_mc_ga__') { v3._propStart = ((new Color(v3._targ)).getTransform()).ga; } else { if (v3._prop == '__special_mc_gb__') { v3._propStart = ((new Color(v3._targ)).getTransform()).gb; } else { if (v3._prop == '__special_mc_ba__') { v3._propStart = ((new Color(v3._targ)).getTransform()).ba; } else { if (v3._prop == '__special_mc_bb__') { v3._propStart = ((new Color(v3._targ)).getTransform()).bb; } else { if (v3._prop == '__special_mc_aa__') { v3._propStart = ((new Color(v3._targ)).getTransform()).aa; } else { if (v3._prop == '__special_mc_ab__') { v3._propStart = ((new Color(v3._targ)).getTransform()).ab; } else { if (v3._prop == '__special_text_r__') { v3._propStart = v3._targ.textColor >> 16; } else { if (v3._prop == '__special_text_g__') { v3._propStart = (v3._targ.textColor & 65280) >> 8; } else { if (v3._prop == '__special_text_b__') { v3._propStart = v3._targ.textColor & 255; } else { if (v3._prop == '__special_sound_volume__') { v3._propStart = v3._targ.getVolume(); } else { if (v3._prop == '__special_sound_pan__') { v3._propStart = v3._targ.getPan(); } else { if (v3._prop == '__special_bst_t__') { v3._propStart = 0; v3._extras.__special_bst_ix__ = v3._targ._x; v3._extras.__special_bst_iy__ = v3._targ._y; } else { if (v3._prop == '__special_blur_x__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BlurFilter) { v3._propStart = v3._targ.filters[v5].blurX; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_blur_y__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BlurFilter) { v3._propStart = v3._targ.filters[v5].blurY; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_glow_color__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.GlowFilter) { v3._propStart = v3._targ.filters[v5].color; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 16777215; } } else { if (v3._prop == '__special_glow_alpha__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.GlowFilter) { v3._propStart = v3._targ.filters[v5].alpha; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 1; } } else { if (v3._prop == '__special_glow_blurX__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.GlowFilter) { v3._propStart = v3._targ.filters[v5].blurX; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_glow_blurY__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.GlowFilter) { v3._propStart = v3._targ.filters[v5].blurY; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_glow_strength__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.GlowFilter) { v3._propStart = v3._targ.filters[v5].strength; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 1; } } else { if (v3._prop == '__special_bevel_distance__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].distance; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_bevel_angle__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].angle; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 45; } } else { if (v3._prop == '__special_bevel_highlightColor__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].highlightColor; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 16777215; } } else { if (v3._prop == '__special_bevel_highlightAlpha__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].highlightAlpha; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 1; } } else { if (v3._prop == '__special_bevel_shadowColor__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].shadowColor; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_bevel_shadowAlpha__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].shadowAlpha; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 1; } } else { if (v3._prop == '__special_bevel_blurX__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].blurX; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_bevel_blurY__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].blurY; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 0; } } else { if (v3._prop == '__special_bevel_strength__') { var v5 = 0; while (v5 < v3._targ.filters.length) { if (v3._targ.filters[v5] instanceof flash.filters.BevelFilter) { v3._propStart = v3._targ.filters[v5].strength; } ++v5; } if (v3._propStart == undefined) { v3._propStart = 1; } } else { v3._propStart = v3._targ[v3._prop]; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } else { v3._propStart = v3._targ[v3._prop]; } } var v10 = v3._timeDest + v3._delay * 1000; if (v10 <= v8) { var v4 = v3._propDest; } else { var v4 = _global.findTweenValue(v3._propStart, v3._propDest, v3._timeStart, v8 - v3._delay * 1000, v3._timeDest, v3._animType, v3._extra1, v3._extra2); } v3._targ[v3._prop] = v3._extras.mustRound ? Math.round(v4) : v4; if (v3._prop == '__special_mc_frame__') { v3._targ.gotoAndStop(Math.round(v4)); } else { if (v3._prop == '__special_mc_ra__') { (new Color(v3._targ)).setTransform({'ra': v4}); } else { if (v3._prop == '__special_mc_rb__') { (new Color(v3._targ)).setTransform({'rb': v4}); } else { if (v3._prop == '__special_mc_ga__') { (new Color(v3._targ)).setTransform({'ga': v4}); } else { if (v3._prop == '__special_mc_gb__') { (new Color(v3._targ)).setTransform({'gb': v4}); } else { if (v3._prop == '__special_mc_ba__') { (new Color(v3._targ)).setTransform({'ba': v4}); } else { if (v3._prop == '__special_mc_bb__') { (new Color(v3._targ)).setTransform({'bb': v4}); } else { if (v3._prop == '__special_mc_aa__') { (new Color(v3._targ)).setTransform({'aa': v4}); } else { if (v3._prop == '__special_mc_ab__') { (new Color(v3._targ)).setTransform({'ab': v4}); } } } } } } } } } if (v3._prop == '__special_bst_t__') { var v7 = v3._extras; var v9 = _global.findPointOnCurve(v7.__special_bst_ix__, v7.__special_bst_iy__, v7.__special_bst_cx__, v7.__special_bst_cy__, v7.__special_bst_dx__, v7.__special_bst_dy__, v4); if (v3._extras.mustRound) { v3._targ._x = Math.round(v9.x); v3._targ._y = Math.round(v9.y); } else { v3._targ._x = v9.x; v3._targ._y = v9.y; } } if (typeof v3._targ != 'movieclip' && v3._prop == '__special_text_b__') { v3._targ.textColor = (v3._targ.__special_text_r__ << 16) + (v3._targ.__special_text_g__ << 8) + v3._targ.__special_text_b__; } if (v3._prop == '__special_sound_volume__') { v3._targ.setVolume(v4); } if (v3._prop == '__special_sound_pan__') { v3._targ.setPan(v4); } if (v3._prop == '__special_blur_x__') { _global.$setFilterProperty(v3._targ, 'blur_blurX', v4, v3._extras); } if (v3._prop == '__special_blur_y__') { _global.$setFilterProperty(v3._targ, 'blur_blurY', v4, v3._extras); } if (v3._prop == '__special_glow_color__') { _global.$setFilterProperty(v3._targ, 'glow_color', _global.findTweenColor(v3, v8), v3._extras); } if (v3._prop == '__special_glow_alpha__') { _global.$setFilterProperty(v3._targ, 'glow_alpha', v4, v3._extras); } if (v3._prop == '__special_glow_blurX__') { _global.$setFilterProperty(v3._targ, 'glow_blurX', v4, v3._extras); } if (v3._prop == '__special_glow_blurY__') { _global.$setFilterProperty(v3._targ, 'glow_blurY', v4, v3._extras); } if (v3._prop == '__special_glow_strength__') { _global.$setFilterProperty(v3._targ, 'glow_strength', v4, v3._extras); } if (v3._prop == '__special_bevel_distance__') { _global.$setFilterProperty(v3._targ, 'bevel_distance', v4, v3._extras); } if (v3._prop == '__special_bevel_angle__') { _global.$setFilterProperty(v3._targ, 'bevel_angle', v4, v3._extras); } if (v3._prop == '__special_bevel_highlightColor__') { _global.$setFilterProperty(v3._targ, 'bevel_highlightColor', _global.findTweenColor(v3, v8), v3._extras); } if (v3._prop == '__special_bevel_highlightAlpha__') { _global.$setFilterProperty(v3._targ, 'bevel_highlightAlpha', v4, v3._extras); } if (v3._prop == '__special_bevel_shadowColor__') { _global.$setFilterProperty(v3._targ, 'bevel_shadowColor', _global.findTweenColor(v3, v8), v3._extras); } if (v3._prop == '__special_bevel_shadowAlpha__') { _global.$setFilterProperty(v3._targ, 'bevel_shadowAlpha', v4, v3._extras); } if (v3._prop == '__special_bevel_blurX__') { _global.$setFilterProperty(v3._targ, 'bevel_blurX', v4, v3._extras); } if (v3._prop == '__special_bevel_blurY__') { _global.$setFilterProperty(v3._targ, 'bevel_blurY', v4, v3._extras); } if (v3._prop == '__special_bevel_strength__') { _global.$setFilterProperty(v3._targ, 'bevel_strength', v4, v3._extras); } if (v3._targ.onTweenUpdate != undefined) { v3._targ.onTweenUpdate(v3._prop); } if (v10 <= v8) { if (v3._targ.onTweenComplete != undefined) { v3._targ.onTweenComplete(v3._prop); } _global.$stopTween(v3._targ, [v3._prop], false); --v6; if (v3._callback != undefined) { if (_global.backwardCallbackTweening) { var v11 = v3._targ.createEmptyMovieClip('__child__', 122344); v3._callback.apply(v11, null); v11.removeMovieClip(); } else { v3._callback.apply(v3._targ, null); } } } } } ++v6; } if (this.$_tweenPropList.length == 0) { _global.$removeTweenController(); } }; ASSetPropFlags(_global, '$updateTween', 1, 0); _global.$stopTween = function (mtarget, props, wipeFuture) { var v4 = _root.__tweenController__.$_tweenPropList; var v7; for (var v9 in v4) { v7 = v4[v9]._prop; var v5 = 0; for (;;) { if (!(v5 < props.length || v5 < 1 && props == undefined)) break; if (v4[v9]._targ == mtarget && (v7 == props[v5] || props == undefined) && (wipeFuture || v4[v9]._timeDest + v4[v9]._delay * 1000 <= getTimer())) { switch (v7) { 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[v7]; break; case '__special_text_b__': delete mtarget.__special_text_r__; delete mtarget.__special_text_g__; delete mtarget.__special_text_b__; } v4.splice(v9, 1); } ++v5; } } if (props == undefined) { delete mtarget.$_tweenCount; } else { mtarget.$_tweenCount = 0; for (v9 in v4) { if (v4[v9]._targ == mtarget) { ++mtarget.$_tweenCount; } } if (mtarget.$_tweenCount == 0) { delete mtarget.$_tweenCount; } } if (v4.length == 0) { _global.$removeTweenController(); } }; ASSetPropFlags(_global, '$stopTween', 1, 0); _global.$setFilterProperty = function (mtarget, propName, propValue, extras) { var v1; var v7 = false; var v3 = []; v1 = 0; while (v1 < mtarget.filters.length) { v3.push(mtarget.filters[v1]); ++v1; } if (propName.substr(0, 5) == 'blur_') { v1 = 0; while (v1 < mtarget.filters.length) { if (v3[v1] instanceof flash.filters.BlurFilter) { v3[v1][propName.substr(5)] = propValue; if (extras.__special_blur_quality__ != undefined) { v3[v1].quality = extras.__special_blur_quality__; } v7 = true; break; } ++v1; } if (!v7) { var v9; var v8 = (extras.__special_blur_quality__ == undefined) ? 2 : extras.__special_blur_quality__; if (propName == 'blur_blurX') { v9 = new flash.filters.BlurFilter(propValue, 0, v8); } if (propName == 'blur_blurY') { v9 = new flash.filters.BlurFilter(0, propValue, v8); } v3.push(v9); } } else { if (propName.substr(0, 5) == 'glow_') { v1 = 0; while (v1 < mtarget.filters.length) { if (v3[v1] instanceof flash.filters.GlowFilter) { v3[v1][propName.substr(5)] = propValue; if (extras.__special_glow_quality__ != undefined) { v3[v1].quality = extras.__special_glow_quality__; } if (extras.__special_glow_inner__ != undefined) { v3[v1].inner = extras.__special_glow_inner__; } if (extras.__special_glow_knockout__ != undefined) { v3[v1].knockout = extras.__special_glow_knockout__; } v7 = true; break; } ++v1; } if (!v7) { var v8 = (extras.__special_glow_quality__ == undefined) ? 2 : extras.__special_glow_quality__; var v12 = (extras.__special_glow_inner__ == undefined) ? false : extras.__special_glow_inner__; var v10 = (extras.__special_glow_knockout__ == undefined) ? false : extras.__special_glow_knockout__; if (propName == 'glow_color') { var v9 = new flash.filters.GlowFilter(propValue, 1, 0, 0, 1, v8, v12, v10); } if (propName == 'glow_alpha') { v9 = new flash.filters.GlowFilter(16777215, propValue, 0, 0, 1, v8, v12, v10); } if (propName == 'glow_blurX') { v9 = new flash.filters.GlowFilter(16777215, 1, propValue, 0, 1, v8, v12, v10); } if (propName == 'glow_blurY') { v9 = new flash.filters.GlowFilter(16777215, 1, 0, propValue, 1, v8, v12, v10); } if (propName == 'glow_strength') { v9 = new flash.filters.GlowFilter(16777215, 1, 0, 0, propValue, v8, v12, v10); } v3.push(v9); } } else { if (propName.substr(0, 6) == 'bevel_') { v1 = 0; while (v1 < mtarget.filters.length) { if (v3[v1] instanceof flash.filters.BevelFilter) { v3[v1][propName.substr(6)] = propValue; if (extras.__special_bevel_quality__ != undefined) { v3[v1].quality = extras.__special_bevel_quality__; } if (extras.__special_bevel_type__ != undefined) { v3[v1].inner = extras.__special_bevel_type__; } if (extras.__special_bevel_knockout__ != undefined) { v3[v1].knockout = extras.__special_bevel_knockout__; } v7 = true; break; } ++v1; } if (!v7) { var v8 = (extras.__special_bevel_quality__ == undefined) ? 2 : extras.__special_bevel_quality__; var v11 = (extras.__special_bevel_type__ == undefined) ? 'inner' : extras.__special_bevel_type__; var v10 = (extras.__special_bevel_knockout__ == undefined) ? false : extras.__special_bevel_knockout__; if (propName == 'bevel_distance') { var v9 = new flash.filters.BevelFilter(propValue, 45, 16777215, 1, 0, 1, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_angle') { v9 = new flash.filters.BevelFilter(0, propValue, 16777215, 1, 0, 1, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_highlightColor') { v9 = new flash.filters.BevelFilter(0, 45, propValue, 1, 0, 1, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_highlightAlpha') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, propValue, 0, 1, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_shadowColor') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, propValue, 1, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_shadowAlpha') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, propValue, 0, 0, 1, v8, v11, v10); } if (propName == 'bevel_blurX') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, propValue, 0, 1, v8, v11, v10); } if (propName == 'bevel_blurY') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, 0, propValue, 1, v8, v11, v10); } if (propName == 'bevel_strength') { v9 = new flash.filters.BevelFilter(0, 45, 16777215, 1, 0, 1, 0, 0, propValue, v8, v11, v10); } v3.push(v9); } } else { return undefined; } } } mtarget.filters = v3; }; Sound.prototype.tween = function (prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2); }; TextField.prototype.tween = Sound.prototype.tween; MovieClip.prototype.tween = Sound.prototype.tween; ASSetPropFlags(MovieClip.prototype, 'tween', 1, 0); ASSetPropFlags(TextField.prototype, 'tween', 1, 0); ASSetPropFlags(Sound.prototype, 'tween', 1, 0); 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}); }; TextField.prototype.roundedTween = Sound.prototype.roundedTween; MovieClip.prototype.roundedTween = Sound.prototype.roundedTween; ASSetPropFlags(MovieClip.prototype, 'roundedTween', 1, 0); ASSetPropFlags(TextField.prototype, 'roundedTween', 1, 0); ASSetPropFlags(Sound.prototype, 'roundedTween', 1, 0); Sound.prototype.stopTween = function (props) { if (typeof props == 'string') { props = [props]; } if (props != undefined) { var v4 = 1; while (v4 < arguments.length) { props.push(arguments[v4]); ++v4; } } _global.$stopTween(this, props, true); }; TextField.prototype.stopTween = Sound.prototype.stopTween; MovieClip.prototype.stopTween = Sound.prototype.stopTween; ASSetPropFlags(MovieClip.prototype, 'stopTween', 1, 0); ASSetPropFlags(TextField.prototype, 'stopTween', 1, 0); ASSetPropFlags(Sound.prototype, 'stopTween', 1, 0); Sound.prototype.pauseTween = function (props) { if (props != undefined) { if (typeof props == 'string') { props = [props]; } var v6 = 1; while (v6 < Arguments.length) { props.push(Arguments[v6]); ++v6; } } var v4 = _root.__tweenController__.$_tweenPropList; var v5; for (var v7 in v4) { if (v4[v7]._targ == this && !v4[v7]._isPaused) { if (props != undefined) { v5 = false; for (v6 in props) { if (props[v6] == v4[v7]._prop) { v5 = true; break; } } } if (props == undefined || v5) { v4[v7]._isPaused = true; v4[v7]._timePaused = _root.__tweenController__.$_tTime; } } } }; TextField.prototype.pauseTween = Sound.prototype.pauseTween; MovieClip.prototype.pauseTween = Sound.prototype.pauseTween; ASSetPropFlags(MovieClip.prototype, 'pauseTween', 1, 0); ASSetPropFlags(TextField.prototype, 'pauseTween', 1, 0); ASSetPropFlags(Sound.prototype, 'pauseTween', 1, 0); Sound.prototype.resumeTween = function (props) { if (props != undefined) { if (typeof props == 'string') { props = [props]; } var v7 = 1; while (v7 < Arguments.length) { props.push(Arguments[v7]); ++v7; } } var v3 = _root.__tweenController__.$_tweenPropList; var v5; var v6; for (var v8 in v3) { if (v3[v8]._targ == this && v3[v8]._isPaused) { if (props != undefined) { v5 = false; for (v7 in props) { if (props[v7] == v3[v8]._prop) { v5 = true; break; } } } if (props == undefined || v5) { v3[v8]._isPaused = false; v6 = _root.__tweenController__.$_tTime - v3[v8]._timePaused; v3[v8]._timeStart += v6; v3[v8]._timeDest += v6; v3[v8]._timePaused = 0; } } } }; TextField.prototype.resumeTween = Sound.prototype.resumeTween; MovieClip.prototype.resumeTween = Sound.prototype.resumeTween; ASSetPropFlags(MovieClip.prototype, 'resumeTween', 1, 0); ASSetPropFlags(TextField.prototype, 'resumeTween', 1, 0); ASSetPropFlags(Sound.prototype, 'resumeTween', 1, 0); Sound.prototype.lockTween = function () { this.$_isTweenLocked = true; ASSetPropFlags(this, 'this.$_isTweenLocked', 1, 0); }; TextField.prototype.lockTween = Sound.prototype.lockTween; MovieClip.prototype.lockTween = Sound.prototype.lockTween; ASSetPropFlags(MovieClip.prototype, 'lockTween', 1, 0); ASSetPropFlags(TextField.prototype, 'lockTween', 1, 0); ASSetPropFlags(Sound.prototype, 'lockTween', 1, 0); Sound.prototype.unlockTween = function () { delete this.$_isTweenLocked; }; TextField.prototype.unlockTween = Sound.prototype.unlockTween; MovieClip.prototype.unlockTween = Sound.prototype.unlockTween; ASSetPropFlags(MovieClip.prototype, 'unlockTween', 1, 0); ASSetPropFlags(TextField.prototype, 'unlockTween', 1, 0); ASSetPropFlags(Sound.prototype, 'unlockTween', 1, 0); Sound.prototype.getTweens = function () { return this.$_tweenCount; }; TextField.prototype.getTweens = Sound.prototype.getTweens; MovieClip.prototype.getTweens = Sound.prototype.getTweens; ASSetPropFlags(MovieClip.prototype, 'getTweens', 1, 0); ASSetPropFlags(TextField.prototype, 'getTweens', 1, 0); ASSetPropFlags(Sound.prototype, 'getTweens', 1, 0); Sound.prototype.isTweening = function () { return this.$_tweenCount > 0 ? true : false; }; TextField.prototype.isTweening = Sound.prototype.isTweening; MovieClip.prototype.isTweening = Sound.prototype.isTweening; ASSetPropFlags(MovieClip.prototype, 'isTweening', 1, 0); ASSetPropFlags(TextField.prototype, 'isTweening', 1, 0); ASSetPropFlags(Sound.prototype, 'isTweening', 1, 0); TextField.prototype.alphaTo = function (propDest_a, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_alpha', propDest_a, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.alphaTo = TextField.prototype.alphaTo; 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); 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); }; MovieClip.prototype.resizeTo = TextField.prototype.resizeTo; ASSetPropFlags(MovieClip.prototype, 'resizeTo', 1, 0); ASSetPropFlags(TextField.prototype, 'resizeTo', 1, 0); TextField.prototype.rotateTo = function (propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_rotation', propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.rotateTo = TextField.prototype.rotateTo; ASSetPropFlags(MovieClip.prototype, 'rotateTo', 1, 0); ASSetPropFlags(TextField.prototype, 'rotateTo', 1, 0); 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); }; MovieClip.prototype.scaleTo = TextField.prototype.scaleTo; ASSetPropFlags(MovieClip.prototype, 'scaleTo', 1, 0); ASSetPropFlags(TextField.prototype, 'scaleTo', 1, 0); TextField.prototype.xScaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_xscale', propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.xScaleTo = TextField.prototype.xScaleTo; ASSetPropFlags(MovieClip.prototype, 'xScaleTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xScaleTo', 1, 0); TextField.prototype.yScaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_yscale', propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.yScaleTo = TextField.prototype.yScaleTo; 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); 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); }; MovieClip.prototype.slideTo = TextField.prototype.slideTo; ASSetPropFlags(MovieClip.prototype, 'slideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'slideTo', 1, 0); 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}); }; MovieClip.prototype.roundedSlideTo = TextField.prototype.roundedSlideTo; ASSetPropFlags(MovieClip.prototype, 'roundedSlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'roundedSlideTo', 1, 0); TextField.prototype.xSlideTo = function (propDest_x, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_x', propDest_x, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.xSlideTo = TextField.prototype.xSlideTo; ASSetPropFlags(MovieClip.prototype, 'xSlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xSlideTo', 1, 0); 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}); }; MovieClip.prototype.roundedXSlideTo = TextField.prototype.roundedXSlideTo; ASSetPropFlags(MovieClip.prototype, 'roundedXSlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'roundedXSlideTo', 1, 0); TextField.prototype.ySlideTo = function (propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) { _global.$addTween(this, '_y', propDest_y, timeSeconds, animType, delay, callback, extra1, extra2); }; MovieClip.prototype.ySlideTo = TextField.prototype.ySlideTo; ASSetPropFlags(MovieClip.prototype, 'ySlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'ySlideTo', 1, 0); 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}); }; MovieClip.prototype.roundedYSlideTo = TextField.prototype.roundedYSlideTo; ASSetPropFlags(MovieClip.prototype, 'roundedYSlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'roundedYSlideTo', 1, 0); TextField.prototype.bezierSlideTo = function (cpoint_x, cpoint_y, propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) { var v3 = new Object(); v3.__special_bst_ix__ = undefined; v3.__special_bst_iy__ = undefined; v3.__special_bst_cx__ = cpoint_x; v3.__special_bst_cy__ = cpoint_y; v3.__special_bst_dx__ = propDest_x; v3.__special_bst_dy__ = propDest_y; _global.$addTween(this, '__special_bst_t__', 1, timeSeconds, animType, delay, callback, extra1, extra2, v3); }; MovieClip.prototype.bezierSlideTo = TextField.prototype.bezierSlideTo; ASSetPropFlags(MovieClip.prototype, 'bezierSlideTo', 1, 0); ASSetPropFlags(TextField.prototype, 'bezierSlideTo', 1, 0); TextField.prototype.roundedBezierSlideTo = function (cpoint_x, cpoint_y, propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) { var v3 = new Object(); v3.__special_bst_ix__ = undefined; v3.__special_bst_iy__ = undefined; v3.__special_bst_cx__ = cpoint_x; v3.__special_bst_cy__ = cpoint_y; v3.__special_bst_dx__ = propDest_x; v3.__special_bst_dy__ = propDest_y; v3.mustRound = true; _global.$addTween(this, '__special_bst_t__', 1, timeSeconds, animType, delay, callback, extra1, extra2, v3); }; MovieClip.prototype.roundedBezierSlideTo = TextField.prototype.roundedBezierSlideTo; 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 v3 = propDest_color >> 16; var v5 = (propDest_color & 65280) >> 8; var v4 = propDest_color & 255; this.colorTransformTo(0, v3, 0, v5, 0, v4, 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 v3 = propDest_color >> 16; var v6 = (propDest_color & 65280) >> 8; var v4 = propDest_color & 255; _global.$addTween(this, ['__special_text_r__', '__special_text_g__', '__special_text_b__'], [v3, v6, v4], 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); 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]}); } }; MovieClip.prototype.blurTo = TextField.prototype.blurTo; ASSetPropFlags(MovieClip.prototype, 'blurTo', 1, 0); ASSetPropFlags(TextField.prototype, 'blurTo', 1, 0); 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}); }; MovieClip.prototype.xyBlurTo = TextField.prototype.xyBlurTo; ASSetPropFlags(MovieClip.prototype, 'xyBlurTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xyBlurTo', 1, 0); 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}); }; MovieClip.prototype.xBlurTo = TextField.prototype.xBlurTo; ASSetPropFlags(MovieClip.prototype, 'xBlurTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xBlurTo', 1, 0); 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}); }; MovieClip.prototype.yBlurTo = TextField.prototype.yBlurTo; ASSetPropFlags(MovieClip.prototype, 'yBlurTo', 1, 0); ASSetPropFlags(TextField.prototype, 'yBlurTo', 1, 0); 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]}); } }; MovieClip.prototype.glowTo = TextField.prototype.glowTo; ASSetPropFlags(MovieClip.prototype, 'glowTo', 1, 0); ASSetPropFlags(TextField.prototype, 'glowTo', 1, 0); 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}); }; MovieClip.prototype.xyGlowTo = TextField.prototype.xyGlowTo; ASSetPropFlags(MovieClip.prototype, 'xyGlowTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xyGlowTo', 1, 0); 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}); }; MovieClip.prototype.xGlowTo = TextField.prototype.xGlowTo; ASSetPropFlags(MovieClip.prototype, 'xGlowTo', 1, 0); ASSetPropFlags(TextField.prototype, 'xGlowTo', 1, 0); 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}); }; MovieClip.prototype.yGlowTo = TextField.prototype.yGlowTo; ASSetPropFlags(MovieClip.prototype, 'yGlowTo', 1, 0); ASSetPropFlags(TextField.prototype, 'yGlowTo', 1, 0); 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]}); } }; MovieClip.prototype.bevelTo = TextField.prototype.bevelTo; ASSetPropFlags(MovieClip.prototype, 'bevelTo', 1, 0); ASSetPropFlags(TextField.prototype, 'bevelTo', 1, 0); 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}); }; MovieClip.prototype.xyBevelTo = TextField.prototype.xyBevelTo; 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 v8 = objProp._propStart >> 16; var v4 = objProp._propDest >> 16; var v5 = objProp._propStart >> 8 & 255; var v6 = objProp._propDest >> 8 & 255; var v9 = objProp._propStart & 255; var v7 = objProp._propDest & 255; var v12 = Math.round(_global.findTweenValue(v8, v4, objProp._timeStart, tTime - objProp._delay * 1000, objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2)); var v10 = Math.round(_global.findTweenValue(v5, v6, objProp._timeStart, tTime - objProp._delay * 1000, objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2)); var v3 = Math.round(_global.findTweenValue(v9, v7, objProp._timeStart, tTime - objProp._delay * 1000, objProp._timeDest, objProp._animType, objProp._extra1, objProp._extra2)); return (v12 << 16) + (v10 << 8) + v3; }; _global.findTweenValue = function (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) { var v1 = _timeNow - _timeStart; var v4 = _propStart; var v2 = _propDest - _propStart; var v3 = _timeDest - _timeStart; var v6 = _extra1; var v7 = _extra2; var v5 = _extra1; switch (_animType.toLowerCase()) { return 0; case 'linear': return v2 * v1 / v3 + v4; case 'easeinquad': v1 /= v3; return v2 * v1 * v1 + v4; case 'easeoutquad': v1 /= v3; return -v2 * v1 * (v1 - 2) + v4; case 'easeinoutquad': v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * v1 * v1 + v4; } return (-v2 / 2) * (--v1 * (v1 - 2) - 1) + v4; case 'easeoutinquad': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutQuad') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInQuad') * 0.5 + v2 * 0.5 + v4; case 'easeincubic': v1 /= v3; return v2 * v1 * v1 * v1 + v4; case 'easeoutcubic': v1 = v1 / v3 - 1; return v2 * (v1 * v1 * v1 + 1) + v4; case 'easeinoutcubic': v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * v1 * v1 * v1 + v4; } v1 -= 2; return (v2 / 2) * (v1 * v1 * v1 + 2) + v4; case 'easeoutincubic': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutCubic') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInCubic') * 0.5 + v2 * 0.5 + v4; case 'easeinquart': v1 /= v3; return v2 * v1 * v1 * v1 * v1 + v4; case 'easeoutquart': v1 = v1 / v3 - 1; return -v2 * (v1 * v1 * v1 * v1 - 1) + v4; case 'easeinoutquart': v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * v1 * v1 * v1 * v1 + v4; } v1 -= 2; return (-v2 / 2) * (v1 * v1 * v1 * v1 - 2) + v4; case 'easeoutinquart': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutQuart') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInQuart') * 0.5 + v2 * 0.5 + v4; case 'easeinquint': v1 /= v3; return v2 * v1 * v1 * v1 * v1 * v1 + v4; case 'easeoutquint': v1 = v1 / v3 - 1; return v2 * (v1 * v1 * v1 * v1 * v1 + 1) + v4; case 'easeinoutquint': v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * v1 * v1 * v1 * v1 * v1 + v4; } v1 -= 2; return (v2 / 2) * (v1 * v1 * v1 * v1 * v1 + 2) + v4; case 'easeoutinquint': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutQuint') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInQuint') * 0.5 + v2 * 0.5 + v4; case 'easeinsine': return -v2 * Math.cos((v1 / v3) * 1.570796326794897) + v2 + v4; case 'easeoutsine': return v2 * Math.sin((v1 / v3) * 1.570796326794897) + v4; case 'easeinoutsine': return (-v2 / 2) * (Math.cos(Math.PI * v1 / v3) - 1) + v4; case 'easeoutinsine': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutSine') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInSine') * 0.5 + v2 * 0.5 + v4; case 'easeinexpo': return (v1 == 0) ? v4 : v2 * Math.pow(2, 10 * (v1 / v3 - 1)) + v4; case 'easeoutexpo': return (v1 == v3) ? v4 + v2 : v2 * (-Math.pow(2, -10 * v1 / v3) + 1) + v4; case 'easeinoutexpo': if (v1 == 0) { return v4; } if (v1 == v3) { return v4 + v2; } v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * Math.pow(2, 10 * (v1 - 1)) + v4; } return (v2 / 2) * (-Math.pow(2, -10 * --v1) + 2) + v4; case 'easeoutinexpo': if (v1 == 0) { return v4; } if (v1 == v3) { return v4 + v2; } v1 /= v3 / 2; if (v1 < 1) { return (v2 / 2) * (-Math.pow(2, -10 * v1 / 1) + 1) + v4; } return (v2 / 2) * (Math.pow(2, 10 * (v1 - 2) / 1) + 1) + v4; case 'easeincirc': v1 /= v3; return -v2 * (Math.sqrt(1 - v1 * v1) - 1) + v4; case 'easeoutcirc': v1 = v1 / v3 - 1; return v2 * Math.sqrt(1 - v1 * v1) + v4; case 'easeinoutcirc': v1 /= v3 / 2; if (v1 < 1) { return (-v2 / 2) * (Math.sqrt(1 - v1 * v1) - 1) + v4; } v1 -= 2; return (v2 / 2) * (Math.sqrt(1 - v1 * v1) + 1) + v4; case 'easeoutincirc': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutCirc') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInCirc') * 0.5 + v2 * 0.5 + v4; case 'easeinelastic': if (v1 == 0) { return v4; } v1 /= v3; if (v1 == 1) { return v4 + v2; } if (!v7) { v7 = v3 * 0.3; } if (!v6 || v6 < Math.abs(v2)) { v6 = v2; v5 = v7 / 4; } else { v5 = (v7 / 6.283185307179586) * Math.asin(v2 / v6); } v1 -= 1; return -(v6 * Math.pow(2, 10 * v1) * Math.sin((v1 * v3 - v5) * 6.283185307179586 / v7)) + v4; case 'easeoutelastic': if (v1 == 0) { return v4; } v1 /= v3; if (v1 == 1) { return v4 + v2; } if (!v7) { v7 = v3 * 0.3; } if (!v6 || v6 < Math.abs(v2)) { v6 = v2; v5 = v7 / 4; } else { v5 = (v7 / 6.283185307179586) * Math.asin(v2 / v6); } return v6 * Math.pow(2, -10 * v1) * Math.sin((v1 * v3 - v5) * 6.283185307179586 / v7) + v2 + v4; case 'easeinoutelastic': if (v1 == 0) { return v4; } v1 /= v3 / 2; if (v1 == 2) { return v4 + v2; } if (!v7) { v7 = v3 * 0.45; } if (!v6 || v6 < Math.abs(v2)) { v6 = v2; v5 = v7 / 4; } else { v5 = (v7 / 6.283185307179586) * Math.asin(v2 / v6); } if (v1 < 1) { v1 -= 1; return -0.5 * (v6 * Math.pow(2, 10 * v1) * Math.sin((v1 * v3 - v5) * 6.283185307179586 / v7)) + v4; } v1 -= 1; return v6 * Math.pow(2, -10 * v1) * Math.sin((v1 * v3 - v5) * 6.283185307179586 / v7) * 0.5 + v2 + v4; case 'easeoutinelastic': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutElastic') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInElastic') * 0.5 + v2 * 0.5 + v4; case 'easeinback': if (v5 == undefined) { v5 = 1.70158; } v1 /= v3; return v2 * v1 * v1 * ((v5 + 1) * v1 - v5) + v4; case 'easeoutback': if (v5 == undefined) { v5 = 1.70158; } v1 = v1 / v3 - 1; return v2 * (v1 * v1 * ((v5 + 1) * v1 + v5) + 1) + v4; case 'easeinoutback': if (v5 == undefined) { v5 = 1.70158; } v1 /= v3 / 2; if (v1 < 1) { v5 *= 1.525; return (v2 / 2) * (v1 * v1 * ((v5 + 1) * v1 - v5)) + v4; } v1 -= 2; v5 *= 1.525; return (v2 / 2) * (v1 * v1 * ((v5 + 1) * v1 + v5) + 2) + v4; case 'easeoutinback': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutBack') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInBack') * 0.5 + v2 * 0.5 + v4; case 'easeinbounce': return v2 - findTweenValue(0, v2, 0, v3 - v1, v3, 'easeOutBounce') + v4; case 'easeoutbounce': v1 /= v3; if (v1 < 0.3636363636363637) { return v2 * (7.5625 * v1 * v1) + v4; } else { if (v1 < 0.7272727272727273) { v1 -= 0.5454545454545454; return v2 * (7.5625 * v1 * v1 + 0.75) + v4; } else { if (v1 < 0.9090909090909091) { v1 -= 0.8181818181818182; return v2 * (7.5625 * v1 * v1 + 0.9375) + v4; } else { v1 -= 0.9545454545454546; return v2 * (7.5625 * v1 * v1 + 0.984375) + v4; } } } case 'easeinoutbounce': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeInBounce') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeOutBounce') * 0.5 + v2 * 0.5 + v4; case 'easeoutinbounce': if (v1 < v3 / 2) { return findTweenValue(0, v2, 0, v1 * 2, v3, 'easeOutBounce') * 0.5 + v4; } return findTweenValue(0, v2, 0, v1 * 2 - v3, v3, 'easeInBounce') * 0.5 + v2 * 0.5 + v4; } return 0; }; ASSetPropFlags(_global, 'findTweenValue', 1, 0); } frame 2 { var versionNumber = 'v1.2'; verNumber.text = versionNumber; } frame 2 { function loadAdMessage() { _root.attachMovie('adMessage', 'adMessage', 13); adMessage.opened = false; adMessage._x = 495.2; adMessage._y = 137.7; adMessage.onEnterFrame = function () { if (_root._xmouse > 350 && _root._xmouse < 650 && _root._ymouse > 120 && _root._ymouse < 375) { if (adMessage.opened == false) { adMessage._alpha = 0; adMessage.alphaTo(100, 0.2); adMessage.box.ySlideTo(-30, 0.2); adMessage.opened = true; } } else { adMessage.box.ySlideTo(0, 0.2, 'linear'); adMessage.alphaTo(0, 0.2, 'linear', 0, function () { this.opened = false; }); } }; } function loadAd() { System.security.allowDomain('server.cpmstar.com'); _root.attachMovie('adBox', 'adBox', 12); adBox._x = 344.9; adBox._y = 126.3; adBox.loadMovie('http://server.cpmstar.com/adviewas2.swf?poolid=' + CPMStarPoolID + '&subpoolid=' + CPMStarSubPoolID); } function removeAd() { loadMovie('', adBox); adBox._x = -500; adBox._y = -500; removeMovieClip(this); removeMovieClip(adMessage); } var CPMStarPoolID = 1052; var CPMStarSubPoolID = 36; loadAd(); loadAdMessage(); } frame 2 { function urlChecker() { if (urlCheckerOn == true) { mainAd.gotoAndStop('ad'); urlStart = _url.indexOf('://') + 3; urlEnd = _url.indexOf('/', urlStart); domain = _url.substring(urlStart, urlEnd); LastDot = domain.lastIndexOf('.') - 1; pfixEnd = domain.lastIndexOf('.', LastDot) + 1; domain = domain.substring(pfixEnd, domain.length); if (domain == 'armorgames.com' || domain == 'conartistgames.com' || domain == '') { armorGamesVersion = true; mainAd.gotoAndStop('hints'); mainAd.hintText.text = ''; } else { nextHintButton._visible = false; } if (domain != 'armorgames.com' && domain != '' && domain != 'conartistgames.com') { 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 v3 = this.getBytesLoaded(); var v4 = this.getBytesTotal(); var v2 = Math.round((v3 / v4) * 100); percentage = v2 + '%'; preLoaderCombo.percentageTotal.text = percentage; preLoaderCombo.preloader.loadBar._xscale = v2; if (v2 >= 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.adBox.loadMovie(); _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(); var hints = new Array('If you\'re experiencing bugs or balancing issues leave a comment detailing them.', 'If you\'re experiencing bugs or balancing issues leave a comment detailing them.', 'If you\'re experiencing bugs or balancing issues leave a comment detailing them.', 'If you\'re experiencing bugs or balancing issues leave a comment detailing them.', 'ONE squad to ONE piece of cover, thems the rules (for now).', 'ONE squad to ONE piece of cover, thems the rules (for now).', 'ONE squad to ONE piece of cover, thems the rules (for now).', 'ONE squad to ONE piece of cover, thems the rules (for now).', 'Make sure you have empty cover for your Snipers and Machine Gun teams to move into.', 'All\'s fair in love and Warfare.', 'Use Assault Teams to throw grenades at tanks in an attempt to disable them.', 'Experience is earned by killing enemy units, winning battles quickly and efficiently.', 'Keep an eye on the green 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.', 'Outnumbering your enemy will boost the Morale of your men and reduce theirs.', 'Outnumbering your enemy will boost the Morale of your men and reduce theirs.', 'Resupply of Resource Points occurs about every 8 seconds.', 'The maximum amount of Resource Points available varies from mission to mission.', 'Use smoke to block the view of enemies ahead of you. They will still fire at you but with decreased accuracy', '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.', '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 Snipers 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.', 'Artillery strikes are costly in terms of resources use them wisely.', 'Machine Gun Teams and Snipers are weak in the open, try to get them to cover positions quickly.', 'Tanks are almost invulnerable against small arms fire. Use anti-tank teams to knock them out.', 'Take notice of the \'Ground Taken\' progress bar at the top of screen. It shows your units front most position.'); var goodURL = false; var armorGamesVersion = false; var urlCheckerOn = true; var everyWhereVersion = true; urlChecker(); preLoaderCombo.versionNumber.text = versionNumber; } // unknown tag 88 length 105 // unknown tag 88 length 69 movieClip 38 { } movieClip 39 { } movieClip 40 { } movieClip 43 { } // unknown tag 88 length 74 movieClip 46 { } movieClip 47 { } movieClip 51 { } movieClip 52 { } movieClip 56 { } movieClip 58 { frame 1 { stop(); } instance of movieClip 56 { 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/', '_blank'); }; } } } // unknown tag 88 length 71 // unknown tag 88 length 66 movieClip 66 { } movieClip 67 { instance of movieClip 66 { onClipEvent (load) { this.onRelease = function () { getURL('http://armorgames.com/', '_blank'); }; } } } frame 3 { armorAnim.alphaTo(100, 2, 'easeOutSine', 0, function () { this.play(); }); } movieClip 70 { } movieClip 71 { } movieClip 74 { } movieClip 81 { } movieClip 86 { } movieClip 89 { } movieClip 94 { } button 101 { on (press) { getURL('http://www.armorgames.com', '_blank'); } } movieClip 106 { frame 1 { stop(); } frame 225 { _root.gotoAndPlay('conArtistsLogo'); } } instance armorAnim of movieClip 106 { onClipEvent (load) { this.onEnterFrame = function () { removeAd(); }; } } frame 4 { stop(); } movieClip 110 { } movieClip 114 { } movieClip 117 { } movieClip 120 { } movieClip 122 { } movieClip 136 { } movieClip 137 { } movieClip 138 { } movieClip 139 { frame 234 { _root.gotoAndPlay('main'); } } instance of movieClip 139 { onClipEvent (load) { this.onEnterFrame = function () { removeAd(); }; } } movieClip 298 { frame 1 { stop(); } } movieClip 302 particle_dirt { } movieClip 305 { } movieClip 306 particle_dustShaft { frame 10 { stop(); } } movieClip 309 particle_dirt2 { } movieClip 312 { } movieClip 379 { } movieClip 380 { } movieClip 381 particle_fireball { frame 13 { stop(); } } movieClip 384 { } movieClip 385 particle_cloudDust { frame 9 { stop(); } } movieClip 386 particle_fireball_mortar { frame 10 { stop(); } } movieClip 387 particle_dustShaft_mortar { frame 11 { stop(); } } movieClip 389 { } movieClip 390 particle_dirt2_mortar { frame 6 { stop(); } } movieClip 391 particle_cloudDust_mortar { frame 9 { stop(); } } movieClip 394 { } movieClip 395 particle_sparks { frame 9 { stop(); } } movieClip 398 { } movieClip 399 particle_cloudDust_white { frame 15 { stop(); } } movieClip 401 particle_dirt2_bullet { } movieClip 402 particle_cloudDust_bullet { frame 9 { stop(); } } movieClip 403 particle_dustShaft_bullet { frame 2 { stop(); } } movieClip 406 { } movieClip 409 { } movieClip 410 artilleryStrike { frame 1 { stop(); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 2 { _root.playSound('sound_artillery_fire'); } frame 47 { _root.playIncomingSound('artillery'); } 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'); } frame 156 { stop(); removeMovieClip(this); } } movieClip 412 { } movieClip 413 particle_bloodCloud { } movieClip 414 particle_fireball_tank { instance of movieClip 380 { onClipEvent (load) { this._rotation = random(360); this._yscale = random(60) + 40; this._xscale = this._yscale; } } frame 50 { stop(); removeMovieClip(this); } } movieClip 415 smokeStrikeAnim { frame 1 { _root.playSound('sound_mortar_fire'); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 100 { ++_root.gasCollisions; 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); } frame 102 { stop(); } frame 104 { removeMovieClip(this); } } movieClip 418 { } movieClip 419 gasCloud { frame 11 { stop(); } } movieClip 420 particle_dustShaft_grenade { frame 11 { stop(); } } movieClip 421 particle_cloudDust_grenade { frame 9 { stop(); } } movieClip 422 particle_fireball_grenade { frame 10 { stop(); } } movieClip 423 particle_dirt2_grenade { frame 6 { stop(); } } movieClip 424 antiTankStrike { frame 1 { stop(); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 2 { _root.playSound('sound_artillery_fire'); } 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'); } frame 86 { stop(); removeMovieClip(this); } } movieClip 425 antiTankStrikeCollision { } movieClip 426 mineStrike { frame 1 { _root.playSound('sound_mine_click'); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } 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'); } frame 20 { stop(); removeMovieClip(this); } } movieClip 427 mortarStrike { frame 1 { stop(); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 2 { _root.playSound('sound_mortar_fire'); } frame 50 { _root.playIncomingSound('mortar'); } 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'); } frame 105 { stop(); removeMovieClip(this); } } movieClip 428 tankRound { instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } 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'); } frame 10 { stop(); removeMovieClip(this); } } movieClip 436 particle_metalFragment { } movieClip 437 airSupportStrike { frame 1 { stop(); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 2 { } frame 7 { this.attachMovie('airSupportCollision', 'collision', 600); this.collision._visible = false; _root.airSupportExplosion(this._x, this._y); _root.explosiveHit(this, _root.compTeam.team, this.ownerTeam, 'airSupport'); _root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, 'airSupport'); } frame 11 { stop(); removeMovieClip(this); } } movieClip 438 airSupportCollision { } movieClip 439 particle_dustShaft_bulletLarge { frame 2 { stop(); } } movieClip 440 particle_cloudDust_bulletLarge { frame 9 { stop(); } } movieClip 442 particle_dirt2_bulletLarge { } movieClip 444 damageReport { } movieClip 446 { } movieClip 449 { frame 1 { stop(); } } movieClip 460 { frame 1 { stop(); } } movieClip 471 { frame 1 { stop(); } } movieClip 479 { } movieClip 481 { } movieClip 483 { frame 1 { stop(); } instance of movieClip 479 { onClipEvent (load) { this.gotoAndStop(random(10) + 1); } } instance bloodSplat of movieClip 481 { onClipEvent (load) { this._visible = false; } } } movieClip 489 { frame 1 { stop(); } } movieClip 492 { } movieClip 494 { } movieClip 496 { } movieClip 498 { } movieClip 500 { } movieClip 501 { frame 1 { stop(); } instance of movieClip 489 { onClipEvent (load) { this.gotoAndStop(random(4) + 1); } } instance of movieClip 492 { onClipEvent (load) { this.gotoAndStop(random(4) + 1); } } instance of movieClip 489 { onClipEvent (load) { this.gotoAndStop(random(4) + 1); } } instance of movieClip 489 { onClipEvent (load) { this.gotoAndStop(random(4) + 1); } } } movieClip 512 { frame 1 { stop(); } } movieClip 526 { frame 1 { stop(); } } movieClip 528 { frame 1 { stop(); } } movieClip 535 { } movieClip 537 { frame 1 { stop(); } } movieClip 545 { frame 1 { stop(); } instance of movieClip 528 { onClipEvent (load) { this.gotoAndStop(random(2) + 1); } } instance bloodSplat of movieClip 481 { onClipEvent (load) { this._visible = false; } } instance of movieClip 537 { onClipEvent (load) { this.gotoAndStop(random(2) + 1); } } } movieClip 548 { } movieClip 554 { frame 1 { stop(); } } movieClip 555 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } instance of movieClip 554 { onClipEvent (load) { this.gotoAndStop(random(5) + 1); } } } movieClip 562 { } movieClip 564 { } movieClip 566 { } movieClip 568 { } movieClip 570 { frame 41 { stop(); } } movieClip 571 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } } movieClip 573 { } movieClip 574 { frame 17 { stop(); } } movieClip 575 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } } movieClip 576 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } } movieClip 578 { } movieClip 582 { } movieClip 584 { } movieClip 586 { } movieClip 588 { } movieClip 591 { } movieClip 593 { } movieClip 594 { frame 1 { stop(); } } movieClip 596 { } movieClip 598 { } movieClip 600 { } movieClip 601 { } movieClip 604 { } movieClip 606 { } movieClip 608 { } movieClip 610 { } movieClip 611 { frame 1 { stop(); } } movieClip 643 { frame 4 { stop(); } } movieClip 644 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } instance of movieClip 643 { onClipEvent (load) { this._visible = false; if (random(2) == 0) { this._visible = true; this._xscale = random(90) + 130; this._rotation += random(4) - 2; } } } } movieClip 647 { frame 4 { stop(); } } movieClip 648 { frame 1 { stop(); } instance of movieClip 548 { onClipEvent (load) { this._visible = false; } } instance of movieClip 647 { onClipEvent (load) { this._visible = false; if (random(2) == 0) { this._visible = true; this._xscale = random(90) + 130; this._rotation += random(4) - 2; } } } } movieClip 649 { frame 32 { stop(); } } movieClip 655 { } movieClip 666 soldier { instance selectedRing of movieClip 596 { onClipEvent (load) { this._visible = false; } } instance collision of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } instance backing of movieClip 23 blankBlock { onClipEvent (load) { this._alpha = 0; } } instance healthBar of movieClip 601 { onClipEvent (load) { this._visible = false; } } frame 19 { this.animating = true; play(); } frame 34 { if (_root.game.state != 'endBattle') { if (this.alive == true && this.changingToFire == false && this.enteringTrench == false) { gotoAndPlay('rifle_run'); } else { stop(); this.moveAnim = false; } } } frame 36 { this.animating = true; this.changingToMove = true; play(); } frame 61 { this.animating = false; this.position = 'standing'; this.changingToMove = false; this.inMovingPosition = true; this.inFiringPosition = false; this.changingToFire = false; this.moveAnim = false; this.exitedTrench = true; } frame 63 { stop(); } frame 68 { play(); this.animating = true; } frame 89 { gotoAndPlay('victoryStandingLoop'); } frame 91 { play(); this.animating = true; } frame 109 { this.animating = false; stop(); } frame 113 { this.animating = true; this.moveAnim = false; this.inMovingPosition = false; this.changingToFire = true; this.changingToMove = false; play(); } frame 128 { this.animating = false; this.position = 'prone'; this.inFiringPosition = true; this.changingToFire = false; this.animating = false; stop(); } frame 131 { this.animating = true; this.changingToMove = true; play(); } frame 160 { this.animating = false; this.position = 'standing'; this.inMovingPosition = true; this.changingToMove = false; stop(); } frame 162 { play(); } frame 218 { this.suppressed = false; this.firing = false; this.animating = false; gotoAndPlay('recoverSuppressed_crouch'); } frame 231 { play(); this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 298 { this.firing = false; this.animating = false; stop(); } frame 301 { play(); this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 313 { this.firing = false; this.animating = false; stop(); } frame 334 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 337 { this.firing = false; this.animating = false; stop(); } frame 348 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 351 { this.firing = false; this.animating = false; stop(); } frame 368 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 438 { this.firing = false; this.animating = false; stop(); } frame 439 { this.animating = true; } instance rangeFinder of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } frame 455 { stop(); this.animating = false; } frame 457 { this.animating = true; this.moveAnim = false; this.inMovingPosition = false; this.changingToFire = true; play(); } frame 470 { stop(); this.animating = false; this.position = 'crouch'; this.inFiringPosition = true; this.changingToFire = false; } frame 472 { this.animating = true; this.moveAnim = false; this.inMovingPosition = false; this._xscale = -this._xscale; } frame 486 { weapon.gotoAndStop(this.team + 'Wounded'); _root.removeWounded(this); this.carryingPatient = true; this.inMovingPosition = true; this.squadObjRef.state = 'moving'; stop(); } frame 492 { play(); this.animating = true; this.moveAnim = false; this.inMovingPosition = false; this.changingToFire = true; this.changingToMove = false; } frame 501 { this.animating = false; this.position = 'crouch'; this.inFiringPosition = true; this.changingToFire = false; stop(); } frame 513 { this.animating = true; this.changingToMove = true; play(); } frame 521 { this.position = 'standing'; this.animating = false; this.inMovingPosition = true; this.changingToMove = false; stop(); } frame 529 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 610 { this.firing = false; this.animating = false; stop(); } frame 611 { this.animating = true; this.firing = true; this.moveAnim = false; } frame 625 { _root.playSound('sound_bazookaFire' + (random(2) + 1)); } frame 634 { _root.bazookaFire(this); weapon.muzzleFlash.play(); weapon.muzzleFlashRear.play(); } frame 701 { this.firing = false; this.animating = false; stop(); } frame 703 { this.animating = true; this.firing = true; this.moveAnim = false; } frame 829 { var mortarTarget = this.squadObjRef.enemyTarget.members[0]; weapon.muzzleFlash.play(); --this.specialRoundCount; if (this.specialRoundCount < 0) { this.squadObjRef.firingSmoke = false; this.mortarType = 'mortar'; } if (this.specialRoundCount >= 0) { _root.launchSpecialAttack('smoke', this.specialTargetX, this.specialTargetY, this.squadObjRef.team, this); } else { _root.launchSpecialAttack('mortar', mortarTarget._x, mortarTarget._y, this.squadObjRef.team, this); } } frame 905 { this.firing = false; this.animating = false; stop(); if (this.squadObjRef.firingSmoke == true) { gotoAndPlay('mortar_fire_crouch'); } } frame 913 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 929 { this.firing = false; this.animating = false; stop(); } frame 957 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 960 { this.firing = false; this.animating = false; stop(); } frame 970 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 972 { this.firing = false; this.animating = false; stop(); } frame 989 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1064 { this.firing = false; this.animating = false; stop(); } frame 1065 { this.animating = true; play(); } instance rangeFinder of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } instance of movieClip 649 { onClipEvent (load) { this._y += random(10) - 5; } } frame 1097 { stop(); this.animating = false; } frame 1098 { play(); this.animating = true; this.moveAnim = false; this.inMovingPosition = false; this.changingToFire = true; this.changingToMove = false; } frame 1103 { this.position = 'standing'; this.animating = false; this.inFiringPosition = true; this.changingToFire = false; stop(); } frame 1117 { stop(); } frame 1127 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); play(); } frame 1195 { this.firing = false; this.animating = false; stop(); } frame 1197 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1222 { this.firing = false; this.animating = false; stop(); } frame 1253 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1256 { this.firing = false; this.animating = false; stop(); } frame 1272 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1304 { this.firing = false; this.animating = false; stop(); } frame 1308 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1311 { this.firing = false; this.animating = false; stop(); } frame 1331 { this.animating = true; this.firing = true; this.moveAnim = false; weapon.muzzleFlash.play(); tracer.play(); } frame 1398 { this.firing = false; this.animating = false; stop(); } frame 1399 { this.animating = true; this.changingToMove = true; play(); } frame 1404 { this.position = 'standing'; this.animating = false; this.inMovingPosition = true; this.changingToMove = false; stop(); } frame 1416 { this.animating = true; this.throwingGrenade = true; this.firing = true; play(); } frame 1436 { var rpTeam = ''; if (this.grenType != 'smokeGrenade') { _root.throwGrenade(this.grenType, this.squadObjRef.enemyTarget, this, this.team); } else { _root.throwSmokeGrenade(this.grenType, this.grenTargetX, this.grenTargetY, this, this.team); } this.grenType = 'handGrenade'; if (this.team == _root.playerTeam.team) { rpTeam = 'player'; } else { rpTeam = 'enemy'; } _root.adjustRP('remove', 50, rpTeam); } frame 1457 { this.throwingGrenade = false; this.animating = false; this.firing = false; gotoAndPlay('rifle_fire_standing'); } frame 1463 { this.animating = true; play(); } instance helmet of movieClip 501 { onClipEvent (load) { this._visible = false; } } instance weapon of movieClip 594 { onClipEvent (load) { this._visible = false; } } instance rangeFinder of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } frame 1508 { stop(); this.animating = false; this.cacheAsBitmap = true; } frame 1510 { this.animating = true; play(); } frame 1670 { stop(); this.cacheAsBitmap = true; } frame 1676 { this.animating = true; play(); } instance of movieClip 649 { onClipEvent (load) { this._y += random(20) - 10; } } frame 1701 { stop(); this.animating = false; this.cacheAsBitmap = true; } frame 1704 { this.animating = true; play(); } instance helmet of movieClip 501 { onClipEvent (load) { this._visible = false; } } instance weapon of movieClip 594 { onClipEvent (load) { this._visible = false; } } frame 1715 { stop(); this.animating = false; this.cacheAsBitmap = true; } } movieClip 669 decal_artilleryScorch { } movieClip 672 xpIcon { } movieClip 677 { } movieClip 680 { } movieClip 686 { } movieClip 691 { frame 6 { stop(); } } movieClip 692 { frame 1 { _root.playSound('sound_tankExplosion'); _root.playSound('sound_tankExplosion_indivExplosion'); } frame 10 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 26 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 53 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 78 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 93 { stop(); } } movieClip 693 { frame 1 { stop(); } } movieClip 695 { } movieClip 696 { frame 1 { stop(); } frame 7 { _parent._parent.firingSecondary = true; _parent.tracer.play(); } frame 10 { _parent._parent.firingSecondary = false; } } movieClip 700 { frame 1 { stop(); } frame 7 { _parent._parent.firing = true; } frame 103 { _parent._parent.firing = false; } } movieClip 711 { frame 1 { this.state = 'straight'; stop(); } frame 7 { this._parent.movingTurret = true; } frame 18 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 19 { this._parent.movingTurret = true; } frame 34 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 35 { this._parent.movingTurret = true; } frame 58 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 59 { this._parent.movingTurret = true; } frame 82 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 83 { this._parent.movingTurret = true; } frame 98 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 99 { this._parent.movingTurret = true; } frame 110 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } } movieClip 718 { frame 1 { stop(); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } } movieClip 869 { } movieClip 870 { frame 1 { stop(); } } movieClip 871 { instance fireAnim3 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 20; this._xscale = random(60) + 70; this._yscale = random(60) + 70; } } instance fireAnim1 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 20; this._xscale = random(60) + 70; this._yscale = random(60) + 70; } } } movieClip 876 { } movieClip 879 { } movieClip 882 { } movieClip 887 { frame 5 { stop(); } } movieClip 888 { frame 1 { stop(); } frame 4 { stop(); } } movieClip 910 { frame 1 { this.state = 'straight'; stop(); } frame 7 { this._parent.movingTurret = true; } frame 18 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 19 { this._parent.movingTurret = true; } frame 34 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 35 { this._parent.movingTurret = true; } frame 58 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 59 { this._parent.movingTurret = true; } frame 82 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 83 { this._parent.movingTurret = true; } frame 98 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 99 { this._parent.movingTurret = true; } frame 110 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } } movieClip 912 { instance fireAnim3 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 20; this._xscale = random(60) + 70; this._yscale = random(60) + 70; } } instance fireAnim2 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 20; this._xscale = random(60) + 70; this._yscale = random(60) + 70; } } } movieClip 913 tank { frame 1 { stop(); this.animating = false; } instance collision of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } instance healthBar of movieClip 601 { onClipEvent (load) { this._visible = false; } } instance damageClip of movieClip 871 { onClipEvent (load) { this._visible = false; } } frame 18 { this.animating = false; } instance damageClip of movieClip 912 { onClipEvent (load) { this._visible = false; } } } movieClip 916 interface_groundTarget { } movieClip 919 { frame 1 { _root.playSound('sound_tankExplosion'); _root.playSound('sound_tankExplosion_indivExplosion'); } frame 10 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 26 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 53 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 78 { _root.playSound('sound_tankExplosion_indivExplosion'); } frame 93 { stop(); } } movieClip 920 { frame 1 { stop(); } } movieClip 922 { } movieClip 923 { frame 1 { stop(); } frame 7 { _parent._parent.firingSecondary = true; _parent.tracer.play(); } frame 10 { _parent._parent.firingSecondary = false; } } movieClip 924 { frame 1 { this.state = 'straight'; stop(); } frame 7 { this._parent.movingTurret = true; } frame 40 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 41 { this._parent.movingTurret = true; } frame 74 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 75 { this._parent.movingTurret = true; } frame 113 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'up'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 114 { this._parent.movingTurret = true; } frame 153 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'down'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 154 { this._parent.movingTurret = true; } frame 187 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } frame 188 { this._parent.movingTurret = true; } frame 220 { this._parent.turretInPosition = true; this._parent.movingTurret = false; this.state = 'straight'; this._parent.firing = false; this._parent.firingSecondary = false; stop(); } } movieClip 928 { instance fireAnim2 of movieClip 870 { onClipEvent (load) { this._xscale = random(90) + 70; this._yscale = random(90) + 70; } } instance fireAnim3 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 30; this._xscale = random(60) + 90; this._yscale = random(60) + 90; } } instance fireAnim1 of movieClip 870 { onClipEvent (load) { this._x += random(60) - 20; this._xscale = random(90) + 70; this._yscale = random(90) + 70; } } } movieClip 929 bunker { frame 1 { stop(); this.animating = false; } instance collision of movieClip 23 blankBlock { onClipEvent (load) { this._visible = false; } } instance healthBar of movieClip 601 { onClipEvent (load) { this._visible = false; } } instance damageClip of movieClip 928 { onClipEvent (load) { this._visible = false; } } } movieClip 932 { } movieClip 935 { } movieClip 937 { } movieClip 939 { } movieClip 940 { } movieClip 941 { } movieClip 944 { instance continueCampaign of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance newCampaign of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance playWarfare1917 of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance playMoreGames of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance howToPlay of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance skirmish of movieClip 940 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance credits of movieClip 941 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } instance options of movieClip 941 { onClipEvent (load) { _root.buttonSetup_mainMenu(this._name); } } } movieClip 946 { } movieClip 947 { } movieClip 954 { } movieClip 955 { } movieClip 957 { } movieClip 958 { instance low of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance medium of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance high of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance effectsOff of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance effectsOn of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance musicOff of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance musicOn of movieClip 947 { onClipEvent (load) { _root.buttonSetup_options(this._name); } } instance backButton of movieClip 957 { onClipEvent (load) { _root.buttonSetup_optionsBack(this._name); } } } movieClip 963 { } movieClip 966 { } movieClip 967 { } movieClip 968 { } movieClip 971 { } movieClip 974 { } movieClip 975 { frame 1 { stop(); } } movieClip 978 { } // unknown tag 88 length 76 movieClip 984 { frame 1 { stop(); } } movieClip 987 { } movieClip 990 { } movieClip 991 { } movieClip 992 { instance british of movieClip 967 { onClipEvent (load) { _root.buttonSetup_campaignSelect(this._name); } } instance german of movieClip 975 { onClipEvent (load) { _root.buttonSetup_campaignSelect(this._name); } } } movieClip 995 { } movieClip 996 { } movieClip 998 { } movieClip 999 { frame 1 { stop(); } } movieClip 1001 { } movieClip 1002 { } movieClip 1004 { } movieClip 1005 { } movieClip 1007 { } movieClip 1008 { } movieClip 1010 { } movieClip 1011 { } movieClip 1013 { } movieClip 1014 { } movieClip 1016 { } movieClip 1017 { } movieClip 1019 { } movieClip 1020 { } movieClip 1022 { } movieClip 1023 { } movieClip 1025 { } movieClip 1026 { } movieClip 1028 { } movieClip 1029 { } movieClip 1032 { } movieClip 1035 { } movieClip 1036 { } movieClip 1039 { } movieClip 1040 { } movieClip 1041 { } movieClip 1042 { } movieClip 1043 { } movieClip 1044 { } movieClip 1045 { } movieClip 1046 { } movieClip 1047 { } movieClip 1048 { } movieClip 1049 { } // unknown tag 88 length 105 movieClip 1054 { } movieClip 1058 { } movieClip 1061 { } movieClip 1063 { } movieClip 1065 { } movieClip 1068 { } movieClip 1071 { instance launch of movieClip 1054 { onClipEvent (load) { _root.buttonSetup_mapScreen(this._name); } } instance upgrades of movieClip 1058 { onClipEvent (load) { _root.buttonSetup_mapScreen(this._name); } } instance backToMainButt of movieClip 1065 { onClipEvent (load) { _root.buttonSetup_mapScreen(this._name); } } } movieClip 1085 { instance backButton of movieClip 957 { onClipEvent (load) { this.buttonText.text = 'CLOSE'; this.onRollOver = function () { _root.playRollOverSound(); }; this.onRelease = function () { _root.playClickSound(); _root.hideCredits(); }; } } } movieClip 1088 { instance backButton of movieClip 957 { onClipEvent (load) { this.buttonText.text = 'CLOSE'; this.onRollOver = function () { _root.playRollOverSound(); }; this.onRelease = function () { _root.playClickSound(); _root.hideInstructions(); }; } } instance of movieClip 23 blankBlock { onClipEvent (load) { this.buttonText.text = 'WATCH TUTORIAL'; this.onRollOver = function () { _root.playRollOverSound(); }; this.onRelease = function () { _root.playClickSound(); _root.fromInstructions = true; _root.loadTutorial(); }; } } } movieClip 1097 { } movieClip 1098 { } movieClip 1101 { } movieClip 1116 { frame 11 { stop(); } } movieClip 1121 { } movieClip 1138 { frame 11 { stop(); } } movieClip 1141 { frame 1 { stop(); } instance of movieClip 1101 { onClipEvent (load) { this.buttonText.text = 'SKIP'; this.onRelease = function () { _parent.stop(); _root.hideTutorial(); }; } } frame 1989 { stop(); _root.hideTutorial(); } } movieClip 1146 { } movieClip 1150 { } movieClip 1151 { } movieClip 1154 { } movieClip 1155 { } // unknown tag 88 length 118 // unknown tag 88 length 62 movieClip 1208 { instance backToMainButt of movieClip 1146 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance launch of movieClip 1054 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance british of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance german of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance easy of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance medium of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance hard of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance riflemen of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance assault of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance machineGun of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance sniper of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance officer of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance bazooka of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance mortarTeam of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance tank of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance AI_aggressive of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance AI_defensive of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance AI_balanced of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_1 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_2 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_3 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance allUnits of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_4 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_5 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_6 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_9 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_8 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance map_skirmish_7 of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance grenade of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance smokeGrenade of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance airSupport of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance artillery of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance allSupport of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance rp_plus of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance rp_minus of movieClip 1155 { onClipEvent (load) { _root.buttonSetup_skirmish(this._name); } } instance of movieClip 1146 { onClipEvent (load) { this.onRelease = function () { _root.skirmishToMainMenu(); }; } } } movieClip 1209 { frame 97 { stop(); removeMovieClip(this); } } movieClip 1210 menu { instance bg of movieClip 932 { onClipEvent (load) { this.useHandCursor = false; this.onRelease = function () {}; } } instance options of movieClip 958 { onClipEvent (load) { this._visible = false; } } instance teamSelect of movieClip 992 { onClipEvent (load) { this._visible = false; } } instance credits of movieClip 1085 { onClipEvent (load) { this._visible = false; } } instance instructions of movieClip 1088 { onClipEvent (load) { this._visible = false; } } } movieClip 1213 { } movieClip 1214 dialogBox { instance blackOut of movieClip 23 blankBlock { onClipEvent (load) { this.onRelease = function () {}; this.useHandCursor = false; } } } movieClip 1219 { } movieClip 1222 { } movieClip 1226 { } movieClip 1229 { } movieClip 1230 { frame 1 { stop(); } } movieClip 1233 { } movieClip 1234 { frame 1 { stop(); } } movieClip 1237 { } movieClip 1238 { frame 1 { stop(); } } movieClip 1241 { } movieClip 1242 { frame 1 { stop(); } } movieClip 1245 { } movieClip 1246 { frame 1 { stop(); } } movieClip 1249 { } movieClip 1250 { frame 1 { stop(); } } movieClip 1253 { } movieClip 1254 { frame 1 { stop(); } } movieClip 1257 { } movieClip 1258 { frame 1 { stop(); } } movieClip 1261 { } movieClip 1262 { frame 1 { stop(); } } movieClip 1265 { } movieClip 1266 { frame 1 { stop(); } } movieClip 1269 { } movieClip 1272 { } movieClip 1273 { frame 1 { stop(); } } movieClip 1276 { } movieClip 1277 { frame 1 { stop(); } } movieClip 1280 { } movieClip 1281 { frame 1 { stop(); } } movieClip 1284 { } movieClip 1285 { frame 1 { stop(); } } movieClip 1288 { } movieClip 1289 { frame 1 { stop(); } } movieClip 1292 { } movieClip 1293 { frame 1 { stop(); } } movieClip 1296 { } movieClip 1297 { frame 1 { stop(); } } movieClip 1300 { } movieClip 1301 { frame 1 { stop(); } } movieClip 1304 { } movieClip 1305 { frame 1 { stop(); } } movieClip 1308 { } movieClip 1309 { frame 1 { stop(); } } movieClip 1312 { } movieClip 1313 { frame 1 { stop(); } } movieClip 1322 { } movieClip 1323 { } movieClip 1327 { } movieClip 1328 { frame 1 { stop(); } } movieClip 1331 { } movieClip 1332 { frame 1 { stop(); } } movieClip 1335 { } movieClip 1336 { frame 1 { stop(); } } movieClip 1339 { } movieClip 1340 { frame 1 { stop(); } } movieClip 1343 { } movieClip 1344 { frame 1 { stop(); } } movieClip 1347 { } movieClip 1348 { frame 1 { stop(); } } movieClip 1352 { } movieClip 1353 { frame 1 { stop(); } } movieClip 1356 { } movieClip 1357 { frame 1 { stop(); } } movieClip 1360 { } movieClip 1361 { frame 1 { stop(); } } movieClip 1364 { } movieClip 1365 { frame 1 { stop(); } } movieClip 1368 { } movieClip 1369 { frame 1 { stop(); } } movieClip 1372 { } movieClip 1373 { frame 1 { stop(); } } movieClip 1376 { } movieClip 1377 { frame 1 { stop(); } } movieClip 1378 upgrades { frame 1 { stop(); } instance backing of movieClip 23 blankBlock { onClipEvent (load) { this.onRelease = function () {}; this.useHandCursor = false; } } } movieClip 1396 { frame 1 { stop(); } } movieClip 1411 { frame 1 { stop(); } } movieClip 1412 { frame 1 { stop(); } } movieClip 1416 { } movieClip 1417 unlockDialog { instance blackOut of movieClip 23 blankBlock { onClipEvent (load) { this.onRelease = function () {}; this.useHandCursor = false; } } instance mainButton of movieClip 957 { onClipEvent (load) { _root.unlockInterfaceButton(this._name); } } } // unknown tag 88 length 106 movieClip 1422 { } movieClip 1424 { } movieClip 1426 { } movieClip 1429 inGameMenu { instance backing of movieClip 23 blankBlock { onClipEvent (load) { this.onRelease = function () {}; this.useHandCursor = false; } } instance close of movieClip 1422 { onClipEvent (load) { this.buttonText.text = 'CLOSE'; _root.buttonSetup_inGameMenu(this._name); } } instance low of movieClip 1424 { onClipEvent (load) { this.buttonText.text = 'LOW'; _root.buttonSetup_inGameMenu(this._name); } } instance medium of movieClip 1424 { onClipEvent (load) { this.buttonText.text = 'MED'; _root.buttonSetup_inGameMenu(this._name); } } instance high of movieClip 1424 { onClipEvent (load) { this.buttonText.text = 'HIGH'; _root.buttonSetup_inGameMenu(this._name); } } instance sound_on of movieClip 1424 { onClipEvent (load) { this.buttonText.text = 'ON'; _root.buttonSetup_inGameMenu(this._name); } } instance sound_off of movieClip 1424 { onClipEvent (load) { this.buttonText.text = 'OFF'; _root.buttonSetup_inGameMenu(this._name); } } instance quitToMenu of movieClip 1426 { onClipEvent (load) { this.buttonText.text = 'QUIT TO MAIN MENU'; _root.buttonSetup_inGameMenu(this._name); } } instance quitBattle of movieClip 1426 { onClipEvent (load) { this.buttonText.text = 'QUIT BATTLE'; _root.buttonSetup_inGameMenu(this._name); } } } movieClip 1432 { } movieClip 1433 gameCursor { frame 1 { stop(); } } movieClip 1438 { frame 1 { stop(); } } movieClip 1462 { } movieClip 1471 { } movieClip 1514 { instance of movieClip 1471 { onClipEvent (load) { this.buttonText.text = 'PLAY MORE GAMES'; this.onRelease = function () { getURL('http://armorgames.com', '_blank'); }; } } instance of movieClip 1471 { 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 movieClip 1471 { onClipEvent (load) { this.buttonText.text = 'PLAY WARFARE 1917'; this.onRelease = function () { getURL('http://armorgames.com/play/2267/warfare-1917', '_blank'); }; } } } // unknown tag 88 length 73 movieClip 1521 { } movieClip 1526 { instance viewStats of movieClip 1471 { 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; }); }; } } } movieClip 1527 { instance of movieClip 1526 { onClipEvent (load) { this._alpha = 0; this.alphaTo(100, 0.5, 'linear', 4); } } frame 79 { stop(); } } movieClip 1528 loadScreen { frame 1 { stop(); } instance bg of movieClip 1438 { onClipEvent (load) { this.onRollOver = function () { this.useHandCursor = false; }; } } instance campaignStats of movieClip 1514 { onClipEvent (load) { this._visible = false; } } } movieClip 1531 { } // unknown tag 88 length 118 movieClip 1536 { } movieClip 1539 { } movieClip 1542 { } movieClip 1545 { } movieClip 1548 { } movieClip 1551 { } movieClip 1552 { frame 1 { stop(); } } movieClip 1555 { } movieClip 1558 { } movieClip 1560 { } movieClip 1561 { frame 1 { stop(); } } movieClip 1562 { } movieClip 1563 { } movieClip 1566 { } movieClip 1569 { frame 1 { stop(); } } movieClip 1570 { frame 1 { stop(); } } movieClip 1571 { frame 1 { stop(); } } movieClip 1572 trenchInterface { frame 1 { stop(); } } movieClip 1574 { } movieClip 1576 dialog_quickMessage { } movieClip 1579 { frame 1 { stop(); } } movieClip 1580 handGrenade { frame 1 { stop(); } instance of movieClip 1579 { onClipEvent (load) { if (_parent.ownerTeam == 'german') { this.gotoAndStop('stick'); } } } frame 2 { play(); } 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 *= 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'); } frame 46 { stop(); removeMovieClip(this); } frame 48 { play(); } 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 *= 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'); } frame 89 { stop(); removeMovieClip(this); } } movieClip 1581 grenadeStrikeCollision { } movieClip 1583 { } movieClip 1584 bazookaRound { } movieClip 1585 bazookaStrikeCollision { } movieClip 1586 bazookaStrike { frame 1 { this.attachMovie('bazookaStrikeCollision', '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, 'bazookaRound'); _root.explosiveHit(this, _root.playerTeam.team, this.ownerTeam, 'bazookaRound'); } instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 5 { stop(); removeMovieClip(this); } } movieClip 1588 { frame 1 { stop(); } } movieClip 1589 smokeGrenade { frame 1 { stop(); } instance of movieClip 1588 { onClipEvent (load) { if (_parent.ownerTeam == 'german') { this.gotoAndStop('stick'); } } } frame 2 { play(); } frame 41 { _root.smokeGrenadeRound(this._x, this._y, this.ownerTeam); } frame 46 { stop(); removeMovieClip(this); } frame 48 { play(); } frame 83 { _root.smokeGrenadeRound(this._x, this._y, this.ownerTeam); } frame 89 { stop(); removeMovieClip(this); } } movieClip 1590 smokeGrenadeAnim { instance of movieClip 406 { onClipEvent (load) { this._visible = false; } } frame 2 { ++_root.gasCollisions; 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); ++_root.gasCollisions; 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); stop(); } } movieClip 1595 { frame 1 { this.gotoAndStop(random(2) + 1); } } movieClip 1596 wireFence { } movieClip 1600 systemConsole { } movieClip 1603 { } movieClip 1604 { } movieClip 1608 { } movieClip 1611 { } movieClip 1612 { instance fullBlock of movieClip 1611 { onClipEvent (load) { this._visible = false; } } instance whiteOut of movieClip 1611 { } } movieClip 1617 { frame 1 { stop(); } } movieClip 1619 { } movieClip 1622 { } movieClip 1623 { frame 1 { stop(); } } movieClip 1626 { } movieClip 1627 { frame 1 { stop(); } } movieClip 1630 { } movieClip 1631 { frame 1 { stop(); } } movieClip 1634 { } movieClip 1635 { frame 1 { stop(); } } movieClip 1638 { } movieClip 1639 { frame 1 { stop(); } } movieClip 1640 { frame 1 { stop(); } } movieClip 1641 { } movieClip 1642 { frame 1 { stop(); } } movieClip 1643 { } movieClip 1644 { frame 1 { stop(); } } movieClip 1645 { frame 1 { stop(); } } movieClip 1646 { } movieClip 1647 { frame 1 { stop(); } } movieClip 1648 { } movieClip 1649 { frame 1 { stop(); } } movieClip 1650 { frame 1 { stop(); } } movieClip 1651 { } movieClip 1652 { frame 1 { stop(); } } movieClip 1653 { } movieClip 1654 { frame 1 { stop(); } } movieClip 1655 { frame 1 { stop(); } } movieClip 1656 { } movieClip 1657 { frame 1 { stop(); } } movieClip 1658 { } movieClip 1659 { frame 1 { stop(); } } movieClip 1660 { frame 1 { stop(); } } movieClip 1663 { } movieClip 1664 { frame 1 { stop(); } } movieClip 1665 { } movieClip 1666 { frame 1 { stop(); } } movieClip 1667 { } movieClip 1668 { frame 1 { stop(); } } movieClip 1669 { frame 1 { stop(); } } movieClip 1670 { } movieClip 1671 { frame 1 { stop(); } } movieClip 1672 { } movieClip 1673 { frame 1 { stop(); } } movieClip 1674 { frame 1 { stop(); } } movieClip 1675 { } movieClip 1676 { frame 1 { stop(); } } movieClip 1677 { } movieClip 1678 { frame 1 { stop(); } } movieClip 1679 { frame 1 { stop(); } } movieClip 1681 { } movieClip 1685 { } movieClip 1705 { frame 1 { stop(); } } movieClip 1709 { } movieClip 1710 { frame 1 { stop(); } } movieClip 1713 { } movieClip 1714 { } movieClip 1717 { } movieClip 1718 { } movieClip 1721 { } movieClip 1722 { } movieClip 1725 { } movieClip 1726 { } movieClip 1729 { } movieClip 1730 { } movieClip 1733 { } movieClip 1734 { } movieClip 1737 { } movieClip 1738 { } movieClip 1741 { } movieClip 1742 { } movieClip 1743 { frame 1 { stop(); } } movieClip 1744 { } movieClip 1745 { } movieClip 1746 { } movieClip 1748 { } movieClip 1749 { frame 1 { stop(); } } movieClip 1752 { } movieClip 1754 { frame 1 { stop(); } } movieClip 1757 { } movieClip 1763 { } movieClip 1764 { instance fullBlock of movieClip 1611 { onClipEvent (load) { this._visible = false; } } instance whiteOut of movieClip 1611 { } } movieClip 1765 { } movieClip 1767 { } movieClip 1768 { } movieClip 1769 floatingRP { } movieClip 1774 { } movieClip 1776 { } movieClip 1786 { } movieClip 1791 { } movieClip 1795 { } movieClip 1802 { frame 1 { stop(); } } movieClip 1803 { } movieClip 1804 hud { instance highlight_slot1 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot2 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot3 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot4 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot5 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot6 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot7 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance highlight_slot8 of movieClip 1611 { onClipEvent (load) { this._alpha = 0; } } instance slot1 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot2 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot3 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot4 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot5 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot6 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance supportSlot1 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup_fireSupport(this._name); } } instance supportSlot2 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup_fireSupport(this._name); } } instance supportSlot3 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup_fireSupport(this._name); } } instance supportSlot4 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup_fireSupport(this._name); } } instance slot7 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance slot8 of movieClip 1612 { onClipEvent (load) { _root.buttonSetup(this._name); } } instance menuButton of movieClip 1774 { onClipEvent (load) { _root.buttonSetup_hudMenuButton(this._name); } } instance progressBarToolTip of movieClip 1786 { onClipEvent (load) { this._visible = false; } } instance toolTip of movieClip 1791 { onClipEvent (load) { this._visible = false; this.onEnterFrame = function () { this._x = _root._xmouse; this._y = _root._ymouse - 40; }; } } } movieClip 1805 trench { instance mainTrenchButton of movieClip 1569 { onClipEvent (load) { this._visible = false; } } } movieClip 1808 { } movieClip 1809 { frame 1 { stop(); } frame 41 { gotoAndPlay(random(100) + 50); } } movieClip 1812 { } movieClip 1815 { } movieClip 1818 { } movieClip 1821 { } movieClip 1822 { instance flash1 of movieClip 1809 { onClipEvent (load) { this.gotoAndPlay(random(300)); } } instance flash1 of movieClip 1809 { onClipEvent (load) { this.gotoAndPlay(random(300)); } } instance flash1 of movieClip 1809 { onClipEvent (load) { this.gotoAndPlay(random(300)); } } } movieClip 1823 testMap { } movieClip 1849 { } movieClip 1862 { frame 1 { stop(); } } movieClip 1863 coverBlock { frame 1 { stop(); } instance of movieClip 1849 { onClipEvent (load) { this.gotoAndStop(random(2) + 1); } } instance of movieClip 1862 { onClipEvent (load) { this.gotoAndStop(random(2)); } } } movieClip 1865 { } movieClip 1866 rainDrop { } movieClip 1868 { } movieClip 1869 rainSplash { frame 5 { stop(); } } movieClip 1878 midGroundObjects { frame 1 { stop(); } } movieClip 1882 { } movieClip 1883 { } movieClip 1884 deployZoneHighlight { } movieClip 1886 specialAttackRange { } movieClip 1889 cursorSupport { } movieClip 1891 specialAttackRange_smokeGrenade { } movieClip 1893 { } movieClip 1895 { } movieClip 1896 saveAnim { frame 85 { stop(); removeMovieClip(this); } } movieClip 1902 { } movieClip 1903 map_british_8 { } movieClip 1907 midground_map_british_81 { } movieClip 1912 midground_map_british_82 { } movieClip 1916 midground_map_british_83 { } movieClip 1925 { } movieClip 1928 { } movieClip 1931 { } movieClip 1942 { } movieClip 1943 map_british_7 { } movieClip 1947 midground_map_british_71 { } movieClip 1950 midground_map_british_72 { } movieClip 1952 midground_map_british_73 { } movieClip 1956 { } movieClip 1959 { } movieClip 1962 { } movieClip 1965 { } movieClip 1968 { } movieClip 1975 { } movieClip 1978 { } movieClip 1979 map_british_6 { } movieClip 1981 midground_map_british_61 { } movieClip 1984 midground_map_british_62 { } movieClip 1986 midground_map_british_63 { } movieClip 1989 { } movieClip 1990 map_british_5 { } movieClip 1992 midground_map_british_53 { } movieClip 1994 midground_map_british_52 { } movieClip 1996 midground_map_british_51 { } movieClip 1998 { } movieClip 1999 map_british_4 { } movieClip 2002 midground_map_british_41 { } movieClip 2004 midground_map_british_42 { } movieClip 2006 midground_map_british_43 { } movieClip 2010 { } movieClip 2015 { } movieClip 2016 { } movieClip 2017 map_british_3 { } movieClip 2019 midground_map_british_31 { } movieClip 2021 midground_map_british_32 { } movieClip 2026 { } movieClip 2027 map_british_2 { } movieClip 2030 midground_map_british_21 { } movieClip 2032 midground_map_british_22 { } movieClip 2038 { } movieClip 2039 { } movieClip 2040 map_british_1 { } movieClip 2042 midground_map_british_11 { } movieClip 2044 midground_map_british_12 { } movieClip 2045 midground_map_british_13 { } movieClip 2047 { } movieClip 2050 map_german_8 { } movieClip 2053 midground_map_german_81 { } movieClip 2055 midground_map_german_82 { } movieClip 2058 { } movieClip 2060 { } movieClip 2062 midground_map_german_83 { } movieClip 2064 { } movieClip 2066 map_german_7 { } movieClip 2068 midground_map_german_71 { } movieClip 2070 midground_map_german_72 { } movieClip 2072 midground_map_german_73 { } movieClip 2076 { } movieClip 2078 { } movieClip 2079 map_german_6 { } movieClip 2081 midground_map_german_61 { } movieClip 2083 midground_map_german_62 { } movieClip 2085 midground_map_german_63 { } movieClip 2087 { } movieClip 2088 map_german_5 { } movieClip 2092 midground_map_german_51 { } movieClip 2095 midground_map_german_52 { } movieClip 2097 midground_map_german_53 { } movieClip 2099 { } movieClip 2100 map_german_4 { } movieClip 2102 midground_map_german_41 { } movieClip 2104 midground_map_german_42 { } movieClip 2106 midground_map_german_43 { } movieClip 2108 { } movieClip 2109 map_german_2 { } movieClip 2111 { } movieClip 2112 map_german_3 { } movieClip 2114 midground_map_german_31 { } movieClip 2116 midground_map_german_32 { } movieClip 2118 midground_map_german_33 { } movieClip 2120 midground_map_german_21 { } movieClip 2122 midground_map_german_22 { } movieClip 2124 midground_map_german_23 { } movieClip 2128 { } movieClip 2129 map_german_1 { } movieClip 2131 midground_map_german_11 { } movieClip 2133 midground_map_german_12 { } movieClip 2135 midground_map_german_13 { } movieClip 2136 { } movieClip 2137 map_skirmish_1 { } movieClip 2138 midground_map_skirmish_11 { } movieClip 2139 midground_map_skirmish_12 { } movieClip 2140 midground_map_skirmish_13 { } movieClip 2141 { } movieClip 2142 map_skirmish_2 { } movieClip 2143 midground_map_skirmish_21 { } movieClip 2144 midground_map_skirmish_22 { } movieClip 2145 midground_map_skirmish_23 { } movieClip 2146 { } movieClip 2147 map_skirmish_3 { } movieClip 2148 midground_map_skirmish_31 { } movieClip 2149 midground_map_skirmish_32 { } movieClip 2150 midground_map_skirmish_33 { } movieClip 2151 { } movieClip 2152 map_skirmish_4 { } movieClip 2153 midground_map_skirmish_41 { } movieClip 2154 midground_map_skirmish_42 { } movieClip 2155 midground_map_skirmish_43 { } movieClip 2157 { } movieClip 2158 map_skirmish_5 { } movieClip 2159 midground_map_skirmish_51 { } movieClip 2160 midground_map_skirmish_52 { } movieClip 2161 midground_map_skirmish_53 { } movieClip 2163 { } movieClip 2164 map_skirmish_6 { } movieClip 2165 midground_map_skirmish_61 { } movieClip 2166 midground_map_skirmish_62 { } movieClip 2167 midground_map_skirmish_63 { } movieClip 2168 { } movieClip 2169 map_skirmish_7 { } movieClip 2170 midground_map_skirmish_71 { } movieClip 2171 midground_map_skirmish_72 { } movieClip 2172 midground_map_skirmish_73 { } movieClip 2173 { } movieClip 2174 map_skirmish_8 { } movieClip 2178 midground_map_skirmish_81 { } movieClip 2182 midground_map_skirmish_82 { } movieClip 2183 midground_map_skirmish_83 { } movieClip 2187 { } movieClip 2188 map_skirmish_9 { } movieClip 2190 midground_map_skirmish_91 { } movieClip 2192 midground_map_skirmish_92 { } movieClip 2194 midground_map_skirmish_93 { } movieClip 2202 { frame 1 { stop(); } frame 2 { play(); } frame 11 { gotoAndPlay('loop'); } } movieClip 2205 { frame 1 { stop(); } } movieClip 2208 { } movieClip 2209 aircraft_british { instance of movieClip 1889 cursorSupport { } frame 120 { _root.playSound('sound_aircraft'); } frame 210 { aircraft.muzzleFlash.gotoAndPlay('loop'); _root.playSound('sound_aircraftGuns'); } frame 259 { aircraft.muzzleFlash.gotoAndStop('off'); } frame 299 { removeMovieClip(this); } } movieClip 2212 tankTraps { frame 1 { stop(); } } movieClip 2213 { frame 1 { stop(); } instance of movieClip 387 particle_dustShaft_mortar { onClipEvent (load) { if (random(2) > 0) { this._xscale = -100; } } } instance of movieClip 403 particle_dustShaft_bullet { onClipEvent (load) { if (random(2) > 0) { this._xscale = -100; } } } instance of movieClip 420 particle_dustShaft_grenade { onClipEvent (load) { if (random(2) > 0) { this._xscale = -100; } } } } movieClip 2216 fpsChecker { } frame 6 { function showSavingGameIcon(upgrades) { _root.attachMovie('saveAnim', 'saveAnim', depth_saveAnim); saveAnim._yscale = 70; saveAnim._xscale = 70; saveAnim._alpha = 70; saveAnim._x = 386; saveAnim._y = 460; if (upgrades == true) { saveAnim._alpha = 0; } } 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(upgrades) { saveGameData.data.difficulty = difficulty; 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_mortarTeamDeployed = career_mortarTeamDeployed; saveGameData.data.career_bazookaDeployed = career_bazookaDeployed; saveGameData.data.career_tankDeployed = career_tankDeployed; if (saveGameData.data.gameName != undefined) { showSavingGameIcon(upgrades); } } function loadGameInfo() { playerTeam.team = saveGameData.data.teamName; compTeam.team = saveGameData.data.enemyTeamName; currentMapName = saveGameData.data.currentMapName; currentMap = _root[currentMapName]; difficulty = saveGameData.data.difficulty; if (saveGameData.data.difficulty == undefined) { difficulty = 'regular'; } } function loadGame() { difficulty = saveGameData.data.difficulty; 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; career_mortarTeamDeployed = saveGameData.data.career_mortarTeamDeployed; career_bazookaDeployed = saveGameData.data.career_bazookaDeployed; } 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.button3._alpha = 0; dialogBox.button1._visible = false; dialogBox.button2._visible = false; dialogBox.button3._visible = false; 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 += 40; } if (contents.button1Active == true && contents.button2Active != true && contents.button3Active != true) { dialogBox.button1.buttonText.text = contents.button1Desc; dialogBox.button1._y = dialogBox.backing._height - 45; dialogBox.button1._visible = true; 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 && contents.button3Active != true) { dialogBox.button1.buttonText.text = contents.button1Desc; dialogBox.button2.buttonText.text = contents.button2Desc; dialogBox.button1._x = -50; dialogBox.button2._x = 50; dialogBox.button2._y = dialogBox.backing._height - 45; dialogBox.button1._y = dialogBox.button2._y; dialogBox.button1._visible = true; dialogBox.button2._visible = true; 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; } if (contents.button1Active == true && contents.button2Active == true && contents.button3Active == true) { dialogBox.backing._height = 150; dialogBox.button1.buttonText.text = contents.button1Desc; dialogBox.button2.buttonText.text = contents.button2Desc; dialogBox.button3.buttonText.text = contents.button3Desc; dialogBox.button1._visible = true; dialogBox.button2._visible = true; dialogBox.button3._visible = true; dialogBox.button3._y = dialogBox.backing._height - 40; dialogBox.button2._y = dialogBox.backing._height - 75; dialogBox.button1._y = dialogBox.backing._height - 110; dialogBox.button1.alphaTo(100, 0.6, 'easeOutSine', 0.4); dialogBox.button2.alphaTo(100, 0.6, 'easeOutSine', 0.4); dialogBox.button3.alphaTo(100, 0.6, 'easeOutSine', 0.4); dialogBox.button1.onRelease = contents.button1Action; dialogBox.button2.onRelease = contents.button2Action; dialogBox.button3.onRelease = contents.button3Action; dialogBox.button1.onRollOver = playRollOverSound; dialogBox.button2.onRollOver = playRollOverSound; dialogBox.button3.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_selectDifficulty = new Object(); dialog_selectDifficulty.heading = 'SELECT DIFFICULTY'; dialog_selectDifficulty.body = 'What kind of commander are you?'; dialog_selectDifficulty.button1Active = true; dialog_selectDifficulty.button2Active = true; dialog_selectDifficulty.button3Active = true; dialog_selectDifficulty.button1Desc = 'RECRUIT'; dialog_selectDifficulty.button2Desc = 'REGULAR'; dialog_selectDifficulty.button3Desc = 'HARDENED'; dialog_selectDifficulty.button1Action = function () { _root.menu.teamSelect.alphaTo(0, 0.4, 'easeOutSine', 0, function () { this._visible = false; }); _root.difficulty = 'recruit'; playClickSound(); loadMapScreen(); closeDialogBox(); }; dialog_selectDifficulty.button2Action = function () { _root.menu.teamSelect.alphaTo(0, 0.4, 'easeOutSine', 0, function () { this._visible = false; }); _root.difficulty = 'regular'; playClickSound(); loadMapScreen(); closeDialogBox(); }; dialog_selectDifficulty.button3Action = function () { _root.menu.teamSelect.alphaTo(0, 0.4, 'easeOutSine', 0, function () { this._visible = false; }); _root.difficulty = 'hardened'; playClickSound(); loadMapScreen(); closeDialogBox(); }; dialog_startNewCampaign = new Object(); dialog_startNewCampaign.heading = 'START A NEW CAMPAIGN?'; if (saveGameData.data.teamName == 'british') { dialog_startNewCampaign.body = 'Starting a new campaign will overwrite\ryour previous save game:\r\rU.S FORCES CAMPAIGN - MISSION ' + saveGameData.data.missionNumber + '\ron ' + saveGameData.data.difficulty.toUpperCase() + '\r\rAre you sure?'; } else { dialog_startNewCampaign.body = 'Starting a new campaign will overwrite\ryour previous save game:\r\r' + saveGameData.data.teamName.toUpperCase() + ' CAMPAIGN - MISSION ' + saveGameData.data.missionNumber + '\ron ' + saveGameData.data.difficulty.toUpperCase() + '\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?'; if (saveGameData.data.teamName == 'british') { dialog_continueCampaign.body = 'Continue playing:\r\rU.S FORCES CAMPAIGN - MISSION ' + saveGameData.data.missionNumber + '\ron ' + saveGameData.data.difficulty.toUpperCase() + '\r\rAre you sure?'; } else { dialog_continueCampaign.body = 'Continue playing:\r\r' + saveGameData.data.teamName.toUpperCase() + ' CAMPAIGN - MISSION ' + saveGameData.data.missionNumber + '\ron ' + saveGameData.data.difficulty.toUpperCase() + '\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(); }; dialog_tutorial = new Object(); dialog_tutorial.heading = 'TUTORIAL'; dialog_tutorial.body = 'This is your first time playing Warfare 1944, it is highly recommended\ryou watch the short tutorial presentation.'; dialog_tutorial.button1Active = true; dialog_tutorial.button2Active = true; dialog_tutorial.button1Desc = 'OK'; dialog_tutorial.button2Desc = 'NO THANKS'; dialog_tutorial.button1Action = function () { playClickSound(); closeDialogBox(); loadTutorial(); }; dialog_tutorial.button2Action = function () { playClickSound(); closeDialogBox(); loadCampaignSelect(); }; } function hotKeySetup() { var v1 = new Object(); v1.onKeyDown = function () { if (Key.getCode() == 49) { hud.intel.actionSlot0.onPress(); } if (Key.getCode() == 50) { hud.intel.actionSlot1.onPress(); } if (Key.getCode() == 51) { hud.intel.actionSlot2.onPress(); } if (Key.getCode() == 52) { hud.intel.actionSlot3.onPress(); } }; Key.addListener(v1); } 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); delete menu.mainMenu.onPress; menu.mainMenu.versionNumber.text = _root.versionNumber; menu.bootCamp._visible = false; 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() { delete menu.mainMenu.onPress; 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() { delete menu.mainMenu.onPress; 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() { delete menu.mainMenu.onPress; 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() { delete menu.mainMenu.onPress; 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 loadTutorial() { music_menuMusic.stop(); menu.mainMenu.alphaTo(0, 0.8, 'easeOutSine', 0, function () { this._visible = false; }); menu.bootCamp._alpha = 0; menu.bootCamp._visible = true; menu.bootCamp.alphaTo(100, 0.6, 'easeOutSine', 0.8, function () { this.gotoAndPlay(2); }); } function hideTutorial() { menu.bootCamp.alphaTo(0, 0.6, 'easeOutSine', 0, function () { this._visible = false; }); if (fromInstructions != true) { loadCampaignSelect(); } fromInstructions = false; } function loadCampaignSelect() { playingSkirmish = false; playingContinue = false; initBattleStats(); resetCareerStats(); battleNum = 1; upgradePoints = 0; retry = false; resetExperience(); menu.mainMenu.onPress = function () {}; 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() { delete menu.mainMenu.onPress; 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() { menu.mainMenu.onPress = function () {}; skirmishUnlockReset(); rainSetup = false; resetDepthVariables(); _root.menu.mapScreen.upgradePointsText.text = upgradePoints; setupUpgradeInterface(playerTeam.team); _root.menu.skirmish._visible = false; _root.menu.bootCamp._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(); } if (playingSkirmish == false) { saveGame(); } _root.menu.mapScreen.upgradePointsText.text = upgradePoints; _root.menu.bootCamp._visible = false; _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(true); 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', 1, 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); this.highlights.alphaTo(40, 0.4); } }; _root.menu.mainMenu[btnName].onRollOut = function () { if (this.activated == true) { this.textClip.colorTo(null, 0.8, 'easeOutSine'); this.textClip.scaleTo(100, 0.6); this.highlights.alphaTo(0, 0.4); } }; 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_tutorial); } }; 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 'agame': _root.menu.mainMenu[btnName].textClip.btnText.text = 'AGAME.COM'; _root.menu.mainMenu[btnName].onRelease = function () { playClickSound(); getURL('http://agame.com', '_blank'); }; 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; case 'playWarfare1917': _root.menu.mainMenu[btnName].textClip.btnText.text = 'PLAY WARFARE 1917'; _root.menu.mainMenu[btnName].onRelease = function () { playClickSound(); getURL('http://armorgames.com/play/2267/warfare-1917', '_blank'); }; break; default: } } } 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].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].onRollOut = _root.menu.teamSelect[btnName].onDragOut; _root.menu.teamSelect[btnName].onRelease = function () { playClickSound(); if (btnName == 'british') { playerTeam.team = 'british'; compTeam.team = 'german'; _root.currentMap = _root[playerTeam.team + '_map' + battleNum]; showDialogBox(dialog_selectDifficulty); } else { if (armorGamesVersion == true && btnName == 'german') { playerTeam.team = 'german'; compTeam.team = 'british'; _root.currentMap = _root[playerTeam.team + '_map' + battleNum]; showDialogBox(dialog_selectDifficulty); } 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].onDragOut = function () { this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, 'easeOutSine'); }; _root.menu.mapScreen[btnName].onRollOut = _root.menu.mapScreen[btnName].onDragOut; _root.menu.mapScreen[btnName].onRelease = function () { playClickSound(); switch (btnName) { case 'launch': hideMenu(); buildMap(currentMap); showLoadScreen(); saveGame(); break; case 'backToMainButt': mapScreenToMainMenu(); break; case 'upgrades': loadUpgradeScreen(); break; default: } }; } 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; default: } _root.menu.options[btnName].onRollOver = function () { playRollOverSound(); this.textClip.scaleTo(110, 0.5); }; _root.menu.options[btnName].onDragOut = function () { this.textClip.scaleTo(100, 0.6); }; _root.menu.options[btnName].onRollOut = _root.menu.options[btnName].onDragOut; } 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 () { hud.fpsCheck.enemyRP.text = enemyResources.RP; 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 v1 = new Object(); v1.onKeyDown = function () { if (Key.isDown(37)) { cameraPanKeys('left'); } if (Key.isDown(39)) { cameraPanKeys('right'); } }; Key.addListener(v1); } function cameraControl() { if (game.state != 'paused' && camera.state != 'locked') { if (supportCursorUp == false) { Mouse.show(); } hud.panArrow._visible = false; gameCursor._visible = true; if (_xmouse <= panBuffer && _ymouse <= panInterfaceBlock && world._x <= -panBuffer) { Mouse.hide(); 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 -= 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 += panSpeed; } if (panDir == 'right' && world._x > -world.bg._width + Stage.width + panBuffer) { world._x -= panSpeed; } } } function setUnitCosts() { british.riflemen.cost = 200; british.assault.cost = 300; british.machineGun.cost = 400; british.sniper.cost = 500; british.officer.cost = 300; british.mortarTeam.cost = 500; british.bazooka.cost = 400; british.medic.cost = 100; british.tank.cost = 800; british.artillery.cost = 500; british.airSupport.cost = 300; german.riflemen.cost = 200; german.assault.cost = 300; german.machineGun.cost = 400; german.sniper.cost = 500; german.officer.cost = 300; german.mortarTeam.cost = 500; german.bazooka.cost = 400; german.medic.cost = 100; german.tank.cost = 800; german.artillery.cost = 500; german.airSupport.cost = 300; } function resourcesCheck(points, team, unitName) { _root[team + 'Resources'].canAfford = false; if (_root[team + 'Resources'].RP >= points) { _root[team + 'Resources'].canAfford = true; } if (team == 'player' && british_slot11_upgrade.active == true && _root[team + 'Resources'].RP >= points * british_slot11_upgrade.bonus) { _root[team + 'Resources'].canAfford = true; } if (unitName == 'Riflemen' && team == 'player' && german_slot11_upgrade.active && _root[team + 'Resources'].RP >= 100) { _root[team + 'Resources'].canAfford = true; } } function resourceResupply() { --supplyTimer; if (supplyTimer < 0) { supplyTimer = supplyTimerMax; adjustRP('add', playerResources.SP, 'player'); adjustRP('add', enemyResources.SP, 'enemy'); } } function resourceResupplyTimer() { if (hud.resupplyTimer.experience.rightDial._rotation < 45) { hud.resupplyTimer.experience.rightDial._rotation += 45; } if (hud.resupplyTimer.experience.rightDial._rotation >= 45 && hud.resupplyTimer.experience.leftDial._rotation > -135) { hud.resupplyTimer.experience.leftDial._rotation += 45; } if (hud.resupplyTimer.experience.leftDial._rotation < 0 && hud.resupplyTimer.experience.rightDial._rotation >= 0) { hud.resupplyTimer.experience.rightDial._rotation = -135; hud.resupplyTimer.experience.leftDial._rotation = 0; } } function adjustRP(addRemove, points, team) { if (addRemove == 'remove') { if (team == 'player') { hud.resourcePoints.colorTo(10027008, 0.2); hud.resourcePoints.colorTo(10327418, 0.2, 'linear', 1); ++rpText; if (rpText > 100) { rpText = 1; } hud.attachMovie('floatingRP', 'rpText' + rpText, 16000 + rpText); hud['rpText' + rpText].glowBox.colourBox.colorTo(10027008); if (team == 'player' && british_slot11_upgrade.active == true) { hud['rpText' + rpText].glowBox.colourBox.textRP.text = '-' + points * british_slot11_upgrade.bonus; } else { hud['rpText' + rpText].glowBox.colourBox.textRP.text = '-' + points; } hud['rpText' + rpText]._x = 59.3; hud['rpText' + rpText]._y = 443; hud['rpText' + rpText].ySlideTo(423, 4, 'easeOutSine'); hud['rpText' + rpText].alphaTo(0, 1, 'linear', 1); } if (playerTeam.team == 'german') { if (team == 'player' && german_slot11_upgrade.active && points == 200) { _root[team + 'Resources'].RP -= 100; } else { _root[team + 'Resources'].RP -= points; } } if (playerTeam.team == 'british') { if (team == 'player' && british_slot11_upgrade.active == true) { _root[team + 'Resources'].RP -= Math.round(points * british_slot11_upgrade.bonus); } else { _root[team + 'Resources'].RP -= points; } } } else { if (team == 'player') { hud.resourcePoints.colorTo(6723840, 0.2); hud.resourcePoints.colorTo(10327418, 0.2, 'linear', 1); ++rpText; if (rpText > 100) { rpText = 1; } hud.attachMovie('floatingRP', 'rpText' + rpText, 16000 + rpText); hud['rpText' + rpText].glowBox.colourBox.colorTo(6723840); hud['rpText' + rpText].glowBox.colourBox.textRP.text = '+' + points; hud['rpText' + rpText]._x = 59.3; hud['rpText' + rpText]._y = 443; hud['rpText' + rpText].ySlideTo(423, 4, 'easeOutSine'); hud['rpText' + rpText].alphaTo(0, 1, 'linear', 1); } _root[team + 'Resources'].RP += points; } if (_root[team + 'Resources'].RP < 0) { _root[team + 'Resources'].RP = 0; } if (_root[team + 'Resources'].RP > _root[team + 'Resources'].maxRP) { _root[team + 'Resources'].RP = _root[team + 'Resources'].maxRP; } updateResourcesInterface(); } function setupResourcePoints(map) { playerResources.RP = map.resourcePointsPlayer; playerResources.maxRP = map.resourcePointsPlayer; playerResources.SP = startingSupplyPoints; playerResources.maxSP = startingSupplyPoints; enemyResources.RP = map.resourcePointsEnemy; enemyResources.maxRP = map.resourcePointsEnemy; enemyResources.SP = startingSupplyPoints; enemyResources.maxSP = startingSupplyPoints; } function updateResourcesInterface() { hud.resourcePoints.text = Math.round(playerResources.RP); if (playerResources.SP == 0) { hud.supplyPoints.text = playerResources.SP; } else { hud.supplyPoints.text = '+' + playerResources.SP; } supplyPerc = (playerResources.SP / playerResources.maxSP) * 100; supplyPercEnemy = (enemyResources.SP / enemyResources.maxSP) * 100; if (playerTeam.team == 'british') { hud.progressBar.supplyBar_british.bar.xScaleTo(supplyPerc, 1); hud.progressBar.supplyBar_german.bar.xScaleTo(supplyPercEnemy, 1); } else { hud.progressBar.supplyBar_british.bar.xScaleTo(supplyPercEnemy, 1); hud.progressBar.supplyBar_german.bar.xScaleTo(supplyPerc, 1); } var v1 = new Array(hud.progressBar.supplyBar_british.bar, hud.progressBar.supplyBar_german.bar); for (spa in v1) { if (v1[spa]._xscale == 100) { v1[spa].colorTo(null); } if (v1[spa]._xscale < 100 && v1[spa]._xscale >= 75) { v1[spa].colorTo(6452814, 1); } if (v1[spa]._xscale < 75 && v1[spa]._xscale >= 50) { v1[spa].colorTo(13285499, 1); } if (v1[spa]._xscale < 50 && v1[spa]._xscale >= 25) { v1[spa].colorTo(15632960, 1); } if (v1[spa]._xscale < 25 && v1[spa]._xscale >= 0) { v1[spa].colorTo(7285547, 1); } } } function createSquad(team, squadType, loc, fixedLoc, isObjective, isPreset) { ++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; if (loc == deploymentZone1) { _root[team].currentSquad.deployZone = 1; } if (loc == deploymentZone2) { _root[team].currentSquad.deployZone = 2; } if (loc == deploymentZone3) { _root[team].currentSquad.deployZone = 3; } _root[team].currentSquad.health = _root[team][squadType].health; _root[team].currentSquad.speed = _root[team][squadType].speed; if (playerTeam.team == 'german' && german_slot15_upgrade.active) { _root[team].currentSquad.health *= german_slot15_upgrade.bonus; } if (playerTeam.team == 'german' && german_slot19_upgrade.active) { _root[team].currentSquad.speed *= german_slot19_upgrade.bonus; } if (playerTeam.team == 'british' && british_slot15_upgrade.active) { _root[team].currentSquad.speed *= british_slot15_upgrade.bonus; } _root[team].currentSquad.ref = currentSquad; _root[team].currentSquad.team = team; _root[team].currentSquad.cost = _root[team][squadType].cost; _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; _root[team].currentSquad.hit = false; _root[team].currentSquad.accuracy = _root[team][squadType].accuracy; _root[team].currentSquad.damage = _root[team][squadType].damage; _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.firingSmoke = false; _root[team].currentSquad.smoked = false; _root[team].currentSquad.staticUnit = false; _root[team].currentSquad.medicUnit = false; if (squadType == 'medic') { _root[team].currentSquad.medicUnit = true; } _root[team].currentSquad.pickingUpPatient = false; _root[team].currentSquad.engineDisabled = false; _root[team].currentSquad.nearGas = false; _root[team].currentSquad.gasMasksOn = false; _root[team].currentSquad.allMasksOn = false; _root[team].currentSquad.allMasksOff = false; _root[team].currentSquad.selectedUnit = false; _root[team].currentSquad.unitDesc = _root[team][squadType].name; if (squadType != 'tank') { _root[team].currentSquad.controlList = new Array('advance', _root[team][squadType].control1, _root[team][squadType].control2, _root[team][squadType].control3, _root[team][squadType].control4); } else { _root[team].currentSquad.controlList = new Array(_root[team][squadType].control1, _root[team][squadType].control2, _root[team][squadType].control3, _root[team][squadType].control4, _root[team][squadType].control5); } _root[team].currentSquad.nearOfficer = false; _root[team].currentSquad.officerRef = null; if (squadType == 'tank') { _root[team].currentSquad.state = 'tankMoving'; } if (isObjective == true) { _root[team].currentSquad.objective = true; } if (isPreset == true) { _root[team].currentSquad.cost = 0; } if (squadType == 'bunker') { _root[team].currentSquad.state = 'bunkerIdle'; _root[team].currentSquad.objective = true; } if (_root[team].currentSquad.staticUnit == true) { _root[team].currentSquad.state = 'static'; } else { _root[team].currentSquad.state = 'moving'; } if (squadType == 'officer') { _root[team + 'Officers'].push(_root[team].currentSquad); if (team == playerTeam.team) { playerMorale += moraleCost.officerBonus; } else { if (team == compTeam.team) { compMorale += moraleCost.officerBonus; } } } for (unitAdd in _root[team][squadType].units) { setTimeout(createSoldier, 300 * unitAdd, currentSquad, _root[team][squadType].units[unitAdd], team, squadType, loc, fixedLoc); } _root[team + 'SquadsOnScreen'].push(_root[team].currentSquad); _root[team + 'SquadsZone' + _root[team].currentSquad.deployZone].push(_root[team].currentSquad); findWounded(team); } 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.front_foot.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); soldierRef.back_foot.gotoAndStop(team + '_' + soldierType); } function createSoldier(currentSquad, soldierType, team, squadType, loc, fixedLoc) { ++soldierNumber; if (squadType != 'tank' && squadType != 'bunker') { world.attachMovie('soldier', 'soldier' + soldierNumber, soldierNumber + _root.depth_world_soldiers); } else { if (squadType == 'tank') { world.attachMovie('tank', 'soldier' + soldierNumber, soldierNumber + _root.depth_world_soldiers); world['soldier' + soldierNumber].gotoAndStop(team); } else { if (squadType == 'bunker') { world.attachMovie('bunker', 'soldier' + soldierNumber, soldierNumber + _root.depth_world_soldiers); world['soldier' + soldierNumber].mainGunDisabled = true; world['soldier' + soldierNumber].roundCount = 200; } } } world['soldier' + soldierNumber]._visible = true; if (squadType != 'tank' && squadType != 'bunker') { world['soldier' + soldierNumber]._yscale = random(10) + 125; world['soldier' + soldierNumber]._xscale = world['soldier' + soldierNumber]._yscale; } 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][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].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].fireType = _root[team][soldierType].fireType; 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].mortarType = 'mortar'; world['soldier' + soldierNumber].specialRoundCount = -1; world['soldier' + soldierNumber].suppressed = false; world['soldier' + soldierNumber].turretInPosition = false; world['soldier' + soldierNumber].movingTurret = false; world['soldier' + soldierNumber].mainGunDisabled = false; world['soldier' + soldierNumber].secondGunDisabled = false; world['soldier' + soldierNumber].engineDisabled = false; world['soldier' + soldierNumber].wounded = false; world['soldier' + soldierNumber].closestWoundedX = undefined; world['soldier' + soldierNumber].closestWoundedY = undefined; world['soldier' + soldierNumber].hasPatient = false; world['soldier' + soldierNumber].carryingPatient = false; world['soldier' + soldierNumber].medicUnit = false; if (squadType == 'medic') { world['soldier' + soldierNumber].medicUnit = true; } world['soldier' + soldierNumber].deployZone = world['soldier' + soldierNumber].squadObjRef.deployZone; world['soldier' + soldierNumber].maxY = loc + deployZoneHeight / 2.25; world['soldier' + soldierNumber].minY = loc - deployZoneHeight / 2.25 + 10; world['soldier' + soldierNumber]._y = loc + (random(deployZoneHeight) - deployZoneHeight / 2.25); if (squadType == 'tank') { world['soldier' + soldierNumber]._y = loc + 35; } if (squadType == 'bunker') { world['soldier' + soldierNumber]._y = loc - 100; } 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 - random(50); } else { if (team == german.name) { world['soldier' + soldierNumber]._x = german.spawnPoint + random(50); world['soldier' + soldierNumber]._xscale = -world['soldier' + soldierNumber]._xscale; } } if (fixedLoc > -99999) { world['soldier' + soldierNumber]._x = fixedLoc; } world['soldier' + soldierNumber].coverIcon._visible = false; if (squadType != 'officer') { world['soldier' + soldierNumber].officerStar._visible = false; } if (squadType == 'officer' && team == 'german') { world['soldier' + soldierNumber].officerStar.gotoAndStop('german_officer'); } if (squadType != 'tank' && squadType != 'bunker' && world['soldier' + soldierNumber].squadObjRef.staticUnit == false) { 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 checkCoverRating(coverSquad) { if (_root['cover_' + coverSquad.trenchRef.coverType].defence == 0.7) { coverSquad.members[0].coverIcon.icon.colorTo(16763904); } if (_root['cover_' + coverSquad.trenchRef.coverType].defence == 0.5) { coverSquad.members[0].coverIcon.icon.colorTo(6723840); } } function deployKeyboardSetup() { var v1 = new Object(); v1.onKeyDown = function () { if (Key.isDown(27)) { cancelDeploy(); cancelSpecialAttack(world.specAttack); } }; Key.addListener(v1); } function deploySquad(unitName, btnName) { deployMode = true; squadToDeploy = new Object(); squadToDeploy.btnName = btnName; squadToDeploy.unitName = unitName; squadToDeploy.cost = _root[playerTeam.team][unitName].cost; deselectRings(hud['ring_' + btnName._name]); hud['ring_' + btnName._name].colorTo(null); hud['ring_' + btnName._name]._alpha = 50; hud['ring_' + btnName._name].cost = _root[playerTeam.team][unitName].cost; hud['ring_' + btnName._name].onEnterFrame = function () { if (this.cost <= _root.playerResources.RP) { this.alphaTo(100, 0.2); this.colorTo(8305408, 0.2); delete this.onEnterFrame; } }; if (helpEnabled == true && this.cost <= _root.playerResources.RP) { _rootworld.deployZone3.onRollOver(); } } function deselectRings(noDeselect) { dr = 0; while (dr < 9) { if (hud['ring_slot' + dr] != noDeselect) { hud['ring_slot' + dr]._alpha = 0; hud['ring_slot' + dr].colorTo(null); delete hud['ring_slot' + dr].onEnterFrame; } ++dr; } } function setupDeployButtons() { world.attachMovie('deployBlock', 'deployZone1', depth_world_deployButtons + 1); world.attachMovie('deployBlock', 'deployZone2', depth_world_deployButtons + 2); world.attachMovie('deployBlock', 'deployZone3', depth_world_deployButtons + 3); world.deployZone1._y = deploymentZone1; world.deployZone2._y = deploymentZone2; world.deployZone3._y = deploymentZone3; world.deployZone1.zone = 1; world.deployZone2.zone = 2; world.deployZone3.zone = 3; world.deployZone3._x = 0; world.deployZone2._x = 0; world.deployZone1._x = 0; world.deployZone3._width = world.bg._width; world.deployZone2._width = world.deployZone3._width; world.deployZone1._width = world.deployZone3._width; world.deployZone3._height = deployZoneHeight; world.deployZone2._height = world.deployZone3._height; world.deployZone1._height = world.deployZone3._height; world.deployZone3._alpha = 0; world.deployZone2._alpha = 0; world.deployZone1._alpha = 0; world.deployZone3.onEnterFrame = function () { if (_root.deployMode == true) { var v2 = new Object(); v2.x = Stage.width / 2; v2.y = 0; world.globalToLocal(v2); world.zoneAnim._x = v2.x; } }; world.deployZone2.onEnterFrame = world.deployZone3.onEnterFrame; world.deployZone1.onEnterFrame = world.deployZone3.onEnterFrame; world.deployZone3.onRollOver = function () { if (_root.deployMode == true) { world.attachMovie('deployZoneHighlight', 'zoneAnim', depth_world_deployZoneHighlight); world.zoneAnim._y = this._y; if (_root.currentMap['coverZone' + this.zone].length > 0 && squadToDeploy.unitName == 'tank') { this.useHandCursor = false; this._alpha = 15; world.zoneAnim.colorTo(10027008); this.colorTo(10027008); } else { this.useHandCursor = true; this._alpha = 15; this.colorTo(null); } if (playerTeam.team == 'german') { world.zoneAnim._xscale = -100; } } else { this.useHandCursor = false; } if (this == world.deployZone3) { _root.world.deployZone1.onRollOut(); _root.world.deployZone2.onRollOut(); } }; world.deployZone2.onRollOver = world.deployZone3.onRollOver; world.deployZone1.onRollOver = world.deployZone3.onRollOver; world.deployZone3.onRollOut = function () { this._alpha = 0; }; world.deployZone2.onRollOut = world.deployZone3.onRollOut; world.deployZone1.onRollOut = world.deployZone3.onRollOut; world.deployZone3.onPress = function () { resourcesCheck(squadToDeploy.cost, 'player', squadToDeploy.name); if (_root.currentMap['coverZone' + this.zone].length > 0 && squadToDeploy.unitName == 'tank') { this.useHandCursor = false; this._alpha = 30; world.zoneAnim.colorTo(10027008); this.colorTo(10027008); cancelDeploy(); showQuickMessage('PATH IS BLOCKED FOR ARMOR.'); } if (_root.deployMode == true && _root.playerResources.canAfford == true) { _root.deselectRings(); _root.adjustRP('remove', squadToDeploy.cost, 'player'); world.zoneAnim.alphaTo(0, 0.5, 'linear', 0, function () { removeMovieClip(this); }); this._alpha = 30; this.alphaTo(0, 0.5); squadToDeploy.btnName.activated = false; _root.createSquad(playerTeam.team, squadToDeploy.unitName, this._y); _root.resetButtonTimers(squadToDeploy.btnName); _root.showHelp(); _root.deployMode = false; squadToDeploy = null; _root.clearIntelInterface(); ++_root['soldiersZone' + this.zone]; } else { if (deployMode == true && _root.playerResources.canAfford == false) { if (british_slot11_upgrade.active == true) { showQuickMessage('NOT ENOUGH RESOURCES. NEED ' + squadToDeploy.cost * british_slot11_upgrade.bonus + '.'); } else { showQuickMessage('NOT ENOUGH RESOURCES. NEED ' + squadToDeploy.cost + '.'); } cancelDeploy(); _root.clearIntelInterface(); } } }; world.deployZone2.onPress = world.deployZone3.onPress; world.deployZone1.onPress = world.deployZone3.onPress; } function cancelDeploy() { clearIntelInterface(); deselectRings(); world.zoneAnim.alphaTo(0, 0.2, 'linear', 0, function () { removeMovieClip(this); }); world.deployZone1.alphaTo(0, 0.2); world.deployZone2.alphaTo(0, 0.2); world.deployZone3.alphaTo(0, 0.2); _root.deployMode = false; squadToDeploy = null; } function checkSmoke(teamName) { for (cst in _root[teamName + 'SquadsOnScreen']) { currentSmokeSquad = _root[teamName + 'SquadsOnScreen'][cst]; for (css in activeGas) { if (teamName == 'british' && currentSmokeSquad.deployZone == activeGas[css].zone) { if (currentSmokeSquad.members[0]._x < activeGas[css]._x && currentSmokeSquad.enemyTarget.members[0]._x > activeGas[css]._x) { currentSmokeSquad.smoked = true; } else { currentSmokeSquad.smoked = false; } } if (teamName == 'german' && currentSmokeSquad.deployZone == activeGas[css].zone) { if (currentSmokeSquad.members[0]._x > activeGas[css]._x && currentSmokeSquad.enemyTarget.members[0]._x < activeGas[css]._x) { currentSmokeSquad.smoked = true; } else { currentSmokeSquad.smoked = false; } } } } } function squadAI(teamName) { for (s in _root[teamName + 'SquadsOnScreen']) { if (_root[teamName + 'SquadsOnScreen'][s].selectedUnit == true && rollingOverDeployButtons == false) { updateSelectedUnitInfo(_root[teamName + 'SquadsOnScreen'][s]); } var v6 = _root[teamName + 'SquadsOnScreen'][s].members[0]; if (_root[teamName + 'SquadsOnScreen'][s].selectedUnit == true || _root[teamName + 'SquadsOnScreen'][s].rolledOver == true) { _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 (v6.inTrench) { checkCoverRating(_root[teamName + 'SquadsOnScreen'][s]); } if (game.state != 'endBattle') { } switch (_root[teamName + 'SquadsOnScreen'][s].state) { case 'static': for (m in _root[teamName + 'SquadsOnScreen'][s].members) { staticSoldierRef = _root[teamName + 'SquadsOnScreen'][s].members[m]; if (staticSoldierRef.inFiringPosition == false && staticSoldierRef.changingToFire == false) { soldierRef.changingToFire = true; soldierRef.inMovingPosition = false; soldierRef.moveAnim = false; soldierRef.gotoAndStop('stop_idle'); soldierMovements('crouch', staticSoldierRef); } } break; case 'moving': for (m in _root[teamName + 'SquadsOnScreen'][s].members) { mSR = _root[teamName + 'SquadsOnScreen'][s].members[m]; mSR.firing = false; mSR.inFiringPosition = false; mSR.inTrench = false; mSR.changingToFire = false; mSR.wayPoint = null; mSR.trenchWayPoint = null; mSR.wayPointSet = false; mSR.wayPointReached = false; mSR.trenchWayPointSet = false; mSR.trenchWayPointReached = false; --mSR.directionCount; if (mSR.directionCount < 0 && mSR.medicUnit == false) { mSR.directionCount = mSR.directionCountMax; var v5 = random(10); if (v5 == 0) { mSR.movingUp = true; } if (v5 == 1) { mSR.movingDown = true; } if (v5 > 1) { mSR.movingUp = false; mSR.movingDown = false; } } if (mSR.alive == true && game.state != 'endBattle') { if (mSR.changingToMove == false && mSR.inMovingPosition == false) { mSR.changingToMove = true; mSR.inFiringPosition = false; mSR.changingToFire = false; mSR.moveAnim = false; soldierMovements(mSR.position + 'ToStand', mSR); } if (mSR.changingToMove == false && mSR.inMovingPosition == true && mSR.alive == true) { if (mSR.moveAnim == false && mSR.alive == true) { mSR.moveAnim = true; mSR.changingToFire = false; mSR.changingToMove = false; mSR.gotoAndPlay('rifle_run'); } if (teamName == british.name && mSR.alive == true) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { mSR._x += _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { if (british_slot10_upgrade.active == true) { mSR._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier * british_slot10_upgrade.bonus; } else { mSR._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (mSR.movingUp && mSR._y > mSR.minY) { mSR._y -= _root[teamName + 'SquadsOnScreen'][s].speed / 6; } if (mSR.movingDown && mSR._y < mSR.maxY) { mSR._y += _root[teamName + 'SquadsOnScreen'][s].speed / 6; } if (mSR._x > world.bg._width - conquerWinArea) { if (m == 0 && mSR._x > world.bg._width && (mSR.squadObjRef.deployZone == 1 || mSR.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); playVoice('flanked', 'german'); removeSquad(mSR.squadObjRef, mSR.squadObjRef.type, teamName); } else { if (mSR.squadObjRef.deployZone == 2 && m == 0) { endBattle('british', 'conquer'); } } } } if (teamName == german.name && mSR.alive == true) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { mSR._x -= _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { mSR._x -= _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } if (mSR.movingUp && mSR._y > mSR.minY) { mSR._y -= _root[teamName + 'SquadsOnScreen'][s].speed / 6; } if (mSR.movingDown && mSR._y < mSR.maxY) { mSR._y += _root[teamName + 'SquadsOnScreen'][s].speed / 6; } if (mSR._x < conquerWinArea) { if (mSR._x < 0 && (mSR.squadObjRef.deployZone == 1 || mSR.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); playVoice('flanked', 'british'); removeSquad(mSR.squadObjRef, mSR.squadObjRef.type, teamName); } else { if (mSR.squadObjRef.deployZone == 2 && mSR.carryingPatient == false && m == 0) { endBattle('german', 'conquer'); } } } } } } } break; case 'halt': for (m in _root[teamName + 'SquadsOnScreen'][s].members) { _root['soldierRef' + m] = _root[teamName + 'SquadsOnScreen'][s].members[m]; sol = _root[teamName + 'SquadsOnScreen'][s].members[m]; sqd = _root[teamName + 'SquadsOnScreen'][s]; if (sol.alive == true && sol.squadObjRef.staticUnit == false) { if (sol.wayPointSet == false) { if (teamName == british.name) { if (sqd.nearTrench == false || sqd.pickingUpPatient == true) { if (sol._x > -50) { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.changingToFire = false; sol.changingToMove = false; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = sol._x + random(50); if (sqd.pickingUpPatient == true) { sol.wayPoint = sol._x + 80; } sol.wayPointSet = true; } else { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.changingToFire = false; sol.changingToMove = false; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = 100 + random(50); sol.wayPointSet = true; } } else { sol.wayPoint = sol._x + 1; sol.wayPointSet = true; } } if (teamName == german.name) { if (sqd.nearTrench == false || sqd.pickingUpPatient == true) { if (sol._x < world.bg._width) { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.changingToFire = false; sol.changingToMove = false; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = sol._x - random(50); if (sqd.pickingUpPatient == true) { sol.wayPoint = sol._x - 80; } sol.wayPointSet = true; } else { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; soldierMovements('run', movingsol); } sol.wayPoint = world.bg._width - 100 - random(50); sol.wayPointSet = true; } } else { sol.wayPoint = sol._x - 1; sol.wayPointSet = true; } } } if (teamName == british.name && sol._x < sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == british.name && sol._x >= sol.wayPoint) { sol.wayPointReached = true; } if (teamName == german.name && sol._x > sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == german.name && sol._x <= sol.wayPoint) { sol.wayPointReached = true; } if (sol.wayPointReached == true && sol.inFiringPosition == false && sol.changingToFire == false && sol.alive == true) { sol.changingToFire = true; sol.inMovingPosition = false; sol.moveAnim = false; sol.gotoAndStop('stop_idle'); var v4 = random(3) + 1; if (sol.type == 'lieutenant') { v4 = 1; } if (sol.type == 'mortarCarrier' || sol.type == 'mortarLoader' || sol.type == 'bazookaMan') { v4 = 2; } if (sol.type == 'machineGunner') { v4 = random(2) + 2; } if (sol.type == 'medicUnit') { v4 = 4; } if (v4 == 1) { setTimeout(soldierMovements, random(400) + 100, 'stand', _root['sol' + m]); } else { if (v4 == 2) { setTimeout(soldierMovements, random(400) + 100, 'crouch', _root['sol' + m]); } else { if (v4 == 3) { setTimeout(soldierMovements, random(400) + 100, 'prone', _root['sol' + m]); } else { if (v4 == 4) { setTimeout(soldierMovements, random(400) + 100, 'medicPickup', _root['sol' + m]); } } } } } } } break; case 'engaging': for (m in _root[teamName + 'SquadsOnScreen'][s].members) { _root['sol' + m] = _root[teamName + 'SquadsOnScreen'][s].members[m]; sol = _root[teamName + 'SquadsOnScreen'][s].members[m]; sqd = _root[teamName + 'SquadsOnScreen'][s]; if (sol.cacheAsBitmap == true) { sol.cacheAsBitmap = false; } if (game.state != 'endBattle') { if (sqd.enemyTarget.members[0].alive != true && sqd.inTrench == false && sqd.staticUnit == false) { solmem = 0; while (solmem < sqd.members.length + 1) { sqd.members[solmem].firing = false; sqd.members[solmem].changingToFire = false; sqd.members[solmem].changingToMove = false; sqd.members[solmem].moveAnim = false; ++solmem; } sqd.state = 'moving'; } } if (sol.alive == true) { if (sol.wayPointSet == false) { if (teamName == british.name) { if (sqd.nearTrench == false) { if (sol._x > -50) { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.changingToFire = false; sol.changingToMove = false; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = sol._x + random(50); sol.wayPointSet = true; } else { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.changingToFire = false; sol.changingToMove = false; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = 100 + random(50); sol.wayPointSet = true; } } else { sol.wayPoint = sol._x + 1; sol.wayPointSet = true; } } if (teamName == german.name) { if (sqd.nearTrench == false) { if (sol._x < world.bg._width) { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = sol._x - random(50); sol.wayPointSet = true; } else { if (sol.moveAnim == false && sol.alive == true) { sol.moveAnim = true; sol.gotoAndPlay('rifle_run'); } sol.wayPoint = world.bg._width - 100 - random(50); sol.wayPointSet = true; } } else { sol.wayPoint = sol._x - 1; sol.wayPointSet = true; } } } if (teamName == british.name && sol._x < sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == british.name && sol._x >= sol.wayPoint) { sol.wayPointReached = true; } if (teamName == german.name && sol._x > sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == german.name && sol._x <= sol.wayPoint) { sol.wayPointReached = true; sol.moveAnim = false; } if (sol.wayPointReached == true && sol.inFiringPosition == false && sol.changingToFire == false && sol.alive == true) { sol.moveAnim = false; sol.changingToMove = false; sol.changingToFire = true; sol.inMovingPosition = false; sol.gotoAndStop('stop_idle'); var v4 = random(3) + 1; if (sol.type == 'lieutenant') { v4 = 1; } if (sol.type == 'mortarCarrier' || sol.type == 'mortarLoader' || sol.type == 'bazookaMan') { v4 = 2; } if (sol.type == 'machineGunner') { v4 = random(2) + 2; } if (v4 == 1) { setTimeout(soldierMovements, random(400) + 100, 'stand', _root['sol' + m]); } else { if (v4 == 2) { setTimeout(soldierMovements, random(400) + 100, 'crouch', _root['sol' + m]); } else { if (v4 == 3) { setTimeout(soldierMovements, random(400) + 100, 'prone', _root['sol' + m]); } } } sol.burstCounter = random(5); } if (sol.inFiringPosition == true && sol.firing == false && sol.alive == true && sol.suppressed == false) { sol.moveAnim = false; sol.inMovingPosition = false; if (teamName != playerTeam.team && sol.throwingGrenade == false && sqd.type == 'assault' && sqd.enemyTarget.type == 'tank') { if (random(2) == 0) { sol.throwingGrenade = true; sol.gotoAndPlay('standing_throwGrenade'); } } if (sol.fireType == 'slowBurst') { if (sol.burstCounter <= random(2) + 1) { ++sol.burstCounter; playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } else { ++sol.waitCounter; } if (sol.waitCounter >= random(slowBurstRate) + minWait) { sol.waitCounter = 0; sol.burstCounter = 0; } } else { if (sol.fireType == 'medBurst') { if (sol.burstCounter <= random(5) + 2) { ++sol.burstCounter; playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } else { ++sol.waitCounter; } if (sol.waitCounter >= random(medBurstRate) + minWait) { sol.waitCounter = 0; sol.burstCounter = 0; } } else { if (sol.fireType == 'burst') { if (sol.burstCounter <= random(8) + 4) { ++sol.burstCounter; playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } else { ++sol.waitCounter; } if (sol.waitCounter >= random(highBurstRate) + minWait) { sol.waitCounter = 0; sol.burstCounter = 0; } } else { if (sol.throwingGrenade == false) { playVoice('attack', teamName); playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (sol.damage > 0) { if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } } } } } } } } break; case 'assaultTrench': for (m in _root[teamName + 'SquadsOnScreen'][s].members) { sol = _root[teamName + 'SquadsOnScreen'][s].members[m]; _root['sol' + m] = _root[teamName + 'SquadsOnScreen'][s].members[m]; sqd = _root[teamName + 'SquadsOnScreen'][s]; if (sol.alive == true) { if (sol.wayPointSet == false) { if (teamName == british.name) { sol.wayPoint = sqd.enemyTarget.trenchRef._x - 150 - random(60); sol.wayPointSet = true; } if (teamName == german.name) { sol.wayPoint = sqd.enemyTarget.trenchRef._x + 150 + random(60); sol.wayPointSet = true; } } if (teamName == british.name && sol._x <= sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } else { if (teamName == british.name && sol._x >= sol.wayPoint) { sol.wayPointReached = true; } } if (teamName == german.name && sol._x >= sol.wayPoint) { if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { sol._x -= _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } else { if (teamName == german.name && sol._x <= sol.wayPoint) { sol.wayPointReached = true; } } if (sol.wayPointReached == true && sol.inFiringPosition == false && sol.changingToFire == false && sol.alive == true) { sol.changingToFire = true; sol.inMovingPosition = false; sol.moveAnim = false; sol.gotoAndStop('stop_idle'); var v4 = random(2) + 1; if (v4 == 1) { setTimeout(soldierMovements, random(400) + 100, 'crouch', _root['sol' + m]); } else { if (v4 == 2) { setTimeout(soldierMovements, random(400) + 100, 'stand', _root['sol' + m]); } } sol.burstCounter = random(5); } if (game.state != 'endBattle') { if (sqd.enemyTarget.members[0].alive == undefined && sqd.inTrench == false && sqd.staticUnit == false) { bluurg = 0; while (bluurg < sqd.members.length + 1) { sqd.members[bluurg].firing = false; sqd.members[bluurg].changingToFire = false; sqd.members[bluurg].changingToMove = false; sqd.members[bluurg].moveAnim = false; ++bluurg; } sqd.state = 'moving'; } } if (sqd.enemyTarget.members.length > 0 && sol.inFiringPosition == true && sol.firing == false && sol.alive == true) { sqd.assaulting = true; sol.inMovingPosition = false; if (sol.throwingGrenade == false) { if (sol.fireType == 'slowBurst') { if (sol.burstCounter <= random(2) + 1) { ++sol.burstCounter; playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } else { ++sol.waitCounter; } if (sol.waitCounter >= random(slowBurstRate) + minWait) { sol.waitCounter = 0; sol.burstCounter = 0; } } if (sol.fireType == 'medBurst') { if (sol.burstCounter <= random(5) + 2) { ++sol.burstCounter; playSound('sound_' + _root[teamName][sol.type].mainWeapon + '_fire' + (random(2) + 1)); sol.gotoAndPlay(_root[teamName][sol.type].firePose + '_fire_' + sol.position); if (teamName == british.name) { hitEnemy(british.name, german.name, sol, sqd); } else { hitEnemy(german.name, british.name, sol, sqd); } } else { ++sol.waitCounter; } if (sol.waitCounter >= random(medBurstRate) + minWait) { sol.waitCounter = 0; sol.burstCounter = 0; } } } } } } 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) { es = _root[teamName + 'SquadsOnScreen'][s].members[m]; esq = _root[teamName + 'SquadsOnScreen'][s]; if (es.alive == true) { if (es.trenchWayPointSet == false) { if (teamName == 'british') { es.trenchWayPoint = esq.trenchRef._x - esq.trenchRef.holder._width / 2 - (random(10) + 2) + 5; es.trenchWayPointSet = true; } if (teamName == 'german') { es.trenchWayPoint = esq.trenchRef._x + esq.trenchRef.holder._width / 2 + (random(10) + 2) - 5; es.trenchWayPointSet = true; } } if (es.trenchWayPointSet == true && teamName == 'british' && es._x < es.trenchWayPoint && es.trenchWayPointReached == false) { if (es.moveAnim == false && es.alive == true && es.enteringTrench == false) { es.changingToMove = false; es.changingToFire = false; es.moveAnim = true; es.gotoAndPlay('rifle_run'); } if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { es._x += _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { es._x += _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == 'british' && es._x >= es.trenchWayPoint) { es.trenchWayPointReached = true; es.inTrenchPosition = true; es.trenchWayPoint = null; } if (es.trenchWayPointSet == true && teamName == 'german' && es._x > es.trenchWayPoint && es.trenchWayPointReached == false) { if (es.moveAnim == false && es.alive == true && es.enteringTrench == false) { es.changingToMove = false; es.changingToFire = false; es.moveAnim = true; es.gotoAndPlay('rifle_run'); } if (_root[teamName + 'SquadsOnScreen'][s].inWire == true) { es._x -= _root[teamName + 'SquadsOnScreen'][s].speed / wireSpeedMod; } else { es._x -= _root[teamName + 'SquadsOnScreen'][s].speed * moveModifier; } } if (teamName == 'german' && es._x <= es.trenchWayPoint) { es.trenchWayPointReached = true; es.inTrenchPosition = true; es.trenchWayPoint = null; } } if (esq.trenchRef.slot1 == 'empty' || esq.trenchRef.slot1 == undefined) { esq.passingTrench = false; } else {} if (es.trenchWayPointReached == true && es.inFiringPosition == false && es.changingToFire == false && es.alive == true) { es.enteringTrench = true; es.changingToFire = true; es.inMovingPosition = false; es.moveAnim = false; es.gotoAndStop('stop_idle'); es.coverRating = esq.trenchRef.coverType; var v4 = random(2) + 1; if (es.type == 'lieutenant') { v4 = 1; } if (es.type == 'mortarCarrier' || es.type == 'mortarLoader' || es.type == 'bazookaMan') { v4 = 2; } if (es.type == 'machineGunner') { v4 = 2; } if (v4 == 1) { setTimeout(soldierMovements, random(400) + 100, 'stand', es, true); } else { if (v4 == 2) { setTimeout(soldierMovements, random(400) + 100, 'crouch', es, true); } } sol.burstCounter = random(5); } if (es.inTrench) { esq.trenchRef.ownerTeam = teamName; } if (esq.passingTrench == true) { esq.allMembersInTrench = true; for (m in esq.members) { if (esq.members[m].inTrench == false) { esq.allMembersInTrench = false; } } if (esq.allMembersInTrench == true) { esq.state = 'exitTrench'; esq.passingTrench = false; } } else { esq.allMembersInTrench = true; for (m in esq.members) { if (esq.members[m].inTrench == false) { esq.allMembersInTrench = false; } } } if (esq.enemyTarget.members.length > 0 && es.inFiringPosition == true && es.firing == false && es.alive == true) { if (es.fireType == 'slowBurst') { if (es.burstCounter <= random(2) + 1) { ++es.burstCounter; playSound('sound_' + _root[teamName][es.type].mainWeapon + '_fire' + (random(2) + 1)); es.gotoAndPlay(_root[teamName][es.type].firePose + '_fire_' + es.position); if (teamName == british.name) { hitEnemy(british.name, german.name, es, esq); } else { hitEnemy(german.name, british.name, es, esq); } } else { ++es.waitCounter; } if (es.waitCounter >= random(slowBurstRate) + minWait) { es.waitCounter = 0; es.burstCounter = 0; } } else { if (es.fireType == 'medBurst') { if (es.burstCounter <= random(5) + 2) { ++es.burstCounter; playSound('sound_' + _root[teamName][es.type].mainWeapon + '_fire' + (random(2) + 1)); es.gotoAndPlay(_root[teamName][es.type].firePose + '_fire_' + es.position); if (teamName == british.name) { hitEnemy(british.name, german.name, es, esq); } else { hitEnemy(german.name, british.name, es, esq); } } else { ++es.waitCounter; } if (es.waitCounter >= random(medBurstRate) + minWait) { es.waitCounter = 0; es.burstCounter = 0; } } else { if (es.fireType == 'burst') { if (es.burstCounter <= random(6) + 4) { ++es.burstCounter; playSound('sound_' + _root[teamName][es.type].mainWeapon + '_fire' + (random(2) + 1)); es.gotoAndPlay(_root[teamName][es.type].firePose + '_fire_' + es.position); if (teamName == british.name) { hitEnemy(british.name, german.name, es, esq); } else { hitEnemy(german.name, british.name, es, esq); } } else { ++es.waitCounter; } if (es.waitCounter >= random(highBurstRate) + minWait) { es.waitCounter = 0; es.burstCounter = 0; } } else { if (es.throwingGrenade == false) { playVoice('attack', teamName); playSound('sound_' + _root[teamName][es.type].mainWeapon + '_fire' + (random(2) + 1)); es.gotoAndPlay(_root[teamName][es.type].firePose + '_fire_' + es.position); if (teamName == british.name) { hitEnemy(british.name, german.name, es, esq); } else { hitEnemy(german.name, british.name, es, esq); } } } } } } } break; case 'exitTrench': _root[teamName + 'SquadsOnScreen'][s].enemyTarget = undefined; if (teamName != playerTeam.team) { _root[teamName + 'SquadsOnScreen'][s].trenchRef.slot1 = 'empty'; } for (m in _root[teamName + 'SquadsOnScreen'][s].members) { memberRef = _root[teamName + 'SquadsOnScreen'][s].members[m]; memberRef.moveAnim = false; if (memberRef.exitingTrench == false) { memberRef.exitingTrench = true; memberRef.gotoAndPlay('exitTrench'); if (m == 0) { playVoice('advance', teamName); } } if (memberRef.exitedTrench == true) { if (teamName == 'british') { memberRef._x += 45; } else { memberRef._x -= 45; } memberRef.gotoAndPlay(random(10) + 20); memberRef.trenchWayPointReached = false; memberRef.trenchWayPointSet = false; memberRef.trenchWayPoint = null; memberRef.inTrenchPosition = false; memberRef.enteringTrench = false; memberRef.firing = false; memberRef.inTrench = false; memberRef.exitingTrench = false; memberRef.inFiringPosition = false; memberRef.moveAnim = false; } } for (m in _root[teamName + 'SquadsOnScreen'][s].members) { memberRef = _root[teamName + 'SquadsOnScreen'][s].members[m]; memberRef.squadObjRef.allOut = true; if (memberRef.exitedTrench == false) { memberRef.squadObjRef.allOut = false; } } if (_root[teamName + 'SquadsOnScreen'][s].allOut == true && _root[teamName + 'SquadsOnScreen'][s].staticUnit == false) { for (m in _root[teamName + 'SquadsOnScreen'][s].members) { _root[teamName + 'SquadsOnScreen'][s].members[m].exitedTrench = false; _root[teamName + 'SquadsOnScreen'][s].members[m].changingToMove = false; _root[teamName + 'SquadsOnScreen'][s].members[m].inMovingPosition = true; } _root.trenches[memberRef.squadObjRef.trenchNumRef].slot1 = 'empty'; memberRef.squadObjRef.inTrench = false; memberRef.squadObjRef.nearTrench = false; memberRef.squadObjRef.allMembersInTrench = false; memberRef.squadObjRef.state = 'moving'; } break; case 'bunkerIdle': break; case 'bunkerEngaging': bunkerSquadRef = _root[teamName + 'SquadsOnScreen'][s]; for (m in _root[teamName + 'SquadsOnScreen'][s].members) { bunkerRef = _root[teamName + 'SquadsOnScreen'][s].members[m]; if (bunkerRef.turretInPosition == false && bunkerRef.movingTurret == false) { if (bunkerSquadRef.enemyTarget.deployZone < bunkerSquadRef.deployZone && bunkerRef.turret.state == 'straight') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveUp'); } if (bunkerSquadRef.enemyTarget.deployZone > bunkerSquadRef.deployZone && bunkerRef.turret.state == 'straight') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveDown'); } if (bunkerSquadRef.enemyTarget.deployZone < bunkerSquadRef.deployZone && bunkerRef.turret.state == 'down') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveUpFromDown'); } if (bunkerSquadRef.enemyTarget.deployZone > bunkerSquadRef.deployZone && bunkerRef.turret.state == 'up') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveDownFromUp'); } if (bunkerSquadRef.enemyTarget.deployZone == bunkerSquadRef.deployZone && bunkerRef.turret.state == 'down') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveStraightFromDown'); } if (bunkerSquadRef.enemyTarget.deployZone == bunkerSquadRef.deployZone && bunkerRef.turret.state == 'up') { bunkerRef.firing = true; bunkerRef.firingSecondary = true; bunkerRef.turret.gotoAndPlay('moveStraightFromUp'); } } bunkerRef.mainGunDisabled = true; if (bunkerSquadRef.enemyTarget.members[0].alive != undefined && bunkerRef.alive == true && bunkerRef.mainGunDisabled == false && bunkerRef.burstCounter < 1 && bunkerRef.firing == false && _root[teamName + 'SquadsOnScreen'][s].enemyTarget != undefined) { ++bunkerRef.burstCounter; bunkerRef.turret.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 { ++bunkerRef.waitCounter; } if (bunkerRef.waitCounter >= random(20) + 10) { bunkerRef.waitCounter = 0; bunkerRef.burstCounter = 0; } if (bunkerRef.alive == true && bunkerRef.secondGunDisabled == false && bunkerRef.mgBurstCounter <= random(12) + 6 && bunkerRef.firingSecondary == false && _root[teamName + 'SquadsOnScreen'][s].enemyTarget != undefined) { --bunkerRef.roundCount; ++bunkerRef.mgBurstCounter; bunkerRef.turret.secondGun.gotoAndPlay('firing'); bunkerRef.tracer.play(); if (teamName == 'british') { playSound('sound_lewis_fire' + (random(2) + 1)); } else { playSound('sound_mg42_fire' + (random(2) + 1)); } if (teamName == british.name) { hitEnemy(british.name, german.name, bunkerRef, bunkerSquadRef); } else { hitEnemy(german.name, british.name, bunkerRef, bunkerSquadRef); } } else { ++bunkerRef.mgWaitCounter; } if (bunkerRef.mgWaitCounter >= random(160) + 60) { bunkerRef.mgWaitCounter = 0; bunkerRef.mgBurstCounter = 0; } if (bunkerRef.roundCount <= 0) { bunkerRef.mgBurstCounter = 100; bunkerRef.mgWaitCounter = -300; bunkerRef.roundCount = 200; } } 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 += _root[teamName + 'SquadsOnScreen'][s].speed; rotateTankWheels(movingTankRef, tankWheelSpeed); if (movingTankRef._x >= world.bg._width - conquerWinArea) { if (movingTankRef._x >= world.bg._width && (movingTankRef.squadObjRef.deployZone == 1 || movingTankRef.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); removeSquad(movingTankRef.squadObjRef, movingTankRef.squadObjRef.type, teamName); } else { if (movingTankRef.squadObjRef.deployZone == 2 && movingTankRef.carryingPatient == false) { endBattle('british', 'conquer'); } } } } if (teamName == german.name && movingTankRef.alive == true) { movingTankRef._x -= _root[teamName + 'SquadsOnScreen'][s].speed; rotateTankWheels(movingTankRef, tankWheelSpeed); if (movingTankRef._x <= conquerWinArea) { if (movingTankRef._x < 0 && (movingTankRef.squadObjRef.deployZone == 1 || movingTankRef.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); removeSquad(movingTankRef.squadObjRef, movingTankRef.squadObjRef.type, teamName); } else { if (movingTankRef.squadObjRef.deployZone == 2 && movingTankRef.carryingPatient == false) { 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 += _root[teamName + 'SquadsOnScreen'][s].speed / 2; rotateTankWheels(tankRef, tankWheelSpeed / 2); if (tankRef._x >= world.bg._width - conquerWinArea) { if (tankRef._x >= world.bg._width && (tankRef.squadObjRef.deployZone == 1 || tankRef.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); removeSquad(tankRef.squadObjRef, movingTankRef.squadObjRef.type, teamName); } else { if (tankRef.squadObjRef.deployZone == 2 && movingTankRef.carryingPatient == false) { endBattle('british', 'conquer'); } } } } if (teamName == german.name && tankRef.alive == true && tankSquadRef.enemyTarget.type != 'tank' && tankRef._x >= tankSquadRef.enemyTarget.members[0]._x + 50) { tankRef._x -= _root[teamName + 'SquadsOnScreen'][s].speed / 2; rotateTankWheels(tankRef, tankWheelSpeed / 2); if (tankRef._x <= conquerWinArea) { if (tankRef._x < 0 && (tankRef.squadObjRef.deployZone == 1 || tankRef.squadObjRef.deployZone == 3)) { adjustMorale(teamName, 'flanked'); removeSquad(tankRef.squadObjRef, tankRef.squadObjRef.type, teamName); } else { if (tankRef.squadObjRef.deployZone == 2 && tankRef.carryingPatient == false) { endBattle('german', 'conquer'); } } } } if (tankRef.turretInPosition == false && tankRef.movingTurret == false) { if (tankSquadRef.enemyTarget.deployZone < tankSquadRef.deployZone && tankRef.turret.state == 'straight') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveUp'); } if (tankSquadRef.enemyTarget.deployZone > tankSquadRef.deployZone && tankRef.turret.state == 'straight') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveDown'); } if (tankSquadRef.enemyTarget.deployZone < tankSquadRef.deployZone && tankRef.turret.state == 'down') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveUpFromDown'); } if (tankSquadRef.enemyTarget.deployZone > tankSquadRef.deployZone && tankRef.turret.state == 'up') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveDownFromUp'); } if (tankSquadRef.enemyTarget.deployZone == tankSquadRef.deployZone && tankRef.turret.state == 'down') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveStraightFromDown'); } if (tankSquadRef.enemyTarget.deployZone == tankSquadRef.deployZone && tankRef.turret.state == 'up') { tankRef.firing = true; tankRef.firingSecondary = true; tankRef.turret.gotoAndPlay('moveStraightFromUp'); } } if (tankSquadRef.enemyTarget.members[0].alive != undefined && tankRef.alive == true && tankRef.mainGunDisabled == false && tankRef.burstCounter < 1 && tankRef.firing == false && _root[teamName + 'SquadsOnScreen'][s].enemyTarget != undefined) { ++tankRef.burstCounter; tankRef.turret.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.secondGunDisabled == false && tankRef.mgBurstCounter <= random(5) + 3 && tankRef.firingSecondary == false && _root[teamName + 'SquadsOnScreen'][s].enemyTarget != undefined) { ++tankRef.mgBurstCounter; tankRef.turret.secondGun.gotoAndPlay('firing'); tankRef.tracer.play(); if (teamName == 'british') { playSound('sound_lewis_fire' + (random(2) + 1)); } else { playSound('sound_mg42_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; default: } } } function soldierMovements(moveType, soldier, entrenching) { if (entrenching) { soldier.inTrench = true; } if (soldier.alive == true) { switch (moveType) { case 'medicPickup': soldier.gotoAndPlay('medicPickup'); break; case 'victory': soldier.gotoAndPlay('victory_' + soldier.position); break; case 'exitTrench': soldier.gotoAndPlay('exitTrench'); break; case 'defeatTrench': soldier.gotoAndPlay('defeat_trench'); break; case 'defeatGround': soldier.gotoAndPlay('defeat_standing'); break; case 'crouch': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_stop_crouch'); break; case 'stand': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_stop_standing'); break; case 'prone': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_stop_prone'); break; case 'proneToStand': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_start_prone'); break; case 'crouchToStand': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_start_crouch'); break; case 'standingToStand': soldier.moveAnim = false; soldier.gotoAndPlay(soldier.weaponType + '_start_standing'); break; case 'run': if (soldier.changingToMove == false) { soldier.gotoAndPlay(soldier.weaponType + '_run'); } break; default: } } } function startFiringDelay(firingSoldierRef) { firingSoldierRef.startFiring = true; } function findEnemy(friendlyTeam, enemyTeam) { for (var v9 in _root[friendlyTeam + 'SquadsOnScreen']) { var v2 = _root[friendlyTeam + 'SquadsOnScreen'][v9]; if (_root[enemyTeam + 'SquadsOnScreen'].length > 0 && v2.members[0].alive == true && v2.firingSmoke == false) { for (fee in _root[enemyTeam + 'SquadsOnScreen']) { var v3 = _root[enemyTeam + 'SquadsOnScreen'][fee]; if (v3.members[0].alive == true && v3.members[0].alive != undefined) { var v4 = v3.members[0]._x - v2.members[0]._x; if (friendlyTeam == german.name) { v4 = -v4; } inZone = false; if (v2.deployZone == v3.deployZone) { inZone = true; } if (v2.deployZone - 1 == v3.deployZone || v2.deployZone + 1 == v3.deployZone) { inZone = true; } if (v2.type == 'bazooka' && v3.type == 'tank' && v4 < v2.range + 200 && inZone) { v2.enemyTarget = v3; v2.targetProx = v4; if (v2.state != 'entrench' && v2.state != 'exitTrench') { v2.state = 'engaging'; } } if (v2.type == 'tank' && v3.type == 'bazooka' && v4 < v2.range && inZone) { v2.members[0].turretInPosition = false; v2.enemyTarget = v3; v2.targetProx = v4; v2.state = 'tankEngaging'; } if (v2.type == 'tank' && v3.type == 'tank' && v4 < v2.range && inZone) { v2.members[0].turretInPosition = false; v2.enemyTarget = v3; v2.targetProx = v4; v2.state = 'tankEngaging'; } if (v2.enemyTarget.members[0].alive != true && inZone && v3 != v2.enemyTarget && v4 < v2.range && v3.members.length > 0 && v2.members[0]._x > targetingBuffer && v2.members[0]._x < world.bg._width - targetingBuffer && v3.members[0]._x > targetingBuffer && v3.members[0]._x < world.bg._width - targetingBuffer) { v2.enemyTarget = v3; v2.targetProx = v4; if (v2.state != 'entrench' && v2.state != 'exitTrench' && v2.state != 'engaging') { if (v2.nearTrench == false && v2.enemyTarget.state == 'entrench' && v2.type == 'assault') { v2.lastState = v2.state; v2.state = 'assaultTrench'; } else { if (v2.nearTrench == false && v2.state != 'entrench' && v2.state != 'assaultTrench') { v2.state = 'engaging'; } } } if (v2.type == 'tank') { v2.members[0].turretInPosition = false; v2.state = 'tankEngaging'; } if (v2.type == 'bunker') { v2.members[0].turretInPosition = false; v2.state = 'bunkerEngaging'; } } if (v2.enemyTarget.members.length < 1 || v2.enemyTarget.members[0].alive == undefined || v2.enemyTarget.members[0].alive != true) { v2.enemyTarget = undefined; v2.targetProx = 999999; for (var v7 in v2.members) { v2.members[v7].startFiring = false; v2.members[v7].firing = false; } if (v2.staticUnit == false && v2.nearTrench == false && v2.state != 'assaultTrench' && v2.type != 'bunker' && v2.type != 'tank' && v2.lastState != 'halt' && v2.state != 'moving' && v2.state != 'entrench' && v2.state != 'exitTrench') { v2.lastState = v2.state; for (esx in v2.members) { v2.members[esx].changingToMove = false; v2.members[esx].moveAnim = false; } v2.state = 'moving'; } if (v2.nearTrench == true && v2.type != 'tank' && v2.state != 'exitTrench') { for (esx in v2.members) { v2.members[esx].moveAnim = false; } v2.state = 'entrench'; } if (v2.type == 'tank') { v2.members[0].turretInPosition = false; v2.state = 'tankMoving'; } if (v2.type == 'bunker') { v2.state = 'bunkerIdle'; } if (v2.staticUnit) { v2.state = 'static'; } } } } } else { v2.enemyTarget = undefined; v2.targetProx = 999999; for (var v8 in v2.members) { v2.members[v8].startFiring = false; v2.members[v8].firing = false; } if (v2.staticUnit == false && v2.nearTrench == false && v2.state != 'moving' && v2.state != 'assaultTrench' && v2.type != 'bunker' && v2.type != 'tank' && v2.lastState != 'halt' && v2.state != 'halt' && v2.state != 'entrench' && v2.state != 'exitTrench') { v2.lastState = v2.state; for (esxss in v2.members) { v2.members[esxss].changingToMove = false; v2.members[esxss].moveAnim = false; } v2.state = 'moving'; } if (v2.type == 'tank') { v2.members[0].turretInPosition = false; v2.state = 'tankMoving'; } if (v2.type == 'bunker') { v2.members[0].turretInPosition = false; v2.state = 'bunkerIdle'; } if (v2.staticUnit) { v2.state = 'static'; } } } } 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']) { if (currentMap['coverZone' + _root[teamName + 'SquadsOnScreen'][w].deployZone].length > 0) { str = _root[teamName + 'SquadsOnScreen'][w]; ltr = _root[teamName + 'SquadsOnScreen'][w].members[0]; if (str.state != 'exitTrench' && str.state != 'entrench' && str.state != 'engaging' && ltr.type != 'tankMarkIV' && ltr.type != 'bunkerBase') { for (var v3 in trenches) { if (trenches[v3].zone == str.deployZone) { if (teamName == 'british') { if (trenches[v3].zone == str.deployZone && trenches[v3]._x - ltr._x <= trenchBoundary && trenches[v3]._x - ltr._x > 0) { if (trenches[v3].slot1.team != 'german') { str.nearTrench = true; } } else { str.nearTrench = false; } } else { if (teamName == 'german') { if (trenches[v3].zone == str.deployZone && ltr._x - trenches[v3]._x <= trenchBoundary && ltr._x - trenches[v3]._x > 0) { if (trenches[v3].slot1.team != 'british') { str.nearTrench = true; } } else { str.nearTrench = false; } } } if (str.nearTrench == true && str.state != 'exitTrench') { if (trenches[v3].owner == teamName || trenches[v3].owner == undefined) { if (trenches[v3].slot1 != 'empty' && trenches[v3].slot1 != str && trenches[v3].slot1 != undefined) { if (str.inTrench == false) { str.state = 'entrench'; str.trenchRef = trenches[v3]; str.passingTrench = true; str.enemyTarget = undefined; } } if (str.inTrench == false) { str.state = 'entrench'; if ((trenches[v3].slot1 == 'empty' || trenches[v3].slot1 == undefined) && str.state != 'exitTrench') { if (trenches[v3].owner == teamName || trenches[v3].owner == undefined) { trenches[v3].owner = teamName; str.trenchRef = trenches[v3]; str.trenchNumRef = v3; str.trenchSlotRef = r; str.inTrench = true; trenches[v3].slot1 = str; str.passingTrench = false; str.enemyTarget = undefined; } } } } else { if (trenches[v3].owner != teamName && trenches[v3].owner != undefined) { if (trenches[v3].slot1 != 'empty' && trenches[v3].slot1 != str && trenches[v3].slot1 != undefined) { if (str.inTrench == false) { str.state = 'entrench'; str.trenchRef = trenches[v3]; str.inTrench = true; str.passingTrench = true; str.enemyTarget = undefined; } } if (str.inTrench == false) { str.state = 'entrench'; if ((trenches[v3].slot1 == 'empty' || trenches[v3].slot1 == undefined) && str.state != 'exitTrench') { if (teamName != playerTeam.team) { trenches[v3].locked = false; } trenches[v3].owner = teamName; str.trenchRef = trenches[v3]; str.trenchNumRef = v3; str.trenchSlotRef = r; str.inTrench = true; trenches[v3].slot1 = str; str.passingTrench = false; str.enemyTarget = undefined; } } } } } } } } } } } function findWire(teamName) { if (currentMap.wire.length > 0) { 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 findWounded(teamName) { for (med in _root[teamName + 'SquadsOnScreen']) { if (_root[teamName + 'SquadsOnScreen'][med].type == 'medic') { var v2 = _root[teamName + 'SquadsOnScreen'][med].members[0]; for (wnd in _root[teamName + 'Wounded']) { var v3 = _root[teamName + 'Wounded'][wnd]; if (v2.deployZone == v3.deployZone && v2.hasPatient == false) { if (teamName == 'british') { if (v3._x < v2.closestWoundedX || v2.closestWoundedX == undefined) { v2.closestWoundedX = v3._x; v2.closestWoundedY = v3._y; v2.patientObj = v3; v2.patientCost = v3.squadObjRef.cost; } } if (teamName == 'german') { if (v3._x > v2.closestWoundedX || v2.closestWoundedX == undefined) { v2.closestWoundedX = v3._x; v2.closestWoundedY = v3._y; v2.patientObj = v3; v2.patientCost = v3.squadObjRef.cost; } } } } if (v2.closestWoundedX != undefined) { v2._y = v2.closestWoundedY; v2.patientWP = v2.closestWoundedX; v2.hasPatient = true; } } } } function removeWounded(medicName) { removeMovieClip(medicName.patientObj.ref); } function enemyUnitAI() { for (esai in _root[compTeam.team + 'SquadsOnScreen']) { enemySquadAIRef = _root[compTeam.team + 'SquadsOnScreen'][esai]; switch (_root.currentMap.enemyMood) { case 'aggressive': if (enemySquadAIRef.state == 'entrench' && enemySquadAIRef.allMembersInTrench == true && enemySquadAIRef.enemyTarget == undefined) { if (random(2) == 0 && (enemySquadAIRef.type == 'riflemen' || enemySquadAIRef.type == 'assault')) { enemySquadAIRef.state = 'exitTrench'; } if (random(3) == 0 && (enemySquadAIRef.type == 'sniper' || enemySquadAIRef.type == 'bazooka')) { enemySquadAIRef.state = 'exitTrench'; } if (random(5) == 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(5) == 0 && (enemySquadAIRef.type == 'riflemen' || enemySquadAIRef.type == 'assault')) { enemySquadAIRef.state = 'exitTrench'; } if (random(7) == 0 && (enemySquadAIRef.type == 'sniper' || enemySquadAIRef.type == 'bazooka')) { enemySquadAIRef.state = 'exitTrench'; } if (random(15) == 0 && (enemySquadAIRef.type == 'officer' || enemySquadAIRef.type == 'machineGun')) { enemySquadAIRef.state = 'exitTrench'; } } break; case 'balanced': if (enemySquadAIRef.state == 'entrench' && enemySquadAIRef.allMembersInTrench == true && enemySquadAIRef.enemyTarget == undefined) { if (random(3) == 0 && (enemySquadAIRef.type == 'riflemen' || enemySquadAIRef.type == 'assault')) { enemySquadAIRef.state = 'exitTrench'; } if (random(7) == 0 && (enemySquadAIRef.type == 'sniper' || enemySquadAIRef.type == 'bazooka')) { enemySquadAIRef.state = 'exitTrench'; } if (random(10) == 0 && (enemySquadAIRef.type == 'officer' || enemySquadAIRef.type == 'machineGun')) { enemySquadAIRef.state = 'exitTrench'; } } break; case 'static': break; default: } } } 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) { chooseSpawnZone(); firstEnemyUnit = false; enemyUnitRate = enemyUnitRateMax; if (playingSkirmish == true) { randomEnemyUnit = random(currentMap.enemyUnits.length); createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit], chosenSpawn); } else { createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave], chosenSpawn); } } if (createEnemyUnits && enemyUnitRate < 0) { chooseSpawnZone(); enemyUnitRate = enemyUnitRateMax; ++enemyUnitWave; if (enemyUnitWave > currentMap.enemyUnits.length) { enemyUnitWave = 0; } if (playingSkirmish == true) { randomEnemyUnit = random(currentMap.enemyUnits.length); createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit], chosenSpawn); } else { createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave], chosenSpawn); } } if (createEnemyUnits && AIpanicMode == true && enemyUnitRate <= enemyUnitRate / 2) { chooseSpawnZone(); enemyUnitRate = enemyUnitRateMax; ++enemyUnitWave; if (enemyUnitWave > currentMap.enemyUnits.length) { enemyUnitWave = 0; } if (playingSkirmish == true) { randomEnemyUnit = random(currentMap.enemyUnits.length); createSquad(compTeam.team, currentMap.enemyUnits[randomEnemyUnit], chosenSpawn); } else { createSquad(compTeam.team, currentMap.enemyUnits[enemyUnitWave], chosenSpawn); } } } function setupEnemySupportGenerator() { enemySupportRateMax = currentMap.enemySupportRate; enemySupportRate = enemySupportRateMax; enemySupportWave = 0; } function enemySupportGenerator() { --enemySupportRate; if (enemySupportRate < 0) { enemySupportRate = enemySupportRateMax; if (difficulty == 'recruit') { enemySupportRate = enemySupportRateMax * 1.4; } if (difficulty == 'hardened') { enemySupportRate = enemySupportRateMax * 0.5; } 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 runEnemyTimers() { for (etx in enemyTimers) { if (enemyTimers[etx].active == false) { --enemyTimers[etx].timer; } if (enemyTimers[etx].timer <= 0) { enemyTimers[etx].active = true; enemyTimers[etx].timer = enemyTimers[etx].timerMax; } } } function checkEnemyUnitsAvailable() { enemyUnitReadyForSpawn = false; for (cet in enemyTimers) { if (enemyTimers[cet].active == true) { enemyUnitReadyForSpawn = true; } } } function spawnEnemy() { if (spawnEnemyActive) { hud.enemyResources.text = enemyResources.RP; --spawnEnemyTimer; if (spawnEnemyTimer < 0) { firstEnemyUnit = false; spawnEnemyTimer = spawnEnemyTimerMax; if (difficulty == 'recruit') { spawnEnemyTimer = spawnEnemyTimerMax * 1.3; } if (difficulty == 'hardened') { spawnEnemyTimer = spawnEnemyTimerMax * 0.75; } checkEnemyUnitsAvailable(); if (enemyUnitReadyForSpawn == true) { randomSpecialUnit = new Array(); randomEnemyUnit = currentMap.enemyUnits[random(currentMap.enemyUnits.length)]; if (enemyResources.RP >= 300) { randomSpecialUnit = new Array(); for (ceu in currentMap.enemyUnits) { if (currentMap.enemyUnits[ceu] == 'riflemen' && enemy_riflemen.active) { randomSpecialUnit.push('riflemen'); } if (currentMap.enemyUnits[ceu] == 'assault' && enemy_assault.active) { randomSpecialUnit.push('assault'); } if (random(waitChance) == 0) { randomSpecialUnit.push('wait'); } } randomEnemyUnit = randomSpecialUnit[random(randomSpecialUnit.length)]; } if (enemyResources.RP >= 400) { randomSpecialUnit = new Array(); for (ceu in currentMap.enemyUnits) { if (currentMap.enemyUnits[ceu] == 'officer' && enemy_officer.active) { randomSpecialUnit.push('officer'); } if (currentMap.enemyUnits[ceu] == 'machineGun' && enemy_machineGun.active) { randomSpecialUnit.push('machineGun'); } if (currentMap.enemyUnits[ceu] == 'bazooka' && enemy_bazooka.active) { randomSpecialUnit.push('bazooka'); } if (currentMap.enemyUnits[ceu] == 'riflemen' && enemy_riflemen.active) { randomSpecialUnit.push('riflemen'); } if (currentMap.enemyUnits[ceu] == 'assault' && enemy_assault.active) { randomSpecialUnit.push('assault'); } if (random(waitChance) == 0) { randomSpecialUnit.push('wait'); } } randomEnemyUnit = randomSpecialUnit[random(randomSpecialUnit.length)]; } if (enemyResources.RP >= 500) { randomSpecialUnit = new Array(); for (ceu in currentMap.enemyUnits) { if (currentMap.enemyUnits[ceu] == 'sniper' && enemy_sniper.active) { randomSpecialUnit.push('sniper'); } if (currentMap.enemyUnits[ceu] == 'mortarTeam' && enemy_mortarTeam.active) { randomSpecialUnit.push('mortarTeam'); } if (currentMap.enemyUnits[ceu] == 'officer' && enemy_officer.active) { randomSpecialUnit.push('officer'); } if (currentMap.enemyUnits[ceu] == 'machineGun' && enemy_machineGun.active) { randomSpecialUnit.push('machineGun'); } if (currentMap.enemyUnits[ceu] == 'bazooka' && enemy_bazooka.active) { randomSpecialUnit.push('bazooka'); } if (currentMap.enemyUnits[ceu] == 'riflemen' && enemy_riflemen.active) { randomSpecialUnit.push('riflemen'); } if (currentMap.enemyUnits[ceu] == 'assault' && enemy_assault.active) { randomSpecialUnit.push('assault'); } if (random(waitChance) == 0) { randomSpecialUnit.push('wait'); } } randomEnemyUnit = randomSpecialUnit[random(randomSpecialUnit.length)]; } if (enemyResources.RP >= 800) { for (ceu in currentMap.enemyUnits) { if (currentMap.enemyUnits[ceu] == 'tank' && enemy_tank.active) { randomEnemyUnit = currentMap.enemyUnits[ceu]; } } } enemySquadToDeploy = new Object(); enemySquadToDeploy.unitName = randomEnemyUnit; enemySquadToDeploy.cost = _root[compTeam.team][randomEnemyUnit].cost; resourcesCheck(enemySquadToDeploy.cost, 'enemy'); if (_root.enemyResources.canAfford == true && _root['enemy_' + enemySquadToDeploy.unitName].active == true) { chooseSpawnZone(enemySquadToDeploy.unitName); createSquad(compTeam.team, enemySquadToDeploy.unitName, chosenSpawn); _root.adjustRP('remove', enemySquadToDeploy.cost, 'enemy'); for (ett in enemyTimers) { if (enemyTimers[ett].name == enemySquadToDeploy.unitName) { enemyTimers[ett].active = false; } } } } } } } function chooseSpawnZone(squadType) { currentEnemySpawn = 0; while (currentEnemySpawn == 0) { if (playerTeam.team == 'british') { var v2 = 0; while (v2 < britishSquadsOnScreen.length) { if (britishSquadsOnScreen[v2].members[0]._x != undefined) { if (britishSquadsOnScreen[v2].members[0]._x > britishSquadsOnScreen[v2 + 1].members[0]._x && britishSquadsOnScreen[v2 + 1].members[0]._x != undefined) { currentEnemySpawn = britishSquadsOnScreen[v2].deployZone; } } ++v2; } } else { var v2 = 0; while (v2 < germanSquadsOnScreen.length) { if (germanSquadsOnScreen[v2].members[0]._x != undefined) { if (germanSquadsOnScreen[v2].members[0]._x < germanSquadsOnScreen[v2 + 1].members[0]._x && germanSquadsOnScreen[v2 + 1].members[0]._x != undefined) { currentEnemySpawn = germanSquadsOnScreen[v2].deployZone; } } ++v2; } } if (random(1000) <= randomSpawnChance) { currentEnemySpawn = random(3) + 1; } if (currentEnemySpawn == 0) { currentEnemySpawn = 2; } if (squadType == 'tank') { if (currentMap['coverZone' + currentEnemySpawn].length > 0) { currentEnemySpawn = 0; } } } chosenSpawn = _root['deploymentZone' + currentEnemySpawn]; } function hitEnemy(frit, targt, atk, ats) { var v2 = ats.enemyTarget; var v4 = atk.damage; trenchDefence = _root['cover_' + v2.trenchRef.coverType].defence; if (ats.type != 'mortarTeam') { if (v2.type == 'bunker') { v4 /= 4; } if (v2.type == 'tank') { v2.health -= v4 / 16; } else { if (atk.inTrench == true) { v4 *= trenchBonus; if (v2.type == 'assault') { v4 *= 0.7; } if (frit == 'german') { if (german_slot5_upgrade.active && atk.type == 'machineGun') { v4 *= german_slot5_upgrade.bonus; } } } if (v2.state == 'entrench') { v4 *= trenchDefence; if (frit == 'british') { } if (frit == 'german') { if (german_slot2_upgrade.active) { v4 *= german_slot2_upgrade.bonus; } if (german_slot6_upgrade.active) { v4 *= german_slot6_upgrade.bonus; } } } if (atk.nearOfficer == true) { v4 *= officerBonus; if (german_slot11_upgrade.active == true) { v4 *= german_slot11_upgrade.bonus; } } if (frit == 'british') { if (british_slot1_upgrade.active) { v4 *= british_slot1_upgrade.bonus; } if (british_slot5_upgrade.active == true && atk.type == 'assault') { v4 *= british_slot5_upgrade.bonus; } if (british_slot6_upgrade.active == true && atk.type == 'assault' && ats.enemyTarget.deployZone != ats.deployZone) { v4 *= british_slot6_upgrade.bonus; } if (british_slot9_upgrade.active == true && atk.type == 'machineGunner') { v4 *= british_slot9_upgrade.bonus; } if (british_slot19_upgrade.active == true && atk.type == 'tank') { v4 *= british_slot19_upgrade.bonus; } if (german_slot2_upgrade.active) { v4 *= german_slot2_upgrade.bonus; } if (german_slot6_upgrade.active && ats.enemyTarget.deployZone != ats.deployZone) { v4 *= german_slot6_upgrade.bonus; } if (german_slot10_upgrade.active) { v4 *= german_slot10_upgrade.bonus; } } if (frit == 'german') { if (german_slot1_upgrade.active) { v4 *= german_slot1_upgrade.bonus; } if (german_slot5_upgrade.active) { v4 *= german_slot5_upgrade.bonus; } if (german_slot9_upgrade.active) { v4 *= german_slot9_upgrade.bonus; } if (british_slot2_upgrade.active) { v4 *= british_slot2_upgrade.bonus; } } if (ats.smoked == true) { v4 *= smokedEffect; } if (frit == playerTeam.team) { if (difficulty == 'recruit') { v2.health -= v4 * damageModifier * 1.1; } if (difficulty == 'hardened') { v2.health -= v4 * damageModifier * 0.91; } if (difficulty != 'hardened' && difficulty != 'recruit') { v2.health -= v4 * damageModifier; } } else { v2.health -= v4 * damageModifier; } } var v5 = v2.members.length - 1; if (v2.type == 'tank' && v2.members[0].alive == true) { if (random(10) <= showBulletDustChance) { playSound('sound_ricochetMetal' + (random(2) + 1)); v2.members[v5]['ricochet' + (random(11) + 1)].play(); } if (random(100) <= showBulletDustChance) { bulletDust(v2.members[v5]._x + (random(120) - 60), v2.members[v5]._y); } } if (v2.health <= v2.members[v5].health && v2.members[v5].alive == true && v2.type != 'bunker' && v2.type != 'tank') { v2.members[v5].alive = false; updateTrenchInterface(v2.trenchRef); adjustMorale(targt, v2.type, 'normal'); if (frit == playerTeam.team) { updateExperience(v2.type, v2.members[v5]); ++career_soldiersKilled; } else { ++career_soldiersLost; } adjustStats('kill', frit); if (random(10) == 0) { v2.members[v5].torso.bloodSplat._visible = true; } if (random(10) == 0) { v2.members[v5].head.bloodSplat._visible = true; } v2.members[v5].gotoAndPlay(v2.members[v5].position + '_death'); setTimeout(fadeDeadSoldier, clearDeadSoldierTime, v2.members[v5]); _root['uniSol' + v2.members[v5].name] = v2.members[v5]; setTimeout(sortDeadSoldiers, sortDeadDelay, _root['uniSol' + v2.members[v5].name]); v2.members[v5]._visible = true; v2.members[v5].selectedRing.alphaTo(0, 0.3); v2.members[v5].healthBar.alphaTo(0, 0.3); v2.members[v5].coverIcon.alphaTo(0, 0.3); v2.members[v5].officerStar.alphaTo(0, 0.3); if (ats.type == 'sniper' && v5 != 0) { playVoice('sniper', targt); if (v2.team != playerTeam.team && v2.enemyTarget == undefined && v2.inTrench == true) { if (random(2) == 0) { v2.state = 'exitTrench'; } } } if (ats.type == 'machineGun' && v5 != 0) { playVoice('machineGun', targt); } if (ats.type == 'tank' && v5 != 0) { playVoice('tank', targt); } delete v2.members[v5].onRelease; delete v2.members[v5].onPress; delete v2.members[v5].onRollOver; delete v2.members[v5].onRollOut; v2.members.splice(v5, 1); playSound('sound_soldierDeath' + (random(10) + 1)); } else { if (ats.suppressingFire == true) { if (ats.suppressionCounter > 0 && (v2.state == 'engaging' || v2.state == 'entrench' || v2.state == 'assaultTrench')) { --ats.suppressionCounter; var v9 = random(v2.members.length); if (v2.members[v9].inFiringPosition == true && v2.members[v9].suppressed == false) { v2.members[v9].gotoAndPlay('suppressed_' + v2.members[v9].position); v2.members[v9].suppressed = true; } } } if (ats.suppressionCounter <= 0) { ats.suppressingFire = false; } if (random(100) <= showBulletDustChance) { bulletDust(v2.members[v5]._x + (random(120) - 60), v2.members[v5]._y); } } if (v2.members[0].health == undefined) { for (hs in _root[targt + 'SquadsOnScreen']) { if (_root[targt + 'SquadsOnScreen'][hs].name == v2.name) { _root['loop' + v2.name].stop(); _root.trenches[v2.trenchNumRef].slot1 = 'empty'; if (_root[targt + 'SquadsOnScreen'][hs].selectedUnit == true) { showIntelDeathMessage(_root[targt + 'SquadsOnScreen'][hs]); deselectAll(); } if (targt == playerTeam.team) { --_root['soldiersZone' + _root[targt + 'SquadsOnScreen'][hs].deployZone]; } _root[targt + 'SquadsOnScreen'].splice(hs, 1); playVoice('enemyDown', frit); adjustStats('unitLost', targt); } } } } } function explosiveHit(explosionName, teamName, ownerTeam, explosionType) { for (ex in _root[teamName + 'SquadsOnScreen']) { cext = _root[teamName + 'SquadsOnScreen'][ex]; var v6 = cext.members[0]._x - explosionName._x; var v7 = cext.members[0]._y - explosionName._y; if ((v6 < 80 && v6 >= 0 || v6 > -80 && v6 <= 0) && (v7 < 80 && v7 >= 0 || v7 > -80 && v7 <= 0)) { if (cext.smoked == true) { explosionSurvivalChance /= 3; } if (explosionType == 'bazookaRound') { playVoice('bazooka', teamName); } if (cext.type == 'tank' || cext.type == 'bunker') { explosionSurvivalChance = 1000000; } if (random(explosionSurvivalChance) != 0) { for (em in _root[teamName + 'SquadsOnScreen'][ex].members) { explMemberRef = _root[teamName + 'SquadsOnScreen'][ex].members[em]; if (teamName != ownerTeam) { playVoice('incoming', teamName); } _root['unique' + _root[teamName + 'SquadsOnScreen'][ex].members[em].name] = _root[teamName + 'SquadsOnScreen'][ex].members[em]; if (explMemberRef.alive == true) { if (explosionName.collision.hitTest(explMemberRef.collision) == true && explMemberRef.alive == true) { if (explMemberRef.squadType == 'tank' || explMemberRef.squadType == 'bunker') { explosiveDamage = 0; explosiveDamage = _root[ownerTeam][explosionType].damage; if (british_slot20_upgrade.active || german_slot20_upgrade.active) { explosiveDamage *= british_slot20_upgrade.bonus; } _root[teamName + 'SquadsOnScreen'][ex].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 - 30); playSound('sound_metalImpact'); if (explMemberRef.squadType == 'tank') { if (random(1000) < tankDamageChance) { switch (random(3)) { case 0: if (explMemberRef.secondGunDisabled == false) { explMemberRef.secondGunDisabled = true; reportTankDamage(explMemberRef, 'MG'); } break; case 1: if (explMemberRef.mainGunDisabled == false) { explMemberRef.mainGunDisabled = true; reportTankDamage(explMemberRef, 'MAIN GUN'); } break; case 2: if (explMemberRef.engineDisabled == false) { explMemberRef.engineDisabled = true; explMemberRef.speed -= explMemberRef.speed / tankEngineBrokenEffect; reportTankDamage(explMemberRef, 'ENGINE'); } break; default: } } } if (_root[teamName + 'SquadsOnScreen'][ex].health <= 0) { explMemberRef.alive = false; _root[teamName + 'SquadsOnScreen'][ex].state = 'tankDead'; explMemberRef.damageClip._alpha = 0; explMemberRef.damageClip._visible = true; explMemberRef.damageClip.alphaTo(100, 3); explMemberRef.damageClip.fireAnim1.alphaTo(0, 6, 'easeOutSine', 5 + random(10), function () { removeMovieClip(this); }); explMemberRef.damageClip.fireAnim2.alphaTo(0, 6, 'easeOutSine', 5 + random(10), function () { removeMovieClip(this); }); explMemberRef.damageClip.fireAnim3.alphaTo(0, 6, 'easeOutSine', 5 + random(10), function () { removeMovieClip(this); }); explMemberRef.damageClip.fireAnim4.alphaTo(0, 6, 'easeOutSine', 5 + random(10), function () { removeMovieClip(this); }); explMemberRef.damageClip.fireAnim1.fireAnim.gotoAndPlay(random(45) + 1); explMemberRef.damageClip.fireAnim2.fireAnim.gotoAndPlay(random(45) + 1); ++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); metalFragmentParticle(explosionName._x + random(50), explosionName._y + random(25) + 50); playSound('sound_metalImpact'); explMemberRef.tankBody.gotoAndStop('destroyed'); explMemberRef.turret.gotoAndStop('off'); if (explMemberRef.squadType == 'tank') { if (random(2) > 0) { explMemberRef.damageClip.fireAnim3.fireAnim.gotoAndPlay(random(45) + 1); } else { explMemberRef.damageClip.fireAnim3._visible = false; } if (random(2) > 0) { explMemberRef.damageClip.fireAnim4.fireAnim.gotoAndPlay(random(45) + 1); } else { explMemberRef.damageClip.fireAnim4._visible = false; } } _root['loop' + explMemberRef.name].volumeTo(0, 2, 'easeOutSine', 0, function () { this.stop(); }); explMemberRef.healthBar._alpha = 0; explMemberRef.coverIcon._alpha = 0; adjustMorale(explMemberRef.squadObjRef.team, explMemberRef.squadType, 'normal'); adjustStats('kill', ownerTeam); adjustStats('unitLost', explMemberRef.squadObjRef.team); sortDeadSoldiers(_root[teamName + 'SquadsOnScreen'][ex].members[em]); delete explMemberRef.onRelease; delete explMemberRef.onPress; delete explMemberRef.onRollOver; delete explMemberRef.onRollOut; _root[teamName + 'SquadsOnScreen'][ex].members.splice(em, 1); if (_root[teamName + 'SquadsOnScreen'][ex].members.length == 0) { if (_root[teamName + 'SquadsOnScreen'][ex].objective == true && game.state != 'endBattle') { setTimeout(endBattle, 3000, ownerTeam, 'objective'); } _root[teamName + 'SquadsOnScreen'].splice(ex, 1); } } } if (explMemberRef.squadType != 'tank' && explMemberRef.squadType != 'bunker') { explMemberRef.alive = false; updateTrenchInterface(cext.trenchRef); if (teamName != ownerTeam) { adjustStats('kill', ownerTeam); } adjustMorale(teamName, _root[teamName + 'SquadsOnScreen'][ex].type, 'explosive', ownerTeam); if (ownerTeam == playerTeam.team && teamName != playerTeam.team) { updateExperience(_root[teamName + 'SquadsOnScreen'][ex].type, explMemberRef); } _root[teamName + 'SquadsOnScreen'][ex].health -= _root[teamName + 'SquadsOnScreen'][ex].minHealth; if (random(2) > 0 && explosionType != 'airSupport') { bodyRagdoll(explMemberRef); _root['unique' + _root[teamName + 'SquadsOnScreen'][ex].members[em].name].gotoAndPlay('exploded_death'); } else { if (random(10) == 0) { cext.members[em].head.bloodSplat._visible = true; } if (random(10) == 0) { cext.members[em].torso.bloodSplat._visible = true; } _root['unique' + _root[teamName + 'SquadsOnScreen'][ex].members[em].name].gotoAndPlay(_root['unique' + _root[teamName + 'SquadsOnScreen'][ex].members[em].name].position + '_death'); } setTimeout(fadeDeadSoldier, clearDeadSoldierTime, _root['unique' + _root[teamName + 'SquadsOnScreen'][ex].members[em].name]); playSound('sound_soldierDeath' + (random(10) + 1)); bldCloud = new Object(); bldCloud.x = explMemberRef._x; bldCloud.y = explMemberRef._y; bloodCloudParticle(bldCloud.x, bldCloud.y - random(15)); _root[teamName + 'SquadsOnScreen'][ex].members[em].selectedRing.alphaTo(0, 0.3); _root[teamName + 'SquadsOnScreen'][ex].members[em].healthBar.alphaTo(0, 0.3); _root[teamName + 'SquadsOnScreen'][ex].members[em].coverIcon.alphaTo(0, 0.3); _root[teamName + 'SquadsOnScreen'][ex].members[em].officerStar.alphaTo(0, 0.3); _root[teamName + 'SquadsOnScreen'][ex].members[em]._visible = true; _root['uniSol' + cts.members[hm].name] = cts.members[hm]; setTimeout(sortDeadSoldiers, sortDeadDelay, _root['uniSol' + cts.members[hm].name]); delete _root[teamName + 'SquadsOnScreen'][ex].members[em].onRelease; delete _root[teamName + 'SquadsOnScreen'][ex].members[em].onPress; delete _root[teamName + 'SquadsOnScreen'][ex].members[em].onRollOver; delete _root[teamName + 'SquadsOnScreen'][ex].members[em].onRollOut; _root[teamName + 'SquadsOnScreen'][ex].members.splice(em, 1); if (_root[teamName + 'SquadsOnScreen'][ex].members.length <= 0) { if (_root[teamName + 'SquadsOnScreen'][ex].selectedUnit == true) { showIntelDeathMessage(_root[teamName + 'SquadsOnScreen'][ex]); deselectAll(); } if (teamName == playerTeam.team) { --_root['soldiersZone' + _root[teamName + 'SquadsOnScreen'][ex].deployZone]; } _root.trenches[_root[teamName + 'SquadsOnScreen'][ex].trenchNumRef].slot1 = 'empty'; _root[teamName + 'SquadsOnScreen'].splice(ex, 1); } } } } } } explosionSurvivalChance = explosionSurvivalChanceBase; } } } function playExplodedDeath(deadSoldierRef) { deadSoldierRef.gotoAndPlay('exploded_death'); } function removeSquad(squadName, squadType, teamName) { var v5 = squadType; for (rs in _root[teamName + 'SquadsOnScreen']) { if (squadName.name == _root[teamName + 'SquadsOnScreen'][rs].name) { clearIntelInterface(squadName); for (rm in squadName.members) { removeMovieClip(squadName.members[rm]); squadName.members.splice(rm, 1); } _root['loop' + squadName.name].volumeTo(0, 2, 'easeOutSine', 0, function () { this.stop(); }); _root[teamName + 'SquadsOnScreen'].splice(rs, 1); } } if (v5 != 'medic') { adjustSP(teamName); } } 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 v2 = world.attachMovie(particleType, particleName + i, particleCount); v2.ref = particleName + i; v2.partType = particleType; v2.gravity = particleGravity; if (random(2) > 0) { v2.HorzEnergy = Math.random() * particleHorizontalEnergy; } else { v2.HorzEnergy = Math.random() * -particleHorizontalEnergy; } v2.VertEnergy = -particleVerticalEnergy + Math.random() * particleVerticalEnergy / 2; if (particleScaling == true) { v2._yscale = random(50) + 50; v2._xscale = v2._yscale; } v2._x = particleX; v2._y = particleY; v2.originY = particleY; if (particleChangeAngle == true) { if (random(2) > 0) { v2.angle = random(60); } else { v2.angle = random(60) + 300; } } v2._alpha = random(30) + 70; v2._rotation = v2.angle; v2.rotation = particleRotationRate; v2.acceleration = 5; v2.particleFade = particleFade; v2.splash = particleSplash; v2.onEnterFrame = _root.moveParticle; ++i; } } function moveParticle() { with (this) { _alpha -= particleFade; if (_alpha < 15 || this._y > this.originY + 10) { removeMovieClip(this); } this._rotation += rotation; this.x = Math.cos(this.angle * Math.PI / 180) * HorzEnergy; _x -= this.x; VertEnergy += gravity; _y += VertEnergy; } } 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 airSupportDustParticle(targetX, targetY) { particleEmitter('particle_dustShaft_bulletLarge', 'dustPart', 100, targetX, targetY, 0.015, 1, 0, 0.5, 1.75, 0.05, true, false); particleEmitter('particle_cloudDust_bulletLarge', 'dustPart', 100, targetX, targetY, 0.01, 2, 0.5, 0.5, 1.5, 0.05, true, true); particleEmitter('particle_dirt2_bulletLarge', 'dirtPart', 100, targetX + (random(50) - 25), targetY - 20, 0.4, 2, 1, 1, 6, 1.5, true, true); } 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) { 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; break; case 9: default: } 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.x = Math.cos(this.angle * Math.PI / 180) * this.HorzEnergy; this._x -= this.x; this.VertEnergy += this.gravity; this._y += this.VertEnergy; 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); screenShake(3, 8); } function mineExplosion(targetX, targetY) { mineExplosionParticle(targetX, targetY); randomSound = 'sound_mine_explosion' + (random(2) + 1); playSound(randomSound); screenShake(3, 8); } function artilleryExplosion(targetX, targetY) { artilleryExplosionParticle(targetX, targetY); randomSound = 'sound_artillery_explosion' + (random(3) + 1); playSound(randomSound); screenShake(10, 14); } function grenadeExplosion(targetX, targetY) { grenadeExplosionParticle(targetX, targetY); randomSound = 'sound_grenade_explosion' + (random(2) + 1); playSound(randomSound); } function airSupportExplosion(targetX, targetY) { airSupportDustParticle(targetX, targetY); randomSound = 'sound_bulletHit' + (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) { ++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; } } } }; } 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 += 2; 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 screenShake(magnitude, time) { if (screenShaking == false) { screenShakeTimer = time; screenShaking = true; screenOrigin.x = world._x; screenOrigin.y = world._y; s = screenShakeTimer; while (s > 0) { setTimeout(shakeScreen, screenShakeDelay * s, magnitude); --s; } setTimeout(resetScreenShake, time * screenShakeDelay); } } function shakeScreen(magnitude) { world._x -= random(magnitude) - magnitude / 2; world._y -= random(magnitude) - magnitude / 2; if (world._y < -10) { world._y = -10; } if (world._y > 0) { world._y = 0; } if (world._x > 0) { world._x = 0; } if (world._x < -(world.bg._width + 300)) { world._x = -(world.bg._width + 300); } } function resetScreenShake() { screenShaking = false; } function launchSpecialAttack(type, targetX, targetY, owner, special, ownerUnit) { switch (type) { case 'artillery': artilleryStrike(targetX, targetY, owner); break; case 'mortar': mortarStrike(targetX, targetY, owner, special, ownerUnit); break; case 'mortarAI': mortarStrikeAI(targetX, targetY, owner, special, ownerUnit); break; case 'smokeGrenade': throwSmokeCommand('smokeGrenade', targetX, targetY, ownerUnit); break; case 'airSupport': airStrike(targetX, targetY, owner); break; case 'smoke': smokeStrike(targetX, targetY, owner); break; case 'antiTank': antiTankStrike(targetX, targetY, owner); break; default: } } 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 (ownerTeam == 'british' && british_slot21_upgrade.active || ownerTeam == 'german' && german_slot21_upgrade.active) { 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(); this._x = targetX + (random(250) - 125); this._y = targetY + (random(100) - 50); if (this._y < 140) { this._y = 140; } if (this._y > 340) { this._y = 340; } this.ownerTeam = ownerTeam; delete this.onEnterFrame; } } }; } function artilleryScorchDecal(targetX, targetY) { ++decals; world.attachMovie('decal_artilleryScorch', 'decal' + decals, depth_world_decals + decals); world['decal' + decals]._yscale = random(40) + 90; world['decal' + decals]._xscale = world['decal' + decals]._yscale; 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 airStrike(targetX, targetY, ownerTeam) { adjustStats('supportUsed', ownerTeam); tempNumAirStrikeRounds = numAirSupportRounds; v = 0; while (v < tempNumAirStrikeRounds) { airSupportRound(targetX, targetY, ownerTeam, 220 + random(5) + v * 3, v); ++v; } ++fighters; world.attachMovie('aircraft_british', 'fighter' + fighters, depth_world_fighter + fighters); world['fighter' + fighters]._x = targetX; world['fighter' + fighters]._y = targetY; if (ownerTeam == 'german') { world['fighter' + fighters].aircraft.gotoAndStop('german'); world['fighter' + fighters]._xscale = -100; } } function airSupportRound(targetX, targetY, ownerTeam, delay, multiplier) { ++specialRounds; world.attachMovie('airSupportStrike', '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 (ownerTeam == 'german') { this._x = targetX + 150 - 50 * multiplier; } else { this._x = targetX - 150 + 50 * multiplier; } this._y = targetY + (random(30) - 15); if (this._y < 140) { this._y = 140; } if (this._y > 340) { this._y = 340; } this.ownerTeam = ownerTeam; delete this.onEnterFrame; } } }; } function mortarStrikeAI(targetX, targetY, ownerTeam, mortarType, ownerUnit) { adjustStats('supportUsed', ownerTeam); tempNumMortarRounds = numMortarRounds; if (british_slot13_upgrade.active) { tempNumMortarRounds += british_slot13_upgrade.bonus; } v = 0; while (v < 6) { mortarRound(targetX, targetY, ownerTeam, random(20) + v * 70, mortarType, ownerUnit); ++v; } } function mortarStrike(targetX, targetY, ownerTeam, mortarType, ownerUnit) { adjustStats('supportUsed', ownerTeam); tempNumMortarRounds = numMortarRounds; if (british_slot13_upgrade.active) { tempNumMortarRounds += british_slot13_upgrade.bonus; } v = 0; while (v < tempNumMortarRounds) { mortarRound(targetX, targetY, ownerTeam, random(20) + v * 70, mortarType, ownerUnit); ++v; } } function mortarRound(targetX, targetY, ownerTeam, delay, mortarType, ownerUnit) { ++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 (ownerTeam == 'british' && british_slot13_upgrade.active || ownerTeam == 'german' && german_slot13_upgrade.active) { this._x = targetX + (random(80) - 45) * british_slot13_upgrade.bonus; } else { this._x = targetX + (random(100) - 50); } var v3 = targetY + (random(100) - 50); if (ownerUnit.smoked == true) { this._x = targetX + (random(200) - 100); v3 = targetY + (random(150) - 75); } if (v3 < world.ground) { v3 = world.ground + (random(30) + 10); } this._y = v3; this.ownerTeam = ownerTeam; delete this.onEnterFrame; } } }; } function mortarScorchDecal(targetX, targetY) { ++decals; world.attachMovie('decal_artilleryScorch', 'decal' + decals, depth_world_decals + decals); world['decal' + decals]._yscale = random(20) + 50; world['decal' + decals]._xscale = world['decal' + decals]._yscale; 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 smokeStrike(targetX, targetY, ownerTeam) { adjustStats('supportUsed', ownerTeam); v = 0; while (v < numSmokeRounds) { setTimeout(smokeRound, random(800) + v * 1100, targetX, targetY, ownerTeam); ++v; } } function smokeRound(targetX, targetY, ownerTeam) { ++specialRounds; world.attachMovie('smokeStrikeAnim', 'smokeRound' + specialRounds, depth_world_artillery + specialRounds); if (targetY < deploymentZone1 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 1; world['smokeRound' + specialRounds]._y = deploymentZone1 + (random(deployZoneHeight) - deployZoneHeight / 2); } if (targetY > deploymentZone1 + deployZoneHeight / 2 && targetY < deploymentZone2 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 2; world['smokeRound' + specialRounds]._y = deploymentZone2 + (random(deployZoneHeight) - deployZoneHeight / 2); } if (targetY > deploymentZone2 + deployZoneHeight / 2 && targetY < deploymentZone3 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 3; world['smokeRound' + specialRounds]._y = deploymentZone3 + (random(deployZoneHeight) - deployZoneHeight / 2); } world['smokeRound' + specialRounds]._x = targetX + (random(50) - 25); world['smokeRound' + specialRounds].ownerTeam = ownerTeam; world['smokeRound' + specialRounds].gasIndex = activeGas.length; activeGas.push(world['smokeRound' + specialRounds]); } function smokeGrenadeRound(targetX, targetY, ownerTeam) { ++specialRounds; world.attachMovie('smokeGrenadeAnim', 'smokeRound' + specialRounds, depth_world_artillery + specialRounds); if (targetY < deploymentZone1 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 1; world['smokeRound' + specialRounds]._y = deploymentZone1 + (random(deployZoneHeight) - deployZoneHeight / 2); } if (targetY > deploymentZone1 + deployZoneHeight / 2 && targetY < deploymentZone2 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 2; world['smokeRound' + specialRounds]._y = deploymentZone2 + (random(deployZoneHeight) - deployZoneHeight / 2); } if (targetY > deploymentZone2 + deployZoneHeight / 2 && targetY < deploymentZone3 + deployZoneHeight / 2) { world['smokeRound' + specialRounds].zone = 3; world['smokeRound' + specialRounds]._y = deploymentZone3 + (random(deployZoneHeight) - deployZoneHeight / 2); } world['smokeRound' + specialRounds]._x = targetX + (random(50) - 25); world['smokeRound' + specialRounds].ownerTeam = ownerTeam; world['smokeRound' + specialRounds].gasIndex = activeGas.length; activeGas.push(world['smokeRound' + specialRounds]); } 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 *= british_slot15_upgrade.bonus; } _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(); setupUnitControls(); hud.experience.text = 'XP: ' + experiencePoints; hud.level.text = 'LEVEL: ' + experienceLevel; hud.resupplyTimer.experience.rightDial._rotation = -180; checkUnitNames(); hud.attachMovie('panArrow', 'panArrow', depth_HUD_panArrow); debugTools(); startBattle(); clearIntelInterface(); } 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.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'; } } }; hud.gasMask.mainButton.onRelease = hud.gasMask.maskButton.onRelease; } } 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() { updateResourcesInterface(); 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, 0.5, '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, 0.5, '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, 3, 'easeOutSine'); hud.progressBar.compTeamProgBar.xScaleTo(progressBarCompScale, 3, 'easeOutSine'); } } function setButtonSlotValues() { slot1_unit = new Object(); slot1_unit.name = 'riflemen'; slot1_unit.unitType = 'Riflemen'; slot1_unit.description = 'Good vs Infantry. \rWeak vs Armor.'; slot1_unit.timer = resupply_riflemen; 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 = resupply_assault; slot3_unit = new Object(); slot3_unit.name = 'machineGun'; slot3_unit.unitType = '.30 Cal'; slot3_unit.description = 'Good vs Infantry \rwhen entrenched.'; slot3_unit.timer = resupply_machineGun; slot4_unit = new Object(); slot4_unit.name = 'sniper'; slot4_unit.unitType = 'Sniper'; slot4_unit.description = 'Strong vs Infantry at \rlong range.'; slot4_unit.timer = resupply_sniper; slot5_unit = new Object(); slot5_unit.name = 'bazooka'; slot5_unit.unitType = 'Bazooka Team'; slot5_unit.description = 'Anti-tank team. \rStrong vs Armor.'; slot5_unit.timer = resupply_bazooka; slot6_unit = new Object(); slot6_unit.name = 'mortarTeam'; slot6_unit.unitType = 'Mortar Team'; slot6_unit.description = 'Light Artillery. \rAverage vs All.'; slot6_unit.timer = resupply_mortarTeam; slot7_unit = new Object(); slot7_unit.name = 'officer'; slot7_unit.unitType = 'Officer'; slot7_unit.description = 'Has fire support. \rProvides morale boost.'; slot7_unit.timer = resupply_officer; slot8_unit = new Object(); slot8_unit.name = 'tank'; slot8_unit.unitType = 'Sherman Tank'; slot8_unit.description = 'Strong vs All. \rWeak vs Fire support.'; slot8_unit.timer = resupply_tank; } function checkUnitNames() { if (playerTeam.team == 'german') { slot2_unit.unitType = 'Sturmtruppen'; slot3_unit.unitType = 'MG34 Team'; slot5_unit.unitType = 'Panzershreck'; slot8_unit.unitType = 'Panzer III'; } if (playerTeam.team == 'british') { slot2_unit.unitType = 'Assault Team'; slot5_unit.unitType = 'Bazooka Team'; slot3_unit.unitType = '.30 Cal'; slot8_unit.unitType = 'Sherman Tank'; } } function buttonSetup(btnName) { hud['icon_' + btnName].gotoAndStop(playerTeam.team); hud.hudBG.gotoAndStop(playerTeam.team); hud.upgrades.upgradeButton.gotoAndStop(playerTeam.team); hud.progressBar.casing.gotoAndStop(playerTeam.team); hud['icon_' + btnName].icon._alpha = 0; hud[btnName].rightDial._rotation = -180; hud[btnName]._alpha = 0; deselectRings(); 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 () { rollingOverDeployButtons = true; hud[btnName].useHandCursor = false; if (deployMode == 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'; if (british_slot11_upgrade.active == true) { hud.toolTip.cost.text = _root[playerTeam.team][_root[btnName + '_unit'].name].cost * british_slot11_upgrade.bonus; } else { hud.toolTip.cost.text = _root[playerTeam.team][_root[btnName + '_unit'].name].cost; } hud.toolTip.desc.text = _root[btnName + '_unit'].description; hud.toolTip.backing._width = 145; hud.toolTip.backing._height = hud.toolTip.desc._height + 20; 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].onDragOut = function () { rollingOverDeployButtons = false; 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].onRollOut = hud[btnName].onDragOut; hud[btnName].onReleaseOutside = function () { if (this.activated == true && this.unlocked == true) { deploySquad(_root[btnName + '_unit'].name, this); deselectAll(); } }; hud[btnName].onRelease = hud[btnName].onReleaseOutside; hud[btnName].onPress = hud[btnName].onReleaseOutside; 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_slot4_upgrade.active && btnName != 'slot8') { currentReinforceTime *= british_slot4_upgrade.bonus; } if (british_slot8_upgrade.active && btnName != 'slot8') { currentReinforceTime *= british_slot8_upgrade.bonus; } if (german_slot4_upgrade.active && btnName != 'slot8') { currentReinforceTime *= german_slot4_upgrade.bonus; } if (german_slot8_upgrade.active && btnName != 'slot8') { currentReinforceTime *= german_slot8_upgrade.bonus; } if (german_slot22_upgrade.active && btnName == 'slot8') { currentReinforceTime *= german_slot22_upgrade.bonus; } if (hud[btnName].unlocked == true) { if (hud[btnName].rightDial._rotation < 0 && hud[btnName].activated == false) { 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 += 180 / (currentReinforceTime / 2); } if (hud[btnName].leftDial._rotation < 0 && hud[btnName].rightDial._rotation >= 0 && hud[btnName].activated == false) { hud[btnName].useHandCursor = true; 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(btnName) { if (btnName.unlocked == true) { btnName.activated = false; btnName.stopTween(); hud['icon_' + btnName._name].icon.gotoAndStop('bw'); hud['highlight_' + btnName._name].alphaTo(0, 0.8); btnName.alphaTo(100, 0.1, 'linear'); btnName.colorTo(null, 0.1, 'linear'); btnName.rightDial._rotation = -179; btnName.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].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].onRollOut = hud[btnName].onDragOut; 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].onRelease = hud[btnName].onReleaseOutside; hud[btnName].onPress = hud[btnName].onReleaseOutside; 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 *= british_slot20_upgrade.bonus; } if (hud[btnName].unlocked == true) { if (hud[btnName].rightDial._rotation < 0 && hud[btnName].activated == false) { 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 += 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.squadObjRef.members[mp].coverIcon._visible = false; soldierRef.onPress = function () { deselectAll(); cancelDeploy(); cancelSpecialAttack(world.specAttack); for (mp in soldierRef.squadObjRef.members) { if (mp == 0) { soldierRef.squadObjRef.members[mp].healthBar._visible = true; soldierRef.squadObjRef.members[mp].healthBar.alphaTo(100, 0.2); if (soldierRef.squadObjRef.members[mp].inTrench == true) { soldierRef.squadObjRef.members[mp].coverIcon._visible = true; soldierRef.squadObjRef.members[mp].coverIcon.alphaTo(100, 0.2); } } soldierRef.squadObjRef.members[mp].selectedRing._visible = true; soldierRef.squadObjRef.members[mp].selectedRing.alphaTo(30, 0.2); } soldierRef.squadObjRef.selectedUnit = true; showUnitControls(soldierRef.squadObjRef); }; soldierRef.onRollOver = function () { soldierRef.squadObjRef.rolledOver = true; for (mr in soldierRef.squadObjRef.members) { if (mr == 0) { soldierRef.squadObjRef.members[mr].healthBar._visible = true; soldierRef.squadObjRef.members[mr].healthBar.alphaTo(100, 0.2); if (soldierRef.squadObjRef.members[mr].inTrench == true) { soldierRef.squadObjRef.members[mr].coverIcon._visible = true; soldierRef.squadObjRef.members[mr].coverIcon.alphaTo(100, 0.2); } if (soldierRef.squadObjRef.team == compTeam.team) { } } soldierRef.squadObjRef.members[mr].selectedRing._visible = true; soldierRef.squadObjRef.members[mr].selectedRing.alphaTo(30, 0.2); } }; soldierRef.onRollOut = function () { soldierRef.squadObjRef.rolledOver = false; if (soldierRef.squadObjRef.selectedUnit == false) { for (mo in soldierRef.squadObjRef.members) { if (mo == 0) { soldierRef.squadObjRef.members[mo].healthBar.alphaTo(0, 0.3, 'linear'); soldierRef.squadObjRef.members[mp].coverIcon.alphaTo(0, 0.2); } soldierRef.squadObjRef.members[mo].selectedRing.alphaTo(0, 0.3, 'linear'); } } }; } } function deselectAll() { clearIntelInterface(); for (deselect in _root[playerTeam.team + 'SquadsOnScreen']) { _root[playerTeam.team + 'SquadsOnScreen'][deselect].rolledOver = false; _root[playerTeam.team + 'SquadsOnScreen'][deselect].selectedUnit = false; for (dm in _root[playerTeam.team + 'SquadsOnScreen'][deselect].members) { if (dm == 0) { _root[playerTeam.team + 'SquadsOnScreen'][deselect].members[dm].healthBar.alphaTo(0, 0.3, 'linear'); _root[playerTeam.team + 'SquadsOnScreen'][deselect].members[dm].coverIcon.alphaTo(0, 0.2); } _root[playerTeam.team + 'SquadsOnScreen'][deselect].members[dm].selectedRing.alphaTo(0, 0.3, 'linear'); } } } function setupUnitControls() { for (a in allActionControls) { hud.intel[allActionControls[a]].gotoAndStop('empty'); } } function showUnitControls(unit) { updateSelectedUnitInfo(unit); hud.intel.icons.gotoAndStop(unit.type); hud.intel.actionSlot0._alpha = 100; hud.intel.actionSlot1._alpha = 100; hud.intel.actionSlot2._alpha = 100; hud.intel.actionSlot3._alpha = 100; hud.intel.actionSlot4._alpha = 100; c = 0; while (c < allActionControls.length + 1) { hud.intel[allActionControls[c]].gotoAndStop('empty'); hud.intel[allActionControls[c]].gotoAndStop(unit.controlList[c]); hud.intel[allActionControls[c]].action = unit.controlList[c]; hud.intel[allActionControls[c]].icon.bw._alpha = 0; hud.intel[allActionControls[c]].disabled = false; hud.intel[allActionControls[c]].desc = _root[unit.controlList[c] + '_description']; hud.intel[allActionControls[c]].unlocked = true; if (playerTeam.team == 'german') { hud.intel.actionSlot0.icon._xscale = -100; } if (playingSkirmish == true) { if (unit.controlList[c] == 'throwGrenade' && skirmishUpgrade12active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callAirSupport' && skirmishUpgrade14active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'throwSmoke' && skirmishUpgrade16active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callArtillery' && skirmishUpgrade18active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } } if (playerTeam.team == 'british') { if (unit.controlList[c] == 'throwGrenade' && british_slot12_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'throwSmoke' && british_slot16_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'smokeRounds' && british_slot17_upgrade.active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callArtillery' && british_slot18_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callAirSupport' && british_slot14_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } } if (playerTeam.team == 'german') { if (unit.controlList[c] == 'throwGrenade' && german_slot12_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'throwSmoke' && german_slot16_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'smokeRounds' && german_slot17_upgrade.active != true) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callArtillery' && german_slot18_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } if (unit.controlList[c] == 'callAirSupport' && german_slot14_upgrade.active != true && playingSkirmish == false) { hud.intel[allActionControls[c]].unlocked = false; hud.intel[allActionControls[c]].gotoAndStop('empty'); } } if (hud.intel[allActionControls[c]].unlocked == true) { hud.intel[allActionControls[c]].onRollOver = function () { this.colorTransformTo(150, 0, 150, 0, 150, 0, 100, 0, 0.4, 'easeOutSine'); _root.hud.intel.controlDesc.text = this.desc; if (this.desc == undefined) { _root.hud.intel.controlDesc.text = ''; } }; hud.intel[allActionControls[c]].onRollOut = function () { this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.5, 'easeOutSine'); _root.hud.controlDesc.text = ''; }; hud.intel[allActionControls[c]].onPress = function () { if (this.disabled == true) { this.useHandCursor = false; } switch (this.action) { case 'stop': if (this.disabled == false) { this.pressedAnim.play(); unit.lastState = unit.state; unit.state = 'halt'; } break; case 'advance': if (this.disabled == false) { this.pressedAnim.play(); if (unit.state == 'entrench') { unit.state = 'exitTrench'; } } break; case 'throwGrenade': if (unit.enemyTarget != undefined) { resourcesCheck(50, 'player'); this.pressedAnim.play(); if (playerResources.canAfford == true) { playVoice('grenade', playerTeam.team); throwGrenadeCommand(unit, 'handGrenade'); } } break; case 'throwSmoke': if (this.disabled == false) { resourcesCheck(50, 'player'); this.pressedAnim.play(); if (playerResources.canAfford == true) { showFireSupportArea('smokeGrenade', unit); } } break; case 'smokeRounds': this.pressedAnim.play(); showFireSupportArea('smoke', unit); break; case 'suppressingFire': this.pressedAnim.play(); playVoice('suppress', playerTeam.team); unit.suppressingFire = true; unit.suppressionCounter = 50; break; case 'callArtillery': if (this.disabled == false) { this.pressedAnim.play(); showFireSupportArea('artillery', unit); } break; case 'callAirSupport': if (this.disabled == false) { this.pressedAnim.play(); showFireSupportArea('airSupport', unit); } break; break; case 'callParaDrop': default: } }; } ++c; } } function showIntel(unitName) { hud.intel.icons.gotoAndStop(unitName); hud.intel.unitType.text = _root[playerTeam.team][unitName].name; hud.intel.unitState.text = _root[playerTeam.team][unitName].intel; var v3 = _root[playerTeam.team][unitName].cost; if (british_slot11_upgrade.active == true) { v3 *= british_slot11_upgrade.bonus; } hud.intel.unitCost.text = v3; hud.intel.unitRP.text = 'RP'; hud.intel.unitStatus.perc.text = ''; hud.intel.actionSlot0._alpha = 0; hud.intel.actionSlot1._alpha = 0; hud.intel.actionSlot2._alpha = 0; hud.intel.actionSlot3._alpha = 0; hud.intel.actionSlot4._alpha = 0; } function showFireSupportArea(attack, unit) { if (attack != 'smokeGrenade') { world.attachMovie('specialAttackRange', 'specAttack', depth_world_specialAttackRange); world.specAttack._y = 240; world.specAttack._width = 2500; } else { world.attachMovie('specialAttackRange_smokeGrenade', 'specAttack', depth_world_specialAttackRange); world.specAttack._y = unit.members[0]._y; } supportCursorUp = true; Mouse.hide(); world.specAttack.owner = unit; world.specAttack.onEnterFrame = function () { this._x = this.owner.members[0]._x; if (this.owner.members[0].alive == false || this.owner.members[0].alive == undefined) { _root.cancelSpecialAttack(this); } }; hud.attachMovie('cursorSupport', 'supportCursor', depth_HUD_supportCursor); hud.supportCursor.onEnterFrame = function () { this._x = _root._xmouse; this._y = _root._ymouse; }; world.specAttack.onRollOver = function () { hud.supportCursor._alpha = 100; hud.supportCursor.colorTo(null); }; world.specAttack.onRollOut = function () { hud.supportCursor._alpha = 50; hud.supportCursor.colorTo(10027008); }; world.specAttack.onPress = function () { resourcesCheck(_root[playerTeam.team][attack].cost, 'player'); if (_root.playerResources.canAfford == true) { if (_root[playerTeam.team][attack].cost > 0) { adjustRP('remove', _root[playerTeam.team][attack].cost, 'player'); } specAttackMouse = new Object(); specAttackMouse.x = _root._xmouse; specAttackMouse.y = _root._ymouse; world.globalToLocal(specAttackMouse); if (attack == 'smokeGrenade') { playVoice('smoke', playerTeam.team); } if (attack == 'smoke') { unit.members[0].mortarType = 'smoke'; unit.members[0].specialRoundCount = 3; unit.members[0].specialTargetX = specAttackMouse.x; unit.members[0].specialTargetY = specAttackMouse.y; unit.firingSmoke = true; unit.members[0].gotoAndPlay('mortar_fire_crouch'); } else { launchSpecialAttack(attack, specAttackMouse.x, specAttackMouse.y, playerTeam.team, undefined, unit); } removeMovieClip(this); removeMovieClip(_root.hud.supportCursor); Mouse.show(); supportCursorUp = false; } else { showQuickMessage('NOT ENOUGH RESOURCES. NEED ' + _root[playerTeam.team][attack].cost + '.'); cancelSpecialAttack(this); } }; } function cancelSpecialAttack(target) { removeMovieClip(target); removeMovieClip(_root.hud.supportCursor); Mouse.show(); supportCursorUp = false; } function updateSelectedUnitInfo(selectedUnit) { hud.intel.unitType.text = selectedUnit.unitDesc; hud.intel.lastState.text = 'State: ' + selectedUnit.state; hud.intel.unitCost.text = ''; hud.intel.unitRP.text = ''; hud.actionSlot0._alpha = 100; hud.actionSlot1._alpha = 100; hud.actionSlot2._alpha = 100; hud.actionSlot3._alpha = 100; hud.actionSlot4._alpha = 100; selectedUnitStatus = Math.round(selectedUnit.members[0].healthBar.bar._xscale); var v3 = ''; var v4 = ''; if (selectedUnitStatus > 60) { hud.intel.unitStatus.colorTo(null); v3 = 'Healthy.'; } if (selectedUnitStatus <= 59 && selectedUnitStatus >= 36) { hud.intel.unitStatus.colorTo(15325829); v3 = 'Taking casualties.'; } if (selectedUnitStatus <= 35) { hud.intel.unitStatus.colorTo(7416872); v3 = 'Needs support.'; } hud.intel.unitStatus.perc.text = selectedUnitStatus + '%'; if (selectedUnit.enemyTarget.members.length > 0) { v4 = 'Engaging. '; } switch (selectedUnit.state) { case 'halt': hud.intel.unitState.text = 'Holding position. ' + v3; break; case 'tankMoving': hud.intel.unitState.text = 'Moving. ' + v3; break; case 'tankEngaging': hud.intel.unitState.text = 'Engaging. ' + v3; break; case 'exitTrench': hud.intel.unitState.text = 'Leaving cover. ' + v3; break; case 'assaultTrench': hud.intel.unitState.text = 'Engaging enemy in cover. ' + v3; break; case 'engaging': hud.intel.unitState.text = 'Engaging. ' + v3; break; case 'entrench': hud.intel.unitState.text = v4 + 'In cover behind ' + _root['cover_' + selectedUnit.trenchRef.coverType].desc + '. ' + v3; break; case 'moving': hud.intel.unitState.text = 'Moving out. ' + v3; break; case 'victory': hud.intel.unitState.text = 'Celebrating victory!'; break; case 'defeat': hud.intel.unitState.text = 'Surrendering.'; break; default: hud.intel.unitState.text = 'State: ' + selectedUnit.state; } if ((selectedUnit.state == 'engaging' || selectedUnit.state == 'moving' || selectedUnit.state == 'entrench' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot0.disabled == false) { hud.intel.actionSlot0.disabled = true; hud.intel.actionSlot0.icon.bw._alpha = 100; } if (selectedUnit.allMembersInTrench == true && selectedUnit.passingTrench == false) { hud.intel.actionSlot0.disabled = false; hud.intel.actionSlot0.icon.bw._alpha = 0; } if (selectedUnit.type == 'riflemen') { if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot1.disabled == false) { hud.intel.actionSlot1.disabled = true; hud.intel.actionSlot1.icon.bw._alpha = 100; } if (selectedUnit.enemyTarget.members[0]._x > 0 && (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging')) { hud.intel.actionSlot1.disabled = false; hud.intel.actionSlot1.icon.bw._alpha = 0; } if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot2.disabled == false) { hud.intel.actionSlot2.disabled = true; hud.intel.actionSlot2.icon.bw._alpha = 100; } if (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging') { hud.intel.actionSlot2.disabled = false; hud.intel.actionSlot2.icon.bw._alpha = 0; } } if (selectedUnit.type == 'assault') { if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot1.disabled == false) { hud.intel.actionSlot1.disabled = true; hud.intel.actionSlot1.icon.bw._alpha = 100; } if (selectedUnit.enemyTarget.members[0]._x > 0 && (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging')) { hud.intel.actionSlot1.disabled = false; hud.intel.actionSlot1.icon.bw._alpha = 0; } if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot2.disabled == false) { hud.intel.actionSlot2.disabled = true; hud.intel.actionSlot2.icon.bw._alpha = 100; } if (selectedUnit.enemyTarget.members[0]._x > 0 && (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging')) { hud.intel.actionSlot2.disabled = false; hud.intel.actionSlot2.icon.bw._alpha = 0; } if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot3.disabled == false) { hud.intel.actionSlot3.disabled = true; hud.intel.actionSlot3.icon.bw._alpha = 100; } if (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging') { hud.intel.actionSlot3.disabled = false; hud.intel.actionSlot3.icon.bw._alpha = 0; } } if (selectedUnit.type == 'machineGun') { if ((selectedUnit.state == 'moving' || selectedUnit.state == 'exitTrench') && hud.intel.actionSlot1.disabled == false) { hud.intel.actionSlot1.disabled = true; hud.intel.actionSlot1.icon.bw._alpha = 100; } if (selectedUnit.enemyTarget.members[0]._x > 0 && (selectedUnit.allMembersInTrench == true || selectedUnit.state == 'engaging')) { hud.intel.actionSlot1.disabled = false; hud.intel.actionSlot1.icon.bw._alpha = 0; } } } function showIntelDeathMessage() { hud.intel.unitStatus.colorTo(7416872); hud.intel.unitStatus.perc.text = 'KIA'; hud.intel.icons.gotoAndStop('dead'); hud.intel.unitState.text = 'Killed in Action.'; a = 0; while (a < 7) { hud.intel['actionSlot' + a].onRollOut = null; hud.intel['actionSlot' + a].onRollOver = hud.intel['actionSlot' + a].onRollOut; hud.intel['actionSlot' + a].onRelease = hud.intel['actionSlot' + a].onRollOut; hud.intel['actionSlot' + a].onPress = hud.intel['actionSlot' + a].onRollOut; hud.intel['actionSlot' + a].disabled = true; hud.intel['actionSlot' + a].icon.bw._alpha = 100; ++a; } } function clearIntelInterface(unitName) { if (deployMode == true) { hud.intel.unitType.text = 'Select a Deployment Zone'; hud.intel.unitStatus.colorTo(7416872); hud.intel.unitStatus.perc.text = ''; hud.intel.icons.gotoAndStop('empty'); hud.intel.unitState.text = 'Press [ESC] to cancel.'; } else { hud.intel.unitType.text = 'Select a Unit'; hud.intel.unitStatus.colorTo(7416872); hud.intel.unitStatus.perc.text = ''; hud.intel.icons.gotoAndStop('empty'); hud.intel.unitState.text = 'Click on a squad to select it.'; } a = 0; while (a < 7) { delete hud.intel['actionSlot' + a].onPress; delete hud.intel['actionSlot' + a].onRelease; delete hud.intel['actionSlot' + a].onRollOver; delete hud.intel['actionSlot' + a].onRollOut; hud.intel['actionSlot' + a].disabled = true; hud.intel['actionSlot' + a].gotoAndStop('empty'); ++a; } } function initBattleStats() { britishEnemiesKilled = 0; germanEnemiesKilled = 0; britishUnitsLost = 0; germanUnitsLost = 0; britishUnitsDeployed = 0; germanUnitsDeployed = 0; britishTrenchesTaken = 0; germanTrenchesTaken = 0; britishSupportUsed = 0; germanSupportUsed = 0; missionTimerSeconds = 0; missionTimerMinutes = 0; missionTimerHours = 0; missionTotalSeconds = 0; missionTime = ''; } function winBattle() { endBattle(playerTeam.team); } function startBattle() { firstSort = true; supplyTimer = supplyTimerMax; spawnEnemyTimer = 4; initBattleStats(); spawnEnemyActive = true; if (retry == true) { } if (retry == false) { } if (currentMap.timed == true) { timerActive = true; setTimer(); } else { timerActive = 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; deployKeyboardSetup(); cameraSetup(); assignMorale(); setupEnemyUnitGenerator(); setupEnemySupportGenerator(); var v3 = 1; while (v3 < 4) { for (v in currentMap['bunkersZone' + v3]) { setTimeout(_root.createSquad, 20, compTeam.team, 'bunker', _root['deploymentZone' + v3], currentMap['bunkersZone' + v3][v], true); } for (ps in currentMap['prespawnSquad' + v3]) { if (compTeam.team == 'german') { if (currentMap['prespawnSquad' + v3][ps] != 'tank') { setTimeout(_root.createSquad, 3000 * v3, compTeam.team, currentMap['prespawnSquad' + v3][ps], _root['deploymentZone' + v3], german.spawnPoint - 300); } else { setTimeout(_root.createSquad, 3000 * v3, currentMap['prespawnSquad' + v3][ps], _root['deploymentZone' + v3], german.spawnPoint); } } else { setTimeout(_root.createSquad, 3000 * v3, currentMap['prespawnSquad' + v3][ps], _root['deploymentZone' + v3], british.spawnPoint + 300); } } ++v3; } for (psp in currentMap.presetSpawn) { _root['psspawn' + psp] = setTimeout(_root.createSquad, currentMap.presetSpawnTime[psp], compTeam.team, currentMap.presetSpawn[psp], _root['deploymentZone' + currentMap.presetSpawnZone[psp]], _root[compTeam.team].spawnPoint, currentMap.presetSpawnObj[psp], true); } loadScreen.alphaTo(0, 1, 'easeOutSine', 3, function () { playSoundLoop('sound_ambienceBattle', 9999, 'ambience'); removeMovieClip(this); }); game.state = 'unpaused'; if (currentMap.timed) { showQuickMessage('HOLD THE LINE FOR ' + currentMap.timerMinutes + ' MINS!'); } } function endBattle(winner, winType) { clearInterval(psspawn1); clearInterval(psspawn2); clearInterval(psspawn3); clearInterval(psspawn4); 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 == 'objective') { showQuickMessage('OBJECTIVE COMPLETED! VICTORY!', 'center'); } if (winType == 'defend') { showQuickMessage('DEFENCE HELD! YOU WIN!', 'center'); } if (winType == 'morale') { showQuickMessage('THE ENEMY HAS SURRENDERED, YOU WIN!', 'center'); } playMusicLoop('music_winMusic', 1, 'endBattleMusic'); music_endBattleMusic.volumeTo(100, 10); } else { if (winType == 'conquer') { showQuickMessage('GROUND LOST, YOU HAVE BEEN DEFEATED.', 'center'); } if (winType == 'morale') { showQuickMessage('OUR MEN SURRENDERED, YOU HAVE BEEN DEFEATED.', 'center'); } if (winType == 'defend') { showQuickMessage('WE FAILED TO BREAK THEIR RANKS! OUR ATTACK HAS BEEN DELAYED!', 'center'); } if (winType == 'objective') { showQuickMessage('OBJECTIVE DESTROYED! YOU HAVE FAILED!', 'center'); } playMusicLoop('music_lossMusic', 1, '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 += britishTrenchesTaken; } else { 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); if (winner == playerTeam.team) { loadScreen.hints._visible = false; } else { loadScreen.hints._visible = true; loadScreen.hints.buttonText.text = 'VIEW GAME GUIDE'; loadScreen.hints.onRollOver = function () { playRollOverSound(); this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, 'easeOutSine'); }; loadScreen.hints.onRollOut = function () { this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, 'easeOutSine'); }; loadScreen.hints.onRelease = function () { playClickSound(); getURL('http://armorgames.com/guide/Warfare-1944-Tips-and-Tricks', '_blank'); }; } 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(); this.onRelease = undefined; }; 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) * 5); if (playerBonusXP <= 0) { playerBonusXP = 0; } } if (playerTeam.team == 'german') { killDifference = germanEnemiesKilled - britishEnemiesKilled; if (killDifference <= 0) { killDifference = 0; } playerBonusXP = Math.round((germanTrenchesTaken + killDifference + currentMap.mission) * 5); if (playerBonusXP <= 0) { playerBonusXP = 0; } } var v3 = Math.round(currentMap.timeBonus - missionTotalSeconds); if (v3 > 0) { playerBonusXP += v3; } career_bonusExpGained += playerBonusXP; if (currentMap.mission == 8 && winner == playerTeam.team) { loadScreen.gotoAndStop('endGame'); game.state = 'paused'; showEnding(); } if (playerTeam.team == 'british') { loadScreen.teamVictory.text = 'U.S VICTORY!'; } else { loadScreen.teamVictory.text = playerTeam.team.toUpperCase() + ' VICTORY!'; } loadScreen.bonusXP.text = 'BONUS XP: ' + playerBonusXP; updateExperience('bonus', null); } else { if (playerTeam.team == 'british') { loadScreen.teamVictory.text = 'U.S DEFEAT!'; } 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 += britishSupportUsed; } else { career_supportUsed += germanSupportUsed; } loadScreen.missionTime.text = missionTime; 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.header.text = currentMapLoc.battleTitle; _root.menu.mapScreen.desc.text = currentMapLoc.description; _root.menu.mapScreen.mapBG.gotoAndStop(playerTeam.team); 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']._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) { setupResourcePoints(mapName); spawnEnemyTimerMax = mapName.enemyRate; spawnEnemyTimer = 4; _root.trenches = new Array(); _root.midGround = new Array(); _root.attachMovie(mapName.file, 'world', depth_testMap); world.bg.bmp = new BitmapData(world.bg._width, world.bg._height, true, 0); world.bg.bmp.draw(world.bg); world.ground = 170; world.bg.useHandCursor = false; world.bg.onPress = function () { deselectAll(); }; setupDeployButtons(); coverCount = 0; var v2 = 1; while (v2 < 4) { var v3 = 0; while (v3 < mapName['coverZone' + v2].length) { ++coverCount; world.attachMovie('coverBlock', 'cover' + coverCount, depth_world_cover + coverCount); world['cover' + coverCount].gotoAndStop(mapName['coverTypeZone' + v2][v3]); world['cover' + coverCount]._y = _root['deployZone' + v2].zone - deployZoneHeight / 2 + 10; world['cover' + coverCount]._x = mapName['coverZone' + v2][v3]; world['cover' + coverCount].zone = v2; world['cover' + coverCount].coverType = mapName['coverTypeZone' + v2][v3]; world['cover' + coverCount].slot1 = 'empty'; world['cover' + coverCount].name = 'cover' + coverCount; world['cover' + coverCount].locked = false; world['cover' + coverCount].controlVisible = false; world['cover' + coverCount].controlClipVisible = false; world['cover' + coverCount].depth = world['cover' + coverCount]._y; world['cover' + coverCount].ref = world['cover' + coverCount]; world['cover' + coverCount].ownerTeam = undefined; _root.trenches.push(world['cover' + coverCount]); _root.trenchButtons(world['cover' + coverCount]); ++v3; } ++v2; } _root.midGround = new Array(); ++coverCount; world.attachMovie('midground_' + mapName.file + '1', 'midGround' + coverCount, depth_world_cover + coverCount); world['midGround' + coverCount]._y = 195; world['midGround' + coverCount]._x = 0; world['midGround' + coverCount].depth = world['midGround' + coverCount]._y; world['midGround' + coverCount].ref = world['midGround' + coverCount]; _root.midGround.push(world['midGround' + coverCount]); world['midGround' + coverCount].bmp = new BitmapData(world['midGround' + coverCount]._width, world['midGround' + coverCount]._height, true, 0); world['midGround' + coverCount].bmp.draw(world['midGround' + coverCount]); ++coverCount; world.attachMovie('midground_' + mapName.file + '2', 'midGround' + coverCount, depth_world_cover + coverCount); world['midGround' + coverCount]._y = 275; world['midGround' + coverCount]._x = 0; world['midGround' + coverCount].depth = world['midGround' + coverCount]._y; world['midGround' + coverCount].ref = world['midGround' + coverCount]; _root.midGround.push(world['midGround' + coverCount]); world['midGround' + coverCount].bmp = new BitmapData(world['midGround' + coverCount]._width, world['midGround' + coverCount]._height, true, 0); world['midGround' + coverCount].bmp.draw(world['midGround' + coverCount]); ++coverCount; world.attachMovie('midground_' + mapName.file + '3', 'midGround' + coverCount, depth_world_cover + coverCount); world['midGround' + coverCount]._y = 375; world['midGround' + coverCount]._x = 0; world['midGround' + coverCount].depth = world['midGround' + coverCount]._y; world['midGround' + coverCount].ref = world['midGround' + coverCount]; _root.midGround.push(world['midGround' + coverCount]); world['midGround' + coverCount].bmp = new BitmapData(world['midGround' + coverCount]._width, world['midGround' + coverCount]._height, true, 0); world['midGround' + coverCount].bmp.draw(world['midGround' + coverCount]); _root.wire = new Array(); if (mapName.wire != undefined) { x = 1; while (x <= mapName.wire) { w = 0; while (w < 9) { ++wireCount; world.attachMovie('wireFence', 'wire' + wireCount, depth_world_wire + wireCount); if (random(2) == 0) { world['wire' + wireCount]._xscale = -100; } var v5 = 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 = 125 + 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 = 'BALLISTICS'; british_slot1_upgrade.desc = 'All Infantry armed with rifles & sub-machine guns will inflict more damage.'; british_slot1_upgrade.effect = '+15% Damage'; british_slot1_upgrade.cost = 1; british_slot1_upgrade.bonus = 1.15; british_slot1_upgrade.unlocked = true; british_slot1_upgrade.active = false; british_slot2_upgrade.name = 'TAKE COVER'; british_slot2_upgrade.desc = 'All Infantry soldiers gain a slight defensive bonus.'; british_slot2_upgrade.effect = '+10% to Defence'; british_slot2_upgrade.cost = 1; british_slot2_upgrade.bonus = 0.9; british_slot2_upgrade.unlocked = true; british_slot2_upgrade.active = false; british_slot3_upgrade.name = 'RED WHITE AND BLUE'; british_slot3_upgrade.desc = 'Morale boost to our fighting men.'; british_slot3_upgrade.effect = '+10% to Starting Morale'; british_slot3_upgrade.cost = 1; british_slot3_upgrade.bonus = 1.1; british_slot3_upgrade.unlocked = true; british_slot3_upgrade.active = false; british_slot4_upgrade.name = 'POST HASTE'; british_slot4_upgrade.desc = 'Decreases the reinforcment time for all units.'; british_slot4_upgrade.effect = '10% faster reinforcement'; british_slot4_upgrade.cost = 1; british_slot4_upgrade.bonus = 1.1; british_slot4_upgrade.unlocked = true; british_slot4_upgrade.active = false; british_slot5_upgrade.name = 'ASSAULT TACTICS'; british_slot5_upgrade.desc = 'Assault teams are highly trained and deal more damage.'; british_slot5_upgrade.effect = '+10% Damage for Assault'; british_slot5_upgrade.cost = 2; british_slot5_upgrade.bonus = 1.1; british_slot5_upgrade.unlocked = false; british_slot5_upgrade.active = false; british_slot6_upgrade.name = 'HIT \'EM HARD'; british_slot6_upgrade.desc = 'Our units will do more damage when attacking from flanks.'; british_slot6_upgrade.effect = '+10% Damage on Flank Attack'; british_slot6_upgrade.cost = 2; british_slot6_upgrade.bonus = 1.1; british_slot6_upgrade.unlocked = false; british_slot6_upgrade.active = false; british_slot7_upgrade.name = 'SECURE FLANKS'; british_slot7_upgrade.desc = 'Our flanks and support are secure, the men aren\'t worried.'; british_slot7_upgrade.effect = '-20% from Morale loss when Flanked'; british_slot7_upgrade.cost = 2; british_slot7_upgrade.bonus = 0.8; british_slot7_upgrade.unlocked = false; british_slot7_upgrade.active = false; british_slot8_upgrade.name = 'RESUPPLY INBOUND'; british_slot8_upgrade.desc = 'Reinforcements arrive much quicker.'; british_slot8_upgrade.effect = '15% faster reinforcement'; 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 = 'FIRE SUPPORT'; british_slot9_upgrade.desc = 'Your Machine Gun Teams have spent time training on the range.'; british_slot9_upgrade.effect = '+40% Damage for Machine Gun Team'; british_slot9_upgrade.cost = 3; british_slot9_upgrade.bonus = 1.4; british_slot9_upgrade.unlocked = false; british_slot9_upgrade.active = false; british_slot10_upgrade.name = 'GO! GO! GO!'; british_slot10_upgrade.desc = 'Time doing long runs has increased their endurance.'; british_slot10_upgrade.effect = '+20% to Infantry Movement'; british_slot10_upgrade.cost = 3; british_slot10_upgrade.bonus = 1.2; british_slot10_upgrade.unlocked = false; british_slot10_upgrade.active = false; british_slot11_upgrade.name = 'IN GOOD SUPPLY'; british_slot11_upgrade.desc = 'Resources needed for all infantry units is reduced.'; british_slot11_upgrade.effect = '-20% Resource Point Costs'; british_slot11_upgrade.cost = 3; british_slot11_upgrade.bonus = 0.8; british_slot11_upgrade.unlocked = false; british_slot11_upgrade.active = false; } function setUpgradesSupport() { british_slot12_upgrade.name = 'GRENADES'; british_slot12_upgrade.desc = 'Riflemen and Assault Teams have been supplied grenades.'; british_slot12_upgrade.effect = 'Grenades added to Units'; british_slot12_upgrade.cost = 1; british_slot12_upgrade.bonus = 'grenades'; british_slot12_upgrade.unlocked = true; british_slot12_upgrade.active = false; british_slot13_upgrade.name = 'MORTAR ACCURACY'; british_slot13_upgrade.desc = 'Mortar crews fire more accurately on designated targets.'; british_slot13_upgrade.effect = '+25% more Accurate'; british_slot13_upgrade.cost = 1; british_slot13_upgrade.bonus = 0.75; british_slot13_upgrade.unlocked = true; british_slot13_upgrade.active = false; british_slot14_upgrade.name = 'AIR SUPPORT'; british_slot14_upgrade.desc = 'Officers will have aircraft support available.'; british_slot14_upgrade.effect = 'Air Support'; british_slot14_upgrade.cost = 1; british_slot14_upgrade.bonus = 'airSupport'; british_slot14_upgrade.unlocked = true; british_slot14_upgrade.active = false; british_slot15_upgrade.name = 'ENGINE UPGRADE'; british_slot15_upgrade.desc = 'Our tanks now roll significantly faster.'; british_slot15_upgrade.effect = '+25% Tank Movement Speed'; 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 = 'SMOKE GRENADES'; british_slot16_upgrade.desc = 'Snipers and Assault Teams have been supplied smoke grenades.'; british_slot16_upgrade.effect = 'Smoke Grenades added to Units'; british_slot16_upgrade.cost = 2; british_slot16_upgrade.bonus = 'smokeGrenade'; british_slot16_upgrade.unlocked = false; british_slot16_upgrade.active = false; british_slot17_upgrade.name = 'SMOKE MORTAR'; british_slot17_upgrade.desc = 'Mortar teams have been issued smoke rounds.'; british_slot17_upgrade.effect = 'Smoke Rounds'; british_slot17_upgrade.cost = 2; british_slot17_upgrade.bonus = 'smokeRounds'; british_slot17_upgrade.unlocked = false; british_slot17_upgrade.active = false; british_slot18_upgrade.name = 'ARTILLERY'; british_slot18_upgrade.desc = 'Officers now have access to call in Artillery Barrages.'; british_slot18_upgrade.effect = 'Artillery available'; british_slot18_upgrade.cost = 2; british_slot18_upgrade.bonus = 'artillery'; british_slot18_upgrade.unlocked = false; british_slot18_upgrade.active = false; british_slot19_upgrade.name = 'ANTI INFANTRY'; british_slot19_upgrade.desc = 'Our tank MG crew have been trained in anti-personnel tactics.'; british_slot19_upgrade.effect = '+30% Tank MG Damage'; 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 = 'EXPLOSIVES'; british_slot20_upgrade.desc = 'All infantry based explosives do more damage.'; british_slot20_upgrade.effect = '+25% Explosives Damage'; british_slot20_upgrade.cost = 3; british_slot20_upgrade.bonus = 1.25; 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 = 'ARMOR PRODUCTION'; british_slot22_upgrade.desc = 'Our industry has been working overtime to supply more tanks.'; british_slot22_upgrade.effect = '-25% Resupply Time for Tanks'; british_slot22_upgrade.cost = 3; british_slot22_upgrade.bonus = 0.75; 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 = 'TAKE COVER'; german_slot2_upgrade.desc = 'Our defensive capability has been improved.'; 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 = 'FOR THE FUHRER'; german_slot3_upgrade.desc = 'Our men are inspired by the Fuhrer.'; german_slot3_upgrade.effect = '15% boost to Morale'; german_slot3_upgrade.cost = 1; german_slot3_upgrade.bonus = 1.15; german_slot3_upgrade.unlocked = true; german_slot3_upgrade.active = false; german_slot4_upgrade.name = 'REINFORCEMENTS'; german_slot4_upgrade.desc = 'Additional reinforcements have been allotted to our fight'; german_slot4_upgrade.effect = '10% faster reinforcement'; german_slot4_upgrade.cost = 1; german_slot4_upgrade.bonus = 0.9; german_slot4_upgrade.unlocked = true; german_slot4_upgrade.active = false; german_slot5_upgrade.name = 'MACHINE GUN TRAINING'; german_slot5_upgrade.desc = 'Our Machine Gun teams have been in training.'; german_slot5_upgrade.effect = '+15% Damage to Machine Gun Teams'; 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 = 'SECURE FLANKS'; german_slot6_upgrade.desc = 'Our men take less damage when attacked from either flank.'; german_slot6_upgrade.effect = '+10% Defence when Flanked'; 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 = 'FOR THE FATHERLAND'; german_slot7_upgrade.desc = 'Our men will die for our country.'; german_slot7_upgrade.effect = '20% boost to Morale'; german_slot7_upgrade.cost = 2; german_slot7_upgrade.bonus = 1.2; german_slot7_upgrade.unlocked = false; german_slot7_upgrade.active = false; german_slot8_upgrade.name = 'RAPID DEPLOYMENT'; german_slot8_upgrade.desc = 'Reinforcements arrive even faster.'; german_slot8_upgrade.effect = '15% faster reinforcement'; german_slot8_upgrade.cost = 2; german_slot8_upgrade.bonus = 0.85; german_slot8_upgrade.unlocked = false; german_slot8_upgrade.active = false; german_slot9_upgrade.name = 'SCHARFSCHÃœTZE'; german_slot9_upgrade.desc = 'Our sharpshooters are a tool of destruction.'; german_slot9_upgrade.effect = '+20% Damage for Snipers'; german_slot9_upgrade.cost = 3; german_slot9_upgrade.bonus = 1.2; german_slot9_upgrade.unlocked = false; german_slot9_upgrade.active = false; german_slot10_upgrade.name = 'FORTIFIED'; german_slot10_upgrade.desc = 'Our engineers have reinforced our defences.'; german_slot10_upgrade.effect = '+15% defence to all units'; german_slot10_upgrade.cost = 3; german_slot10_upgrade.bonus = 1.15; german_slot10_upgrade.unlocked = false; german_slot10_upgrade.active = false; german_slot11_upgrade.name = 'CONSCRIPTS'; german_slot11_upgrade.desc = 'Drawing from the ranks of captured armies, riflemen are now 50% cheaper to train.'; german_slot11_upgrade.effect = 'Riflemen at half cost'; german_slot11_upgrade.cost = 3; german_slot11_upgrade.bonus = 'freerifles'; german_slot11_upgrade.unlocked = false; german_slot11_upgrade.active = false; } function setUpgradesSupportGerman() { german_slot12_upgrade.name = 'GRENADES'; german_slot12_upgrade.desc = 'Riflemen and Assault Teams have been supplied grenades.'; german_slot12_upgrade.effect = 'Grenades added to Units'; german_slot12_upgrade.cost = 1; german_slot12_upgrade.bonus = 'grenades'; german_slot12_upgrade.unlocked = true; german_slot12_upgrade.active = false; german_slot13_upgrade.name = 'MORTAR ACCURACY'; german_slot13_upgrade.desc = 'Mortar crews fire more accurately on designated targets.'; german_slot13_upgrade.effect = '+25% more Accurate'; german_slot13_upgrade.cost = 1; german_slot13_upgrade.bonus = 0.75; german_slot13_upgrade.unlocked = true; german_slot13_upgrade.active = false; german_slot14_upgrade.name = 'AIR SUPPORT'; german_slot14_upgrade.desc = 'Officers will have aircraft support available.'; german_slot14_upgrade.effect = 'Air Support'; german_slot14_upgrade.cost = 1; german_slot14_upgrade.bonus = 'airSupport'; german_slot14_upgrade.unlocked = true; german_slot14_upgrade.active = false; german_slot15_upgrade.name = 'HEAVY'; german_slot15_upgrade.desc = 'Increased armor on our Panzers should protect against enemy fire.'; german_slot15_upgrade.effect = '+15% Armor to Panzer III'; german_slot15_upgrade.cost = 1; german_slot15_upgrade.bonus = 1.15; german_slot15_upgrade.unlocked = true; german_slot15_upgrade.active = false; german_slot16_upgrade.name = 'SMOKE GRENADES'; german_slot16_upgrade.desc = 'Snipers and Assault Teams have been supplied smoke grenades.'; german_slot16_upgrade.effect = 'Smoke Grenades added to Units'; german_slot16_upgrade.cost = 2; german_slot16_upgrade.bonus = 'smokeGrenade'; german_slot16_upgrade.unlocked = false; german_slot16_upgrade.active = false; german_slot17_upgrade.name = 'SMOKE MORTAR'; german_slot17_upgrade.desc = 'Mortar teams have been issued smoke rounds.'; german_slot17_upgrade.effect = 'Smoke Rounds'; german_slot17_upgrade.cost = 2; german_slot17_upgrade.bonus = 'smokeRounds'; german_slot17_upgrade.unlocked = false; german_slot17_upgrade.active = false; german_slot18_upgrade.name = 'ARTILLERY'; german_slot18_upgrade.desc = 'Officers now have access to call in Artillery Barrages.'; german_slot18_upgrade.effect = 'Artillery available'; german_slot18_upgrade.cost = 2; german_slot18_upgrade.bonus = 'artillery'; german_slot18_upgrade.unlocked = false; german_slot18_upgrade.active = false; german_slot19_upgrade.name = 'ENGINE UPGRADE'; german_slot19_upgrade.desc = 'Our tanks now roll significantly faster.'; german_slot19_upgrade.effect = '+25% Tank Movement Speed'; german_slot19_upgrade.cost = 1; german_slot19_upgrade.bonus = 1.25; german_slot19_upgrade.unlocked = true; german_slot19_upgrade.active = false; german_slot20_upgrade.name = 'EXPLOSIVES'; german_slot20_upgrade.desc = 'All infantry based explosives do more damage.'; german_slot20_upgrade.effect = '+25% Explosives Damage'; german_slot20_upgrade.cost = 3; german_slot20_upgrade.bonus = 1.25; 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 = 'ARMOR PRODUCTION'; german_slot22_upgrade.desc = 'Our industry has been working overtime to supply more tanks.'; german_slot22_upgrade.effect = '-25% Resupply Time for Tanks'; german_slot22_upgrade.cost = 3; german_slot22_upgrade.bonus = 0.75; 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 -= 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(true); } } 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 v4; var v1 = new Array(); for (var v5 in tankTraps) { v1.push(tankTraps[v5]); } for (v5 in midGround) { v1.push(midGround[v5]); } for (v5 in britishSquadsOnScreen) { for (dsm in britishSquadsOnScreen[v5].members) { britishSquadsOnScreen[v5].members[dsm].depth = britishSquadsOnScreen[v5].members[dsm]._y; v1.push(britishSquadsOnScreen[v5].members[dsm]); } } for (v5 in germanSquadsOnScreen) { for (dsm in germanSquadsOnScreen[v5].members) { germanSquadsOnScreen[v5].members[dsm].depth = germanSquadsOnScreen[v5].members[dsm]._y; v1.push(germanSquadsOnScreen[v5].members[dsm]); } } for (v5 in trenches) { v1.push(trenches[v5]); } for (v5 in wire) { v1.push(wire[v5]); } for (v5 in deadTanks) { deadTanks[v5].members[0].depth = deadTanks[v5].members[0]._y; v1.push(deadTanks[v5]); } do { v4 = false; var v3 = 1; while (v3 < v1.length) { if (v1[v3 - 1].depth > v1[v3].depth) { var v2 = v1[v3 - 1]; v1[v3 - 1] = v1[v3]; v1[v3] = v2; v4 = true; } ++v3; } } while (v4); v3 = 0; while (v3 < v1.length) { v1[v3].ref.swapDepths(v3 + depth_world_soldiersSorted); ++v3; } } 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].button5.onRollOver = function () { this.colorTransformTo(220, 0, 220, 0, 220, 0, 100, 0, 0.4, 'easeOutSine'); }; world['trenchControls' + tcc].button4.onRollOver = world['trenchControls' + tcc].button5.onRollOver; world['trenchControls' + tcc].button3.onRollOver = world['trenchControls' + tcc].button5.onRollOver; world['trenchControls' + tcc].button2.onRollOver = world['trenchControls' + tcc].button5.onRollOver; world['trenchControls' + tcc].button1.onRollOver = world['trenchControls' + tcc].button5.onRollOver; world['trenchControls' + tcc].button5.onRollOut = function () { this.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.6, 'easeOutSine'); }; world['trenchControls' + tcc].button4.onRollOut = world['trenchControls' + tcc].button5.onRollOut; world['trenchControls' + tcc].button3.onRollOut = world['trenchControls' + tcc].button5.onRollOut; world['trenchControls' + tcc].button2.onRollOut = world['trenchControls' + tcc].button5.onRollOut; world['trenchControls' + tcc].button1.onRollOut = world['trenchControls' + tcc].button5.onRollOut; 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_slot3_upgrade.active == true) { playerMoraleMax *= british_slot3_upgrade.bonus; playerMorale = playerMoraleMax; } if (playerTeam.team == 'german' && german_slot3_upgrade.active == true) { playerMoraleMax *= german_slot3_upgrade.bonus; playerMorale = playerMoraleMax; } if (playerTeam.team == 'german' && german_slot7_upgrade.active == true) { playerMoraleMax *= german_slot7_upgrade.bonus; playerMorale = playerMoraleMax; } compMorale = currentMap.enemyMorale; compMoraleMax = currentMap.enemyMorale; } function adjustMorale(teamName, squadType, attackType, attackOwner) { if (attackOwner == teamName) { if (teamName == playerTeam.team) { playerMorale -= moraleCost.friendlyFire; } else { if (teamName == compTeam.team) { compMorale -= moraleCost.friendlyFire; } } } switch (squadType) { case 'officer': if (teamName == playerTeam.team && attackType == 'normal') { playerMorale -= moraleCost.officer; career_moraleLost += moraleCost.officer; } else { if (teamName == compTeam.team && attackType == 'normal') { compMorale -= moraleCost.officer; } } if (teamName == playerTeam.team && attackType == 'explosive') { playerMorale -= moraleCost.officer * 1.3; career_moraleLost += moraleCost.officer * 1.3; } else { if (teamName == compTeam.team && attackType == 'explosive') { compMorale -= moraleCost.officer * 1.3; } } break; case 'tank': if (teamName == playerTeam.team) { playerMorale -= moraleCost.tank; compMorale += moraleCost.tankKilled; } else { if (teamName == compTeam.team) { compMorale -= moraleCost.tank; playerMorale += moraleCost.tankKilled; } } break; case 'bunker': if (teamName == playerTeam.team) { playerMorale -= moraleCost.bunker; compMorale += moraleCost.bunkerKilled; } else { if (teamName == compTeam.team) { compMorale -= moraleCost.bunker; playerMorale += moraleCost.bunkerKilled; } } break; case 'regen': if (teamName == playerTeam.team) { playerMorale *= moraleRegen_british; compMorale *= moraleRegen_german; } else { compMorale *= moraleRegen_british; playerMorale *= moraleRegen_german; } break; case 'flanked': if (teamName == playerTeam.team) { compMorale -= moraleHitFlanked * compMoraleMax; showQuickMessage('ENEMY FLANKED! THEIR MORALE HAS DROPPED!'); } else { playerMorale -= moraleHitFlanked * playerMoraleMax; showQuickMessage('FLANKED! LOSING MORALE!'); } break; default: if (teamName == playerTeam.team && attackType == 'normal') { playerMorale -= moraleCost.soldier; compMorale += moraleCost.soldier / 2; career_moraleLost += moraleCost.soldier; } else { if (teamName == compTeam.team && attackType == 'normal') { compMorale -= moraleCost.soldier; playerMorale += moraleCost.soldier / 2; career_moraleGained += moraleCost.soldier / 2; } } if (teamName == playerTeam.team && attackType == 'explosive') { playerMorale -= moraleCost.soldier; compMorale += moraleCost.soldier; career_moraleLost += moraleCost.soldier; } else { if (teamName == compTeam.team && attackType == 'explosive') { compMorale -= moraleCost.soldier; playerMorale += moraleCost.soldier; career_moraleGained += moraleCost.soldier; } } } if (playerMorale > playerMoraleMax) { playerMorale = playerMoraleMax; } if (compMorale > compMoraleMax) { compMorale = compMoraleMax; } if ((compMorale / compMoraleMax) * 100 <= 30 && (compMorale / compMoraleMax) * 100 >= 25) { if (moraleEnemyLowShown == false) { moraleEnemyLowShown = true; setTimeout(function () { moraleEnemyLowShown = false; }, 15000); showQuickMessage('ENEMY MORALE IS LOW!'); } } if ((compMorale / compMoraleMax) * 100 <= 10 && (compMorale / compMoraleMax) * 100 >= 5) { if (moraleEnemyBreakingShown == false) { moraleEnemyBreakingShown = true; setTimeout(function () { moraleEnemyBreakingShown = false; }, 15000); showQuickMessage('ENEMY IS AT BREAKING POINT!'); } } if ((playerMorale / playerMoraleMax) * 100 <= 30 && (playerMorale / playerMoraleMax) * 100 >= 25) { if (moraleFriendlyLowShown == false) { moraleFriendlyLowShown = true; setTimeout(function () { moraleFriendlyLowShown = false; }, 15000); showQuickMessage('MORALE IS LOW!'); } } if ((playerMorale / playerMoraleMax) * 100 <= 10 && (playerMorale / playerMoraleMax) * 100 >= 5) { if (moraleFriendlyBreakingShown == false) { moraleFriendlyBreakingShown = true; setTimeout(function () { moraleFriendlyBreakingShown = false; }, 15000); showQuickMessage('OUR UNITS ARE AT BREAKING POINT!'); } } } function moraleRegen() { britishArmyCount = 0; germanArmyCount = 0; for (mrg in britishSquadsOnScreen) { britishArmyCount += britishSquadsOnScreen[mrg].members.length; } for (mrg in germanSquadsOnScreen) { germanArmyCount += germanSquadsOnScreen[mrg].members.length; } if (britishArmyCount / 2 > germanArmyCount && germanArmyCount > 0) { moraleRegen_british = moraleRegenPlus; moraleRegen_german = moraleRegenMinus; } else { if (britishArmyCount < germanArmyCount / 2 && britishArmyCount > 0) { moraleRegen_german = moraleRegenPlus; moraleRegen_british = moraleRegenMinus; } else { moraleRegen_german = 1; moraleRegen_british = 1; } } adjustMorale('british', 'regen'); } 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._xscale = moraleBarBritishScale; hud.progressBar.germanMoraleBar._xscale = moraleBarGermanScale; if (lastmoraleBarBritishScale <= 35) { hud.progressBar.britishMoraleBar.gotoAndStop('red'); } if (lastmoraleBarGermanScale <= 35) { hud.progressBar.germanMoraleBar.gotoAndStop('red'); } if (lastmoraleBarBritishScale <= 15) { hud.progressBar.britishMoraleBar.gotoAndStop('veryRed'); } if (lastmoraleBarGermanScale <= 15) { hud.progressBar.germanMoraleBar.gotoAndStop('veryRed'); } if (lastmoraleBarBritishScale > 30) { hud.progressBar.britishMoraleBar.gotoAndStop('normal'); } if (lastmoraleBarGermanScale > 30) { hud.progressBar.germanMoraleBar.gotoAndStop('normal'); } } } function throwGrenade(grenType, targetSquad, owner, ourTeam) { ++grenNumber; var v1 = targetSquad.members[random(targetSquad.members.length)]; world.attachMovie(grenType, 'gren' + grenNumber, depth_world_grenade + grenNumber); if (ourTeam == 'british') { world['gren' + grenNumber]._x = v1._x + (random(40) - 20); } else { world['gren' + grenNumber]._x = v1._x + (random(40) - 20); } if (targetSquad.type != 'tank') { world['gren' + grenNumber]._y = v1._y + (random(20) - 10); } else { world['gren' + grenNumber]._y = v1._y + (random(10) - 5); } world['gren' + grenNumber].ownerTeam = ourTeam; grenAdj = owner._x - v1._x; grenOpp = -1 * (owner._y - v1._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 v2 = 'throw' + (random(2) + 1); world['gren' + grenNumber].gotoAndPlay(v2); } function throwSmokeCommand(grenType, targetX, targetY, owner) { owner.members[0].grenType = 'smokeGrenade'; owner.members[0].grenTargetX = targetX; owner.members[0].grenTargetY = targetY; owner.members[0].gotoAndPlay('standing_throwGrenade'); } function throwSmokeGrenade(grenType, targetX, targetY, owner, ourTeam) { ++grenNumber; world.attachMovie(grenType, 'gren' + grenNumber, depth_world_grenade + grenNumber); if (ourTeam == 'british') { world['gren' + grenNumber]._x = targetX + (random(40) - 20); } else { world['gren' + grenNumber]._x = targetX + (random(40) - 20); } if (targetSquad.type != 'tank') { world['gren' + grenNumber]._y = targetY + (random(20) - 10); } else { world['gren' + grenNumber]._y = targetY + (random(10) - 5); } world['gren' + grenNumber].ownerTeam = ourTeam; grenAdj = owner._x - targetX; grenOpp = -1 * (owner._y - targetY); 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 v1 = 'throw' + (random(2) + 1); world['gren' + grenNumber].gotoAndPlay(v1); } function throwGrenadeCommand(unit, grenType) { var v1 = unit.members[0]; if (unit.enemyTarget != undefined) { v1.grenType = grenType; v1.gotoAndPlay('standing_throwGrenade'); } } function playVoice(voiceType, teamName) { switch (voiceType) { case 'advance': if (random(5) == 0) { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_advance' + (random(sounds_advance) + 1)); } break; case 'enemyDown': if (random(20) == 0) { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_enemyDown' + (random(sounds_enemyDown) + 1)); } break; case 'bazooka': if (random(6) == 0) { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_bazooka' + (random(sounds_bazooka) + 1)); } break; case 'suppress': setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_suppressingFire' + (random(4) + 1)); break; case 'flanked': setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_losingFlank' + (random(sounds_flank) + 1)); break; case 'grenade': if (random(3) == 0) { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_throwGrenade' + (random(3) + 1)); } break; case 'smoke': if (teamName == 'british') { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_throwSmoke' + (random(4) + 1)); } else { setTimeout(playSound, random(600) + 100, 'sound_voice_' + teamName + '_throwSmoke1'); } break; case 'attack': if (random(40) == 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) { 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'; } if (unlockQueue[0] == 'flanking' || unlockQueue[0] == 'conquer' || unlockQueue[0] == 'objective') { _root['unlockDialog' + udc].textBoxes.headerText.text = 'NEW WAY TO WIN 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 v2 = new Object(); v2.onKeyUp = function () { switch (Key.getCode()) { case 192: openCloseConsole(); break; case 13: executeCommand(); } }; Key.addListener(v2); } 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 += 'Undefined Function\r'; } else { _root.systemConsole.consoleHistory.text += _root.systemConsole.consoleInput.text + '\r'; } _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 += playerBonusXP; experienceGained = playerBonusXP; break; case 'riflemen': experiencePoints += 1; experienceGained = 1; break; case 'assault': experiencePoints += 2; experienceGained = 2; break; case 'machineGun': experiencePoints += 5; experienceGained = 5; break; case 'sniper': experiencePoints += 5; experienceGained = 5; break; case 'bazooka': experiencePoints += 5; experienceGained = 5; break; case 'mortarTeam': experiencePoints += 5; experienceGained = 5; break; case 'officer': experiencePoints += 10; experienceGained = 10; break; case 'tank': experiencePoints += 15; experienceGained = 15; } 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 v3 = soldier._y - 60; world['xpIcon' + xpCount].ySlideTo(v3, 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 += Math.round((180 / (experienceIntervals[experienceLevel] / 2)) * experienceGained); } if (hudRef.rightDial._rotation >= 0 && hudRef.leftDial._rotation > -180) { 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 += (180 / (experienceIntervals[experienceLevel] / 2)) * experiencePoints; if (hudRef.rightDial._rotation >= 0 && hudRef.leftDial._rotation > -180) { hudRef.rightDial._rotation = 0; 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 = 500; skirmishMap.enemyMorale = 500; skirmishMap.resourcePointsPlayer = 800; skirmishMap.resourcePointsEnemy = 800; skirmishMap.file = 'map_skirmish_1'; skirmishMap.coverZone1 = new Array('1140'); skirmishMap.coverTypeZone1 = new Array('sandBagsUrban_german'); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array('1140'); skirmishMap.coverTypeZone3 = new Array('sandBagsUrban_german'); skirmishMap.unlocks = new Array(); skirmishMap.availableUnits = new Array('riflemen'); skirmishMap.enemyRate = 8; 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 == 'map_skirmish_1' || btnName == 'british' || btnName == 'medium' || btnName == 'riflemen' || btnName == 'AI_balanced' || btnName == 'map_medium') { menu.skirmish[btnName].buttonSelected = true; _root.menu.skirmish[btnName].colorTransformTo(190, 0, 190, 0, 190, 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 'grenade': if (_root.menu.skirmish.grenade.buttonSelected == false) { _root.menu.skirmish.grenade.buttonSelected = true; _root.menu.skirmish.grenade.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); } else { _root.menu.skirmish.grenade.buttonSelected = false; _root.menu.skirmish.grenade.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); } break; case 'smokeGrenade': if (_root.menu.skirmish.smokeGrenade.buttonSelected == false) { _root.menu.skirmish.smokeGrenade.buttonSelected = true; _root.menu.skirmish.smokeGrenade.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); } else { _root.menu.skirmish.smokeGrenade.buttonSelected = false; _root.menu.skirmish.smokeGrenade.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); } break; case 'artillery': addRemoveSkirmishUnits(btnName, 'artillery'); break; case 'airSupport': addRemoveSkirmishUnits(btnName, 'airSupport'); break; case 'allSupport': _root.menu.skirmish.grenade.buttonSelected = true; _root.menu.skirmish.grenade.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.smokeGrenade.buttonSelected = true; _root.menu.skirmish.smokeGrenade.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); addRemoveSkirmishUnits('airSupport', 'airSupport', 'allSupport'); addRemoveSkirmishUnits('artillery', 'artillery', 'allSupport'); break; case 'rp_plus': if (_root.skirmishMap.resourcePointsPlayer < _root.skirmishResourcesMax) { _root.skirmishMap.resourcePointsPlayer += skirmishResourcesInc; _root.skirmishMap.resourcePointsEnemy += skirmishResourcesInc; } if (_root.skirmishMap.resourcePointsPlayer > _root.skirmishResourcesMax) { _root.skirmishMap.resourcePointsPlayer = _root.skirmishResourcesMax; _root.skirmishMap.resourcePointsEnemy = _root.skirmishResourcesMax; } _root.menu.skirmish.resourcePoints.text = _root.skirmishMap.resourcePointsPlayer; break; case 'rp_minus': if (_root.skirmishMap.resourcePointsPlayer > _root.skirmishResourcesMin) { _root.skirmishMap.resourcePointsPlayer -= skirmishResourcesInc; _root.skirmishMap.resourcePointsEnemy -= skirmishResourcesInc; } if (_root.skirmishMap.resourcePointsPlayer < _root.skirmishResourcesMin) { _root.skirmishMap.resourcePointsPlayer = _root.skirmishResourcesMin; _root.skirmishMap.resourcePointsEnemy = _root.skirmishResourcesMin; } _root.menu.skirmish.resourcePoints.text = _root.skirmishMap.resourcePointsPlayer; break; 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 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 'mortarTeam': addRemoveSkirmishUnits(btnName, 'mortarTeam'); break; case 'bazooka': addRemoveSkirmishUnits(btnName, 'bazooka'); break; case 'tank': addRemoveSkirmishUnits(btnName, 'tank'); break; case 'allUnits': addRemoveSkirmishUnits('riflemen', 'riflemen', 'allUnits'); addRemoveSkirmishUnits('assault', 'assault', 'allUnits'); addRemoveSkirmishUnits('machineGun', 'machineGun', 'allUnits'); addRemoveSkirmishUnits('sniper', 'sniper', 'allUnits'); addRemoveSkirmishUnits('officer', 'officer', 'allUnits'); addRemoveSkirmishUnits('mortarTeam', 'mortarTeam', 'allUnits'); addRemoveSkirmishUnits('bazooka', 'bazooka', 'allUnits'); addRemoveSkirmishUnits('tank', 'tank', 'allUnits'); 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 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(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); break; case 'map_skirmish_1': _root.skirmishMap.file = 'map_skirmish_1'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_1.buttonSelected = true; _root.menu.skirmish.map_skirmish_1.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_2': _root.skirmishMap.file = 'map_skirmish_2'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_2.buttonSelected = true; _root.menu.skirmish.map_skirmish_2.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_3': _root.skirmishMap.file = 'map_skirmish_3'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_3.buttonSelected = true; _root.menu.skirmish.map_skirmish_3.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_4': _root.skirmishMap.file = 'map_skirmish_4'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_4.buttonSelected = true; _root.menu.skirmish.map_skirmish_4.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_5': _root.skirmishMap.file = 'map_skirmish_5'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_5.buttonSelected = true; _root.menu.skirmish.map_skirmish_5.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_6': _root.skirmishMap.file = 'map_skirmish_6'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_6.buttonSelected = true; _root.menu.skirmish.map_skirmish_6.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_7': _root.skirmishMap.file = 'map_skirmish_7'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_7.buttonSelected = true; _root.menu.skirmish.map_skirmish_7.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_8': _root.skirmishMap.file = 'map_skirmish_8'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_8.buttonSelected = true; _root.menu.skirmish.map_skirmish_8.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; break; case 'map_skirmish_9': _root.skirmishMap.file = 'map_skirmish_9'; skm = 0; while (skm < 10) { _root.menu.skirmish['map_skirmish_' + skm].buttonSelected = false; _root.menu.skirmish['map_skirmish_' + skm].colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.4, 'easeOutSine'); ++skm; } _root.menu.skirmish.map_skirmish_9.buttonSelected = true; _root.menu.skirmish.map_skirmish_9.colorTransformTo(190, 0, 190, 0, 190, 0, 100, 0, 0.4, 'easeOutSine'); _root.menu.skirmish.mapDesc.text = _root[skirmishMap.file + 'Desc']; } }; } function addRemoveSkirmishUnits(btnName, unitName, triggerButton) { if (menu.skirmish[btnName].buttonSelected == false || triggerButton == 'allUnits' || triggerButton == 'allSupport') { menu.skirmish[btnName].buttonSelected = true; _root.skirmishMap.availableUnits.push(unitName); if (unitName == 'mortar' || unitName == 'airSupport' || unitName == 'artillery' || unitName == 'antiTank') { _root.skirmishMap.enemySupport.push(unitName); } else { _root.skirmishMap.enemyUnits.push(unitName); } _root.menu.skirmish[unitName].colorTransformTo(190, 0, 190, 0, 190, 0, 190, 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 saveUnlocks() { savedUnlocks = new Array(); x = 1; while (x <= 22) { savedUnlocks.push(_root[saveGameData.data.teamName + '_slot' + x + '_upgrade'].active); ++x; } } function returnUnlocksToSavedTURNEDOFF() { x = 0; while (x <= savedUnlocks.length + 1) { _root[saveGameData.data.teamName + '_slot' + (x + 1) + '_upgrade'].active = savedUnlocks[x]; ++x; } } function skirmishMapSettings() { difficulty = 'regular'; initBattleStats(); if (_root.menu.skirmish.british.buttonSelected == true) { playerTeam.team = 'british'; compTeam.team = 'german'; } else { playerTeam.team = 'german'; compTeam.team = 'british'; } skirmishUpgrade12active = false; skirmishUpgrade14active = false; skirmishUpgrade16active = false; skirmishUpgrade18active = false; if (_root.menu.skirmish.grenade.buttonSelected == true) { skirmishUpgrade12active = true; } if (_root.menu.skirmish.airSupport.buttonSelected == true) { skirmishUpgrade14active = true; } if (_root.menu.skirmish.smokeGrenade.buttonSelected == true) { skirmishUpgrade16active = true; } if (_root.menu.skirmish.artillery.buttonSelected == true) { skirmishUpgrade18active = true; } if (_root.menu.skirmish.easy.buttonSelected == true) { skirmishMap.enemyRate = 7; skirmishMap.enemySupportRate = 50; } if (_root.menu.skirmish.medium.buttonSelected == true) { skirmishMap.enemyRate = 5; skirmishMap.enemySupportRate = 40; } if (_root.menu.skirmish.hard.buttonSelected == true) { skirmishMap.enemyRate = 2; skirmishMap.enemySupportRate = 30; } skirmishMap.coverZone1 = new Array(); skirmishMap.coverZone2 = new Array(); skirmishMap.coverZone3 = new Array(); skirmishMap.noTanks = false; switch (skirmishMap.file) { case 'map_skirmish_1': skirmishMap.battleTitle = 'SKIRMISH - BEACH LANDING'; skirmishMap.coverZone1 = new Array('1140'); skirmishMap.coverTypeZone1 = new Array('sandBagsUrban_german'); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array('1140'); skirmishMap.coverTypeZone3 = new Array('sandBagsUrban_german'); break; case 'map_skirmish_2': skirmishMap.battleTitle = 'SKIRMISH - OPEN PLAINS'; skirmishMap.coverZone1 = new Array(); skirmishMap.coverTypeZone1 = new Array(); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array(); skirmishMap.coverTypeZone3 = new Array(); break; case 'map_skirmish_3': skirmishMap.battleTitle = 'SKIRMISH - DESERTED TOWN'; skirmishMap.coverZone1 = new Array(); skirmishMap.coverTypeZone1 = new Array(); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array(); skirmishMap.coverTypeZone3 = new Array(); break; case 'map_skirmish_4': skirmishMap.noTanks = true; skirmishMap.battleTitle = 'SKIRMISH - TOWN'; skirmishMap.coverZone1 = new Array('450', '850', '1350'); skirmishMap.coverTypeZone1 = new Array('townWall', 'barrels', 'sandBagsUrban_german'); skirmishMap.coverZone2 = new Array('875'); skirmishMap.coverTypeZone2 = new Array('urban1'); skirmishMap.coverZone3 = new Array('310', '590', '720', '1350'); skirmishMap.coverTypeZone3 = new Array('urban1', 'urban2', 'townWall', 'sandBagsUrban_german'); break; case 'map_skirmish_5': skirmishMap.battleTitle = 'SKIRMISH - HIGH LOW'; skirmishMap.coverZone1 = new Array(); skirmishMap.coverTypeZone1 = new Array(); skirmishMap.coverZone2 = new Array('300', '640', '925', '1300'); skirmishMap.coverTypeZone2 = new Array('stoneWall', 'hedgeRow', 'woodFenceOvergrown', 'sandbags'); skirmishMap.coverZone3 = new Array(); skirmishMap.coverTypeZone3 = new Array(); break; case 'map_skirmish_6': skirmishMap.noTanks = true; skirmishMap.battleTitle = 'SKIRMISH - HEDGEROWS'; skirmishMap.coverZone1 = new Array('300', '750', '1250'); skirmishMap.coverTypeZone1 = new Array('hedgerow', 'hedgerow', 'woodFenceOvergrown', 'hedgerow', 'hedgerow'); skirmishMap.coverZone2 = new Array('500', '925', '1300'); skirmishMap.coverTypeZone2 = new Array('hedgerow', 'woodFenceOvergrown', 'hedgerow', 'hedgerow'); skirmishMap.coverZone3 = new Array('300', '850', '1250'); skirmishMap.coverTypeZone3 = new Array('woodFenceOvergrown', 'hedgerow', 'hedgerow', 'hedgerow'); break; case 'map_skirmish_7': skirmishMap.battleTitle = 'SKIRMISH - RAILWAY'; skirmishMap.coverZone1 = new Array('300', '650', '900', '1250', '1720'); skirmishMap.coverTypeZone1 = new Array('sandBags', 'hedgerow', 'hedgerow', 'woodFenceOvergrown', 'hedgerow'); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array('300', '550', '1350', '1650'); skirmishMap.coverTypeZone3 = new Array('barrels', 'hedgerow', 'hedgerow', 'hedgerow'); break; case 'map_skirmish_8': skirmishMap.noTanks = true; skirmishMap.battleTitle = 'SKIRMISH - TOWN SQUARE'; skirmishMap.coverZone1 = new Array('310', '790', '1170', '1425', '1800'); skirmishMap.coverTypeZone1 = new Array('townWall', 'urban1', 'barrels', 'townWall', 'rubble2'); skirmishMap.coverZone2 = new Array('475', '1000', '1345', '1800'); skirmishMap.coverTypeZone2 = new Array('barrels', 'sandBagsUS', 'urban2', 'sandBagsUrban_german'); skirmishMap.coverZone3 = new Array('310', '725', '1170', '1480', '2105'); skirmishMap.coverTypeZone3 = new Array('townWall', 'rubble1', 'urban1', 'townWall', 'townWall'); break; case 'map_skirmish_9': skirmishMap.battleTitle = 'SKIRMISH - CEMETARY'; skirmishMap.coverZone1 = new Array('335', '745', '900', '1095', '1260', '1360', '1695'); skirmishMap.coverTypeZone1 = new Array('stoneWall', 'townWall', 'headstones', 'headstones', 'headstones', 'townWall', 'sandBagsUrban_german'); skirmishMap.coverZone2 = new Array(); skirmishMap.coverTypeZone2 = new Array(); skirmishMap.coverZone3 = new Array('334', '740', '900', '1095', '1260', '1360', '1695'); skirmishMap.coverTypeZone3 = new Array('stoneWall', 'townWall', 'headstones', 'headstones', 'headstones', 'townWall', 'sandBagsUrban_german'); break; default: } if (skirmishMap.noTanks == true) { for (x in _root.skirmishMap.availableUnits) { if (_root.skirmishMap.availableUnits[x] == 'tank') { _root.skirmishMap.availableUnits.splice(x, 1); } } for (x in _root.skirmishMap.enemyUnits) { if (_root.skirmishMap.enemyUnits[x] == 'tank') { _root.skirmishMap.enemyUnits.splice(x, 1); } } } } function skirmishUnlockReset() { skirmishUpgrade12active = false; skirmishUpgrade14active = false; skirmishUpgrade16active = false; skirmishUpgrade18active = false; } 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 units cost resource points and will need time to resupply.'; hud.help.progressBar.gotoAndStop('flipped'); hud.help.progressBar.header.text = 'GROUND TAKEN'; hud.help.progressBar.desc.text = 'This bar shows ground taken. Move your men to the center of 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 = 'INTEL PANEL'; hud.help.support.desc.text = 'Use HotKeys 1 - 4 to activate these abilities.'; 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.upgrades.closeButton.onRelease = function () { playClickSound(); this._parent.alphaTo(0, 0.6, 'easeOutSine', 0, function () { this._visible = false; }); }; hud.help.morale.closeButton.onRelease = hud.help.upgrades.closeButton.onRelease; hud.help.progressBar.closeButton.onRelease = hud.help.upgrades.closeButton.onRelease; hud.help.unitHelp.closeButton.onRelease = hud.help.upgrades.closeButton.onRelease; hud.help.support.closeButton.onRelease = hud.help.upgrades.closeButton.onRelease; } 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 setTimer() { timerSeconds = currentMap.timerSeconds; timerMinutes = currentMap.timerMinutes; } function timerTick() { if (timerActive) { --timerSeconds; if (timerSeconds < 0) { timerSeconds = timerSecondsMax; --timerMinutes; } if (timerSeconds < 10 && timerMinutes < 10) { timerDisplay = '0' + timerMinutes + ':0' + timerSeconds; } else { if (timerSeconds < 10 && timerMinutes > 10) { timerDisplay = timerMinutes + ':0' + timerSeconds; } else { if (timerSeconds > 10 && timerMinutes < 10) { timerDisplay = '0' + timerMinutes + ':' + timerSeconds; } else { timerDisplay = timerMinutes + ':' + timerSeconds; } } } if (timerMinutes < 0) { timerDisplay = '00:00'; if (spawnEnemyActive == true && _root[compTeam.team + 'SquadsOnScreen'].length >= 1) { showQuickMessage('ENEMY REINFORCEMENTS DEPLETED. FINISH THEM OFF!'); } spawnEnemyActive = false; if (_root[compTeam.team + 'SquadsOnScreen'].length < 1) { endBattle(playerTeam.team, 'defend'); } } updateTimer(); } } function updateTimer() { if (currentMap.timed) { hud.timer.text = timerDisplay; } else { hud.timer.text = ''; } } function missionTimerTick() { ++missionTimerSeconds; ++missionTotalSeconds; if (missionTimerSeconds > missionTimerMax) { missionTimerSeconds = 0; ++missionTimerMinutes; } if (missionTimerSeconds < 10 && missionTimerMinutes < 10) { missionTime = '0' + missionTimerMinutes + ':0' + missionTimerSeconds; } else { if (missionTimerSeconds < 10 && missionTimerMinutes > 10) { missionTime = missionTimerMinutes + ':0' + missionTimerSeconds; } else { if (missionTimerSeconds > 10 && missionTimerMinutes < 10) { missionTime = '0' + missionTimerMinutes + ':' + missionTimerSeconds; } else { missionTime = missionTimerMinutes + ':' + missionTimerSeconds; } } } } function checkWounding(solObj, teamName) { if (random(woundChanceMax) < woundChance) { solObj.wounded = true; solObj.alive = false; solObj.deployZone = solObj.squadObjRef.deployZone; solObj.trenchName = solObj.squadObjRef.trenchRef.name; solObj.gotoAndStop('flatDead'); _root[teamName + 'Wounded'].push(solObj); } } function bazookaFire(bazookaMan) { ++bazookaRounds; world.attachMovie('bazookaRound', 'bazookaRound' + bazookaRounds, depth_world_bazookaRounds + bazookaRounds); world['bazookaRound' + bazookaRounds].team = bazookaMan.squadObjRef.team; world['bazookaRound' + bazookaRounds]._y = bazookaMan._y - 17; if (world['bazookaRound' + bazookaRounds].team == 'british') { world['bazookaRound' + bazookaRounds]._x = bazookaMan._x + bazookaXOffset; } else { world['bazookaRound' + bazookaRounds]._x = bazookaMan._x - bazookaXOffset; world['bazookaRound' + bazookaRounds]._xscale = -100; } world['bazookaRound' + bazookaRounds].targetX = bazookaMan.squadObjRef.enemyTarget.members[0]._x; world['bazookaRound' + bazookaRounds].targetY = bazookaMan.squadObjRef.enemyTarget.members[0]._y + bazookaTargetOffset; world['bazookaRound' + bazookaRounds].ownerTeam = bazookaMan.squadObjRef.team; world['bazookaRound' + bazookaRounds].explosionType = 'bazookaRound'; var v4 = random(bazookaMan.squadObjRef.enemyTarget.members.length); var v6 = bazookaMan._x - bazookaMan.squadObjRef.enemyTarget.members[v4]._x; var v5 = bazookaMan._y - bazookaMan.squadObjRef.enemyTarget.members[v4]._y; world['bazookaRound' + bazookaRounds].angle = Math.atan2(v5, v6) * 57.29577951308232; world['bazookaRound' + bazookaRounds]._rotation = world['bazookaRound' + bazookaRounds].angle; world['bazookaRound' + bazookaRounds].onEnterFrame = function () { this.x = Math.cos(this.angle * Math.PI / 180) * _root.bazookaSpeed; this.y = Math.sin(this.angle * Math.PI / 180) * _root.bazookaSpeed; this._x -= this.x; this._y -= this.y; if (this.team == 'british') { if (this._x >= this.targetX) { _root.bazookaImpact(this._x, this._y, this.ownerTeam, this.explosionType); delete this.onEnterFrame; removeMovieClip(this); } } if (this.team == 'german') { if (this._x <= this.targetX) { _root.bazookaImpact(this._x, this._y, this.ownerTeam, this.explosionType); delete this.onEnterFrame; removeMovieClip(this); } } }; } function bazookaImpact(impactX, impactY, ownerTeam, explosionType) { ++bazookaImpacts; world.attachMovie('bazookaStrike', 'bazRound' + bazookaImpacts, depth_world_bazookaImpacts + bazookaImpacts); world['bazRound' + bazookaImpacts]._x = impactX + (random(bazookaAccuracy) - bazookaAccuracy / 2); world['bazRound' + bazookaImpacts]._y = impactY + (random(bazookaAccuracy) - bazookaAccuracy / 2); world['bazRound' + bazookaImpacts].ownerTeam = ownerTeam; } function checkObjectives() {} function resetDepthVariables() { squadNumber = 0; soldierNumber = 0; particleCount = depth_particles; xpCount = 0; grenNumber = 0; grenadeCollisions = 0; bazookaRounds = 0; bazookaImpacts = 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_mortarTeamDeployed = 0; career_bazookaDeployed = 0; career_tankDeployed = 0; } function showEnding() { loadScreen.gotoAndStop('endGame'); var v1 = ''; if (playerTeam.team == 'british') { v1 = 'U.S'; } else { v1 = 'GERMAN'; } switch (random(5) + 1) { case 1: loadScreen.ending.paper.headLine.text = v1 + ' ARMY LED TO GLORIOUS VICTORY'; break; case 2: loadScreen.ending.paper.headLine.text = v1 + ' ARMY CONQUERS ALL'; break; case 3: loadScreen.ending.paper.headLine.text = v1 + ' FORCES VICTORIOUS'; break; case 4: loadScreen.ending.paper.headLine.text = v1 + ' ARMED FORCES SURGE TO VICTORY'; break; case 5: loadScreen.ending.paper.headLine.text = v1 + ' MEN LED TO VICTORY IN EUROPE'; break; default: loadScreen.ending.paper.headLine.text = v1 + ' 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_mortarTeam.text = career_mortarTeamDeployed; loadScreen.campaignStats.end_bazooka.text = career_bazookaDeployed; loadScreen.campaignStats.end_tank.text = career_tankDeployed; } function reportTankDamage(tankName, damageType) { tankName.damageReport.damage.text = ''; tankName.damageReport._y = -87; if (damageType != 'ENGINE') { tankName.damageReport.damage.text = damageType + ' DESTROYED!'; } else { tankName.damageReport.damage.text = damageType + ' DAMAGED!'; } if (tankName._xscale == -100) { tankName.damageReport._xscale = -100; } tankName.damageReport._alpha = 0; tankName.damageReport.ySlideTo(-110, 4, 'easeOutSine'); tankName.damageReport.alphaTo(100, 1, 'easeOutSine'); tankName.damageReport.alphaTo(0, 3, 'easeOutSine', 1); } function rotateTankWheels(tankName, rotateSpeed) { tankName.tankBody.frontWheel._rotation += rotateSpeed / 2; tankName.tankBody.backWheel._rotation += rotateSpeed / 2; tankName.tankBody.smallWheel1._rotation += rotateSpeed; tankName.tankBody.smallWheel2._rotation += rotateSpeed; tankName.tankBody.smallWheel3._rotation += rotateSpeed; tankName.tankBody.smallWheel4._rotation += rotateSpeed; tankName.tankBody.smallWheel5._rotation += rotateSpeed; tankName.tankBody.smallWheel6._rotation += rotateSpeed; } 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) { resourceResupply(); resourceResupplyTimer(); enemySupportGenerator(); updateProgressBar(); updateMoraleBar(); moraleRegen('british'); slowEFcount = slowEFcountMax; } } function mediumEnterFrame() { --mediumEFcount; if (mediumEFcount <= 0) { findMines('german'); findMines('british'); findWire('german'); findWire('british'); findOfficer('german'); findOfficer('british'); updateTrenchHealthBars(); mediumEFcount = mediumEFcountMax; } } function findEnterFrame() { --findEFcount; if (findEFcount <= 0) { checkSmoke('british'); checkSmoke('german'); findTrenches(british.name); findTrenches(german.name); findEnemy(british.name, german.name); findEnemy(german.name, british.name); findEFcount = findEFcountMax; } } function oneSecondEnterFrame() { --secondEFcount; if (secondEFcount <= 0) { timerTick(); missionTimerTick(); spawnEnemy(); secondEFcount = secondEFcountMax; } } function reallySlowEnterFrame() { --rslowEFcount; if (rslowEFcount <= 0) { enemyUnitAI(); sortSoldierDepths(); rslowEFcount = rslowEFcountMax; } } 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(); var debugMode = false; _quality = 'MEDIUM'; var difficulty = ''; var intoMenu = true; var rslowEFcount = 0; var rslowEFcountMax = 120; var slowEFcount = 0; var slowEFcountMax = 30; var mediumEFcount = 0; var mediumEFcountMax = 5; var findEFcount = 0; var findEFcountMax = 18; var secondEFcountMax = 30; var secondEFcount = secondEFcountMax; 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_saveAnim = 1600500; 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_supportCursor = 1050; var depth_HUD_console = 5000; var depth_world = 1000; var depth_world_deployButtons = 1100; var depth_world_deployZoneHighlight = 1200; var depth_world_specialAttackRange = 1250; var depth_world_decals = 1500; var depth_world_deadSoldiers = 10000; var depth_world_cover = 14000; var depth_world_wire = 15000; var depth_world_tankTraps = 17000; var depth_world_soldiers = 20000; var depth_world_soldiersSorted = 30000; var depth_world_grenade = 400000; var depth_world_bazookaRounds = 450000; var depth_world_bazookaImpacts = 475000; var depth_world_artillery = 500000; var depth_world_rainHolder = 700000; var depth_world_trenchHUD = 750000; var depth_world_target = 900000; var depth_world_fighter = 920000; var depth_world_xpIcons = 950000; var depth_bg_cover = 100; var depth_particles = 480000; var depth_bounceParticles = 680000; var saveGameExists = false; saveGameData = SharedObject.getLocal('ConArtists_Warfare1917'); checkForSaveGame(); initDialogBoxes(); hotKeySetup(); 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 fromInstructions = false; var updateFPScountMax = 20; var updateFPScount = updateFPScountMax; var panSpeed = 20; var panBuffer = 80; var panInterfaceBlock = Stage.height - 165; 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'; var startingSupplyPoints = 200; var rpText = 0; var playerResources = new Object(); playerResources.RP = 0; playerResources.maxRP = 0; playerResources.SP = startingSupplyPoints; var enemyResources = new Object(); enemyResources.RP = 0; enemyResources.maxRP = 0; enemyResources.SP = startingSupplyPoints; var supplyTimerMax = 7; var supplyTimer = supplyTimerMax; var supplyDropRate = 50; var supplyPerc = 100; var supplyPercEnemy = 100; var resupply_riflemen = 200; var resupply_assault = 400; var resupply_machineGun = 800; var resupply_sniper = 800; var resupply_officer = 900; var resupply_mortarTeam = 1100; var resupply_bazooka = 700; var resupply_tank = 2000; var resupply_medic = 1.0e+017; setButtonSlotValues(); british.base = new Object(); british.base.health = 0; british.base.speed = 0; british.base.units = ['base']; british.flanking = new Object(); british.flanking.name = 'Flanking'; british.flanking.description = 'Flanking'; british.flanking.unlockDescription = 'Moving your men off the battlefield on the enemy\'s TOP and BOTTOM zones will flank them dropping their MORALE.'; british.flanking.damage = 0; british.conquer = new Object(); british.conquer.name = 'Conquer'; british.conquer.description = 'Conquer'; british.conquer.unlockDescription = 'Moving your men to END of the MIDDLE ZONE will win the Battle.'; british.conquer.damage = 0; british.objective = new Object(); british.objective.name = 'Objective'; british.objective.description = 'Objective'; british.objective.unlockDescription = 'DESTROY the BUNKER with your BAZOOKA TEAMS to take the beach!'; british.objective.damage = 0; 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.artillery.rechargeTime = 50; british.airSupport = new Object(); british.airSupport.name = 'Air Support'; british.airSupport.description = 'Air Support'; british.airSupport.unlockDescription = 'Devastating heavy rounds that will destroy anything in their way.'; british.airSupport.damage = 120; british.airSupport.timer = 400; british.airSupport.rechargeTime = 200; 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.bazookaRound = new Object(); british.bazookaRound.name = 'Mortar'; british.bazookaRound.description = 'Mortar'; british.bazookaRound.unlockDescription = 'Explosive rounds good for hitting large numbers of infantry in the open.'; british.bazookaRound.damage = 350; british.tankShell = new Object(); british.tankShell.name = 'Riflemen'; british.tankShell.description = 'Riflemen'; british.tankShell.damage = 350; 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.intel = 'Effective in most situations. Good vs Infantry. Weak vs Armor.'; british.riflemen.unlockDescription = 'British riflemen are the core of your infantry. Good in most situations.'; british.riflemen.units = ['rifleman', 'rifleman', 'rifleman', 'rifleman', 'rifleman']; british.riflemen.range = 450; british.riflemen.speed = 2.2; british.riflemen.soldierHealth = 40; british.riflemen.health = (british.riflemen.units.length + 1) * british.riflemen.soldierHealth; british.riflemen.control1 = 'throwGrenade'; british.riflemen.control2 = 'throwSmoke'; british.riflemen.control3 = ''; british.rifleman = new Object(); british.rifleman.mainWeapon = 'garand'; british.rifleman.damage = 9; british.rifleman.firePose = 'semiAuto'; british.rifleman.fireType = 'slowBurst'; british.rifleman.health = 10; british.thompson = new Object(); british.thompson.mainWeapon = 'thompson'; british.thompson.damage = 1.5; british.thompson.firePose = 'smg'; british.thompson.fireType = 'medBurst'; british.thompson.health = 10; british.BAR = new Object(); british.BAR.mainWeapon = 'BAR'; british.BAR.damage = 2; british.BAR.firePose = 'smg'; british.BAR.fireType = 'medBurst'; british.BAR.health = 10; british.carbine = new Object(); british.carbine.mainWeapon = 'garand'; british.carbine.damage = 9; british.carbine.firePose = 'semiAuto'; british.carbine.fireType = 'slowBurst'; british.carbine.health = 10; british.assault = new Object(); british.assault.name = 'Assault Team'; british.assault.description = 'Assault Team'; british.assault.intel = 'Good vs Infantry in cover. Weak vs Armor.'; british.assault.unlockDescription = 'Assault Teams are trained and equipped for the task of clearing enemy emplacements.'; british.assault.units = ['carbine', 'thompson', 'BAR', 'thompson']; british.assault.range = 450; british.assault.speed = 2.55; british.assault.soldierHealth = 95; british.assault.health = (british.assault.units.length + 1) * british.assault.soldierHealth; british.assault.control1 = 'suppressingFire'; british.assault.control2 = 'throwGrenade'; british.assault.control3 = 'throwSmoke'; 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 = '.30 cal Team'; british.machineGun.intel = 'Good vs Infantry when in cover. Weak vs Armor.'; british.machineGun.description = 'The Lewis Gunneroos'; british.machineGun.unlockDescription = 'Carrying the .30 Cal, these teams are your defensive backbone. Keep them in cover.'; british.machineGun.mainWeapon = 'enfield'; british.machineGun.units = ['machineGunner', 'rifleman']; british.machineGun.range = 450; british.machineGun.speed = 1.8; british.machineGun.soldierHealth = 70; british.machineGun.health = (british.machineGun.units.length + 1) * british.machineGun.soldierHealth; british.machineGun.control1 = 'suppressingFire'; british.machineGun.control2 = ''; british.machineGun.control3 = ''; british.machineGunner = new Object(); british.machineGunner.mainWeapon = '30Cal'; british.machineGunner.firePose = 'machineGun'; british.machineGunner.fireType = 'burst'; british.machineGunner.damage = 7; british.mgAssist = new Object(); british.mgAssist.mainWeapon = 'pistol'; british.mgAssist.firePose = 'pistol'; british.mgAssist.damage = 1.25; british.sniper = new Object(); british.sniper.name = 'Sniper'; british.sniper.description = 'British Sharpshooter'; british.sniper.intel = 'Long range infantry. Strong vs Infantry. Weak vs Armor.'; 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 = 2; british.sniper.soldierHealth = 70; british.sniper.health = (british.sniper.units.length + 1) * british.sniper.soldierHealth; british.sniper.control1 = 'throwSmoke'; british.sniper.control2 = ''; british.sniper.control3 = ''; british.sharpShooter = new Object(); british.sharpShooter.mainWeapon = 'enfieldSniper'; british.sharpShooter.firePose = 'sniper'; british.sharpShooter.damage = 40; british.spotter = new Object(); british.spotter.mainWeapon = 'pistol'; british.spotter.health = 10; british.officer = new Object(); british.officer.name = 'Lieutenant'; british.officer.description = 'Lieutenant'; british.officer.intel = 'Command unit. Has control of fire support.'; british.officer.unlockDescription = 'Officers have the battalion\'s fire support at their disposal.'; british.officer.units = ['lieutenant']; british.officer.range = 450; british.officer.mainWeapon = 'garand'; british.officer.speed = 1.8; british.officer.soldierHealth = 115; british.officer.health = (british.officer.units.length + 1) * british.officer.soldierHealth; british.officer.control1 = 'callAirSupport'; british.officer.control2 = 'callArtillery'; british.officer.control3 = 'throwSmoke'; british.lieutenant = new Object(); british.lieutenant.mainWeapon = 'garand'; british.lieutenant.damage = 5; british.lieutenant.firePose = 'semiAuto'; british.lieutenant.fireType = 'slowBurst'; british.lieutenant.health = 10; british.mortarTeam = new Object(); british.mortarTeam.name = 'Mortar Team'; british.mortarTeam.intel = 'Light artillery. Strong vs Infantry. Average vs Armor.'; british.mortarTeam.description = 'Mortar Team'; british.mortarTeam.unlockDescription = 'Mortar Teams are vital to support your men with short range artillery.'; british.mortarTeam.units = ['mortarCarrier']; british.mortarTeam.range = 1600; british.mortarTeam.mainWeapon = 'mortar'; british.mortarTeam.speed = 1.8; british.mortarTeam.soldierHealth = 45; british.mortarTeam.health = (british.mortarTeam.units.length + 1) * british.mortarTeam.soldierHealth; british.mortarTeam.control1 = 'smokeRounds'; british.mortarTeam.control2 = ''; british.mortarTeam.control3 = ''; british.mortarCarrier = new Object(); british.mortarCarrier.mainWeapon = 'mortarTube'; british.mortarCarrier.firePose = 'mortar'; british.mortarCarrier.damage = 1.0e-008; british.mortarLoader = new Object(); british.mortarLoader.mainWeapon = 'none'; british.mortarLoader.firePose = 'mortarLoad'; british.mortarLoader.damage = 1.0e-008; british.medic = new Object(); british.medic.name = 'Medic'; british.medic.description = 'Medic'; british.medic.unlockDescription = 'Medics will recover wounded men from the field adding them back to your resource pool.'; british.medic.units = ['medicUnit']; british.medic.range = 50; british.medic.mainWeapon = 'pistol'; british.medic.speed = 1.5; british.medic.soldierHealth = 200; british.medic.health = (british.medic.units.length + 1) * british.medic.soldierHealth; british.medicUnit = new Object(); british.medicUnit.mainWeapon = 'none'; british.medicUnit.firePose = 'none'; british.medicUnit.damage = 0; british.bazooka = new Object(); british.bazooka.name = 'Bazooka Team'; british.bazooka.intel = 'Anti-tank team. Average vs Infantry. Strong vs Armor.'; british.bazooka.description = 'Bazooka Team'; british.bazooka.unlockDescription = 'Anti-tank team. Use them in cover to ambush enemy tanks.'; british.bazooka.units = ['bazookaMan', 'rifleman']; british.bazooka.range = 400; british.bazooka.mainWeapon = 'bazooka'; british.bazooka.speed = 1.8; british.bazooka.soldierHealth = 80; british.bazooka.health = (british.bazooka.units.length + 1) * british.bazooka.soldierHealth; british.bazookaMan = new Object(); british.bazookaMan.mainWeapon = 'bazooka'; british.bazookaMan.firePose = 'bazooka'; british.bazookaMan.damage = 0; british.bazookaLoader = new Object(); british.bazookaLoader.mainWeapon = 'carbine'; british.bazookaLoader.firePose = 'semi-auto'; british.bazookaLoader.damage = 0; british.tank = new Object(); british.tank.name = 'M4A1 Sherman Tank'; british.tank.description = 'M4A1 Sherman Tank'; british.tank.intel = 'Tank. Strong vs Infantry. Strong vs Armor.'; british.tank.unlockDescription = 'Medium tank. Slightly weaker armor than the Panzer III, keep it supported by infantry.'; british.tank.units = ['tankMarkIV']; british.tank.range = 700; british.tank.mainWeapon = 'mainGun'; british.tank.secondaryWeapon = 'tankMG'; british.tank.speed = 1; british.tank.soldierHealth = 950; 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.flanking = new Object(); german.flanking.name = 'Flanking'; german.flanking.description = 'Flanking'; german.flanking.unlockDescription = 'Moving your men off the battlefield on the enemy\'s TOP and BOTTOM zones will flank them dropping their MORALE.'; german.flanking.damage = 0; german.conquer = new Object(); german.conquer.name = 'Conquer'; german.conquer.description = 'Conquer'; german.conquer.unlockDescription = 'Moving your men to END of the MIDDLE ZONE will win the Battle.'; german.conquer.damage = 0; 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.airSupport = new Object(); german.airSupport.name = 'Air Support'; german.airSupport.description = 'Air Support'; german.airSupport.unlockDescription = 'Devastating heavy rounds that will destroy anything in their way.'; german.airSupport.damage = 120; german.airSupport.timer = 400; german.airSupport.rechargeTime = 200; 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 = 350; german.grenade = new Object(); german.grenade.name = 'Grenade'; german.grenade.description = 'Grenade'; german.grenade.damage = 65; german.bazookaRound = new Object(); german.bazookaRound.name = 'Mortar'; german.bazookaRound.description = 'Mortar'; german.bazookaRound.unlockDescription = 'Explosive rounds good for hitting large numbers of infantry in the open.'; german.bazookaRound.damage = 500; 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.intel = 'Rifle team. Average vs Infantry. Weak vs Armor.'; german.riflemen.units = ['rifleman', 'rifleman', 'rifleman', 'rifleman']; german.riflemen.range = 450; german.riflemen.speed = 2.2; 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.riflemen.control1 = 'throwGrenade'; german.riflemen.control2 = 'throwSmoke'; german.riflemen.control3 = ''; german.rifleman = new Object(); german.rifleman.mainWeapon = 'mauser'; german.rifleman.firePose = 'rifle'; german.rifleman.damage = 12; german.rifleman.health = 0; german.assault = new Object(); german.assault.name = 'Assault Team'; german.assault.description = 'Sturmtruppen'; german.assault.intel = 'Assault team. Strong vs Infantry in cover. Weak vs Armor.'; german.assault.units = ['volksgrenadier', 'volksgrenadier', 'grenadier', 'grenadier']; german.assault.range = 450; german.assault.speed = 2.55; german.assault.soldierHealth = 95; german.assault.health = (german.assault.units.length + 1) * german.assault.soldierHealth; german.assault.unlockDescription = 'Sturmtruppen or Assault Troops are trained in assaulting enemy in cover.'; german.assault.control1 = 'suppressingFire'; german.assault.control2 = 'throwGrenade'; german.assault.control3 = 'throwSmoke'; german.grenadier = new Object(); german.grenadier.mainWeapon = 'mauser'; german.grenadier.damage = 6; german.grenadier.firePose = 'semiAuto'; german.grenadier.fireType = 'slowBurst'; german.grenadier.health = 10; german.volksgrenadier = new Object(); german.volksgrenadier.mainWeapon = 'mp40'; german.volksgrenadier.damage = 1.5; german.volksgrenadier.firePose = 'smg'; german.volksgrenadier.fireType = 'medBurst'; german.volksgrenadier.health = 10; german.machineGun = new Object(); german.machineGun.name = 'MG34 Team'; german.machineGun.description = 'Machine Gun Team'; german.machineGun.intel = 'MG34 Team. Strong vs Infantry. Weak vs Armor.'; german.machineGun.mainWeapon = 'Lewis Gun'; german.machineGun.units = ['machineGunner', 'rifleman']; german.machineGun.range = 450; german.machineGun.speed = 1.8; 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.machineGun.control1 = 'suppressingFire'; german.machineGun.control2 = ''; german.machineGun.control3 = ''; german.machineGunner = new Object(); german.machineGunner.mainWeapon = 'mg34'; german.machineGunner.firePose = 'machineGun'; german.machineGunner.fireType = 'burst'; german.machineGunner.damage = 7; 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.intel = 'Long range infantry. Strong vs Infantry. Weak vs Armor.'; german.sniper.mainWeapon = 'enfieldSniper'; german.sniper.units = ['sharpShooter']; german.sniper.range = 600; german.sniper.speed = 2; 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 = 40; 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.intel = 'Command unit. Has access to fire support.'; german.officer.units = ['lieutenant']; german.officer.range = 450; german.officer.mainWeapon = 'pistol'; german.officer.speed = 1.8; 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.officer.control1 = 'callAirSupport'; german.officer.control2 = 'callArtillery'; german.officer.control3 = 'throwSmoke'; german.officer.control1 = 'callAirSupport'; german.officer.control2 = 'callArtillery'; german.officer.control3 = 'throwSmoke'; german.lieutenant = new Object(); german.lieutenant.mainWeapon = 'mp40'; german.lieutenant.damage = 5; german.lieutenant.firePose = 'semiAuto'; german.lieutenant.fireType = 'slowBurst'; german.lieutenant.health = 10; german.medic = new Object(); german.medic.name = 'medic'; german.medic.description = 'Medic'; german.medic.unlockDescription = 'Medics will recover wounded men from the field adding them back to your resource pool.'; german.medic.units = ['medicUnit']; german.medic.range = 50; german.medic.mainWeapon = 'pistol'; german.medic.speed = 1.8; german.medic.soldierHealth = 200; german.medic.health = (german.medic.units.length + 1) * german.medic.soldierHealth; german.medicUnit = new Object(); german.medicUnit.mainWeapon = 'none'; german.medicUnit.firePose = 'none'; german.medicUnit.damage = 0; german.mortarTeam = new Object(); german.mortarTeam.name = 'Mortar Team'; german.mortarTeam.description = 'Mortar Team'; german.mortarTeam.intel = 'Light artillery. Strong vs Infantry. Average vs Armor.'; german.mortarTeam.unlockDescription = 'Mortar Teams are vital to support your men with short range artillery.'; german.mortarTeam.units = ['mortarCarrier']; german.mortarTeam.range = 1600; german.mortarTeam.mainWeapon = 'mortar'; german.mortarTeam.speed = 1.8; german.mortarTeam.soldierHealth = 45; german.mortarTeam.health = (german.mortarTeam.units.length + 1) * german.mortarTeam.soldierHealth; german.mortarCarrier = new Object(); german.mortarCarrier.mainWeapon = 'mortarTube'; german.mortarCarrier.firePose = 'mortar'; german.mortarCarrier.damage = 0; german.mortarLoader = new Object(); german.mortarLoader.mainWeapon = 'none'; german.mortarLoader.firePose = 'mortarLoad'; german.mortarLoader.damage = 0; german.bazooka = new Object(); german.bazooka.name = 'Panzershreck Team'; german.bazooka.description = 'Panzershreck Team'; german.bazooka.intel = 'Anti-tank team. Average vs Infantry. Strong vs Armor.'; german.bazooka.unlockDescription = 'Devestate the American\'s tin cans with these anti-tank teams.'; german.bazooka.units = ['bazookaMan', 'rifleman']; german.bazooka.range = 400; german.bazooka.mainWeapon = 'pistol'; german.bazooka.speed = 1.8; german.bazooka.soldierHealth = 80; german.bazooka.health = (german.bazooka.units.length + 1) * german.bazooka.soldierHealth; german.bazookaMan = new Object(); german.bazookaMan.mainWeapon = 'panzershreck'; german.bazookaMan.firePose = 'bazooka'; german.bazookaMan.damage = 0; german.bazookaLoader = new Object(); german.bazookaLoader.mainWeapon = 'semiAuto'; german.bazookaLoader.firePose = 'slowBurst'; german.bazookaLoader.damage = 0; german.tank = new Object(); german.tank.name = 'Panzer III'; german.tank.description = 'Panzer III'; german.tank.intel = 'Tank. Strong vs Infantry. Strong vs Armor.'; german.tank.unlockDescription = 'Our tanks are superior but they are not invincible, keep them supported.'; german.tank.units = ['tankMarkIV']; german.tank.range = 650; german.tank.mainWeapon = 'mainGun'; german.tank.secondaryWeapon = 'tankMG'; german.tank.speed = 1; german.tank.soldierHealth = 1000; german.tank.health = german.tank.units.length * german.tank.soldierHealth; german.tankMarkIV = new Object(); german.tankMarkIV.mainWeapon = 'tankMG'; german.tankMarkIV.damage = 4; setUnitCosts(); british.bunker = new Object(); british.bunker.name = 'british Bunker'; british.bunker.description = 'british Bunker'; british.bunker.unlockDescription = '\'Land-ships\' are a fearsome sight to the Fritz. Blazing machine guns and cannons, hurrah!'; british.bunker.units = ['bunkerBase']; british.bunker.range = 650; british.bunker.mainWeapon = 'mainGun'; british.bunker.secondaryWeapon = 'tankMG'; british.bunker.speed = 0; british.bunker.soldierHealth = 850; british.bunker.health = 1200; british.bunkerBase = new Object(); british.bunkerBase.mainWeapon = 'tankMG'; british.bunkerBase.damage = 2.1; german.bunker = new Object(); german.bunker.name = 'German Bunker'; german.bunker.description = 'German Bunker'; german.bunker.unlockDescription = '\'Land-ships\' are a fearsome sight to the Fritz. Blazing machine guns and cannons, hurrah!'; german.bunker.units = ['bunkerBase']; german.bunker.range = 1200; german.bunker.mainWeapon = 'mainGun'; german.bunker.secondaryWeapon = 'tankMG'; german.bunker.speed = 0; german.bunker.soldierHealth = 850; german.bunker.health = 1200; german.bunkerBase = new Object(); german.bunkerBase.mainWeapon = 'tankMG'; german.bunkerBase.damage = 0.8; british.MG42 = new Object(); british.MG42.name = 'Heavy Machine Gun'; british.MG42.description = 'The Lewis Gunneroos'; british.MG42.unlockDescription = 'Carrying the Lewis Gun, these teams are your defensive backbone. Keep them entrenched.'; british.MG42.mainWeapon = 'enfield'; british.MG42.units = ['MG42Gun', 'gunLoader', 'gunLoader']; british.MG42.range = 950; british.MG42.speed = 0; british.MG42.soldierHealth = 570; british.MG42.health = (british.MG42.units.length + 1) * british.MG42.soldierHealth; british.MG42Gun = new Object(); british.MG42Gun.mainWeapon = 'MG42'; british.MG42Gun.firePose = 'machineGun'; british.MG42Gun.fireType = 'burst'; british.MG42Gun.damage = 15; british.gunLoader = new Object(); british.gunLoader.mainWeapon = 'none'; british.gunLoader.firePose = 'none'; british.gunLoader.fireType = 'none'; british.gunLoader.damage = 0; german.MG42 = new Object(); german.MG42.name = 'MG42'; german.MG42.description = 'The Lewis Gunneroos'; german.MG42.unlockDescription = 'Carrying the Lewis Gun, these teams are your defensive backbone. Keep them entrenched.'; german.MG42.mainWeapon = 'enfield'; german.MG42.units = ['gunLoader', 'gunLoader', 'MG42Gun']; german.MG42.range = 950; german.MG42.speed = 0; german.MG42.soldierHealth = 570; german.MG42.health = (german.MG42.units.length + 1) * german.MG42.soldierHealth; german.MG42Gun = new Object(); german.MG42Gun.mainWeapon = 'MG42'; german.MG42Gun.firePose = 'machineGun'; german.MG42Gun.fireType = 'burst'; german.MG42Gun.damage = 8; german.gunLoader = new Object(); german.gunLoader.mainWeapon = 'none'; german.gunLoader.firePose = 'none'; german.gunLoader.fireType = 'none'; german.gunLoader.damage = 0; var squadNumber = 0; var soldierNumber = 0; var britishSquadsOnScreen = new Array(); var germanSquadsOnScreen = new Array(); var britishOfficers = new Array(); var germanOfficers = new Array(); var britishSquadsZone1 = new Array(); var britishSquadsZone2 = new Array(); var britishSquadsZone3 = new Array(); var germanSquadsZone1 = new Array(); var germanSquadsZone2 = new Array(); var germanSquadsZone3 = new Array(); british.squadLeaders = new Array(); german.squadLeaders = new Array(); var cover_stoneWall = new Object(); cover_stoneWall.desc = 'stone wall'; cover_stoneWall.defence = 0.5; var cover_woodFence = new Object(); cover_woodFence.desc = 'wood fence'; cover_woodFence.defence = 0.7; var cover_logPile = new Object(); cover_logPile.desc = 'log pile'; cover_logPile.defence = 0.5; var cover_sandBags = new Object(); cover_sandBags.desc = 'sandbags'; cover_sandBags.defence = 0.5; var cover_sandBagsUS = new Object(); cover_sandBagsUS.desc = 'sandbagsUS'; cover_sandBagsUS.defence = 0.5; var cover_barrels = new Object(); cover_barrels.desc = 'barrels'; cover_barrels.defence = 0.7; var cover_hedgerow = new Object(); cover_hedgerow.desc = 'hedgerow'; cover_hedgerow.defence = 0.7; var cover_rubble1 = new Object(); cover_rubble1.desc = 'rubble'; cover_rubble1.defence = 0.7; var cover_rubble2 = new Object(); cover_rubble2.desc = 'rubble'; cover_rubble2.defence = 0.7; var cover_urban1 = new Object(); cover_urban1.desc = 'barricade'; cover_urban1.defence = 0.7; var cover_urban2 = new Object(); cover_urban2.desc = 'barricade'; cover_urban2.defence = 0.7; var cover_sandDune = new Object(); cover_sandDune.desc = 'sand dune'; cover_sandDune.defence = 0.7; var cover_woodFenceOvergrown = new Object(); cover_woodFenceOvergrown.desc = 'wood fence'; cover_woodFenceOvergrown.defence = 0.7; var cover_headstones = new Object(); cover_headstones.desc = 'headstones'; cover_headstones.defence = 0.7; var cover_townWall = new Object(); cover_townWall.desc = 'stone wall'; cover_townWall.defence = 0.5; var cover_sandBagsUrban = new Object(); cover_sandBagsUrban.desc = 'sandbags'; cover_sandBagsUrban.defence = 0.5; var cover_sandBagsUrban_german = new Object(); cover_sandBagsUrban_german.desc = 'sandbags'; cover_sandBagsUrban_german.defence = 0.5; var deployMode = false; var deploymentZone1 = 145; var deploymentZone2 = 230; var deploymentZone3 = 316; var deployZone1 = new Object(); var deployZone2 = new Object(); var deployZone3 = new Object(); deployZone1.zone = deploymentZone1; deployZone2.zone = deploymentZone2; deployZone3.zone = deploymentZone3; var deployZoneHeight = 70; var deployZoneColour = '0xb4dea7'; var soldiersZone1 = 0; var soldiersZone2 = 0; var soldiersZone3 = 0; var zoneCounts = new Array(soldiersZone1, soldiersZone2, soldiersZone3); var smokedEffect = 0.3; var conquerWinArea = 150; var squadLocalX = 0; var squadGlobalX = 0; var squadLocalPoint = new Object(); var slowBurstRate = 210; var medBurstRate = 160; var highBurstRate = 60; var minWait = 90; var woundedTeam = ''; var moveModifier = 0.75; var currentSquadProx = 0; var targetingBuffer = 30; var inZone = false; var officerInfluence = 150; var officerFound = false; var trenchBoundary = 100; 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 AIpanicMode = false; var enemySupportRate = 0; var enemySupportRateMax = 0; var enemySupportWave = 0; var closestSupportTargetX = 0; var enemySupportTarget = null; var waitChance = 6; var spawnedEnemy = false; var randomEnemyUnit = 0; var currentEnemySpawn = 0; var randomSpawnChance = 250; var enemyUnitReadyForSpawn = false; var spawnEnemyActive = false; var enemy_riflemen = new Object(); enemy_riflemen.name = 'riflemen'; var enemy_assault = new Object(); enemy_assault.name = 'assault'; var enemy_machineGun = new Object(); enemy_machineGun.name = 'machineGun'; var enemy_sniper = new Object(); enemy_sniper.name = 'sniper'; var enemy_mortarTeam = new Object(); enemy_mortarTeam.name = 'mortarTeam'; var enemy_bazooka = new Object(); enemy_bazooka.name = 'bazooka'; var enemy_officer = new Object(); enemy_officer.name = 'officer'; var enemy_medic = new Object(); enemy_medic.name = 'medic'; var enemy_tank = new Object(); enemy_tank.name = 'tank'; var enemyTimers = new Array(enemy_riflemen, enemy_assault, enemy_machineGun, enemy_sniper, enemy_mortarTeam, enemy_bazooka, enemy_officer, enemy_medic, enemy_tank); for (et in enemyTimers) { enemyTimers[et].active = true; enemyTimers[et].timerMax = _root['resupply_' + enemyTimers[et].name]; enemyTimers[et].timer = enemyTimers[et].timerMax; } var damageModifier = 1.3; var squadToHit = 0; var squadMemberNumberToHit = 0; var showBulletDustChance = 8; var sortDeadDelay = 1000; var trenchDefence = 0; var trenchBonus = 1; var officerBonus = 1.5; var explosiveDamage = 0; var clearDeadSoldierTime = 15000; var explosionSurvivalChanceBase = 9; var explosionSurvivalChance = explosionSurvivalChanceBase; 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 screenShaking = false; var screenShakeXMax = 10; var screenShakeYMax = 10; var screenShakeTimer = 0; var screenShakeDelay = 50; var screenOrigin = new Object(); var specialRounds = 0; var decals = 0; var numArtilleryRounds = 8; var numMortarRounds = 1; var numGasRounds = 2; var numAntiTankRounds = 5; var numAirSupportRounds = 15; var numBazookaRounds = 1; var numSmokeRounds = 1; var tempNumMortarRounds = 0; var tempNumArtilleryRounds = 0; var tempNumGasRounds = 0; var tempNumAntiTankRounds = 0; var tempNumAirStrikeRounds = 0; var tempNumSmokeRounds = 0; var decalRemoveDelay = 15; var gasCollisions = 0; var gasDamage = 0.4; var fighters = 0; 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 rollingOverDeployButtons = false; var enemyTeamInterfaceColour = '0x888888'; 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 selectedUnitStatus = 0; var allActionControls = new Array(); var supportCursorUp = false; a = 0; while (a <= 6) { allActionControls.push('actionSlot' + a); ++a; } var advance_description = 'Advance'; var callArtillery_description = 'Call Artillery Strike - 500 RP'; var callAirSupport_description = 'Call Air Support - 300 RP'; var throwGrenade_description = 'Throw Grenade - 50 RP'; var throwSmoke_description = 'Throw Smoke Grenade - 50 RP'; var suppressingFire_description = 'Suppressing Fire'; var smokeRounds_description = 'Smoke Mortar Rounds - 100 RP'; 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 psspawn1 = null; var psspawn2 = null; var psspawn3 = null; var psspawn4 = null; 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 = 'BLOOD ON THE SAND'; british_map1.description = 'BRIEFING: The objective is the enemy emplacement at the end of this beach. Clear the lower defenses, then push your BAZOOKA TEAMS up to clear the bunker.'; british_map1.mapSection = 'section1'; british_map1.sectionNumber = 1; british_map1.bonusXP = 25; british_map1.rainOn = false; british_map1.friendlyMorale = 1500; british_map1.enemyMorale = 1000; british_map1.resourcePointsPlayer = 800; british_map1.resourcePointsEnemy = 0; british_map1.coverZone1 = new Array(); british_map1.coverZone2 = new Array(); british_map1.coverZone3 = new Array(); british_map1.tankTraps = 4; british_map1.tankTrap1Pos = 225; british_map1.tankTrap2Pos = 400; british_map1.tankTrap3Pos = 575; british_map1.tankTrap4Pos = 725; british_map1.bunkersZone1 = null; british_map1.bunkersZone2 = new Array('1420'); british_map1.bunkersZone1 = null; british_map1.coverZone1 = new Array('1140'); british_map1.coverTypeZone1 = new Array('sandBagsUrban_german'); british_map1.coverZone2 = new Array(); british_map1.coverTypeZone2 = new Array(); british_map1.coverZone3 = new Array('1140'); british_map1.coverTypeZone3 = new Array('sandBagsUrban_german'); british_map1.prespawnSquad1 = new Array('riflemen'); british_map1.prespawnSquad2 = new Array(); british_map1.prespawnSquad3 = new Array('riflemen'); british_map1.file = 'map_british_1'; british_map1.wire = 1; british_map1.wire1Pos = 975; british_map1.britishMines = new Array(); british_map1.germanMines = new Array(); british_map1.britishMinesMax = 0; british_map1.germanMinesMax = 0; british_map1.unlocks = new Array('objective'); british_map1.availableUnits = new Array('riflemen', 'assault', 'bazooka'); british_map1.enemyRate = 20; british_map1.enemyUnits = new Array(); british_map1.enemySupport = new Array('artillery', 'mortarAI'); british_map1.enemySupportRate = 15; british_map1.timeBonus = 240; british_map1.enemyMood = 'static'; var british_map2 = new Object(); british_map2.name = 'british_map2'; british_map2.mission = 2; british_map2.battleTitle = 'ON THE RAILS'; british_map2.description = 'BRIEFING: Follow the railway to the nearby village, clear any enemy resistance en route.'; british_map2.mapSection = 'section2'; british_map2.sectionNumber = 2; british_map2.bonusXP = 50; british_map2.rainOn = false; british_map2.resourcePointsPlayer = 500; british_map2.resourcePointsEnemy = 500; british_map2.prespawnSquad2 = new Array('machineGun'); british_map2.coverZone1 = new Array('475'); british_map2.coverTypeZone1 = new Array('barrels'); british_map2.coverZone2 = new Array('930'); british_map2.coverTypeZone2 = new Array('sandBagsUrban_german'); british_map2.coverZone3 = new Array('495'); british_map2.coverTypeZone3 = new Array('hedgerow'); british_map2.friendlyMorale = 100; british_map2.enemyMorale = 90; british_map2.file = 'map_british_2'; british_map2.wire = 0; british_map2.unlocks = new Array('machineGun', 'conquer', 'flanking'); british_map2.availableUnits = new Array('riflemen', 'assault', 'machineGun'); british_map2.enemyRate = 15; british_map2.enemyUnits = new Array('assault', 'riflemen', 'riflemen'); british_map2.enemySupport = new Array(); british_map2.enemySupportRate = 25; british_map2.timeBonus = 180; british_map2.enemyMood = 'static'; var british_map3 = new Object(); british_map3.name = 'british_map3'; british_map3.mission = 3; british_map3.battleTitle = 'MUNITIONS'; british_map3.description = 'BRIEFING: At the end of the road is a small munitions dump just outside of our next objective. Hit it hard and fast from the flanks. Recon has reported mortar fire coming from the position so keep your men moving.'; british_map3.mapSection = 'section3'; british_map3.sectionNumber = 3; british_map3.bonusXP = 50; british_map3.rainOn = false; british_map3.resourcePointsPlayer = 500; british_map3.resourcePointsEnemy = 500; british_map3.coverZone1 = new Array('304', '937', '1250'); british_map3.coverTypeZone1 = new Array('stoneWall', 'woodFence', 'barrels'); british_map3.coverZone2 = new Array('1050'); british_map3.coverTypeZone2 = new Array('logPile', 'woodFenceOvergrown'); british_map3.coverZone3 = new Array('304', '937', '1300'); british_map3.coverTypeZone3 = new Array('stoneWall', 'woodFenceOvergrown', 'urban2'); british_map3.friendlyMorale = 100; british_map3.enemyMorale = 100; british_map3.prespawnSquad1 = new Array(); british_map3.prespawnSquad2 = new Array(); british_map3.prespawnSquad3 = new Array('mortarTeam'); british_map3.file = 'map_british_3'; british_map3.wire = 0; british_map3.unlocks = new Array('sniper', 'officer'); british_map3.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'officer'); british_map3.enemyRate = 14; british_map3.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'riflemen', 'machineGun'); british_map3.enemySupport = new Array(); british_map3.enemySupportRate = 25; british_map3.timeBonus = 180; british_map3.enemyMood = 'aggressive'; var british_map4 = new Object(); british_map4.name = 'british_map4'; british_map4.mission = 4; british_map4.battleTitle = 'ARMOR CONVOY'; british_map4.description = 'BRIEFING: The Germans are said to be moving their armor and infantry through this town. Use your Bazooka Teams to ambush the convoy and destroy the enemy armor.'; british_map4.mapSection = 'section4'; british_map4.sectionNumber = 4; british_map4.bonusXP = 150; british_map4.friendlyMorale = 150; british_map4.enemyMorale = 800; british_map4.file = 'map_british_4'; british_map4.wire = 0; british_map4.wire1Pos = 1200; british_map4.wire2Pos = 850; british_map4.rainOn = false; british_map4.resourcePointsPlayer = 800; british_map4.resourcePointsEnemy = 300; british_map4.coverZone1 = new Array('450', '850', '1350'); british_map4.coverTypeZone1 = new Array('townWall', 'barrels', 'sandBagsUrban_german'); british_map4.coverZone2 = new Array(); british_map4.coverTypeZone2 = new Array(); british_map4.coverZone3 = new Array('310', '590', '720', '1350'); british_map4.coverTypeZone3 = new Array('urban1', 'urban2', 'townWall', 'sandBagsUrban_german'); british_map4.prespawnSquad2 = new Array(); british_map4.presetSpawn = new Array('tank', 'tank', 'tank'); british_map4.presetSpawnTime = new Array('32000', '107000', '187000'); british_map4.presetSpawnZone = new Array('2', '2', '2'); british_map4.presetSpawnObj = new Array(false, false, true); british_map4.britishMines = new Array(); british_map4.germanMines = new Array(); british_map4.britishMinesMax = 0; british_map4.germanMinesMax = 0; british_map4.unlocks = new Array('bazooka'); british_map4.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'bazooka', 'officer'); british_map4.enemyRate = 28; british_map4.enemyUnits = new Array('riflemen', 'riflemen', 'riflemen', 'assault'); british_map4.enemySupport = new Array(); british_map4.enemySupportRate = 25; british_map4.timeBonus = 180; british_map4.enemyMood = 'defensive'; var british_map5 = new Object(); british_map5.name = 'british_map5'; british_map5.mission = 5; british_map5.battleTitle = 'HEDGEROWS'; british_map5.description = 'BRIEFING: These dense hedgerows are a nightmare to fight in, but we can use them to our advantage. Slip around the flanks and advance your line with support.'; british_map5.mapSection = 'section5'; british_map5.sectionNumber = 5; british_map5.bonusXP = 50; british_map5.rainOn = false; british_map5.resourcePointsPlayer = 600; british_map5.resourcePointsEnemy = 600; british_map5.prespawnSquad1 = new Array(); british_map5.prespawnSquad3 = new Array('machineGun'); british_map5.coverZone1 = new Array('300', '650', '900', '1250'); british_map5.coverTypeZone1 = new Array('sandBagsUrban', 'hedgerow', 'hedgerow', 'woodFenceOvergrown'); british_map5.coverZone2 = new Array('1000'); british_map5.coverTypeZone2 = new Array('barrels'); british_map5.coverZone3 = new Array('300', '550', '1350'); british_map5.coverTypeZone3 = new Array('townWall', 'hedgerow', 'hedgerow'); british_map5.friendlyMorale = 100; british_map5.enemyMorale = 120; british_map5.file = 'map_british_5'; british_map5.wire = 0; british_map5.unlocks = new Array('mortarTeam'); british_map5.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'bazooka', 'sniper', 'mortarTeam', 'officer'); british_map5.enemyRate = 11; british_map5.enemyUnits = new Array('assault', 'assault', 'riflemen', 'riflemen', 'riflemen', 'sniper', 'machineGun'); british_map5.enemySupport = new Array(); british_map5.enemySupportRate = 25; british_map5.timeBonus = 220; british_map5.enemyMood = 'aggressive'; var british_map6 = new Object(); british_map6.name = 'british_map6'; british_map6.mission = 6; british_map6.battleTitle = 'OPEN RANGE'; british_map6.description = 'BRIEFING: Armored Corps has come to the party. Recon reports enemy armor movement in these areas across the open fields. Make sure you keep our Shermans supported with infantry.'; british_map6.mapSection = 'section6'; british_map6.sectionNumber = 6; british_map6.bonusXP = 50; british_map6.rainOn = true; british_map6.resourcePointsPlayer = 800; british_map6.resourcePointsEnemy = 1200; british_map6.prespawnSquad1 = new Array(); british_map6.prespawnSquad3 = new Array(); british_map6.coverZone1 = new Array(); british_map6.coverTypeZone1 = new Array(); british_map6.coverZone2 = new Array(); british_map6.coverTypeZone2 = new Array(); british_map6.coverZone3 = new Array(); british_map6.coverTypeZone3 = new Array(); british_map6.friendlyMorale = 500; british_map6.enemyMorale = 500; british_map6.file = 'map_british_6'; british_map6.wire = 0; british_map6.unlocks = new Array('tank'); british_map6.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'bazooka', 'sniper', 'mortarTeam', 'officer', 'tank'); british_map6.enemyRate = 9; british_map6.enemyUnits = new Array('assault', 'riflemen', 'tank', 'tank', 'tank', 'tank', 'bazooka', 'bazooka'); british_map6.enemySupport = new Array(); british_map6.enemySupportRate = 25; british_map6.timeBonus = 240; british_map6.enemyMood = 'aggressive'; var british_map7 = new Object(); british_map7.name = 'british_map7'; british_map7.mission = 7; british_map7.battleTitle = 'CLEAR THE WAY'; british_map7.description = 'BRIEFING: This town and outlying cemetary is littered with infantry and anti-tank. We need to clear a path for our armor. Control the cemetary, then move on the bunker at the edge of town. Expect enemy artillery.'; british_map7.mapSection = 'section7'; british_map7.sectionNumber = 7; british_map7.bonusXP = 50; british_map7.rainOn = false; british_map7.resourcePointsPlayer = 800; british_map7.resourcePointsEnemy = 800; british_map7.prespawnSquad1 = new Array(); british_map7.prespawnSquad3 = new Array(); british_map7.coverZone1 = new Array('920', '1095', '1360', '1540'); british_map7.coverTypeZone1 = new Array('townWall', 'headstones', 'headstones', 'townWall'); british_map7.coverZone2 = new Array('1105', '1410', '1745'); british_map7.coverTypeZone2 = new Array('headstones', 'headstones', 'sandBagsUrban_german'); british_map7.coverZone3 = new Array('920', '1095', '1365', '1540'); british_map7.coverTypeZone3 = new Array('townWall', 'headstones', 'headstones', 'townWall'); british_map7.friendlyMorale = 100; british_map7.enemyMorale = 110; british_map7.file = 'map_british_7'; british_map7.wire = 0; british_map7.unlocks = new Array(); british_map7.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'bazooka', 'sniper', 'mortarTeam', 'officer'); british_map7.enemyRate = 10; british_map7.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'officer', 'mortarTeam', 'sniper', 'machineGun'); british_map7.enemySupport = new Array('airSupport', 'artillery'); british_map7.enemySupportRate = 80; british_map7.timeBonus = 300; british_map7.enemyMood = 'balanced'; var british_map8 = new Object(); british_map8.name = 'british_map8'; british_map8.mission = 8; british_map8.battleTitle = 'THE LAST STEP'; british_map8.description = 'BRIEFING: The Krauts have this town locked down. It\'s crawling with infantry and armor. Secure it and we\'ll have secured the region.'; british_map8.mapSection = 'section8'; british_map8.sectionNumber = 8; british_map8.bonusXP = 50; british_map8.rainOn = false; british_map8.resourcePointsPlayer = 800; british_map8.resourcePointsEnemy = 1800; british_map8.prespawnSquad1 = new Array(); british_map8.prespawnSquad3 = new Array('tank'); british_map8.coverZone1 = new Array(); british_map8.coverTypeZone1 = new Array(); british_map8.coverZone2 = new Array('410', '820', '1650'); british_map8.coverTypeZone2 = new Array('townWall', 'urban2', 'urban1'); british_map8.coverZone3 = new Array(); british_map8.coverTypeZone3 = new Array(); british_map8.friendlyMorale = 1500; british_map8.enemyMorale = 1500; british_map8.file = 'map_british_8'; british_map8.wire = 0; british_map8.unlocks = new Array(); british_map8.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'bazooka', 'sniper', 'mortarTeam', 'officer', 'tank'); british_map8.enemyRate = 6; british_map8.enemyUnits = new Array('assault', 'riflemen', 'bazooka', 'bazooka', 'mortarTeam', 'sniper', 'machineGun', 'bazooka', 'tank', 'tank', 'tank'); british_map8.enemySupport = new Array('airSupport', 'mortarAI', 'artillery'); british_map8.enemySupportRate = 20; british_map8.timeBonus = 300; british_map8.enemyMood = 'static'; var german_map1 = new Object(); german_map1.name = 'german_map1'; german_map1.mission = 1; german_map1.battleTitle = 'INVASION'; german_map1.description = 'BRIEFING: The Allies have mounted a huge offensive along the coast with assistance from their Navy. Hold this position to delay their attack! We must stop them here!'; german_map1.mapSection = 'section1'; german_map1.sectionNumber = 1; german_map1.bonusXP = 0; german_map1.rainOn = false; german_map1.resourcePointsPlayer = 800; german_map1.resourcePointsEnemy = 1000; german_map1.prespawnSquad1 = new Array(); german_map1.prespawnSquad3 = new Array(); german_map1.coverZone1 = new Array('945'); german_map1.coverTypeZone1 = new Array('sandBags'); german_map1.coverZone2 = new Array('920'); german_map1.coverTypeZone2 = new Array('sandBags'); german_map1.coverZone3 = new Array('945'); german_map1.coverTypeZone3 = new Array('sandBags'); german_map1.friendlyMorale = 200; german_map1.enemyMorale = 200; german_map1.file = 'map_german_1'; german_map1.wire = 1; german_map1.wire1Pos = 675; german_map1.germanMinesMax = 5; german_map1.germanMines = new Array(450); german_map1.timed = true; german_map1.timerMinutes = 2; german_map1.timerSeconds = 0; german_map1.unlocks = new Array(); german_map1.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper'); german_map1.enemyRate = 5; german_map1.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'bazooka'); german_map1.enemySupport = new Array('mortarAI', 'artillery'); german_map1.enemySupportRate = 40; german_map1.timeBonus = 100; german_map1.enemyMood = 'aggressive'; var german_map2 = new Object(); german_map2.name = 'german_map2'; german_map2.mission = 2; german_map2.battleTitle = 'HIGH ROAD'; german_map2.description = 'BRIEFING: Delaying the enemy movement along this road is paramount to our defence in this region. Push them out of this area forcing them to find another route.'; german_map2.mapSection = 'section2'; german_map2.sectionNumber = 2; german_map2.bonusXP = 50; german_map2.rainOn = false; german_map2.resourcePointsPlayer = 600; german_map2.resourcePointsEnemy = 600; german_map2.prespawnSquad1 = new Array(); german_map2.prespawnSquad3 = new Array(); german_map2.coverZone1 = new Array('700'); german_map2.coverTypeZone1 = new Array('barrels'); german_map2.coverZone2 = new Array('350', '800', '1150'); german_map2.coverTypeZone2 = new Array('hedgerow', 'hedgerow', 'hedgerow'); german_map2.coverZone3 = new Array('375', '1000'); german_map2.coverTypeZone3 = new Array('hedgerow', 'hedgerow'); german_map2.friendlyMorale = 125; german_map2.enemyMorale = 125; german_map2.file = 'map_german_2'; german_map2.wire = 0; german_map2.germanMinesMax = 0; german_map2.germanMines = new Array(450); german_map2.timed = false; german_map2.timerMinutes = 0; german_map2.timerSeconds = 0; german_map2.unlocks = new Array('flanking'); german_map2.availableUnits = new Array('riflemen', 'assault', 'machineGun'); german_map2.enemyRate = 5; german_map2.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun'); german_map2.enemySupport = new Array(); german_map2.enemySupportRate = 600; german_map2.timeBonus = 180; german_map2.enemyMood = 'aggressive'; var german_map3 = new Object(); german_map3.name = 'german_map3'; german_map3.mission = 3; german_map3.battleTitle = 'HOLD THE LINE'; german_map3.description = 'BRIEFING: Defend the entrance to this town. Our engineers need time for defensive emplacements to be setup within the town itself to stop the allies pushing their armor through here.'; german_map3.mapSection = 'section3'; german_map3.sectionNumber = 3; german_map3.bonusXP = 50; german_map3.rainOn = false; german_map3.resourcePointsPlayer = 800; german_map3.resourcePointsEnemy = 1100; german_map3.prespawnSquad1 = new Array(); german_map3.prespawnSquad3 = new Array(); german_map3.coverZone1 = new Array('1310', '1200', '300', '650'); german_map3.coverTypeZone1 = new Array('urban1', 'sandBagsUrban_german', 'hedgerow', 'hedgerow'); german_map3.coverZone2 = new Array('1150'); german_map3.coverTypeZone2 = new Array('sandBagsUrban_german'); german_map3.coverZone3 = new Array('1310', '1200', '300', '650'); german_map3.coverTypeZone3 = new Array('urban2', 'sandBagsUrban_german', 'hedgerow', 'hedgerow'); german_map3.friendlyMorale = 125; german_map3.enemyMorale = 125; german_map3.file = 'map_german_3'; german_map3.wire = 1; german_map3.wire1Pos = 1050; german_map3.germanMinesMax = 0; german_map3.germanMines = new Array(450); german_map3.timed = true; german_map3.timerMinutes = 3; german_map3.timerSeconds = 0; german_map3.unlocks = new Array('mortarTeam'); german_map3.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'mortarTeam'); german_map3.enemyRate = 4; german_map3.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun', 'sniper', 'bazooka'); german_map3.enemySupport = new Array('airSupport', 'mortarAI'); german_map3.enemySupportRate = 40; german_map3.timeBonus = 200; german_map3.enemyMood = 'aggressive'; var german_map4 = new Object(); german_map4.name = 'german_map4'; german_map4.mission = 4; german_map4.battleTitle = 'URBAN WARFARE'; german_map4.description = 'BRIEFING: This town is ours! Drive the Americans out, do not lose any ground to them or we are bound to fail. Use your officers to call any support you need.'; german_map4.mapSection = 'section4'; german_map4.sectionNumber = 4; german_map4.bonusXP = 50; german_map4.rainOn = false; german_map4.resourcePointsPlayer = 800; german_map4.resourcePointsEnemy = 1000; german_map4.prespawnSquad1 = new Array(); german_map4.prespawnSquad3 = new Array(); german_map4.coverZone1 = new Array('350', '1150'); german_map4.coverTypeZone1 = new Array('barrels', 'sandBagsUrban_german'); german_map4.coverZone2 = new Array('275', '511', '1300'); german_map4.coverTypeZone2 = new Array('townWall', 'townWall', 'townWall'); german_map4.coverZone3 = new Array('550', '800', '1150'); german_map4.coverTypeZone3 = new Array('urban1', 'urban2', 'sandBagsUrban_german'); german_map4.friendlyMorale = 125; german_map4.enemyMorale = 125; german_map4.file = 'map_german_4'; german_map4.wire = 0; german_map4.wire1Pos = 900; german_map4.germanMinesMax = 0; german_map4.germanMines = new Array(450); german_map4.timed = false; german_map4.timerMinutes = 3; german_map4.timerSeconds = 0; german_map4.unlocks = new Array('officer'); german_map4.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'mortarTeam', 'officer'); german_map4.enemyRate = 4; german_map4.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun', 'sniper', 'bazooka', 'mortarTeam'); german_map4.enemySupport = new Array('airSupport', 'artillery'); german_map4.enemySupportRate = 40; german_map4.timeBonus = 210; german_map4.enemyMood = 'aggressive'; var german_map5 = new Object(); german_map5.name = 'german_map5'; german_map5.mission = 5; german_map5.battleTitle = 'LINE OF COMMAND'; german_map5.description = 'BRIEFING: An American battalion and it\'s officers are planning to move through this town. We only have a handful of infantry to defend it. KILL the OFFICERS and the remaining troops should surrender out of fear.'; german_map5.mapSection = 'section5'; german_map5.sectionNumber = 5; german_map5.bonusXP = 50; german_map5.rainOn = false; german_map5.resourcePointsPlayer = 500; german_map5.resourcePointsEnemy = 800; german_map5.prespawnSquad1 = new Array(); german_map5.prespawnSquad3 = new Array(); german_map5.coverZone1 = new Array('275', '1005', '1265'); german_map5.coverTypeZone1 = new Array('barrels', 'rubble2', 'townWall'); german_map5.coverZone2 = new Array(); german_map5.coverTypeZone2 = new Array(); german_map5.coverZone3 = new Array('290', '1015', '1272'); german_map5.coverTypeZone3 = new Array('urban2', 'rubble1', 'townWall'); german_map5.presetSpawn = new Array('officer', 'officer', 'officer'); german_map5.presetSpawnTime = new Array('27000', '67000', '137000'); german_map5.presetSpawnZone = new Array('2', '3', '1'); german_map5.presetSpawnObj = new Array(false, false, true); german_map5.friendlyMorale = 125; german_map5.enemyMorale = 300; german_map5.file = 'map_german_5'; german_map5.wire = 0; german_map5.wire1Pos = 900; german_map5.germanMinesMax = 0; german_map5.germanMines = new Array(450); german_map5.timed = false; german_map5.timerMinutes = 3; german_map5.timerSeconds = 0; german_map5.unlocks = new Array(); german_map5.availableUnits = new Array('machineGun', 'sniper', 'riflemen', 'assault', 'officer'); german_map5.enemyRate = 4; german_map5.enemyUnits = new Array('assault', 'riflemen', 'riflemen'); german_map5.enemySupport = new Array('mortarAI'); german_map5.enemySupportRate = 40; german_map5.timeBonus = 210; german_map5.enemyMood = 'aggressive'; var german_map6 = new Object(); german_map6.name = 'german_map6'; german_map6.mission = 6; german_map6.battleTitle = 'COUNTER ATTACK'; german_map6.description = 'BRIEFING: After delaying the Americans through the town, they have found another route and are hitting it with full force. We have no armor to spare, but our anti-tank teams should be able to handle theirs.'; german_map6.mapSection = 'section6'; german_map6.sectionNumber = 6; german_map6.bonusXP = 50; german_map6.rainOn = true; german_map6.resourcePointsPlayer = 800; german_map6.resourcePointsEnemy = 1000; german_map6.prespawnSquad1 = new Array(); german_map6.prespawnSquad3 = new Array(); german_map6.coverZone1 = new Array(); german_map6.coverTypeZone1 = new Array(); german_map6.coverZone2 = new Array(); german_map6.coverTypeZone2 = new Array(); german_map6.coverZone3 = new Array(); german_map6.coverTypeZone3 = new Array(); german_map6.friendlyMorale = 450; german_map6.enemyMorale = 450; german_map6.file = 'map_german_6'; german_map6.wire = 0; german_map6.wire1Pos = 900; german_map6.germanMinesMax = 0; german_map6.germanMines = new Array(450); german_map6.timed = false; german_map6.timerMinutes = 3; german_map6.timerSeconds = 0; german_map6.unlocks = new Array('bazooka'); german_map6.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'mortarTeam', 'officer', 'bazooka'); german_map6.enemyRate = 3; german_map6.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun', 'sniper', 'bazooka', 'mortarTeam', 'tank', 'tank', 'tank'); german_map6.enemySupport = new Array('airSupport', 'mortarAI', 'artillery'); german_map6.enemySupportRate = 30; german_map6.timeBonus = 210; german_map6.enemyMood = 'aggressive'; var german_map7 = new Object(); german_map7.name = 'german_map7'; german_map7.mission = 7; german_map7.battleTitle = 'OUTSKIRTS'; german_map7.description = 'BRIEFING: Push your armor into this town and decimate the Americans holding it.'; german_map7.mapSection = 'section7'; german_map7.sectionNumber = 7; german_map7.bonusXP = 50; german_map7.rainOn = false; german_map7.resourcePointsPlayer = 800; german_map7.resourcePointsEnemy = 1400; german_map7.prespawnSquad1 = new Array(); german_map7.prespawnSquad2 = new Array('tank'); german_map7.prespawnSquad3 = new Array(); german_map7.coverZone1 = new Array('350', '700', '1200', '1650'); german_map7.coverTypeZone1 = new Array('sandBagsUrban', 'sandBagsUrban', 'urban1', 'hedgerow'); german_map7.coverZone2 = new Array(); german_map7.coverTypeZone2 = new Array(); german_map7.coverZone3 = new Array('400', '590', '1100', '1650'); german_map7.coverTypeZone3 = new Array('sandBagsUrban', 'sandBagsUrban', 'urban2', 'hedgerow'); german_map7.friendlyMorale = 250; german_map7.enemyMorale = 250; german_map7.file = 'map_german_7'; german_map7.wire = 0; german_map7.wire1Pos = 900; german_map7.germanMinesMax = 0; german_map7.germanMines = new Array(450); german_map7.timed = false; german_map7.timerMinutes = 3; german_map7.timerSeconds = 0; german_map7.unlocks = new Array('tank'); german_map7.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'mortarTeam', 'officer', 'bazooka', 'tank'); german_map7.enemyRate = 3; german_map7.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun', 'sniper', 'bazooka', 'bazooka', 'bazooka', 'mortarTeam', 'tank', 'tank', 'tank'); german_map7.enemySupport = new Array('artillery'); german_map7.enemySupportRate = 60; german_map7.timeBonus = 210; german_map7.enemyMood = 'aggressive'; var german_map8 = new Object(); german_map8.name = 'german_map8'; german_map8.mission = 8; german_map8.battleTitle = 'LAST STOP'; german_map8.description = 'BRIEFING: Defence of this town is imperitive to slowing the advance of the allies. They will throw everything they have at you and you will do the same. To the last man!'; german_map8.mapSection = 'section8'; german_map8.sectionNumber = 8; german_map8.bonusXP = 50; german_map8.rainOn = false; german_map8.resourcePointsPlayer = 800; german_map8.resourcePointsEnemy = 1600; german_map8.prespawnSquad1 = new Array(); german_map8.prespawnSquad2 = new Array('tank'); german_map8.prespawnSquad3 = new Array(); german_map8.coverZone1 = new Array('450', '650', '1500', '1950'); german_map8.coverTypeZone1 = new Array('barrels', 'urban2', 'rubble1', 'urban1'); german_map8.coverZone2 = new Array(); german_map8.coverTypeZone2 = new Array(); german_map8.coverZone3 = new Array('450', '1350', '1950'); german_map8.coverTypeZone3 = new Array('urban1', 'rubble2', 'barrels'); german_map8.friendlyMorale = 800; german_map8.enemyMorale = 500; german_map8.file = 'map_german_8'; german_map8.wire = 0; german_map8.wire1Pos = 900; german_map8.germanMinesMax = 0; german_map8.germanMines = new Array(450); german_map8.timed = true; german_map8.timerMinutes = 4; german_map8.timerSeconds = 0; german_map8.unlocks = new Array(); german_map8.availableUnits = new Array('riflemen', 'assault', 'machineGun', 'sniper', 'mortarTeam', 'officer', 'bazooka', 'tank'); german_map8.enemyRate = 2; german_map8.enemyUnits = new Array('assault', 'riflemen', 'riflemen', 'machineGun', 'sniper', 'bazooka', 'bazooka', 'bazooka', 'mortarTeam', 'tank', 'tank', 'tank'); german_map8.enemySupport = new Array('airSupport', 'mortarAI', 'artillery'); german_map8.enemySupportRate = 40; german_map8.timeBonus = 300; 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 tankTrapsCount = 0; var coverCount = 0; var spawnEnemyTimer = 0; var spawnEnemyTimerMax = 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 firstSort = false; var overTrenchButtons; var overTrenchButtonBacking; var allInTrench; var trenchButtonVisible = false; var trenchInterfaceVisible = false; var tcc = 0; var moraleRegenPlus = 1.01; var moraleRegenMinus = 0.99; var moraleHitFlanked = 0.2; var moraleRegen_british = 0; var moraleRegen_german = 0; var britishArmyCount = 0; var germanArmyCount = 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 moraleFriendlyLowShown = false; var moraleFriendlyBreakingShown = false; var moraleEnemyLowShown = false; var moraleEnemyBreakingShown = false; var moraleCost = new Object(); moraleCost.soldier = 2; moraleCost.officer = 5; moraleCost.tank = 40; moraleCost.tankKilled = 20; moraleCost.bunker = 100; moraleCost.bunkerKilled = 100; 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 = 7; var sounds_attack = 2; var sounds_sniper = 3; var sounds_incoming = 4; var sounds_MG = 3; var sounds_tank = 2; var sounds_enemyDown = 8; var sounds_bazooka = 3; var sounds_flank = 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(); var skirmishResourcesMin = 500; var skirmishResourcesMax = 2000; var skirmishResourcesInc = 100; 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 skirmishUpgrade12active = false; var skirmishUpgrade14active = false; var skirmishUpgrade16active = false; var skirmishUpgrade18active = false; var map_skirmish_1Desc = 'BEACH LANDING: MEDIUM size beach landing. LIGHT COVER.'; var map_skirmish_2Desc = 'OPEN PLAINS: LONG open Map with NO COVER.'; var map_skirmish_3Desc = 'DESERTED TOWN: LONG open town Map with NO COVER.'; var map_skirmish_4Desc = 'TOWN: MEDIUM town Map. MEDIUM COVER. NO TANKS!'; var map_skirmish_5Desc = 'HIGH LOW: MEDIUM length. Two open roads, one high one low. LIGHT COVER.'; var map_skirmish_6Desc = 'HEDGEROWS: MEDIUM length. HEAVY COVER. NO TANKS!'; var map_skirmish_7Desc = 'RAILWAY: LONG Map. Dense hedgerows lining a railway track.'; var map_skirmish_8Desc = 'TOWN SQUARE: LONG Map. HEAVY COVER. NO TANKS!'; var map_skirmish_9Desc = 'CEMETARY: MEDIUM Map. HEAVY COVER.'; var helpEnabled = true; var helpArray = new Array('progressBar', 'morale', 'upgrades', 'support'); var helpArrayIndex = 0; var helpCountdownMax = 4; var helpCountdown = helpCountdownMax; var timerSeconds = 60; var timerSecondsMax = 59; var timerMinutes = 1; var missionTimerMax = 59; var missionTimerSeconds = 0; var missionTimerMinutes = 0; var missionTimerHours = 0; var missionTotalSeconds = 0; var missionTime = ''; var timerDisplay = '00:00'; var timerActive = true; var woundChance = 600; var woundChanceMax = 1000; var britishWounded = new Array(); var germanWounded = new Array(); var bazookaRounds = 0; var bazookaImpacts = 0; var bazookaSpeed = 35; var bazookaXOffset = 36; var bazookaAccuracy = 30; var bazookaTargetOffset = 20; 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_mortarTeamDeployed = 0; var career_bazookaDeployed = 0; var career_tankDeployed = 0; var career_conquerWins = 0; var career_conquerLosses = 0; var career_moraleWins = 0; var career_moraleLosses = 0; var tankDamageChance = 100; var tankEngineBrokenEffect = 2; var tankWheelSpeed = 10; _root.kongregateServices.connect(); game = new Object(); game.state = 'paused'; if (intoMenu == true) { setupSound(); loadGameSettings(); loadGameInfo(); loadMenu(); } _root.onEnterFrame = function () { if (game.state == 'unpaused') { reallySlowEnterFrame(); findEnterFrame(); oneSecondEnterFrame(); slowEnterFrame(); mediumEnterFrame(); cameraControl(); squadAI('german'); squadAI('british'); runEnemyTimers(); } if (game.state == 'endBattle') { cameraControl(); squadAI('german'); squadAI('british'); } }; Stage.showMenu = false; adBox._visible = false; mainAd._visible = false; removeAd(); }




http://swfchan.com/27/130585/info.shtml
Created: 22/2 -2019 03:08:13 Last modified: 22/2 -2019 03:08:13 Server time: 22/12 -2024 20:01:38