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

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

World Domination 2.swf

This is the info page for
Flash #47142

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


ActionScript [AS1/AS2]
Combined Code
movieClip 94 spaceRocket_trail_element { #initclip Object.registerClass('spaceRocket_trail_element', SpaceRocket_trail_element); #endinitclip } movieClip 96 { } movieClip 101 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 103 { } movieClip 105 messageWindow { } movieClip 108 { } movieClip 110 { } movieClip 111 popUp { frame 1 { } frame 5 { stop(); } frame 10 { stop(); } } movieClip 114 graph_001 { } movieClip 119 citySet_dummy { frame 1 { stop(); } } movieClip 122 citySelected { } movieClip 339 soldier001 { frame 218 { stop(); } } movieClip 388 ship_plane { } movieClip 390 redDot { } movieClip 391 plane001 { } movieClip 392 plane001_shadow { } movieClip 393 shadow001 { } movieClip 434 explosion001 { frame 21 { stop(); } } movieClip 435 marine { } movieClip 436 soldier { } movieClip 437 tank001 { } movieClip 442 { } movieClip 477 tankTop_red { frame 1 { stop(); } frame 17 { stop(); } } movieClip 478 { } movieClip 481 statsMC { } movieClip 483 interfaceStats { } movieClip 520 boat001 { } movieClip 593 soldier001_shoot { } movieClip 667 chinook { } movieClip 669 tankNoShade_shadow { } movieClip 706 tank_noshade { } movieClip 779 apache { } movieClip 780 apache_shadow { } movieClip 782 { } movieClip 787 { } movieClip 788 emptyMC { } movieClip 790 rocket { frame 1 { stop(); } } movieClip 839 plane002 { } movieClip 840 plane002_shadow { } movieClip 889 plane001_tint { } movieClip 1106 soldier001_tint { } movieClip 1179 soldier001_shoot_tint { } movieClip 1216 boat001_tint { } movieClip 1225 boat001_still_tint { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } movieClip 1266 faces { } movieClip 1267 { } movieClip 1294 { frame 1 { stop(); } } movieClip 1298 { } movieClip 1299 { frame 1 { stop(); loopCount = 0; } frame 18 { ++loopCount; if (!loopCount) { loopCount = 1; } if (loopCount > 10) { gotoAndStop(1); } else { gotoAndPlay(2); } } } movieClip 1301 { } movieClip 1303 { frame 1 { stop(); } } movieClip 1307 communist_buildings { } movieClip 1333 christian_buildings { } movieClip 1358 budhist_buildings { } movieClip 1362 jewish_buildings { } movieClip 1367 muslim_buildings { } movieClip 1368 targetDot { } movieClip 1369 action_hatch_execute { frame 1 { stop(); } frame 13 { stop(); } } movieClip 1452 explosion_bioload_4 { frame 87 { stop(); } } movieClip 1503 explosion_bioload_3 { frame 55 { stop(); } } movieClip 1504 explosion_bioload_2 { frame 53 { stop(); } } movieClip 1505 explosion_bioload_1 { frame 56 { stop(); } } movieClip 1588 explosion_warhead_4 { frame 91 { stop(); } } movieClip 1639 explosion_warhead_3 { frame 55 { stop(); } } movieClip 1684 explosion_warhead_2 { frame 47 { stop(); } } movieClip 1733 explosion_warhead_1 { frame 52 { stop(); } } movieClip 1734 explosion002 { frame 51 { stop(); } } movieClip 1777 explosion003 { frame 22 { stop(); } } movieClip 1814 apache_tint { } movieClip 1851 tankTop_green { frame 1 { stop(); } frame 15 { stop(); } } movieClip 1888 tankTop_yellow { frame 1 { stop(); } frame 17 { stop(); } } movieClip 1925 tankTop_orange { frame 1 { stop(); } frame 17 { stop(); } } movieClip 1926 suicide_bomber_tint { } movieClip 1929 map_icon_crosshair { } movieClip 1932 map_icon_rocket { } movieClip 1935 map_icon_propaganda { } movieClip 1938 map_icon_plane { } movieClip 1941 map_icon_special { } movieClip 1944 map_icon_soldier { } movieClip 2075 submarine_tint { } movieClip 2077 { } movieClip 2079 { } movieClip 2080 space_rocket { } movieClip 2082 playerBtn_overlay { frame 1 { stop(); } } movieClip 2083 { } movieClip 2084 chinook_shadow { } movieClip 2133 plane002_tint { } movieClip 2135 sliderBtn { } movieClip 2137 { } movieClip 2138 cloud { #initclip Object.registerClass('cloud', Cloud); #endinitclip } movieClip 2139 bioCloud { #initclip Object.registerClass('bioCloud', BioCloud); #endinitclip } movieClip 2141 { } movieClip 2142 { frame 1 { stop(); } } movieClip 2143 { frame 1 { stop(); } } movieClip 2206 { frame 1 { stop(); } } movieClip 2269 { frame 1 { stop(); } } movieClip 2270 satellite_bhu { frame 1 { stop(); } } movieClip 2271 satellite { frame 1 { stop(); } } movieClip 2272 whiteSquare { } movieClip 2321 explosion_dust { frame 50 { stop(); } } movieClip 2538 suicide_bomber { } movieClip 2575 tankTop_blue { frame 1 { stop(); } frame 15 { stop(); } } movieClip 2580 audio_switch { frame 1 { stop(); } frame 2 { stop(); } } movieClip 2593 player_colors { frame 1 { stop(); } } movieClip 2598 { frame 1 { stop(); } } movieClip 2619 button_cocoon_sequence { frame 1 { stop(); } } movieClip 2626 actionBtn_switch_mc { frame 1 { stop(); } } movieClip 2627 stockPanel { } movieClip 2629 { } movieClip 2630 { } movieClip 2631 leader_stat_bar_vertical { } movieClip 2633 leader_icon_ceasefire { frame 1 { stop(); } } movieClip 2672 { } movieClip 2715 { frame 1 { stop(); } } movieClip 2719 biohazard { } movieClip 2720 { frame 1 { stop(); } } movieClip 2729 leadersTopMC { frame 22 { gotoAndPlay(1); } frame 24 { play(); } frame 59 { if (this.playDead) { gotoAndStop('leaderDead'); } } frame 60 { stop(); } frame 73 { stop(); } } movieClip 2766 tankBase { } movieClip 2775 boat001_still { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 30 { stop(); } } movieClip 2776 { } movieClip 2778 { } movieClip 2780 { } movieClip 2781 interface_production_stat { } movieClip 2783 { } movieClip 2785 { } movieClip 2794 { } movieClip 2796 { } movieClip 2797 { } movieClip 2799 { } movieClip 2800 interface_center_slider_1 { } movieClip 2801 { } movieClip 2803 { } movieClip 2807 { } movieClip 2811 { frame 1 { stop(); } } movieClip 2829 { } movieClip 2849 { frame 1 { stop(); } } movieClip 2850 { frame 1 { stop(); } } movieClip 2919 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } } movieClip 2942 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } } movieClip 2986 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } } movieClip 3039 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } movieClip 3084 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } } movieClip 3129 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } } movieClip 3177 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } } movieClip 3230 { } movieClip 3239 buildings_research { } movieClip 3244 { } movieClip 3260 { } movieClip 3261 { } movieClip 3262 { } movieClip 3300 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } movieClip 3304 { } movieClip 3306 { } movieClip 3313 { frame 1 { stop(); } } movieClip 3315 { frame 1 { stop(); } } movieClip 3328 { frame 1 { stop(); } } movieClip 3337 { } movieClip 3339 { } movieClip 3340 { frame 1 { stop(); } } movieClip 3345 { } movieClip 3348 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3358 { frame 1 { stop(); } } movieClip 3365 { } movieClip 3382 { } movieClip 3394 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3413 { frame 1 { stop(); } } movieClip 3416 { frame 1 { stop(); } } movieClip 3419 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3422 { frame 1 { stop(); } } movieClip 3432 { } movieClip 3434 { } movieClip 3436 { frame 1 { stop(); } } movieClip 3445 { frame 1 { stop(); } } movieClip 3446 { frame 1 { stop(); } } movieClip 3447 { frame 1 { stop(); } } movieClip 3471 { } movieClip 3482 { } movieClip 3511 factory_smoke { frame 1 { stop(); } frame 41 { stop(); } } movieClip 3520 buildings_factorie { } movieClip 3521 { frame 1 { gotoAndPlay(_global.model.tools.randRange(2, 110)); } } movieClip 3522 { frame 1 { gotoAndPlay(_global.model.tools.randRange(2, 110)); } } movieClip 3523 { frame 1 { gotoAndPlay(_global.model.tools.randRange(2, 110)); } } movieClip 3526 { frame 1 { gotoAndPlay(_global.model.tools.randRange(2, 110)); } } movieClip 3531 { frame 1 { gotoAndPlay(_global.model.tools.randRange(2, 110)); } } movieClip 3540 { } movieClip 3587 { } movieClip 3588 buildings_church { } movieClip 3610 { } movieClip 3611 { } movieClip 3613 { frame 1 { stop(); } } movieClip 3617 { frame 1 { stop(); } } movieClip 3620 { } movieClip 3621 { } movieClip 3622 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } movieClip 3626 { frame 1 { stop(); } frame 10 { play(); } } movieClip 3687 { frame 1 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } } movieClip 3702 missile_silo_jew { frame 1 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } } movieClip 3717 missile_silo_com { frame 1 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } } movieClip 3732 missile_silo_chr { frame 1 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } } movieClip 3747 missile_silo_bhu { frame 1 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } } movieClip 3748 buildings_silo { } movieClip 3755 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3760 airstrip_jew { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3765 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3771 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3776 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 3777 buildings_airfield { } movieClip 3853 { frame 1 { stop(); } } movieClip 3926 { frame 1 { stop(); } } movieClip 3929 propaganda_beams { frame 1 { stop(); } frame 2 { var loopCount = 0; } frame 3 { ++loopCount; if (loopCount > 8) { gotoAndStop(1); } } frame 20 { gotoAndPlay(3); } } movieClip 3938 buildings_propaganda { } movieClip 3947 { frame 1 { stop(); } } movieClip 3948 { frame 1 { stop(); } frame 134 { gotoAndStop(1); } } movieClip 3951 { } movieClip 3954 { } movieClip 3957 { } movieClip 3960 { } movieClip 3963 { } movieClip 3967 { } movieClip 3976 { frame 1 { stop(); } } movieClip 3978 { } movieClip 3979 { frame 1 { stop(); } } movieClip 3984 { } movieClip 3988 { } movieClip 3989 { frame 1 { stop(); } frame 2 { play(); } frame 45 { gotoAndPlay(2); } } movieClip 3990 { } movieClip 3997 { } movieClip 4004 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 4005 { } movieClip 4007 { } movieClip 4016 { } movieClip 4018 { } movieClip 4027 { } movieClip 4029 { } movieClip 4038 { } movieClip 4040 { } movieClip 4049 { } movieClip 4051 { } movieClip 4060 { } movieClip 4062 { } movieClip 4071 { } movieClip 4073 { } movieClip 4078 { } movieClip 4081 { frame 1 { stop(); } } movieClip 4088 { } movieClip 4089 { frame 1 { stop(); } } movieClip 4114 { frame 1 { stop(); } } movieClip 4125 { frame 1 { stop(); } } movieClip 4131 { } movieClip 4146 { frame 1 { stop(); } } movieClip 4147 { frame 1 { stop(); } } movieClip 4149 { } movieClip 4151 { } movieClip 4153 { } movieClip 4155 { } movieClip 4157 { } movieClip 4159 { frame 1 { stop(); } } movieClip 4160 { } movieClip 4161 interface_2 { } movieClip 4164 { } movieClip 4186 curActionTextField { frame 1 { stop(); } } movieClip 4188 { } movieClip 4189 land_outline_4 { frame 1 { stop(); } } movieClip 4191 { } movieClip 4192 land_oultine_3 { frame 1 { stop(); } } movieClip 4194 { } movieClip 4195 land_outline_1 { frame 1 { stop(); } } movieClip 4197 land_outline_2_stroke { } movieClip 4199 { } movieClip 4200 land_outline_0 { frame 1 { stop(); } } movieClip 4204 { } movieClip 4208 carrier_MC { } movieClip 4209 aircraftCarrier { frame 1 { stop(); } frame 2 { stop(); } } movieClip 4336 { frame 1 { stop(); } } movieClip 4337 { frame 1 { stop(); } } movieClip 4338 submarine { frame 1 { stop(); } } movieClip 4391 { } movieClip 4428 { } movieClip 4438 flag_pole { frame 1 { stop(); } } movieClip 4440 trailSmoke { } movieClip 4441 trail { } movieClip 4442 spaceRocket_smoke { #initclip Object.registerClass('spaceRocket_smoke', SpaceRocket_smoke); #endinitclip } movieClip 4465 { frame 1 { stop(); } } movieClip 4466 suicide_bomber_hatch { } movieClip 4501 antiAir_bhu { frame 1 { stop(); } } movieClip 4538 antiAir_chr { frame 1 { stop(); } } movieClip 4575 antiAir_jew { frame 1 { stop(); } } movieClip 4610 antiAir_mus { frame 1 { stop(); } } movieClip 4611 buildings_antiAir { } movieClip 4616 buildings_base { } movieClip 4621 buildings_helipad { } movieClip 4646 mensen_stroom { } movieClip 4648 { } movieClip 4656 buildings_diplomacy { } movieClip 4658 city_position { frame 1 { stop(); } frame 2 { stop(); } } movieClip 4665 lang04 { } movieClip 4672 land03 { } movieClip 4679 land02 { } movieClip 4686 land01 { } movieClip 4693 land00 { } movieClip 4699 land_water { } movieClip 4703 { frame 1 { stop(); } } movieClip 4706 { frame 1 { stop(); } } movieClip 4709 { frame 1 { stop(); } } movieClip 4710 { } movieClip 4717 { frame 1 { stop(); } } movieClip 4774 { } movieClip 4775 { frame 1 { stop(); } } movieClip 4776 { frame 1 { stop(); } } movieClip 4849 { frame 1 { stop(); } } movieClip 4920 { frame 1 { stop(); } } movieClip 4921 { } movieClip 4923 { } movieClip 4924 { frame 1 { stop(); } frame 2 { play(); _global.presenter_interface.launch_space_rocket_sound(); } frame 95 { stop(); } } movieClip 4925 { } movieClip 4926 { frame 1 { stop(); } frame 2 { play(); _global.presenter_interface.launch_space_rocket_sound(); } frame 95 { stop(); } } movieClip 4927 { } movieClip 4928 { frame 1 { stop(); } frame 2 { play(); _global.presenter_interface.launch_space_rocket_sound(); } frame 95 { stop(); } } movieClip 4929 { } movieClip 4930 { frame 1 { stop(); } frame 2 { play(); _global.presenter_interface.launch_space_rocket_sound(); } frame 95 { stop(); } } movieClip 4931 { frame 1 { stop(); } } movieClip 4932 { frame 1 { stop(); } frame 2 { play(); _global.presenter_interface.launch_space_rocket_sound(); } frame 95 { stop(); } } movieClip 4933 { } movieClip 4934 { } movieClip 4935 { frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } frame 15 { stop(); } frame 16 { stop(); } frame 17 { stop(); } frame 18 { stop(); } frame 19 { stop(); } frame 20 { stop(); } frame 21 { stop(); } } movieClip 4936 { frame 1 { stop(); } } movieClip 4997 { frame 1 { stop(); } } movieClip 5042 { frame 1 { stop(); } } movieClip 5043 battleMC { } movieClip 5045 { } movieClip 5049 { } movieClip 5052 { } movieClip 5054 { } movieClip 5058 { } movieClip 5059 gameloader_mc { frame 10 { stop(); } } movieClip 5232 __Packages.Cloud { #initclip if (!_global.Cloud) { var v1 = function () { super(); this._startLoc = new Object(); this._pivotLoc = new Object(); this._x = 0; this._y = 0; }; _global.Cloud = v1; _global.Cloud extends MovieClip; var v2 = v1.prototype; v2.__set__angleChange = function (_num) { this._angleChange = _num / 10; return this.__get__angleChange(); }; v2.__get__angleChange = function () { return this._angleChange; }; v2.__set__startLoc = function (_obj) { this._startLoc._x = _obj._x; this._pivotLoc._x = this._startLoc._x; this._startLoc._y = _obj._y; this._pivotLoc._y = this._startLoc._y; return this.__get__startLoc(); }; v2.initialLoc = function () { this._x = this._startLoc._x; this._y = this._startLoc._y; }; v2.__get__startLoc = function () { return this._startLoc; }; v2.frame_step = function () { this.pivot_step(); var v2 = this._angle * 0.0174532925199433; this._x = this._pivotLoc._x + this.xRadius * Math.cos(v2); this._y = this._pivotLoc._y + this.yRadius * Math.sin(v2); this._angle += this.angleChange; this._angle %= 360; }; v2.pivot_step = function () { var v2 = this._pivotAngle * 0.0174532925199433; this._pivotLoc._x = this._startLoc._x + 40 * Math.cos(v2); this._pivotLoc._y = this._startLoc._y + 70 * Math.sin(v2); this._pivotAngle += 0.1; this._pivotAngle %= 360; }; v2.__get__dist = function () { return Math.sqrt((this._x - this._startLoc._x) * (this._x - this._startLoc._x) + (this._y - this._startLoc._y) * (this._y - this._startLoc._y)); }; v2.__set__curPosByObj = function (_obj) { this._x = _obj._x; this._y = _obj._y; return this.__get__curPosByObj(); }; v2.__set__frameLocOffset = function (_obj) { this._frameLocOffset = _obj; return this.__get__frameLocOffset(); }; v2._angle = 0; v2.xRadius = 20; v2.yRadius = 20; v2._angleChange = 1; v2._pivotAngle = 0; v2.completeCloud_angle = 0; v2.addProperty('angleChange', v2.__get__angleChange, v2.__set__angleChange); v2.addProperty('curPosByObj', function () {}, v2.__set__curPosByObj); v2.addProperty('dist', v2.__get__dist, function () {}); v2.addProperty('frameLocOffset', function () {}, v2.__set__frameLocOffset); v2.addProperty('startLoc', v2.__get__startLoc, v2.__set__startLoc); ASSetPropFlags(_global.Cloud.prototype, null, 1); } #endinitclip } movieClip 5233 __Packages.BioCloud { #initclip if (!_global.BioCloud) { var v1 = function () { super(); this.maxFloat = new Object(); this.maxFloat._x = 0; this.maxFloat._y = 0; }; _global.BioCloud = v1; _global.BioCloud extends MovieClip; var v2 = v1.prototype; v2.spawn = function () { this._x = _global.model.tools.randRange(-25, 25); this._y = _global.model.tools.randRange(-20, 0); this._alpha = _global.model.tools.randRange(30, 50); this._yscale = _global.model.tools.randRange(40, 80); this._xscale = this._yscale; this.alpha_decay = _global.model.tools.randRange(1, 3); this.size_decay = _global.model.tools.randRange(2, 15); this.ySpeed = 2; this.cur_horizontalFloat_offset = _global.model.tools.randRange(this.horizontalFloat_max * -1, this.horizontalFloat_max); this.cur_horizontalFloat_multiplier = 1; }; v2.onEnterFrame = function () { if (this._alpha <= 0) { this.spawn(); } else { this._x += 0.3 * this.cur_horizontalFloat_multiplier; --this.cur_horizontalFloat_offset; if (this.cur_horizontalFloat_offset <= 0) { this.cur_horizontalFloat_multiplier *= -1; this.cur_horizontalFloat_offset = this.horizontalFloat_max; } this._y -= this.ySpeed; this._alpha -= this.alpha_decay; this._xscale += this.size_decay; this._yscale += this.size_decay; } }; v2.horizontalFloat_max = 10; ASSetPropFlags(_global.BioCloud.prototype, null, 1); } #endinitclip } movieClip 5234 __Packages.SpaceRocket_smoke { #initclip if (!_global.SpaceRocket_smoke) { var v1 = function () { super(); this.groundY = this._y; this.trailArr = new Array(); this.interval_ID = setInterval(this, 'removeTrail', 8000); }; _global.SpaceRocket_smoke = v1; _global.SpaceRocket_smoke extends MovieClip; var v2 = v1.prototype; v2.onEnterFrame = function () { if (this.offSet_toSpawn >= this.offSet_toSpawn_max) { this.addTrailElement(); ++this.trailCount; } else { ++this.offSet_toSpawn; } this.updateTrail(); }; v2.addTrailElement = function () { var v2 = this._parent.attachMovie('spaceRocket_trail_element', 'trail' + this.trailCount, this._parent.getNextHighestDepth()); v2._x = this._x; v2.rootX = v2._x; v2._y = this._y; v2.rootY = v2._y; v2.groundY = this.groundY; v2.spawn(); this.trailArr.push(v2); }; v2.updateTrail = function () { for (var v2 in this.trailArr) { this.trailArr[v2].setStep(this._x, this._y); } }; v2.removeTrail = function () { clearInterval(this.interval_ID); this.onEnterFrame = undefined; for (var v2 in this.trailArr) { this.trailArr[v2].removeMovieClip(); } }; v2.trailCount = 0; v2.trailCount_max = 50; v2.offSet_toSpawn = 0; v2.offSet_toSpawn_max = 1; ASSetPropFlags(_global.SpaceRocket_smoke.prototype, null, 1); } #endinitclip } movieClip 5235 __Packages.SpaceRocket_trail_element { #initclip if (!_global.SpaceRocket_trail_element) { var v1 = function () { super(); }; _global.SpaceRocket_trail_element = v1; _global.SpaceRocket_trail_element extends MovieClip; var v2 = v1.prototype; v2.spawn = function () { this._x = _global.model.tools.randRange(this.rootX - 2, this.rootX + 2); this._y = _global.model.tools.randRange(this.rootY - 5, this.rootY + 5); this._yscale = 100; this._xscale = 100; this._alpha = _global.model.tools.randRange(50, 60); this.xAdd = _global.model.tools.randRange(-1, 1); this.yAdd = _global.model.tools.randRange(1, 2); this.xAdd_decay = 0.2; this.sizeDecay_decay = 0.2; this.sizeDecay = _global.model.tools.randRange(3, 15); this.alphaDecay = _global.model.tools.randRange(2, 4); }; v2.setStep = function (_rootX, _rootY) { this._x += this.xAdd; this.sizeDecay -= this.sizeDecay_decay; if (this._y <= this.groundY) { this._y += this.yAdd; } else { this._x += this.xAdd * 3; this._alpha -= this.alphaDecay * 2; } this._alpha -= this.alphaDecay; this._yscale += this.sizeDecay; this._xscale = this._yscale; if (this._alpha <= 0) { this.rootX = _rootX; this.rootY = _rootY; this.spawn(); } }; ASSetPropFlags(_global.SpaceRocket_trail_element.prototype, null, 1); } #endinitclip } movieClip 5236 __Packages.Main { #initclip if (!_global.Main) { var v1 = function () { fscommand('allowscale', false); fscommand('showmenu', false); _quality = 'BEST'; _global.WDTrace = new WD_trace(); _global.debug = new Object(); this.FORCE_COMPILTION = new SpaceRocket_smoke(); this.FORCE_COMPILTION = new SpaceRocket_trail_element(); _global.model = new Model(); this.model = _global.model; this.model.turnActions = 0; this.model.turn = 0; this.model.maxFunds = 100; this.model.decisionPoints = new DecisionPoints(); _global.presenter = new Presenter(this.model); this.presenter = _global.presenter; _global.view = new View(this.model, this.presenter, _root.interfaceMC, _root.battleMC); this.view = _global.view; this.presenter.__set__view(this.view); this.model_interface = new Model_interface(); _global.model_interface = this.model_interface; this.presenter_interface = new Presenter_interface(); _global.presenter_interface = this.presenter_interface; this.view_interface = new View_interface(_level0.interfaceMC); _global.view_interface = this.view_interface; this.presenter_gameMenu = new Presenter_gameMenu(); _global.presenter_gameMenu = this.presenter_gameMenu; this.view_gameMenu = new View_gameMenu(_root.gameMenu); _global.view_gameMenu = this.view_gameMenu; this.model_gameMenu = new Model_gameMenu(); _global.model_gameMenu = this.model_gameMenu; this.model_gameMenu.presenter = this.presenter_gameMenu; this.presenter_gameMenu.view = this.view_gameMenu; this.presenter_gameMenu.model = this.model_gameMenu; this.presenter_gameMenu.initialize_gameMenu(); _global.play_sound_by_action = function (_str) { _global.presenter_interface.play_sound_by_action(_str); }; _global.play_sound_by_building = function (_str) { if (_global.model.option.playSound) { _global.presenter_interface.play_sound_by_building(_str); } }; _global.play_sound_by_event = function (_str, _pan) { if (_global.model.option.playSound) { _global.presenter_interface.play_sound_by_event(_str, _pan); } }; _global.explosion_sound_by_mc_name = function (_str, _pan) { if (_global.model.option.playSound) { _global.presenter_interface.explosion_sound_by_mc_name(_str, _pan); } }; this.presenter_interface.view_interface = this.view_interface; this.presenter_interface.presenter = this.presenter; this.presenter_interface.model = _global.model; this.presenter_interface.model_interface = this.model_interface; this.presenter_interface.view = this.view; this.view_interface.presenter_interface = this.presenter_interface; this.view_interface.model_interface = this.model_interface; this.view.view_interface = this.view_interface; this.view.presenter_interface = this.presenter_interface; this.view.__set__clipSrc(_root.createEmptyMovieClip('windowContainer', 9000)); this.view._graphMC = _root.graphMC; this.model.set_city_position_to_array(); _level0.endGameMC._visible = false; _root.debugBtn1.onPress = function () { --_root.battleMC._visible; --_root.sidePanels._visible; --_root.interfaceMC._visible; }; _root.turnBtn.onPress = function () { var v2 = 0; while (v2 < 1) { _global.model.doTurn(); _global.main.updateStageTxt(); _global.presenter.initBattle(); ++v2; } }; _root.turnBtn2.onPress = function () { var v2 = 0; while (v2 < 25) { _global.model.doTurn(); _global.main.updateStageTxt(); _global.presenter.initBattle(); ++v2; } }; _global.view.cloudTicker_initiate(); this.model.set_city_position_to_array(); this.model.comp2.cityArr[1].population = 2; _level0.interfaceMC._visible = false; _level0.gameMenu._visible = false; _level0.splashScreenMC.onPress = function () { _level0.splashScreenMC._visible = false; _level0.gameMenu._visible = true; }; _level0.introMovie.onPress = function () { _level0.introMovie.gotoAndStop(2); _level0.introMovie._visible = false; _global.presenter_interface.init_theme_snd(); }; _level0.createEmptyMovieClip('theme_sound_mc', _level0.getNextHighestDepth()); this.model.theme_sound = new Sound(_level0.theme_sound_mc); this.model.theme_sound.attachSound('WDTheme.wav'); this.model.option.setMusic(); fscommand('allowscale', 'false'); fscommand('showmenu', 'false'); }; _global.Main = v1; var v2 = v1.prototype; ASSetPropFlags(_global.Main.prototype, null, 1); } #endinitclip } movieClip 5237 __Packages.Sub_model { #initclip if (!_global.Sub_model) { var v1 = function () { this.MD5 = new MD5_class(); }; _global.Sub_model = v1; var v2 = v1.prototype; v2.get_demo_version_name = function () { return this.demo_version_arr[this.demo_version]; }; v2.get_demo_version_url = function () { if (this.demo_version == 0) { var v3 = unescape(_root._url); var v5 = v3.lastIndexOf('_'); var v7 = v3.lastIndexOf('.swf'); var v6 = v3.slice(0, v7); var v4 = v6.slice(v5 + 1); return 'https://www.regnow.com/softsell/nph-softsell.cgi?items=16153-6&action=add_to_cart&affiliate=' + v4; } return this.demo_version_url[this.demo_version]; }; v2.__get__full_version_url = function () { switch (this.get_demo_version_name()) { case 'Affiliates': return 'http://www.youdagames.com/World+Domination+2-game-info-107/'; break; case 'Miniclip': return 'http://www.miniclip.com/buy_worlddominationii.htm'; break; case 'Arcadetown': return 'http://www.arcadetown.com/worlddomination2/ordergame.asp'; break; case 'Agame': return 'http://moregames.agame.com'; break; default: return 'http://www.youdagames.com/World+Domination+2-game-info-107/'; } }; v2.submit_2dplay_score = function () { var v4 = this.MD5.hex_md5('gameid=' + _root.gameid + '&hiscore=' + _global.model.human.score + '2DPlay.com/'); getURL(String(_root.scoreslink + _global.model.human.score + '&hash=' + v4), '_blank'); }; v2.get_religion_name_by_code = function (a_str) { for (var v3 in this.religion_arr) { if (this.religion_arr[v3][0] == a_str) { return this.religion_arr[v3][1]; } } }; v2.getCityByID = function (_nr) { var v2; for (var v5 in this.playerArr) { for (var v4 in this.activePlayerArr[v5].cityArr) { if (this.activePlayerArr[v5].cityArr[v4].cityID == _nr) { v2 = this.activePlayerArr[v5].cityArr[v4]; } } } return v2; }; v2.string_is_used_action = function (_str) { for (var v2 in this.playerAB_position_arr) { if (_str == this.playerAB_position_arr[v2].action_name) { return true; } } return false; }; v2.reset_playerAB_position_arr = function () { this.playerAB_position_arr = [{'_num': 0, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 0, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 1, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 1, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 2, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 2, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 3, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 3, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 4, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}, {'_num': 4, 'building_name': undefined, 'building_MC': undefined, 'action_name': undefined}]; }; v2.get_plr_arr_of_action = function (_str) { var v2 = new Array(); for (var v3 in this.playerAB_position_arr) { if (this.playerAB_position_arr[v3].building_name == _str) { v2.push(this.playerAB_position_arr[v3]._num); } } return v2; }; v2.loop_playerAB_position_arr = function (_for, _num, _BN, _BMC, _action) { for (var v7 in this.playerAB_position_arr) { var v2 = this.playerAB_position_arr[v7]; switch (_for) { case 'num': if (v2.building_name == _BN && v2.building_MC == _BMC) { return v2._num; } break; case 'name': if (v2._num == _num && v2.building_MC == _BMC) { return v2.building_name; } break; case 'MC': if (v2._num == _num && v2.building_name == _BN) { return v2.building_MC; } if (v2._num == _num && v2.action_name == _BN) { return v2.building_MC; } break; case 'preAttack_any': if (v2.building_name == 'silo' || v2.building_name == 'airfield' || v2.building_name == 'sub' || v2.building_name == 'space') { return true; } break; case 'isDouble': if (v2._num == _num && v2.building_name == _BN) { return true; } } } }; v2.reset_preAttackFrame = function (_plr) {}; v2.get_playerAB_mc = function (_plrNum, _aname) { var v2; if (_aname == 'preAttack') { v2 = this.loop_playerAB_position_arr('MC', _plrNum, 'silo'); if (!v2) { v2 = this.loop_playerAB_position_arr('MC', _plrNum, 'airfield'); } if (!v2) { v2 = this.loop_playerAB_position_arr('MC', _plrNum, 'sub'); } if (!v2) { v2 = this.loop_playerAB_position_arr('MC', _plrNum, 'space'); } return v2; } v2 = this.loop_playerAB_position_arr('MC', _plrNum, _aname); return v2; }; v2.__set__broadcaster = function (param) { this._broadcaster = param; return this.__get__broadcaster(); }; v2.setHumanTurnAction = function () { var v2; if (this.human.getNextTurnAction()) { v2 = this.human.getNextTurnAction(); } else {} v2.doReset(); v2.__set__action(this.userSelectedActionBtn); if (v2.__get__action() == 'preAttack') { if (this.human.preAttackStatus != 'ready') { v2.preAttackCarrier = this.userSelectedWeapon; } else { v2.preAttackCarrier = this.userSelectedCarrier; v2.preAttackPayload = this.userSelectedWeapon; } } else { if (v2.__get__action() == 'attack' || v2.__get__action() == 'defense') { v2.attackWeapon = this.userSelectedWeapon; } } v2.humanBuyArr = this.human.weaponStock.productionArray; v2.targetCity = this.userSelectedCity; v2.ship_attack_arr = this.ship_attack_arr; v2.targetPlayer = this.userSelectedPlayer; v2.spyBuilding = this.userSelectedSpyBuilding; if (v2.__get__action() == 'production') { var v3 = Math.round((this.human.turnMoney / 100) * this.__get__userSelectedProductionInvestmentArr_total_amount()); this.human.turnMoney -= v3; } else { if (v2.__get__action() == 'research') { this.human.turnMoney -= this.researchMoneySpend; v2.researchMoneySpend = this.researchMoneySpend; v2.researchArr = this.userSelectedResearchArr; } } v2.productionInvestmentArr = this._userSelectedProductionInvestmentArr; v2.diplomacyArr = this.userSelectedDiplomacyArr; v2.diplomacyLeader = this.userSelectedDiplomacyLeader; v2.diplomacyOption = this.userSelectedDiplomacyOption; if (this.__get__userSelectedActionBtn() == 'diplomacy' && this.diplomacy_options_arr[this.userSelectedDiplomacyOption][0] == 'offer') { this.human.turnMoney -= this.diplomacy_options_arr[this.userSelectedDiplomacyOption][2]; } this.resetUserSelections(); }; v2.loadTurnAction = function (_ta) { this.resetUserSelections(); this.__set__userSelectedActionBtn(_ta.action); this.__set__userSelectedCity(_ta.targetCity); this.__set__userSelectedPlayer(_ta.targetPlayer); this.__set__userSelectedWeapon(_ta.attackWeapon); if (this.human.preAttackStatus != 'ready') { this.__set__userSelectedCarrier(_ta.preAttackCarrier); } this.ship_attack_arr = _ta.ship_attack_arr; _ta.doReset(); }; v2.__get__display_turnMoney = function () { var v2 = '$ '; if (this.human.turnMoney > 0) { v2 = this.human.turnMoney + '.000.000'; return v2; } v2 += '0'; return v2; }; v2.__get__display_population = function () { var v2 = ''; v2 += Math.round(this.human.__get__population()) + '.000.000'; return v2; }; v2.resetPlayersForNewturn = function () { for (var v3 in this.activePlayerArr) { var v2 = this.activePlayerArr[v3]; v2.resetActions(); v2.weaponStock.resetPreOrder(); v2.techTree.resetPreOrder(); v2.turnMoney = v2.money; this.userSelectedSpyBuilding = 'spyCenter'; } this.resetUserSelections(); }; v2.error = function (errorType, var1, var2, var3) { if (this.errorHandling) { if (!errorType) { this._broadcaster.broadcastMessage('error', 'And undefiend error occured... whatcha gonna do \'bout it?'); } else { if (errorType == 'getTargets') { this._broadcaster.broadcastMessage('error', 'Player: ' + var1 + ', General undefined error in \'getTargets\' method @ ' + var2); } else { if (errorType == 'doubleAction') { this._broadcaster.broadcastMessage('error', 'player ' + var1 + ' chose ' + var2 + ' for both their actions... OMG!! '); } else { if (errorType == 'noPreCarrier') { this._broadcaster.broadcastMessage('error', 'player ' + var1 + ' prepaired a pre attack withoug choosing a carrier'); } else { if (errorType == 'noWeaponSelected') { this._broadcaster.broadcastMessage('error', 'player' + var1 + ' selected \'attack\' as an action, but did not select a weapon'); } else { if (errorType == 'money') { this._broadcaster.broadcastMessage('error', 'player' + var1 + ' has a negative amount of money. $ ' + var2 + '.000.000 '); } } } } } } } }; v2.__set__userSelectedActionBtn = function (_param) { if (_param == undefined) { this.resetUserSelections(); } this._userSelectedActionBtn = _param; return this.__get__userSelectedActionBtn(); }; v2.__get__userSelectedActionBtn = function () { return this._userSelectedActionBtn; }; v2.__set__userSelectedStockBtn = function (_param) { this._userSelectedStockBtn = _param; return this.__get__userSelectedStockBtn(); }; v2.__get__userSelectedStockBtn = function () { return this._userSelectedStockBtn; }; v2.__set__userSelectedCity = function (_param) { this._userSelectedCity = _param; return this.__get__userSelectedCity(); }; v2.__set__userSelectedShipCityWaitingForTurnAction = function (_param) { this._userSelectedShipCityWaitingForTurnAction = _param; return this.__get__userSelectedShipCityWaitingForTurnAction(); }; v2.__get__userSelectedShipCityWaitingForTurnAction = function () { return this._userSelectedShipCityWaitingForTurnAction; }; v2.__set__userSelectedShipCityArr = function (_param) { this._userSelectedShipCityArr = _param; return this.__get__userSelectedShipCityArr(); }; v2.__get__userSelectedShipCityPlrNum = function () { return this._userSelectedShipCityPlrNum; }; v2.__set__userSelectedShipCityPlrNum = function (_param) { this._userSelectedShipCityPlrNum = _param; return this.__get__userSelectedShipCityPlrNum(); }; v2.__get__userSelectedShipCityArr = function () { return this._userSelectedShipCityArr; }; v2.__get__userSelectedCity = function () { return this._userSelectedCity; }; v2.__set__userSelectedPlayer = function (_param) { this._userSelectedPlayer = _param; return this.__get__userSelectedPlayer(); }; v2.__get__userSelectedPlayer = function () { return this._userSelectedPlayer; }; v2.__set__userSelectedCarrier = function (_param) { this._userSelectedCarrier = _param; return this.__get__userSelectedCarrier(); }; v2.__get__userSelectedCarrier = function () { return this._userSelectedCarrier; }; v2.__set__userSelectedWeapon = function (_param) { this._userSelectedWeapon = _param; return this.__get__userSelectedWeapon(); }; v2.__get__userSelectedWeapon = function () { return this._userSelectedWeapon; }; v2.__set__userSelectedPayload = function (_param) { this._userSelectedPayload = _param; return this.__get__userSelectedPayload(); }; v2.__get__userSelectedPayload = function () { return this._userSelectedPayload; }; v2.__set__userResetPreAttack = function (_param) { this._userResetPreAttack = _param; return this.__get__userResetPreAttack(); }; v2.__get__userResetPreAttack = function () { return this._userResetPreAttack; }; v2.__set__userSelectedProductionInvestmentArr = function (_arr) { this._userSelectedProductionInvestmentArr = _arr; return this.__get__userSelectedProductionInvestmentArr(); }; v2.__set__userSelectedResearchArr = function (_arr) { this._userSelectedResearchArr = _arr; return this.__get__userSelectedResearchArr(); }; v2.__get__userSelectedResearchArr = function () { return this._userSelectedResearchArr; }; v2.productionInvestementPercLeft = function (_num) { var v3 = 0; var v2 = 1; while (v2 < (this.__get__userSelectedProductionInvestmentArr()).length) { if (v2 != _num) { v3 += (this.__get__userSelectedProductionInvestmentArr())[v2][1]; } ++v2; } return 100 - v3; }; v2.researchInvestementPercLeft = function (_num) { var v3 = 0; var v2 = 1; while (v2 < (this.__get__userSelectedResearchInvestmentArr()).length) { if (v2 != _num) { v3 += (this.__get__userSelectedResearchInvestmentArr())[v2][1]; } ++v2; } return 100 - v3; }; v2.__get__userSelectedProductionInvestmentArr = function () { return this._userSelectedProductionInvestmentArr; }; v2.__get__userSelectedProductionInvestmentArr_total_amount = function () { var v2 = 0; for (var v3 in this._userSelectedProductionInvestmentArr) { if (this._userSelectedProductionInvestmentArr[v3][1]) { v2 += this._userSelectedProductionInvestmentArr[v3][1]; } } return v2; }; v2.__set__userSelectedDiplomacyArr = function (_arr) { this._userSelectedDiplomacyArr = _arr; return this.__get__userSelectedDiplomacyArr(); }; v2.__get__userSelectedDiplomacyArr = function () { return this._userSelectedDiplomacyArr; }; v2.__set__userSelectedResearchInvestmentArr = function (_arr) { this._userSelectedResearchInvestmentArr[_arr[0]] = _arr[1]; return this.__get__userSelectedResearchInvestmentArr(); }; v2.__get__userSelectedResearchInvestmentArr = function () { return this._userSelectedResearchInvestmentArr; }; v2.__get__userSelectedResearchInvestmentArr_total_amount = function () { var v2 = 0; for (var v3 in this._userSelectedResearchInvestmentArr) { v2 += this._userSelectedResearchInvestmentArr[v3]; } return v2; }; v2.resetUserSelections = function () { this._userSelectedActionBtn = undefined; this.__set__userSelectedWeapon(undefined); this.__set__userSelectedStockBtn(undefined); this.__set__userSelectedCity(undefined); this.ship_attack_arr = []; this.__set__userSelectedPlayer(undefined); this.__set__userSelectedShipCityPlrNum(undefined); if (this.human.preAttackStatus != 'ready') { this.__set__userSelectedCarrier(undefined); } this._userSelectedProductionInvestmentArr = [[], ['rockets', 0, 1], ['planes', 0, 6], ['special', 0, 7], ['warhead', 0, 2], ['bioload', 0, 3], ['soldier', 0, 4], ['spy', 0, 5], ['defense', 0, 8]]; for (var v3 in this.__get__userSelectedResearchArr()) { var v2 = (this.__get__userSelectedResearchArr())[v3]; v2.preOrder = false; } this.userSelectedDiplomacyLeader = undefined; this.userSelectedDiplomacyOption = undefined; this.researchMoneySpend = 0; this.__set__userSelectedResearchArr([]); this.userSelectedSpyBuilding = 'spyCenter'; }; v2.resetAfterCanceledTurnAction = function () { (this.__get__userSelectedCarrier()).inUse = 0; (this.__get__userSelectedWeapon()).inUse = 0; switch (this.__get__userSelectedActionBtn()) { case 'preAttack': if ((this.__get__userSelectedCarrier()).weaponName == 'ship') { for (var v2 in this.ship_attack_arr) { (this.getCityByID(this.ship_attack_arr[v2].city)).deselectForShipAttack(); --(this.human.weaponStock.getWeaponByID(this.ship_attack_arr[v2].wpn)).inUse; } } else { if (this.human.preAttackStatus == 'ready') { --(this.__get__userSelectedPayload()).inUse; this.deselectCities('preAttack'); } } break; break; case 'attack': case 'propaganda': } this.resetUserSelections(); }; v2.setCeaseFire = function (_plrA, _plrB, _turns) { this.playerArr[_plrA].ceaseFireArr[_plrB]._turnsLeft = _turns; this.playerArr[_plrA].ceaseFireArr[_plrB]._status = true; this.playerArr[_plrB].ceaseFireArr[_plrA]._turnsLeft = _turns; this.playerArr[_plrB].ceaseFireArr[_plrA]._status = true; }; v2.select_random_city = function (_plr) { var v3 = new Array(); var v5; for (var v4 in _plr.cityArr) { if (_plr.cityArr[v4].population > 0) { v3.push(_plr.cityArr[v4]); } } v5 = v3[this.tools.randRange(0, v3.length - 1)]; return v5; }; v2.deselectCities = function (_action) { for (var v4 in this.playerArr) { for (var v2 in this.playerArr[v4].cityArr) { this.playerArr[v4].cityArr[v2].removeSelection(_action); } } }; v2.gameStatus = function (param_n) { if (param_n !== 'worldPopulation') { } else { var v2 = 0; for (var v3 in this.activePlayerArr) { v2 += this.activePlayerArr[v3].population; } return v2; } }; v2.createBioHazardArr = function (bioLevel) { if (!bioLevel || isNaN(bioLevel)) { bioLevel = 1; } var v3 = 0; var v9 = this.bioHazardDeactivateArray[bioLevel][1]; var v4 = new Array(); var v2 = 0; while (v3 < bioLevel) { v2 = this.tools.randRange(0, this.bioActions_arr.length - 1); v4.push({'_action': this.bioActions_arr[v2]}); ++v3; } v3 = 0; while (v3 < v9) { v2 = this.tools.randRange(0, this.human.weaponStock.weaponArr.length - 1); if (this.human.weaponStock.weaponArr[v2].active) { v4.push({'_stock': this.human.weaponStock.weaponArr[v2].weaponID, '_weaponName': this.human.weaponStock.weaponArr[v2].weaponName}); } ++v3; } return v4; }; v2.next_ambient_sound_index = function () { if (this.ambient_sound_index < 10) { ++this.ambient_sound_index; } else { this.ambient_sound_index = 1; } }; v2.demo_version_arr = ['Affiliates', 'Miniclip', 'Totallygame', 'NewGrounds', 'Arcadetown', 'Agame', '2dplay', '2dplay_youdaHS', 'Craziness']; v2.demo_version_url = ['Affiliates', 'http://www.miniclip.com/buy_worlddominationii.htm', 'http://www.youdagames.com/World+Domination+2-game-info-107/', 'https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=1071719', 'http://www.arcadetown.com/worlddomination2/ordergame.asp', 'https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=1111152', 'https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=1298578', 'https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=1298578', 'https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=712006']; v2.demo_version = 0; v2.general_version_url = ''; v2.demo_mode = true; v2.zs66hj8s = true; v2.view_leader_MCs_played = 'false'; v2.view_leader_MCs_played_count = 0; v2.difficulty_level = 1; v2.actionNames_arr = ['resources', 'production', 'research', 'religion', 'preAttack', 'attack', 'defense', 'propaganda', 'diplomacy']; v2.force_error_window = false; v2.force_error_window_text = ''; v2.satellite_sound_playing = false; v2.game_initiated = false; v2.ambient_sound_index = 1; v2.fullscreen = false; v2.religion_arr = [['chr', 'Christian'], ['bhu', 'Bhudist'], ['com', 'Communist'], ['mus', 'Muslim'], ['jew', 'Jewish']]; v2.building_names_to_actions_arr = [{'building_name': 'resources', 'action_name': 'resources'}, {'building_name': 'factory', 'action_name': 'production'}, {'building_name': 'tech', 'action_name': 'research'}, {'building_name': 'technology', 'action_name': 'research'}, {'building_name': 'religion', 'action_name': 'religion'}, {'building_name': 'sub', 'action_name': 'preAttack'}, {'building_name': 'space', 'action_name': 'preAttack'}, {'building_name': 'ship', 'action_name': 'preAttack'}, {'building_name': 'base', 'action_name': 'attack'}, {'building_name': 'helipad', 'action_name': 'attack'}, {'building_name': '____', 'action_name': 'attack'}, {'building_name': 'hatch', 'action_name': 'attack'}, {'building_name': 'propaganda', 'action_name': 'propaganda'}, {'building_name': 'diplomacy', 'action_name': 'diplomacy'}, {'building_name': 'antiAir_still', 'action_name': 'defense'}, {'building_name': 'antiRocket_still', 'action_name': 'defense'}, {'building_name': 'silo', 'action_name': 'preAttack'}, {'building_name': 'airfield', 'action_name': 'preAttack'}]; v2.orderOfActions_arr = ['resources', 'production', 'produce', 'technology', 'research', 'religion', 'battle', 'preAttack', 'attack', 'propaganda', 'diplomacy']; v2.spyActions_arr = ['diplomacy', 'factory', 'tech', 'religion', 'resources']; v2.spyBuildings_arr = ['diplomacy', 'factory', 'tech', 'religion', 'resources']; v2.bioActions_arr = ['resources', 'production', 'technology', 'religion', 'propaganda', 'diplomacy']; v2.cityPositions = new Array([[377, 242], [308, 307], [418, 425], [478, 251], [546, 322]], [[36, 96], [229, 58], [126, 220], [28, 234], [191, 151]], [[546, 80], [703, 200], [620, 151], [764, 95], [770, 251]], [[26, 426], [136, 438], [41, 572], [308, 583], [237, 478]], [[758, 571], [642, 496], [697, 417], [532, 560], [764, 412]]); v2.soldier_waypoints_arr = new Array([{'_wpArr': [0], '_endPos': 'RT'}, {'_wpArr': [1, 2], '_endPos': 'B'}, {'_wpArr': [1, 2, 3], '_endPos': 'L'}, {'_wpArr': [1, 6], '_endPos': 'B'}, {'_wpArr': [0], '_endPos': 'L'}], [{'_wpArr': [1], '_endPos': 'T'}, {'_wpArr': [1], '_endPos': 'LT'}, {'_wpArr': [2], '_endPos': 'LT'}, {'_wpArr': [2, 3, 5], '_endPos': 'LB'}, {'_wpArr': [4], '_endPos': 'LB'}], [{'_wpArr': [0], '_endPos': 'B'}, {'_wpArr': [1], '_endPos': 'RT'}, {'_wpArr': [1, 2], '_endPos': 'RT'}, {'_wpArr': [1, 2, 3], '_endPos': 'LT'}, {'_wpArr': [4], '_endPos': 'T'}], [{'_wpArr': [0], '_endPos': 'L'}, {'_wpArr': [2], '_endPos': 'L'}, {'_wpArr': [1, 2], '_endPos': 'LB'}, {'_wpArr': [1, 2, 3, 5], '_endPos': 'R'}, {'_wpArr': [4], '_endPos': 'R'}], [{'_wpArr': [0], '_endPos': 'T'}, {'_wpArr': [1], '_endPos': 'R'}, {'_wpArr': [2, 3], '_endPos': 'B'}, {'_wpArr': [2, 3, 4], '_endPos': 'B'}, {'_wpArr': [5], '_endPos': 'L'}]); v2.soldier_fire_positions = new Array({'_pos': 'LB', '_arr': [[-55, -5], [-40, 40], [-10, 20]]}, {'_pos': 'LT', '_arr': [[-55, -5], [-40, -20], [-20, -40]]}, {'_pos': 'RT', '_arr': [[35, -5], [30, -20], [-20, -40]]}, {'_pos': 'R', '_arr': [[55, -5], [40, 15], [40, -15]]}, {'_pos': 'B', '_arr': [[-55, -5], [0, 25], [35, -5]]}, {'_pos': 'L', '_arr': [[-60, -5], [-55, 15], [-55, -15]]}, {'_pos': 'T', '_arr': [[-55, -20], [-40, -30], [25, -20]]}); v2.tank_waypoints_arr = new Array([{'_wpArr': [0], '_endPos': 'RT'}, {'_wpArr': [1, 2], '_endPos': 'B'}, {'_wpArr': [1, 2, 3], '_endPos': 'L'}, {'_wpArr': [1, 6], '_endPos': 'B'}, {'_wpArr': [1], '_endPos': 'LT'}], [{'_wpArr': [1], '_endPos': 'T'}, {'_wpArr': [1], '_endPos': 'LT'}, {'_wpArr': [2], '_endPos': 'LT'}, {'_wpArr': [2, 3, 5], '_endPos': 'LB'}, {'_wpArr': [4], '_endPos': 'LB'}], [{'_wpArr': [0], '_endPos': 'B'}, {'_wpArr': [1], '_endPos': 'RT'}, {'_wpArr': [1, 2], '_endPos': 'RT'}, {'_wpArr': [1, 2, 3], '_endPos': 'LT'}, {'_wpArr': [4], '_endPos': 'T'}], [{'_wpArr': [0], '_endPos': 'L'}, {'_wpArr': [0], '_endPos': 'LB'}, {'_wpArr': [1, 2], '_endPos': 'LB'}, {'_wpArr': [1, 2, 3], '_endPos': 'R'}, {'_wpArr': [4], '_endPos': 'R'}], [{'_wpArr': [0], '_endPos': 'T'}, {'_wpArr': [1], '_endPos': 'L'}, {'_wpArr': [2, 3], '_endPos': 'B'}, {'_wpArr': [2, 3, 4], '_endPos': 'B'}, {'_wpArr': [5], '_endPos': 'L'}]); v2.tank_fire_positions = new Array({'_pos': 'LB', '_arr': [[-55, 20]]}, {'_pos': 'LT', '_arr': [[-55, -25]]}, {'_pos': 'RT', '_arr': [[55, -25]]}, {'_pos': 'R', '_arr': [[55, -5]]}, {'_pos': 'B', '_arr': [[0, 25]]}, {'_pos': 'L', '_arr': [[-55, -5]]}, {'_pos': 'T', '_arr': [[0, -20]]}); v2.boatWayPointPositions = new Array([380, 156], [474, 192], [578, 240], [655, 307], [582, 455], [493, 498], [400, 530], [337, 504], [254, 411], [200, 360], [217, 266], [240, 250], [295, 194]); v2.boatStartingPosition = new Array([410, 474, 7], [179, 252, 11], [528, 145, 1], [311, 525, 7], [575, 510, 5]); v2.landUnitsArr = new Array([420, 420], [160, 201], [563, 108], [260, 500], [562, 511]); v2.marine_landUnitsArr = new Array([420, 420], [160, 201], [563, 108], [260, 500], [562, 511]); v2.chinookStartPositions = new Array([420, 310], [88, 109], [708, 91], [105, 510], [730, 505]); v2.marineFirePos = [[-55, -5], [0, 25], [35, -5], [0, -30]]; v2.bioHazardArr = [1, 8, 9, 14, 15, 17, 18, 32, 33, 34, 35, 36, 37]; v2.bioHazardDeactivateArray = [[], [3, 6], [7, 10], [14, 17], [17, 30]]; v2.suicide_spawn_array = [[420, 420], [160, 201], [563, 108], [260, 500], [562, 511]]; v2.submarine_surface_friendly_loc = [[370, 170], [300, 150], [425, 40], [33, 357], [400, 550]]; v2.submarine_surface_enemy_loc = [[450, 180], [340, 65], [490, 140], [170, 390], [437, 500]]; v2.satellite_height_arr = [158, 18, 18, 269, 169]; v2.satellite_pos_arr = [{'_x': 368, '_y': 75}, {'_x': 268, '_y': 104}, {'_x': 466, '_y': 111}, {'_x': 121, '_y': 321}, {'_x': 667, '_y': 291}]; v2.ship_plane_start_arr = new Array([28, -26], [-9, -3], [-38, 11]); v2.spyBuildingArr = new Array(1, 'spyCenter', 'tech', 'religion', 'resources', 'factory'); v2.diplomacy_options_arr = [['offer', 3, 10], ['offer', 6, 50], ['offer', 10, 90], ['demand', 3, 10], ['demand', 6, 50], ['demand', 10, 90]]; v2.liftOff_location = [[327, 246], [230, 230], [570, 220], [200, 430], [620, 450]]; v2.attackingSubs_arr = new Array(); v2._broadcaster = new Object(); v2.errorHandling = false; v2.curBattleMCAction = ''; v2._userSelectedActionBtn = undefined; v2._userSelectedStockBtn = undefined; v2._userSelectedCity = undefined; v2._userSelectedPlayer = undefined; v2._userSelectedCarrier = undefined; v2._userSelectedWeapon = undefined; v2._userSelectedPayload = undefined; v2._userSelectedShipCityArr = new Array(); v2._userSelectedShipCityWaitingForTurnAction = false; v2._userSelectedProductionInvestmentArr = new Array([], ['rockets', 0, 1, 0], ['planes', 0, 6, 0], ['special', 0, 7, 0], ['warhead', 0, 2, 0], ['bioload', 0, 3, 0], ['soldier', 0, 4, 0], ['spy', 0, 5, 0], ['defense', 0, 8, 0]); v2._userSelectedResearchInvestmentArr = new Array([], ['rockets', 0, 1], ['planes', 0, 6], ['special', 0, 7], ['warhead', 0, 2], ['bioload', 0, 3], ['soldier', 0, 4], ['spy', 0, 5], ['defense', 0, 8]); v2.ship_attack_arr = new Array(); v2.m11 = 'soldier_loop_9'; v2.soldierSpawnArr1 = new Array('soldier', 'soldier', 'soldier'); v2.soldierSpawnArr2 = new Array('soldier', 'soldier'); v2.soldierSpawnArr3 = new Array('soldier', 'soldier', 'soldier'); v2.soldierSpawnArr4 = new Array('soldier', 'soldier', 'soldier', 'soldier'); v2.interface_spawned_bioMC_array = new Array(); v2.battleCounter = 0; v2.battleTimerIndex = 0; v2.unitStartNum = 0; v2.heliStart = []; v2.cityDepthArr = new Array(); v2.lastUnitWasBuilding = false; v2.maxCarrierCityAmount = 3; v2.corrupt_highscore = false; v2.AI_spy_required_stock_obj = new Object({'_level1': 10, '_level2': 8, '_level3': 5, '_level4': 3}); v2.ch_018 = [{'id_str': 'orca', 'str': 'free willy', 'active': false}, {'id_str': 'easter', 'str': 'rapa nui', 'active': false}, {'id_str': 'nessy', 'str': 'nessy', 'active': false}, {'id_str': 'disco', 'str': 'saturdaynight', 'active': false}, {'id_str': 'kill_all', 'str': 'psycho killer', 'active': false}, {'id_str': 'bush', 'str': 'I am Bush', 'active': false}, {'id_str': 'cash', 'str': 'trump', 'active': false}, {'id_str': 'tech', 'str': 'dexter', 'active': false}, {'id_str': 'stock', 'str': 'gimmegimme', 'active': false}]; v2.soundCount = 0; v2.action_to_sound_arr = new Array({'_actionName': 'interface_noise', '_soundName': 'TV noise.wav'}, {'_actionName': 'interface_startup', '_soundName': 'interface_startup.wav'}, {'_actionName': 'interface_actionBtn_on', '_soundName': 'interface_Switch Action selection.wav', '_pan': -80}, {'_actionName': 'interface_actionBtn_off', '_soundName': 'interface_Switch Action selection2.wav', '_pan': -80}, {'_actionName': 'interface_acceptAction_btn', '_soundName': 'interface_Accept action bleep.wav'}, {'_actionName': 'interface_open_tube', '_soundName': 'interface_openactiondevice.wav'}, {'_actionName': 'interface_close_tube', '_soundName': 'interface_closeactiondevice.wav'}, {'_actionName': 'interface_close_turnBtn', '_soundName': 'interface_Closeconfirmbutton.wav'}, {'_actionName': 'interface_open_turnBtn', '_soundName': 'interface_Openconfirmbutton.wav'}, {'_actionName': 'interface_select_stock', '_soundName': 'interface_Switch Sounds 1.wav', '_pan': 80}, {'_actionName': 'interface_slider_bleep', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_select_city', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_select_tech', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_deselect_tech', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_cant_select_tech', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_select_diplo_leader', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_select_diplo_option', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': 'interface_select_spy_building', '_soundName': 'interface_select unit bleep.wav'}, {'_actionName': '--', '_soundName': '--'}); v2.ch_019 = [{'id_str': '#2dawgz', 'str': '#2dawgz', 'active': false, 'msg': '## 2 dawgz / 2 pirates. No ninja\'s. ##'}, {'id_str': '#thenizz', 'str': '#thenizz', 'active': false, 'msg': '## dawgz 4 life, homez 4e4 ##'}, {'id_str': '#lollerskates', 'str': '#lollerskates', 'active': false, 'msg': '## 2 long, 2 much ##'}, {'id_str': '#fc1', 'str': '#fc1', 'active': false, 'msg': '## It is only after you\'ve lost everything, that you are free to do anything... ## ~Chuck Palahniuk, Fight Club, Chapter 8 '}, {'id_str': '#sa1', 'str': '#sa1', 'active': false, 'msg': '## 4 teh goons, humor me with your witty sarcasm. As no one seems to get. ##'}, {'id_str': '#error', 'str': '#error', 'active': false, 'msg': '## get a life, you deserve it ##'}]; v2.building_to_sound_arr = new Array({'_buildingName': 'production', '_soundName': 'building_factory.wav'}, {'_buildingName': 'religion', '_varSoundName': 'religion'}, {'_buildingName': 'diplomacy', '_soundName': 'Diplomacy humans.wav'}, {'_buildingName': 'silo', '_soundName': 'building_silo.wav'}, {'_buildingName': 'airfield', '_soundName': 'building_airfield.wav'}, {'_buildingName': 'propaganda', '_soundName': 'building_Propaganda.wav'}, {'_buildingName': 'resources', '_soundName': 'building_Resource.wav'}, {'_buildingName': 'ambient_resources', '_soundName': 'Resources ambient loop.wav'}, {'_buildingName': 'space', '_soundName': 'building_space_launch_2.wav'}, {'_buildingName': 'research', '_soundName': 'building_tech.wav'}, {'_buildingName': 'helipad', '_soundName': 'building_helipad.wav'}, {'_buildingName': 'base', '_soundName': 'troops_marching_001.wav'}, {'_buildingName': 'sub', '_soundName': 'sub_ping.wav'}, {'_buildingName': 'base', '_soundName': 'building_base.wav'}, {'_buildingName': 'hatch', '_soundName': 'unit_Suicide Hatch.wav'}, {'_buildingName': '--', '_soundName': '--'}); v2.event_to_sound_arr = new Array({'_eventName': 'sub_surface', '_soundName': 'unit_Submarine water splash.wav'}, {'_eventName': 'stop_anti_rocket', '_soundName': 'building_Anti rocket rotate stop.wav'}, {'_eventName': 'satellite_flight', '_soundName': 'Satelite_flight.wav'}, {'_eventName': 'space_launch', '_soundName': 'building_space_launch.wav'}, {'_eventName': '--', '_soundName': '--'}); v2.explosion_MC_to_sound_arr = new Array({'_mcName': 'explosion_warhead_1', '_soundName': 'Explode small3.wav'}, {'_mcName': 'explosion_warhead_2', '_soundName': 'Explode medium 3.wav'}, {'_mcName': 'explosion_warhead_3', '_soundName': 'explode medium.wav'}, {'_mcName': 'explosion_warhead_4', '_soundName': 'Explode large2.wav'}, {'_mcName': 'explosion_bioload_1', '_soundName': 'Explode small3.wav'}, {'_mcName': 'explosion_bioload_2', '_soundName': 'Explode medium 3.wav'}, {'_mcName': 'explosion_bioload_3', '_soundName': 'explode medium.wav'}, {'_mcName': 'explosion_bioload_4', '_soundName': 'Explode large.wav'}, {'_mcName': 'explosion001', '_soundName': 'Explode small3.wav'}, {'_mcName': 'explosion002', '_soundName': 'Explode small3.wav'}, {'_mcName': 'explosion003', '_soundName': 'Explode small3.wav'}, {'_mcName': 'suicide', '_soundName': 'unit_Suicide explode.wav'}, {'_mcName': '', '_soundName': ''}); v2.ambient_sound_arr = new Array({'_building': 'resources', '_soundName': 'Resources ambient loop.wav'}, {'_building': 'production', '_soundName': 'Production Ambient loop.wav'}, {'_building': 'diplomacy', '_soundName': 'Ambience Diplomacy.wav'}, {'_building': 'defense', '_soundName': 'Defence.wav'}, {'_building': 'religion', '_soundName': 'Massmedia ambient loop.wav'}, {'_building': 'research', '_soundName': 'Technology ambient loop.wav'}, {'_building': 'game', '_soundName': 'General ambient.wav'}); v2.addProperty('broadcaster', function () {}, v2.__set__broadcaster); v2.addProperty('display_population', v2.__get__display_population, function () {}); v2.addProperty('display_turnMoney', v2.__get__display_turnMoney, function () {}); v2.addProperty('full_version_url', v2.__get__full_version_url, function () {}); v2.addProperty('userResetPreAttack', v2.__get__userResetPreAttack, v2.__set__userResetPreAttack); v2.addProperty('userSelectedActionBtn', v2.__get__userSelectedActionBtn, v2.__set__userSelectedActionBtn); v2.addProperty('userSelectedCarrier', v2.__get__userSelectedCarrier, v2.__set__userSelectedCarrier); v2.addProperty('userSelectedCity', v2.__get__userSelectedCity, v2.__set__userSelectedCity); v2.addProperty('userSelectedDiplomacyArr', v2.__get__userSelectedDiplomacyArr, v2.__set__userSelectedDiplomacyArr); v2.addProperty('userSelectedPayload', v2.__get__userSelectedPayload, v2.__set__userSelectedPayload); v2.addProperty('userSelectedPlayer', v2.__get__userSelectedPlayer, v2.__set__userSelectedPlayer); v2.addProperty('userSelectedProductionInvestmentArr', v2.__get__userSelectedProductionInvestmentArr, v2.__set__userSelectedProductionInvestmentArr); v2.addProperty('userSelectedProductionInvestmentArr_total_amount', v2.__get__userSelectedProductionInvestmentArr_total_amount, function () {}); v2.addProperty('userSelectedResearchArr', v2.__get__userSelectedResearchArr, v2.__set__userSelectedResearchArr); v2.addProperty('userSelectedResearchInvestmentArr', v2.__get__userSelectedResearchInvestmentArr, v2.__set__userSelectedResearchInvestmentArr); v2.addProperty('userSelectedResearchInvestmentArr_total_amount', v2.__get__userSelectedResearchInvestmentArr_total_amount, function () {}); v2.addProperty('userSelectedShipCityArr', v2.__get__userSelectedShipCityArr, v2.__set__userSelectedShipCityArr); v2.addProperty('userSelectedShipCityPlrNum', v2.__get__userSelectedShipCityPlrNum, v2.__set__userSelectedShipCityPlrNum); v2.addProperty('userSelectedShipCityWaitingForTurnAction', v2.__get__userSelectedShipCityWaitingForTurnAction, v2.__set__userSelectedShipCityWaitingForTurnAction); v2.addProperty('userSelectedStockBtn', v2.__get__userSelectedStockBtn, v2.__set__userSelectedStockBtn); v2.addProperty('userSelectedWeapon', v2.__get__userSelectedWeapon, v2.__set__userSelectedWeapon); ASSetPropFlags(_global.Sub_model.prototype, null, 1); } #endinitclip } movieClip 5238 __Packages.MD5_class { #initclip if (!_global.MD5_class) { var v1 = function () {}; _global.MD5_class = v1; var v2 = v1.prototype; v2.hex_md5 = function (s) { return this.binl2hex(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.b64_md5 = function (s) { return this.binl2b64(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.str_md5 = function (s) { return this.binl2str(this.core_md5(this.str2binl(s), s.length * this.chrsz)); }; v2.hex_hmac_md5 = function (key, data) { return this.binl2hex(this.core_hmac_md5(key, data)); }; v2.b64_hmac_md5 = function (key, data) { return this.binl2b64(this.core_hmac_md5(key, data)); }; v2.str_hmac_md5 = function (key, data) { return this.binl2str(this.core_hmac_md5(key, data)); }; v2.md5_vm_test = function () { return this.hex_md5('abc') == '900150983cd24fb0d6963f7d28e17f72'; }; v2.core_md5 = function (x, len) { x[len >> 5] |= 128 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var v5 = 1732584193; var v4 = -271733879; var v3 = -1732584194; var v2 = 271733878; var v6 = 0; while (v6 < x.length) { var v11 = v5; var v10 = v4; var v9 = v3; var v8 = v2; v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 0], 7, -680876936); v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 1], 12, -389564586); v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 2], 17, 606105819); v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 3], 22, -1044525330); v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 4], 7, -176418897); v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 5], 12, 1200080426); v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 6], 17, -1473231341); v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 7], 22, -45705983); v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 8], 7, 1770035416); v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 9], 12, -1958414417); v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 10], 17, -42063); v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 11], 22, -1990404162); v5 = this.md5_ff(v5, v4, v3, v2, x[v6 + 12], 7, 1804603682); v2 = this.md5_ff(v2, v5, v4, v3, x[v6 + 13], 12, -40341101); v3 = this.md5_ff(v3, v2, v5, v4, x[v6 + 14], 17, -1502002290); v4 = this.md5_ff(v4, v3, v2, v5, x[v6 + 15], 22, 1236535329); v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 1], 5, -165796510); v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 6], 9, -1069501632); v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 11], 14, 643717713); v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 0], 20, -373897302); v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 5], 5, -701558691); v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 10], 9, 38016083); v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 15], 14, -660478335); v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 4], 20, -405537848); v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 9], 5, 568446438); v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 14], 9, -1019803690); v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 3], 14, -187363961); v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 8], 20, 1163531501); v5 = this.md5_gg(v5, v4, v3, v2, x[v6 + 13], 5, -1444681467); v2 = this.md5_gg(v2, v5, v4, v3, x[v6 + 2], 9, -51403784); v3 = this.md5_gg(v3, v2, v5, v4, x[v6 + 7], 14, 1735328473); v4 = this.md5_gg(v4, v3, v2, v5, x[v6 + 12], 20, -1926607734); v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 5], 4, -378558); v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 8], 11, -2022574463); v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 11], 16, 1839030562); v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 14], 23, -35309556); v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 1], 4, -1530992060); v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 4], 11, 1272893353); v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 7], 16, -155497632); v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 10], 23, -1094730640); v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 13], 4, 681279174); v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 0], 11, -358537222); v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 3], 16, -722521979); v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 6], 23, 76029189); v5 = this.md5_hh(v5, v4, v3, v2, x[v6 + 9], 4, -640364487); v2 = this.md5_hh(v2, v5, v4, v3, x[v6 + 12], 11, -421815835); v3 = this.md5_hh(v3, v2, v5, v4, x[v6 + 15], 16, 530742520); v4 = this.md5_hh(v4, v3, v2, v5, x[v6 + 2], 23, -995338651); v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 0], 6, -198630844); v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 7], 10, 1126891415); v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 14], 15, -1416354905); v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 5], 21, -57434055); v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 12], 6, 1700485571); v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 3], 10, -1894986606); v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 10], 15, -1051523); v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 1], 21, -2054922799); v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 8], 6, 1873313359); v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 15], 10, -30611744); v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 6], 15, -1560198380); v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 13], 21, 1309151649); v5 = this.md5_ii(v5, v4, v3, v2, x[v6 + 4], 6, -145523070); v2 = this.md5_ii(v2, v5, v4, v3, x[v6 + 11], 10, -1120210379); v3 = this.md5_ii(v3, v2, v5, v4, x[v6 + 2], 15, 718787259); v4 = this.md5_ii(v4, v3, v2, v5, x[v6 + 9], 21, -343485551); v5 = this.safe_add(v5, v11); v4 = this.safe_add(v4, v10); v3 = this.safe_add(v3, v9); v2 = this.safe_add(v2, v8); v6 += 16; } var v13 = new Array(v5, v4, v3, v2); return v13; }; v2.md5_cmn = function (q, a, b, x, s, t) { return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s), b); }; v2.md5_ff = function (a, b, c, d, x, s, t) { return this.md5_cmn(b & c | ~b & d, a, b, x, s, t); }; v2.md5_gg = function (a, b, c, d, x, s, t) { return this.md5_cmn(b & d | c & ~d, a, b, x, s, t); }; v2.md5_hh = function (a, b, c, d, x, s, t) { return this.md5_cmn(b ^ c ^ d, a, b, x, s, t); }; v2.md5_ii = function (a, b, c, d, x, s, t) { return this.md5_cmn(c ^ (b | ~d), a, b, x, s, t); }; v2.core_hmac_md5 = function (key, data) { var v3 = this.str2binl(key); if (v3.length > 16) { v3 = this.core_md5(v3, key.length * this.chrsz); } var v4 = Array(16); var v5 = Array(16); var v2 = 0; while (v2 < 16) { v4[v2] = v3[v2] ^ 909522486; v5[v2] = v3[v2] ^ 1549556828; ++v2; } var v6 = this.core_md5(v4.concat(this.str2binl(data)), 512 + data.length * this.chrsz); return this.core_md5(v5.concat(v6), 640); }; v2.safe_add = function (x, y) { var v1 = (x & 65535) + (y & 65535); var v2 = (x >> 16) + (y >> 16) + (v1 >> 16); return v2 << 16 | v1 & 65535; }; v2.bit_rol = function (num, cnt) { return num << cnt | num >>> 32 - cnt; }; v2.str2binl = function (str) { var v4 = new Array(); var v5 = (1 << this.chrsz) - 1; var v2 = 0; while (v2 < str.length * this.chrsz) { v4[v2 >> 5] |= (str.charCodeAt(v2 / this.chrsz) & v5) << v2 % 32; v2 += this.chrsz; } return v4; }; v2.binl2str = function (bin) { var v4 = ''; var v5 = (1 << this.chrsz) - 1; var v2 = 0; while (v2 < bin.length * 32) { v4 += String.fromCharCode(bin[v2 >> 5] >>> v2 % 32 & v5); v2 += this.chrsz; } return v4; }; v2.binl2hex = function (binarray) { var v4 = this.hexcase ? '0123456789ABCDEF' : '0123456789abcdef'; var v5 = ''; var v2 = 0; while (v2 < binarray.length * 4) { v5 += v4.charAt(binarray[v2 >> 2] >> (v2 % 4) * 8 + 4 & 15) + v4.charAt(binarray[v2 >> 2] >> (v2 % 4) * 8 & 15); ++v2; } return v5; }; v2.binl2b64 = function (binarray) { var v7 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var v5 = ''; var v3 = 0; while (v3 < binarray.length * 4) { var v6 = (binarray[v3 >> 2] >> 8 * (v3 % 4) & 255) << 16 | (binarray[v3 + 1 >> 2] >> 8 * ((v3 + 1) % 4) & 255) << 8 | binarray[v3 + 2 >> 2] >> 8 * ((v3 + 2) % 4) & 255; var v2 = 0; while (v2 < 4) { if (v3 * 8 + v2 * 6 > binarray.length * 32) { v5 += this.b64pad; } else { v5 += v7.charAt(v6 >> 6 * (3 - v2) & 63); } ++v2; } v3 += 3; } return v5; }; v2.hexcase = 0; v2.b64pad = ''; v2.chrsz = 8; ASSetPropFlags(_global.MD5_class.prototype, null, 1); } #endinitclip } movieClip 5239 __Packages.Player { #initclip if (!_global.Player) { var v1 = function (param_playedBy, param_num, param_startLocation) { this.buildingSet_id = '__'; this.alive = true; this.playerNum = param_num; this.playedBy = param_playedBy; this.turnAction_1 = new TurnAction(1); this.turnAction_2 = new TurnAction(2); this.turnActionArr = [this.turnAction_1, this.turnAction_2]; this.techTree = new TechTree(); this.weaponStock = new WeaponStock(); this.dualAttack = false; this.cityArr = new Array(); this.regardArr = new Array(); this.decisionPointsArr = new Array(); this.preCounterEnemy = new Array(); this.startLocation = param_startLocation; this.bioloadedActionsArr = new Array(); this.bioloadedStockArr = new Array(); this.turnMoney = 0; this.bioloaded = false; this.ceaseFireArr = new Array(); this.diplomacyPendingArr = new Array(); this.diplomacyAcceptedArr = new Array(); this.diplomacyRejectedArr = new Array(); this.shortMSG_arr = new Array(); this.turnBattleCasualties = 0; this.turnPropagandaCasualties = 0; this.turnBattleKills = 0; this.turnResourcesGained = 0; this.diplomacy_offeredLastTurn = [false, false, false, false, false]; this.specialization = new AI_specialization(); this.score = 0; }; _global.Player = v1; var v2 = v1.prototype; v2.__get__turnSpendings = function () { var v2 = this.weaponStock.__get__production_money_spent() + this.techTree.__get__researchMoneySpent(); return Number(v2); }; v2.__get__nextActionBuilding = function () { var v2 = 1; if (this.building1Shown) { v2 = 2; } else { this.building1Shown = true; } if (this.playerNum == 0) { } return v2; }; v2.__get__preLocation = function () { return this._preLocation; }; v2.__set__preLocation = function (_num) { this._preLocation = _num; return this.__get__preLocation(); }; v2.resetBuildingsShown = function () { this.building1Shown = false; this.building2Shown = false; }; v2.isBioloaded = function (param) { var v3 = false; for (var v4 in this.bioloadedActionsArr) { if (param == this.bioloadedActionsArr[v4] || param == 'produce' && this.bioloadedActionsArr[v4] == 'production' || param == 'research' && this.bioloadedActionsArr[v4] == 'technology') { v3 = true; } } return v3; }; v2.approveAction = function () {}; v2.resetActions = function () { if (this.preAttackStatus == 'inactive') { this.turnAction_1.doReset(); this.turnAction_2.doReset(); } if (!this.turnAction_1.preAttackPayload) { this.turnAction_1.doReset(); } if (!this.turnAction_2.preAttackPayload) { this.turnAction_2.doReset(); } else { this.turnAction_1 = this.turnAction_2; this.turnAction_2.doReset(); } }; v2.setNextTurnAction = function () { var v2; if (!this.turnAction_1.__get__action()) { v2 = this.turnAction_1; } else { if (!this.turnAction_2.__get__action()) { v2 = this.turnAction_2; } } }; v2.getNextTurnAction = function () { if (!this.turnAction_1.__get__action()) { return this.turnAction_1; } else { if (!this.turnAction_2.__get__action()) { return this.turnAction_2; } else { return false; } } }; v2.__resolve = function (param) { if (param != 'debug' && param != '_visible') { } }; v2.__get__lowestRegardNum = function () { var v2 = 100; for (var v3 in this.regardArr) { if (this.regardArr[v3] < v2) { v2 = this.regardArr[v3]; } } return v2; }; v2.__get__population = function () { var v2 = 0; for (var v3 in this.cityArr) { v2 += this.cityArr[v3].population; } return v2; }; v2.largest_city = function () { var v3 = 0; var v4; for (var v5 in this.cityArr) { var v2 = this.cityArr[v5]; if (v3 < v2.population) { v3 = v2.population; v4 = v2; } } return v4; }; v2.__get__religion = function () { return this.religionLevel; }; v2.__set__religion = function (n) { this.religionLevel = n; return this.__get__religion(); }; v2.__get__techLevel = function () { return this.techTree.__get__techLevel(); }; v2.__get__weaponStockStrength = function () { var v3 = 0; for (var v4 in this.weaponStock.weaponArr) { var v2 = this.weaponStock.weaponArr[v4]; v3 += v2.__get__inStock() * v2.weaponLevel; } return v3; }; v2.__get__weaponStockLevel = function () { var v3 = 0; var v2 = 0; for (var v4 in this.weaponStock.weaponArr) { if ((this.techTree.getTechByName(this.weaponStock.weaponArr[v4].relatedTechName)).invented) { ++v3; if (this.weaponStock.weaponArr[v4].inStock >= this.weaponStock.weaponArr[v4].desire) { ++v2; } } } return (v2 / v3) * 100; }; v2.__get__strength = function () { return this.__get__techLevel() + this.__get__weaponStockStrength() + this.money; }; v2.setChars = function () { if (this.desireArr.length != this.weaponStock.weaponArr.length) { } else { for (var v2 in this.desireArr) { this.weaponStock.weaponArr[v2].desire = this.desireArr[v2]; (this.techTree.getTechByName(this.weaponStock.weaponArr[v2].relatedTechName)).desire = this.desireArr[v2]; } } }; v2.__get__counterWeapon = function () { for (var v2 in this.turnActionArr) { if (this.turnActionArr[v2].action == 'counterPre') { return this.turnActionArr[v2].attackWeapon; } } }; v2.__get__allActionsSet = function () { var v2 = 0; if (this.turnAction_1.__get__action() != undefined) { ++v2; } if (this.turnAction_2.__get__action() != undefined) { ++v2; } if (v2 == 2) { return true; } else { return false; } }; v2.kill = function () { this.shortMSG_arr = []; this.alive = false; }; v2.religionLevel = 0; v2.preAttackStatus = 'inactive'; v2.alive = false; v2.building1Shown = false; v2.building2Shown = false; v2._preLocation = undefined; v2._propagandaMC = undefined; v2.shipFrame = 1; v2.diplomacy_offeredLastTurn = [false, false, false, false, false]; v2.special_person = false; v2.suicide_person = false; v2.dead_avatar_played = false; v2.production_money_returned = 0; v2._technology_money_spent = 0; v2._anti_spy_money_spent = 0; v2.satellites_used = 0; v2.addProperty('allActionsSet', v2.__get__allActionsSet, function () {}); v2.addProperty('counterWeapon', v2.__get__counterWeapon, function () {}); v2.addProperty('lowestRegardNum', v2.__get__lowestRegardNum, function () {}); v2.addProperty('nextActionBuilding', v2.__get__nextActionBuilding, function () {}); v2.addProperty('population', v2.__get__population, function () {}); v2.addProperty('preLocation', v2.__get__preLocation, v2.__set__preLocation); v2.addProperty('religion', v2.__get__religion, v2.__set__religion); v2.addProperty('strength', v2.__get__strength, function () {}); v2.addProperty('techLevel', v2.__get__techLevel, function () {}); v2.addProperty('turnSpendings', v2.__get__turnSpendings, function () {}); v2.addProperty('weaponStockLevel', v2.__get__weaponStockLevel, function () {}); v2.addProperty('weaponStockStrength', v2.__get__weaponStockStrength, function () {}); ASSetPropFlags(_global.Player.prototype, null, 1); } #endinitclip } movieClip 5240 __Packages.TechTree { #initclip if (!_global.TechTree) { var v1 = function () { var v3 = 1; var v16 = new Tech('rocket1', v3, 5, false, 0, undefined, 1, 1, 'ROCKET (10 MEG)', true); var v14 = new Tech('rocket2', v3++, 10, false, 3, v16, 1, 2, 'ROCKET (25 MEG)', true); var v5 = new Tech('rocket3', v3++, 15, false, 5, v14, 1, 3, 'ROCKET (50 MEG)', false); var v11 = new Tech('rocket4', v3++, 20, false, 8, v5, 1, 4, 'ROCKET (95 MEG)', false); var v18 = new Tech('warhead1', v3++, 5, false, 0, undefined, 2, 1, 'WARHEAD (10 MEG)', true); var v17 = new Tech('warhead2', v3++, 10, false, 3, v18, 2, 2, 'WARHEAD (25 MEG)', true); var v6 = new Tech('warhead3', v3++, 15, false, 5, v17, 2, 3, 'WARHEAD (50 MEG)', false); var v12 = new Tech('warhead4', v3++, 20, false, 8, v6, 2, 4, 'WARHEAD (95 MEG)', false); var v23 = new Tech('bioload1', v3++, 5, false, 0, undefined, 3, 1, 'BIOLOAD (10 MEG)', true); var v22 = new Tech('bioload2', v3++, 10, false, 3, v23, 3, 2, 'BIOLOAD (25 MEG)', true); var v7 = new Tech('bioload3', v3++, 15, false, 5, v22, 3, 3, 'BIOLOAD (50 MEG)', false); var v21 = new Tech('bioload4', v3++, 20, false, 8, v7, 3, 4, 'BIOLOAD (95 MEG)', false); var v15 = new Tech('soldier1', v3++, 5, false, 0, undefined, 4, 1, 'SOLDIER', true); var v13 = new Tech('soldier2', v3++, 10, false, 3, v15, 4, 2, 'SEALS', true); var v4 = new Tech('soldier3', v3++, 15, false, 5, v13, 4, 3, 'TANK', false); var v28 = new Tech('soldier4', v3++, 20, false, 8, v4, 4, 4, 'SPECIAL', false); var v27 = new Tech('spy1', v3++, 5, false, 0, undefined, 5, 1, 'SPY (LEVEL 1)', true); var v26 = new Tech('spy2', v3++, 10, false, 3, v27, 5, 2, 'SPY (LEVEL 2)', true); var v10 = new Tech('spy3', v3++, 15, false, 5, v26, 5, 3, 'SPY (LEVEL 3)', false); var v24 = new Tech('spy4', v3++, 20, false, 8, v10, 5, 4, 'SPY (LEVEL 4)', false); var v20 = new Tech('plane1', v3++, 5, false, 0, undefined, 6, 1, 'FIGHTER', true); var v19 = new Tech('plane2', v3++, 10, false, 4, v20, 6, 2, 'BOMBER', false); var v25 = new Tech('sub', v3++, 20, false, 3, undefined, 7, 1, 'SUBMARINE', true); var v9 = new Tech('ship', v3++, 40, false, 5, v25, 7, 2, 'AIRCRAFT CARRIER', false); var v8 = new Tech('space', v3++, 50, false, 8, v9, 7, 3, 'SPACE ROCKET', false); var v31 = new Tech('antiAir', v3++, 20, true, 8, undefined, 8, 1, 'ANTI AIR', true); var v30 = new Tech('antiRocket', v3++, 20, true, 8, undefined, 8, 1, 'ANTI ROCKET', true); var v29 = new Tech('specialLoad', v3++, 50, false, 8, v8, 7, 4, 'SATELLITE', false); if (_global.model.zs66hj8s) { v5 = undefined; v11 = undefined; v6 = undefined; v12 = undefined; v4 = undefined; v28 = undefined; v7 = undefined; v21 = undefined; v10 = undefined; v24 = undefined; v19 = undefined; v9 = undefined; v8 = undefined; v29 = undefined; } this.techArr = [v16, v14, v5, v11, v18, v17, v6, v12, v23, v22, v7, v21, v15, v13, v4, v28, v27, v26, v10, v24, v20, v19, v25, v9, v8, v31, v30, v29]; }; _global.TechTree = v1; var v2 = v1.prototype; v2.inventAll = function () { for (var v2 in this.techArr) { this.techArr[v2].invented = true; } }; v2.inventTechByID = function (param_id) { for (var v3 in this.techArr) { if (this.techArr[v3].techID == param_id) { if (this.techArr[v3].invented == false) { this.techArr[v3].invented = true; } } } }; v2.inventTechByName = function (param_name) { for (var v3 in this.techArr) { if (this.techArr[v3].techName == param_name) { if (this.techArr[v3].invented == false) { this.techArr[v3].invented = true; return 'success'; break; } else { return 'tech already invented...'; } } } }; v2.unInventTechByName = function (param_name) { for (var v3 in this.techArr) { if (this.techArr[v3].techName == param_name) { if (this.techArr[v3].invented == true) { this.techArr[v3].invented = false; return 'success'; } else { return 'tech already unInvented...'; } } } }; v2.unInventTechByID = function (param_id) { for (var v3 in this.techArr) { if (this.techArr[v3].techID == param_id) { if (this.techArr[v3].invented == false) { this.techArr[v3].invented = true; } } } }; v2.__get__turnTechArr = function () { var v3 = new Array(); for (var v4 in this.techArr) { var v2 = this.techArr[v4]; if (v2.preOrder) { v3.push(v2); } } return v3; }; v2.__get__researchMoneySpent = function () { var v2 = 0; for (var v3 in this.techArr) { if (this.techArr[v3].preOrder) { v2 += this.techArr[v3].cost; } } return v2; }; v2.__set__researchMoneySpent = function (_param) { return this.__get__researchMoneySpent(); }; v2.resetPreOrder = function () { for (var v2 in this.techArr) { this.techArr[v2].preOrder = false; } }; v2.getTechByID = function (param_nr) { for (var v2 in this.techArr) { if (this.techArr[v2].techID == param_nr) { return this.techArr[v2]; break; } } }; v2.getTechByName = function (param_name) { for (var v3 in this.techArr) { if (this.techArr[v3].techName == param_name) { return this.techArr[v3]; break; } } }; v2.__get__allInvented = function () { var v2 = true; for (var v3 in this.techArr) { if (!this.techArr[v3].invented) { v2 = false; } } return v2; }; v2.__get__cheapestUninventedTech = function () { var v3; var v2 = 9000; for (var v4 in this.techArr) { if (this.techArr[v4].cost < v2) { v3 = this.techArr[v4]; v2 = v3.cost; } } return v3; }; v2.__get__techLevel = function () { var v2 = 0; for (var v3 in this.techArr) { if (this.techArr[v3].invented == true) { v2 += this.techArr[v3].weight; } } return v2; }; v2.__get__shortMSG = function () { var v3 = 'Technologies invented: '; var v4; for (var v5 in this.techArr) { var v2 = this.techArr[v5]; if (v2.inventedInLastTurn) { if (!v4) { v4 = true; v3 += v2.prettyName; } else { v3 += ', ' + v2.prettyName; } } } if (v4) { return v3; } else { return ''; } }; v2.resetInventedLastTurn = function () { for (var v2 in this.techArr) { this.techArr[v2].inventedInLastTurn = false; } }; v2.__get__maxTexLevel = function () { var v2 = 0; for (var v3 in this.techArr) { v2 += this.techArr[v3].weight; } return v2; }; v2.__get__allow_special = function () { var v4 = 0; var v6 = false; for (var v5 in this.techArr) { var v3 = this.techArr[v5]; if (v3.techLevel == 4 && v3.__get__invented()) { ++v4; } if (_global.model.zs66hj8s && v3.techLevel == 2 && v3.__get__invented()) { ++v4; } if (_global.model.zs66hj8s && v3.techName == 'plane1' && v3.__get__invented()) { ++v4; } } if ((this.getTechByName('plane2')).invented) { ++v4; } if (v4 >= 4) { v6 = true; } return v6; }; v2.allow_production_by_group = function (a_nr) { var v2; var v5 = false; if (a_nr == 8) { return true; } for (var v4 in this.techArr) { v2 = this.techArr[v4]; if (v2.__get__invented() && v2.desireGroup == a_nr) { return true; } } return v5; }; v2.force_invent_tech_ch = function () { for (var v2 in this.techArr) { this.techArr[v2].invented = true; } }; v2.invent_below_tech_level = function (a_techLevel) { for (var v5 in this.techArr) { var v3 = this.techArr[v5]; if (v3.techLevel <= a_techLevel && v3.desireGroup != 7 && (!_global.model.zs66hj8s || v3.allow_in_demo)) { v3.__set__invented(true); v3.inventedInLastTurn = false; } } }; v2.__get__roc_invented = function () { if (this.techArr[3].invented) { return true; } return false; }; v2.addProperty('allInvented', v2.__get__allInvented, function () {}); v2.addProperty('allow_special', v2.__get__allow_special, function () {}); v2.addProperty('cheapestUninventedTech', v2.__get__cheapestUninventedTech, function () {}); v2.addProperty('maxTexLevel', v2.__get__maxTexLevel, function () {}); v2.addProperty('researchMoneySpent', v2.__get__researchMoneySpent, v2.__set__researchMoneySpent); v2.addProperty('roc_invented', v2.__get__roc_invented, function () {}); v2.addProperty('shortMSG', v2.__get__shortMSG, function () {}); v2.addProperty('techLevel', v2.__get__techLevel, function () {}); v2.addProperty('turnTechArr', v2.__get__turnTechArr, function () {}); ASSetPropFlags(_global.TechTree.prototype, null, 1); } #endinitclip } movieClip 5241 __Packages.Tech { #initclip if (!_global.Tech) { var v1 = function (param_name, param_id, param_cost, param_invented, param_weight, param_requiredTech, param_desireGroup, param_techLevel, param_pretty_name, p_allow_in_demo) { this.techName = param_name; this.techID = param_id; this.cost = param_cost; this._invented = param_invented; this.weight = param_weight; this.requiredTech = param_requiredTech; this.desireGroup = param_desireGroup; this.techLevel = param_techLevel; this.inventedInLastTurn = false; this.prettyName = param_pretty_name; this.allow_in_demo = p_allow_in_demo; }; _global.Tech = v1; var v2 = v1.prototype; v2.__set__invented = function (_bln) { this._invented = _bln; if (_bln) { this.inventedInLastTurn = true; } return this.__get__invented(); }; v2.__get__invented = function () { return this._invented; }; v2.preOrder = false; v2.addProperty('invented', v2.__get__invented, v2.__set__invented); ASSetPropFlags(_global.Tech.prototype, null, 1); } #endinitclip } movieClip 5242 __Packages.WeaponStock { #initclip if (!_global.WeaponStock) { var v1 = function () { var v3 = 0; this._availableWeaponsArr = new Array(); this._productionArr = new Array(); this.roc1 = new WeaponSlot('rocket', 'carrier', 1, 'rocket1', v3++, 5, 'rocket1', 'antiRocket', false, 0, 0, 100, 'lib_rocketMC', 0, 1, 'none', 'ROCKET (10 MEG)'); this.roc2 = new WeaponSlot('rocket', 'carrier', 2, 'rocket2', v3++, 10, 'rocket2', 'antiRocket', false, 0, 0, 100, 'lib_rocketMC', 0, 1, 'none', 'ROCKET (25 MEG)'); this.roc3 = new WeaponSlot('rocket', 'carrier', 3, 'rocket3', v3++, 15, 'rocket3', 'antiRocket', false, 0, 0, 100, 'lib_rocketMC', 0, 1, 'none', 'ROCKET (50 MEG)'); this.roc4 = new WeaponSlot('rocket', 'carrier', 4, 'rocket4', v3++, 20, 'rocket4', 'antiRocket', false, 0, 0, 100, 'lib_rocketMC', 0, 1, 'none', 'ROCKET (95 MEG)'); this.war1 = new WeaponSlot('rocketload', 'payload', 1, 'warhead1', v3++, 5, 'warhead1', 'none', false, 15, 0, 100, 'none', 0, 2, 'explosion_warhead_1', 'WARHEAD (10 MEG)'); this.war2 = new WeaponSlot('rocketload', 'payload', 2, 'warhead2', v3++, 10, 'warhead2', 'none', false, 40, 0, 100, 'none', 0, 2, 'explosion_warhead_2', 'WARHEAD (25 MEG)'); this.war3 = new WeaponSlot('rocketload', 'payload', 3, 'warhead3', v3++, 15, 'warhead3', 'none', false, 90, 0, 100, 'none', 0, 2, 'explosion_warhead_3', 'WARHEAD (50 MEG)'); this.war4 = new WeaponSlot('rocketload', 'payload', 4, 'warhead4', v3++, 20, 'warhead4', 'none', false, 150, 0, 100, 'none', 0, 2, 'explosion_warhead_4', 'WARHEAD (95 MEG)'); this.bio1 = new WeaponSlot('rocketload', 'payload', 1, 'bioload1', v3++, 5, 'bioload1', 'none', false, 10, 0, 100, 'none', 0, 3, 'explosion_bioload_1', 'BIOLOAD (10 MEG)'); this.bio2 = new WeaponSlot('rocketload', 'payload', 2, 'bioload2', v3++, 10, 'bioload2', 'none', false, 35, 0, 100, 'none', 0, 3, 'explosion_bioload_2', 'BIOLOAD (25 MEG)'); this.bio3 = new WeaponSlot('rocketload', 'payload', 3, 'bioload3', v3++, 15, 'bioload3', 'none', false, 60, 0, 100, 'none', 0, 3, 'explosion_bioload_3', 'BIOLOAD (50 MEG)'); this.bio4 = new WeaponSlot('rocketload', 'payload', 4, 'bioload4', v3++, 20, 'bioload4', 'none', false, 80, 0, 100, 'none', 0, 3, 'explosion_bioload_4', 'BIOLOAD (95 MEG)'); this.sol1 = new WeaponSlot('soldier', 'conventional', 1, 'soldier1', v3++, 5, 'soldier1', 'none', false, 4, 0, 100, 'lib_boat001', 0, 4, 'explosion_soldier_1', 'SOLDIER'); this.sol2 = new WeaponSlot('soldier', 'conventional', 2, 'soldier2', v3++, 10, 'soldier2', 'none', false, 10, 0, 100, 'lib_soldier1MC', 0, 4, 'explosion_soldier_2', 'SEAL'); this.sol3 = new WeaponSlot('soldier', 'conventional', 3, 'soldier3', v3++, 15, 'soldier3', 'none', false, 21, 0, 100, 'lib_soldier1MC', 0, 4, 'explosion_soldier_3', 'TANK'); this.sol4 = new WeaponSlot('soldier', 'conventional', 4, 'soldier4', v3++, 20, 'soldier4', 'none', false, 35, 0, 100, 'lib_soldier1MC', 0, 4, 'explosion_soldier_4', 'SPECIAL UNIT'); this.spy1 = new WeaponSlot('spy', 'conventional', 1, 'spy1', v3++, 5, 'spy1', 'none', false, 0, 1, 100, 'none', 0, 5, 'none', 'SPY (LEVEL 1)'); this.spy2 = new WeaponSlot('spy', 'conventional', 2, 'spy2', v3++, 10, 'spy2', 'none', false, 0, 0, 100, 'none', 0, 5, 'none', 'SPY (LEVEL 2)'); this.spy3 = new WeaponSlot('spy', 'conventional', 3, 'spy3', v3++, 15, 'spy3', 'none', false, 0, 0, 100, 'none', 0, 5, 'none', 'SPY (LEVEL 3)'); this.spy4 = new WeaponSlot('spy', 'conventional', 4, 'spy4', v3++, 20, 'spy4', 'none', false, 0, 0, 100, 'none', 0, 5, 'none', 'SPY (LEVEL 4)'); this.plane1 = new WeaponSlot('plane', 'carrier', 2, 'plane1', v3++, 5, 'plane1', 'antiAir', true, 0, 0, 100, 'lib_plane1MC', 0, 6, 'none', 'FIGHTER JET'); this.plane2 = new WeaponSlot('plane', 'carrier', 4, 'plane2', v3++, 10, 'plane2', 'antiAir', false, 0, 0, 100, 'lib_plane2MC', 0, 6, 'none', 'BOMBER'); this.spe1 = new WeaponSlot('sub', 'specialCarrier', 3, 'sub', v3++, 50, 'sub', 'none', false, 0, 0, 100, 'lib_carrierMC', 0, 7, 'none', 'SUBMARINE'); this.spe2 = new WeaponSlot('ship', 'specialCarrier', 3, 'ship', v3++, 65, 'ship', 'antiAir', false, 0, 0, 100, 'lib_submarineMC', 0, 7, 'none', 'AIRCRAFT CARRIER'); this.spe3 = new WeaponSlot('space', 'specialCarrier', 3, 'space', v3++, 70, 'space', 'none', false, 0, 0, 100, 'lib_spaceMC', 0, 7, 'none', 'SPACE ROCKET'); this.antiAir = new WeaponSlot('anti', 'anti', 1, 'antiAir', v3++, 15, 'antiAir', 'none', true, 1, 2, 100, 'none', 0, 8, 'none', 'ANTI AIR'); this.antiRocket = new WeaponSlot('anti', 'anti', 1, 'antiRocket', v3++, 15, 'antiRocket', 'none', true, 1, 2, 100, 'none', 0, 8, 'none', 'ANTI ROCKET'); this.specialLoad = new WeaponSlot('specialLoad', 'specialLoad', 4, 'specialLoad', v3++, 80, 'specialLoad', 'none', false, 200000, 0, 100, 'lib_spaceMC', 0, 7, 'explosion_bioload_4', 'SATELLITE'); if (_global.model.zs66hj8s) { this.roc3 = undefined; this.roc4 = undefined; this.war3 = undefined; this.war4 = undefined; this.sol3 = undefined; this.sol4 = undefined; this.bio3 = undefined; this.bio4 = undefined; this.spy3 = undefined; this.spy4 = undefined; this.plane2 = undefined; this.spe2 = undefined; this.spe3 = undefined; this.specialLoad = undefined; } this.weaponArr = [this.roc1, this.roc2, this.roc3, this.roc4, this.war1, this.war2, this.war3, this.war4, this.bio1, this.bio2, this.bio3, this.bio4, this.sol1, this.sol2, this.sol3, this.sol4, this.spy1, this.spy2, this.spy3, this.spy4, this.plane1, this.plane2, this.spe1, this.spe2, this.spe3, this.specialLoad]; this.counterArr = [this.antiAir, this.antiRocket]; }; _global.WeaponStock = v1; var v2 = v1.prototype; v2.getWeaponByID = function (param_id) { for (var v3 in this.weaponArr) { if (this.weaponArr[v3].weaponID == param_id) { return this.weaponArr[v3]; return this.weaponArr[v3]; break; } } if (param_id == this.antiAir.weaponID) { return this.antiAir; } else { if (param_id == this.antiRocket.weaponID) { return this.antiRocket; } } }; v2.select_spy_by_level = function (_lvl) { for (var v2 in this.weaponArr) { if (this.weaponArr[v2].weaponName == 'spy' + _lvl) { return this.weaponArr[v2]; } } }; v2.activeWeaponByTechName = function (param_name) { for (var v4 in this.weaponArr) { var v2 = this.weaponArr[v4]; if (v2.relatedTechName == param_name) { v2.active = true; } } }; v2.getWeaponByName = function (param_name) { for (var v3 in this.weaponArr) { if (this.weaponArr[v3].weaponName == param_name) { return this.weaponArr[v3]; } } if (param_name == this.antiAir.weaponName) { return this.antiAir; } else { if (param_name == this.antiRocket.weaponName) { return this.antiRocket; } } }; v2.produceWeaponByName = function (param_name, param_amount) { (this.getWeaponByName(param_name)).inStock += param_amount; }; v2.reduceWeaponByName = function (param_name, param_amount) { (this.getWeaponByName(param_name)).inStock -= param_amount; }; v2.reduceWeaponByID = function (param_id, param_amount) { (this.getWeaponByID(param_id)).inStock -= param_amount; }; v2.getAvailableCarrier = function (wp) { var v2; for (var v4 in this.weaponArr) { if (this.weaponArr[v4].active && this.weaponArr[v4].weaponLevel >= wp.weaponLevel && this.weaponArr[v4].inStock > 0 && this.weaponArr[v4].weaponCategory == 'carrier') { v2 = this.weaponArr[v4]; } } return v2; }; v2.__get__allowPre = function () { for (var v3 in this.weaponArr) { var v2 = this.weaponArr[v3]; if (v2.__get__inStock() > 0 && v2.active && (v2.weaponCategory == 'carrier' || v2.weaponCategory == 'specialCarrier')) { return true; } } return false; }; v2.__get__allowDir = function () { for (var v3 in this.weaponArr) { var v2 = this.weaponArr[v3]; if (v2.weaponCategory == 'conventional' && v2.__get__inStock() > 0 && v2.active) { return true; } } return false; }; v2.__get__availableWeaponsArr = function () { this._availableWeaponsArr = []; for (var v2 in this.weaponArr) { if (this.weaponArr[v2].active && this.weaponArr[v2].inStock > 0 && this.weaponArr[v2].weaponType != 'spy' && this.weaponArr[v2].weaponCategory != 'carrier' && this.weaponArr[v2].weaponCategory != 'specialCarrier') { if (this.weaponArr[v2].weaponCategory == 'payload') { if (this['roc' + this.weaponArr[v2].weaponLevel].inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponLevel <= this.plane1.weaponLevel && this.plane1.inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponLevel <= this.plane2.weaponLevel && this.plane2.inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponName == 'ship' && this.spe1.inStock > 0 && this.__get__stocked_for_ship_attack()) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponName == 'sub' && this.spe2.inStock > 0 && this.__get__stocked_for_ship_attack()) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponLevel <= this.spe2.weaponLevel && this.spe2.inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponLevel <= this.spe1.weaponLevel && this.spe1.inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } } } } } } } } else { if (this.weaponArr[v2].weaponCategory == 'specialLoad' && this.spe3.inStock > 0) { this._availableWeaponsArr.push(this.weaponArr[v2]); } else { if (this.weaponArr[v2].weaponCategory != 'specialLoad' && this.weaponArr[v2].weaponCategory != 'payLoad') { this._availableWeaponsArr.push(this.weaponArr[v2]); } } } } } trace(' available WeaponsArr : ' + this._availableWeaponsArr); return this._availableWeaponsArr; }; v2.payloadInStock = function (_wpn) { if (_wpn.weaponCategory == 'payload' && _wpn.__get__inStock() > 0) { return true; } else { return false; } }; v2.get_MaxKillPayload = function (carrierWeapon) { var v3 = 0; var v5 = this.__get__instock_active_payloads(); var v6; for (var v7 in v5) { var v2 = v5[v7]; if (v2.maxKills > v3 && v2.weaponLevel <= carrierWeapon.weaponLevel && carrierWeapon.weaponName != 'space' && v2.weaponName != 'specialLoad' && v2.active) { v6 = v2; v3 = v2.maxKills; } else { if (carrierWeapon.weaponName == 'space' && v2.weaponName == 'specialLoad' && v2.__get__inStock() > 0 && v2.active) { v6 = v2; v3 = v2.maxKills == 2000; } } } return v6; }; v2.__get__stocked_for_ship_attack = function () { if (this.war1.inStock > 0 || this.war2.inStock > 0 || this.war3.inStock > 0 || this.bio1.inStock > 0 || this.bio2.inStock > 0 || this.bio3.inStock > 0) { return true; } return false; }; v2.payloadAvailable = function (_wpn) { var v4 = false; for (var v5 in this.weaponArr) { var v2 = this.weaponArr[v5]; if (_wpn.weaponType == 'rocket' && v2.weaponLevel >= _wpn.weaponLevel) { v4 = true; } else { if (_wpn.weaponType == 'plane' && this.payloadInStock(v2)) { if (_wpn.weaponLevel >= v2.weaponLevel) { v4 = true; } } else { if (_wpn.weaponType == 'sub' && this.payloadInStock(v2)) { v4 = true; } else { if (_wpn.weaponType == 'ship' && this.payloadInStock(v2)) { v4 = true; } } } } } if (_wpn.weaponType == 'space' && this.specialLoad.inStock > 0) { v4 = true; } return v4; }; v2.__get__logicalCarrierArr = function () { this._logicalCarrierArr = []; for (var v3 in this.weaponArr) { var v2 = this.weaponArr[v3]; if (this.payloadAvailable(v2) && v2.__get__inStock() > 0) { this._logicalCarrierArr.push(v2); } } return this._logicalCarrierArr; }; v2.__get__highWeaponCount = function () { var v6 = 0; var v4 = new Array(undefined, 0, 0, 0, 0); var v5 = 0; for (var v7 in this.weaponArr) { var v3 = this.weaponArr[v7]; if (v3.__get__inStock() > 0) { ++v4[v3.weaponLevel]; } } var v2 = 0; while (v2 < 5) { if (v4[v2] >= v5) { v5 = v4[v2]; v6 = v2; } ++v2; } return v6; }; v2.__get__inStock_perLevel_obj = function () { var v2 = new Object(); v2._level1 = 0; v2._level2 = 0; v2._level3 = 0; v2._level4 = 0; for (var v3 in this.weaponArr) { v2['_level' + this.weaponArr[v3].weaponLevel] += this.weaponArr[v3].inStock; } return v2; }; v2.__get__spyAvailable = function () { for (var v2 in this.weaponArr) { if (this.weaponArr[v2].weaponType == 'spy' && this.weaponArr[v2].inStock > 0 && this.weaponArr[v2].active) { return true; } } return false; }; v2.activateAll = function (_amount) { var v3 = _amount || 1; for (var v4 in this.weaponArr) { var v2 = this.weaponArr[v4]; v2.active = true; v2.bioloaded = false; v2.__set__inStock(v3); } }; v2.__get__availableSpies_obj = function () { var v3 = new Object(); v3._level1 = 0; v3._level2 = 0; v3._level3 = 0; v3._level4 = 0; for (var v4 in this.weaponArr) { var v2 = this.weaponArr[v4]; if (v2.weaponType == 'spy') { v3['_level' + v2.weaponLevel] += v2.inStock; } } return v3; }; v2.get_highest_spy_level = function () { var v4 = 0; var v3 = 0; while (v3 < this.weaponArr.length) { var v2 = this.weaponArr[v3]; if (v2.weaponType == 'spy' && v2.__get__inStock() > 0 && v2.active) { if (v2.weaponLevel > v4) { v4 = v2.weaponLevel; } } ++v3; } return v4; }; v2.__get__instock_active_payloads = function () { var v3 = new Array(); for (var v4 in this.weaponArr) { var v2 = this.weaponArr[v4]; if ((v2.weaponCategory == 'payload' || v2.weaponCategory == 'specialLoad') && v2.__get__inStock() > 0 && v2.active) { v3.push(v2); } } return v3; }; v2.__get__instock_active_payloads_perStock = function () { var v4 = new Array(); for (var v5 in this.weaponArr) { var v2 = this.weaponArr[v5]; if ((v2.weaponCategory == 'payload' || v2.weaponCategory == 'specialLoad') && v2.__get__inStock() > 0 && v2.active) { var v3 = 0; while (v3 < v2.__get__inStock()) { v4.push(v2); ++v3; } } } return v4; }; v2.__get__randomAvailableCarrier = function () { var v9 = _global.model.tools.randRange(1, 3); var v3 = new Object(); v3.rocket = false; v3.plane = false; v3.sub = false; v3.ship = false; v3.space = false; var v6 = new Array(); var v5 = ''; for (var v8 in this.__get__logicalCarrierArr()) { var v4 = (this.__get__logicalCarrierArr())[v8]; switch (v4.weaponType) { case 'rocket': v3.rocket = true; break; case 'plane': v3.plane = true; break; case 'sub': v3.sub = true; break; case 'ship': v3.ship = true; break; case 'space': v3.space = true; } } if (v3.rocket == true) { v6.push('rocket'); } if (v3.plane == true) { v6.push('plane'); } if (v3.sub == true) { v6.push('sub'); } if (v3.ship == true) { v6.push('ship'); } if (v3.space == true) { v6.push('space'); } v5 = v6[_global.model.tools.randRange(0, v6.length - 1)]; var v7 = 0; for (v8 in this.__get__logicalCarrierArr()) { v4 = (this.__get__logicalCarrierArr())[v8]; if (v4.weaponType == v5 && v7 < v4.weaponLevel) { return v4; } } }; v2.__get__weaponStocklevel = function () {}; v2.__get__productionArray = function () { var v3 = new Array(); for (var v6 in this.weaponArr) { var v2 = this.weaponArr[v6]; if (v2.preOrder > 0) { v3.push({'weapon': v2, 'amount': v2.preOrder}); } } for (v6 in this.counterArr) { v2 = this.counterArr[v6]; if (v2.preOrder > 0) { v3.push({'weapon': v2, 'amount': v2.preOrder}); } } return v3; }; v2.__get__production_money_spent = function () { var v2 = 0; for (var v3 in this.weaponArr) { v2 += this.weaponArr[v3].preOrder * this.weaponArr[v3].cost; } v2 += this.antiAir.preOrder * this.antiAir.cost; v2 += this.antiRocket.preOrder * this.antiRocket.cost; return v2; }; v2.resetPreOrder = function () { for (var v2 in this.weaponArr) { this.weaponArr[v2].preOrder = 0; } this.antiAir.preOrder = 0; this.antiRocket.preOrder = 0; }; v2.resetInUse = function () { for (var v2 in this.weaponArr) { this.weaponArr[v2].inUse = 0; } this.antiAir.inUse = 0; this.antiRocket.inUse = 0; }; v2.__get__highestRocketLoad = function () { var v2 = 0; for (var v3 in this.weaponArr) { if (this.weaponArr[v3].active && this.weaponArr[v3].weaponLevel > v2.weaponLevel) { v2 = this.weaponArr[v3]; } } }; v2.__set__boughtMSG = function (_str) { return this.__get__boughtMSG(); }; v2.__get__boughtMSG = function () { var v4 = 'Weapons produced: <br />'; var v3 = false; for (var v5 in this.weaponArr) { var v2 = this.weaponArr[v5]; if (v2.boughtInLastTurn > 0) { if (!v3) { v3 = true; v4 += ' -- ' + v2.prettyName + ' x' + v2.boughtInLastTurn + ' <br />'; } else { v4 += ' -- ' + v2.prettyName + ' x' + v2.boughtInLastTurn + ' <br />'; } } } if (this.antiAir.boughtInLastTurn > 0) { if (!v3) { v3 = true; v4 += ' -- Anti Aircraft x' + this.antiAir.boughtInLastTurn + ' <br />'; } else { v4 += ' -- Anti Aircraft x' + this.antiAir.boughtInLastTurn + ' <br />'; } } if (this.antiRocket.boughtInLastTurn > 0) { if (!v3) { v3 = true; v4 += ' -- Anti Rocket x' + this.antiRocket.boughtInLastTurn + ' <br />'; } else { v4 += ' -- Anti Rocket x' + this.antiRocket.boughtInLastTurn + ' <br />'; } } if (v3) { return v4; } else { return ''; } }; v2.removeBioload = function () { for (var v2 in this.weaponArr) { if (this.weaponArr[v2].bioloaded) { this.weaponArr[v2].active = true; this.weaponArr[v2].bioloaded = false; } } }; v2.resetBought = function () { for (var v2 in this.weaponArr) { this.weaponArr[v2].boughtInLastTurn = 0; } this.antiAir.boughtInLastTurn = 0; this.antiRocket.boughtInLastTurn = 0; }; v2.is_activeCategory = function (_num) { for (var v3 in this.weaponArr) { if (this.weaponArr[v3].desireGroup == _num && this.weaponArr[v3].active) { return true; } } return false; }; v2.active_dCat_count = function () { var v3 = 0; var v2 = 0; while (v2 < 8) { if (this.is_activeCategory(v2)) { ++v3; } ++v2; } return v3; }; v2.set_wpn_stock_per_level = function (a_level, a_stock) { for (var v5 in this.weaponArr) { var v2 = this.weaponArr[v5]; if (v2.weaponLevel == a_level) { v2.__set__inStock(a_stock); } } }; v2.set_easy_wpn_stock = function () {}; v2.max_stock = function () { for (var v2 in this.weaponArr) { if (this.weaponArr[v2].active) { this.weaponArr[v2].inStock = 4; } this.counterArr[0].inStock = 4; this.counterArr[1].inStock = 4; } }; v2.addProperty('allowDir', v2.__get__allowDir, function () {}); v2.addProperty('allowPre', v2.__get__allowPre, function () {}); v2.addProperty('availableSpies_obj', v2.__get__availableSpies_obj, function () {}); v2.addProperty('availableWeaponsArr', v2.__get__availableWeaponsArr, function () {}); v2.addProperty('boughtMSG', v2.__get__boughtMSG, v2.__set__boughtMSG); v2.addProperty('highWeaponCount', v2.__get__highWeaponCount, function () {}); v2.addProperty('highestRocketLoad', v2.__get__highestRocketLoad, function () {}); v2.addProperty('inStock_perLevel_obj', v2.__get__inStock_perLevel_obj, function () {}); v2.addProperty('instock_active_payloads', v2.__get__instock_active_payloads, function () {}); v2.addProperty('instock_active_payloads_perStock', v2.__get__instock_active_payloads_perStock, function () {}); v2.addProperty('logicalCarrierArr', v2.__get__logicalCarrierArr, function () {}); v2.addProperty('productionArray', v2.__get__productionArray, function () {}); v2.addProperty('production_money_spent', v2.__get__production_money_spent, function () {}); v2.addProperty('randomAvailableCarrier', v2.__get__randomAvailableCarrier, function () {}); v2.addProperty('spyAvailable', v2.__get__spyAvailable, function () {}); v2.addProperty('stocked_for_ship_attack', v2.__get__stocked_for_ship_attack, function () {}); v2.addProperty('weaponStocklevel', v2.__get__weaponStocklevel, function () {}); ASSetPropFlags(_global.WeaponStock.prototype, null, 1); } #endinitclip } movieClip 5243 __Packages.WeaponSlot { #initclip if (!_global.WeaponSlot) { var v1 = function (param_type, param_category, param_level, param_name, param_ID, param_cost, param_techName, param_counteredBy, param_active, param_maxKills, param_initStock, param_maxStock, param_mcLinkage, param_inUse, param_desireGroup, param_explosion_mc_name, param_prettyName) { this.investment = 0; this.weaponType = param_type; this.weaponCategory = param_category; this.weaponLevel = param_level; this.weaponName = param_name; this.weaponID = param_ID; this.cost = param_cost; this.relatedTechName = param_techName; this.counteredBy = param_counteredBy; this.active = param_active; this.maxKills = param_maxKills; this._inStock = param_initStock; this.maxStock = param_maxStock; this.mcLinkage = param_mcLinkage; this.inUse = param_inUse; this.desireGroup = param_desireGroup; this.prettyName = param_prettyName; this.boughtInLastTurn = 0; this.bioloaded = false; this.explosion_mc_name = param_explosion_mc_name; }; _global.WeaponSlot = v1; var v2 = v1.prototype; v2.buy = function () { this.__set__inStock(this.__get__inStock() + 1); ++this.boughtInLastTurn; }; v2.__set__inStock = function (_nr) { this._inStock = _nr; return this.__get__inStock(); }; v2.__get__inStock = function () { return this._inStock; }; v2.preOrder = 0; v2.inUse = 0; v2.addProperty('inStock', v2.__get__inStock, v2.__set__inStock); ASSetPropFlags(_global.WeaponSlot.prototype, null, 1); } #endinitclip } movieClip 5244 __Packages.TurnAction { #initclip if (!_global.TurnAction) { var v1 = function (param_num) { this.turnMoney = 0; this.num = param_num; this.productionInvestmentArr = new Array([], ['rockets', 0, 1, 0, 1], ['planes', 0, 6, 0, 2], ['special', 0, 7, 0, 3], ['warhead', 0, 2, 0, 4], ['bioload', 0, 3, 0, 5], ['soldier', 0, 4, 0, 6], ['spy', 0, 5, 0, 7], ['defense', 0, 8, 0, 8]); }; _global.TurnAction = v1; var v2 = v1.prototype; v2.doReset = function () { this.attackWeapon.inUse = 0; this.preAttackCarrier.inUse = 0; this.preAttackPayload.inUse = 0; this.__set__action(undefined); this.targetPlayer = undefined; this.targetCity = undefined; this.preAttackCarrier = undefined; this.preAttackPayload = undefined; this.attackWeapon = undefined; this.inventTech = undefined; this.buyArr = []; this.humanBuyArr = []; this.humanResearchArr = []; this.inventArr = []; this.forceCity = undefined; this.ship_attack_arr = undefined; this.productionInvestmentArr = new Array([], ['rockets', 0, 1, 0, 1], ['planes', 0, 6, 0, 2], ['special', 0, 7, 0, 3], ['warhead', 0, 2, 0, 4], ['bioload', 0, 3, 0, 5], ['soldier', 0, 4, 0, 6], ['spy', 0, 5, 0, 7], ['defense', 0, 8, 0, 8]); this.researchArr = []; this.diplomacyArr = []; _global.model.human.turnMoney += this.turnMoney; this.researchMoneySpend = 0; this.turnMoney = 0; this.diplomacyLeader = undefined; this.diplomacyOption = undefined; this.spyBuilding = 'spyCenter'; }; v2.__set__action = function (_str) { if (_str == 'reset') { if (this.__get__action() == '_attack' || this._action == 'preAttack' || this._action == 'attack') { this._action = 'reset'; } } else { this._action = _str; } return this.__get__action(); }; v2.__get__action = function () { return this._action; }; v2.__get__actionNames = function () { var v2 = ''; if (this.__get__action()) { v2 += '<b> ' + this.__get__action() + ' </b><br/>'; } if (this.targetPlayer) { v2 += ' targetPlayer: ' + this.targetPlayer.playerNum + '<br/>'; } if (this.targetCity) { v2 += ' targetCity: ' + this.targetCity.cityID + '<br/>'; } if (this.preAttackCarrier) { v2 += ' carrier: ' + this.preAttackCarrier.weaponName + '<br/>'; } if (this.preAttackPayload) { v2 += ' payload: ' + this.preAttackPayload.weaponName + '<br/>'; } if (this.attackWeapon) { v2 += ' attackWeapon: ' + this.attackWeapon.weaponName + '<br/>'; } if (this.inventTech) { v2 += ' inventTech: ' + this.inventTech.techName + '<br/>'; } if (this.buyArr.length > 0) { v2 += ' buyArr: '; for (var v3 in this.buyArr) { v2 += this.buyArr[v3].weapon.weaponName + ' - '; } v2 += ' <br/> '; } return v2; }; v2.__get__productionMoneySpend = function () { var v2 = 0; for (var v3 in this.productionInvestmentArr) { if (this.productionInvestmentArr[v3][3] > 0) { v2 += this.productionInvestmentArr[v3][3]; } } return v2; }; v2.reset = false; v2.addProperty('action', v2.__get__action, v2.__set__action); v2.addProperty('actionNames', v2.__get__actionNames, function () {}); v2.addProperty('productionMoneySpend', v2.__get__productionMoneySpend, function () {}); ASSetPropFlags(_global.TurnAction.prototype, null, 1); } #endinitclip } movieClip 5245 __Packages.City { #initclip if (!_global.City) { var v1 = function (param_num, param_population, param_plr) { this.num = param_num; this.cityID = param_num; this.prevPopulation = param_population; this.population = param_population; this.plr = param_plr; this.selectionObj = new Object(); this.selectionObj.mcArray = []; this.selectionObj.attack = false; this.selectionObj.attackMC = undefined; this.selectionObj.preAttack = false; this.selectionObj.preAttackMC = undefined; this.selectionObj.preAttackWeapon = undefined; this.selectionObj.propaganda = false; this.selectionObj.propagandaMC = undefined; this.selectionObj.ship = false; this.selectionObj.shipCount = 0; this.selectionObj.shipMC_arr = new Array(); this.total_battle_casualties = 0; this.propagandaMin = []; this.propagandaMinIndex = 0; this.propagandaPlus = 0; this.hideForSelection = false; this.showForSelection = false; this.bioloaded = false; this.bioload_in_battle = undefined; this.bioCloud_container = undefined; this.bioCloud_arr = []; this.battle_loop_casualties = 0; this.propaganda_exclude = false; }; _global.City = v1; var v2 = v1.prototype; v2.selectForShipAttack = function () { ++this.selectionObj.shipCount; this.selectionObj.ship = true; }; v2.deselectForShipAttack = function () { this.selectionObj.shipMC_arr[0].removeMovieClip(); this.selectionObj.shipMC_arr.splice(0, 1); --this.selectionObj.shipCount; if (this.selectionObj.shipCount <= 0) { this.removeSelection('ship'); } }; v2.setMapVars = function (param_mapMC, param_depth, param_xPos, param_yPos) { this.mapMC = param_mapMC; this.yPos = param_yPos; this.xPos = param_xPos; this.image_depth = Math.floor((this.yPos + 15) / 10) * 500 + (4 + this.cityID); var v3 = false; var v4 = 0; while (!v3) { if (this.checkDepth(this.image_depth)) { v3 = true; } else { --this.image_depth; } ++v4; if (v4 > 90) { v3 = true; } } _global.model.cityDepthArr.push(this.image_depth); }; v2.checkDepth = function (_nr) { var v4 = true; for (var v3 in _global.model.cityDepthArr) { if (_global.model.cityDepthArr[v3] == _nr) { return false; } } return v4; }; v2.__set__theme = function (_param) { this.citySet = _param; return this.__get__theme(); }; v2.__get___isSelected = function () { var v2 = false; this.selectionCount = 0; if (this.selectionObj.attack) { v2 = true; ++this.selectionCount; } if (this.selectionObj.preAttack) { v2 = true; ++this.selectionCount; } if (this.selectionObj.propaganda) { v2 = true; ++this.selectionCount; } if (this.selectionObj.ship) { v2 = true; this.selectionCount += this.selectionObj.shipCount; } return v2; }; v2.removeSelection = function (_action) { switch (_action) { case 'preAttack': this.selectionObj.preAttack = false; this.selectionObj.preAttackWeapon = undefined; --this.selectionCount; this.selectionObj.preAttackMC.removeMovieClip(); break; case 'attack': this.selectionObj.attack = false; --this.selectionCount; this.selectionObj.attackMC.removeMovieClip(); break; case 'propaganda': this.selectionObj.propaganda = false; --this.selectionCount; this.selectionObj.propagandaMC.removeMovieClip(); break; case 'ship': this.selectionObj.ship = false; this.selectionObj.shipMC_arr = []; this.selectionObj.shipCount = 0; break; case 'all': this.selectionMC.removeMovieClip(); this.selectionCount = 0; this.selectionObj.attack = false; this.selectionObj.attackMC.removeMovieClip(); this.selectionObj.preAttack = false; this.selectionObj.preAttackMC.removeMovieClip(); this.selectionObj.propaganda = false; this.selectionObj.propagandaMC.removeMovieClip(); this.selectionObj.ship = false; this.selectionObj.shipMC_arr = []; this.selectionObj.shipCount = 0; } if (!this.__get___isSelected()) { this._selected = false; this.selectionMC.removeMovieClip(); this.selectionMC = undefined; } }; v2.alignSelectionMC = function () { this.selectionMC._x = this.xPos; this.selectionMC._y = this.yPos - 25; var v3 = 0; for (var v2 in this.selectionObj.mcArray) { v3 += this.selectionObj.mcArray[v2]._width; } v2 = 0; while (v2 < this.selectionObj.mcArray.length) { if (v2 == 0) { this.selectionObj.mcArray[v2]._x = -(v3 / 2); } else { this.selectionObj.mcArray[v2]._x = this.selectionObj.mcArray[v2 - 1]._x + this.selectionObj.mcArray[v2 - 1]._width; } this.selectionObj.mcArray[v2]._y = 25; ++v2; } }; v2.updateIMG = function () { this.image.gotoAndStop(this.__get__size_and_frame()); }; v2.__get__size_and_frame = function () { var v2 = Math.ceil((this.population / this.frame_divider) * 6); this.debugTextField.text = 'pop: ' + this.population; if (this.deathFrame && this.population <= 0) { return this.deathFrame; } if (this.population <= 0 && this._prevFrame != 99) { this.population = 0; var v3 = this._prevFrame + 9; this._prevFrame = 99; return v3; } if (this.population < 0) { this.population = 0; } if (v2 <= 6) { this._prevFrame = v2; return v2; } else { this._prevFrame = 6; return 6; } }; v2.removeBioload = function () { this.bioloaded = false; for (var v2 in this.bioCloud_arr) { this.bioCloud_arr[v2].removeMovieClip(); } this.bioCloud_arr = []; this.bioCloud_container.removeMovieClip(); }; v2.propagandaMin_func = function () { this.size_and_frame_in_battle(this.propagandaMin[this.propagandaMinIndex], true, 'propaganda'); ++this.propagandaMinIndex; }; v2.propagandaPlus_func = function () { this.curCasualties -= this.propagandaPlus; this.size_and_frame_in_battle(0, true); }; v2.size_and_frame_in_battle = function (casualties, play_sequence, extra_string) { if (this.deathFrame && this.population <= 0) { return this.deathFrame; } this.curCasualties += casualties; var v3 = Math.ceil(((this.prevPopulation - this.curCasualties) / this.frame_divider) * 6); if (this.prevPopulation - this.curCasualties <= 0) { if (!this._prevFrame) { this._prevFrame = this.image._currentframe; } this.deathFrame = this._prevFrame + 9; this.population = 0; _global.view.city_shrink_sequence(this.image, this.deathFrame); return this.deathFrame; } if (this.population < 0) { this.population = 0; } this.debugTextField.text = 'pop: ' + this.population; if (v3 <= 6) { if (v3 != this._prevFrame && play_sequence) { _global.view.city_shrink_sequence(this.image, v3, extra_string, this.propagandaMinIndex); } this._prevFrame = v3; return v3; } else { this._prevFrame = 6; return 6; } }; v2.__set__size_and_frame = function (_param) { return this.__get__size_and_frame(); }; v2._theme = 'string'; v2.curCasualties = 0; v2.prevPopulation = 0; v2.selectionCount = 0; v2.frame_divider = 90; v2.carrierAttackCount = 0; v2.addProperty('_isSelected', v2.__get___isSelected, function () {}); v2.addProperty('size_and_frame', v2.__get__size_and_frame, v2.__set__size_and_frame); v2.addProperty('theme', function () {}, v2.__set__theme); ASSetPropFlags(_global.City.prototype, null, 1); } #endinitclip } movieClip 5246 __Packages.Unit { #initclip if (!_global.Unit) { var v1 = function (param_unitID, param_container, param_targetType, param_newName, param_startX, param_startY, param_wayPointArr, param_result, param_tail, param_tailNum, param_force_MC, param_colorTrans, param_startNum, param_depth, param_targetPlayer, param_tr, param_playerNum, param_colorName, param_wildCard, param_explosion_mc_name) { this.xTargetStep = 0; this.yTargetStep = 0; this.targetX = 0; this.targetY = 0; this.curX = 0; this.curY = 0; this.prevX = 0; this.prevY = 0; this.adjside = 0; this.oppside = 0; this.angle = 0; this.xDist = 0; this.yDist = 0; this.step = 0; this.xStep = 0; this.yStep = 0; this.unloadTimer = 0; this.curWayPoint = 0; this.curShootOffset = 0; this.maxShootOffset = 0; this.unloadTailCount = 0; this.unloadNum = 0; this.multiFrame = false; this.atTarget = false; this.visible = true; this.countDownToStop = 250; this.shotCount = 0; this.dropCount = 0; this.trailActive = false; this.framesActive = 0; this.trailStart = false; this.curCountToStop = 0; this.unitStatus = 'alive'; this.activeAndMoving = true; this.anti_initiated = false; this.anti_life_count = 0; this.anti_pos = [0, 0]; this.anti_mc_name = ''; this.xyArr = new Array([0, 0], [0, 0]); this.unitID = param_unitID; this.startX = param_startX; this.startY = param_startY; this.targetPlayer = param_targetPlayer; this.tr = param_tr; this.trailArr = new Array(); this.playerNum = param_playerNum; this.colorName = param_colorName; this.wildCard = param_wildCard; this.explosion_mc_name = param_explosion_mc_name; if (param_force_MC) { param_targetType = param_force_MC; } if (this.wildCard.anti) { this.anti_active = true; this.anti_num = this.wildCard.antiNum; } else { this.anti_active = false; } this.colorTrans = param_colorTrans; this.shadowXOffset = 0; this.shadowYOffset = 0; this.startNum = param_startNum; this.plane_angle_step = param_wildCard.plane_angle_step; this.plane_cur_angle_in_circular_flight = param_wildCard.plane_angle_start; this.plane_angle_start = this.plane_cur_angle_in_circular_flight; this.plane_circular_modifier = this.wildCard.circular_modifier_center; this.plane_circular_radius = this.wildCard.circular_radius || 100; switch (param_targetType) { case 'plane1': this.action = 'liftOff'; this.mcID = 'plane001'; this.step = 12; this.range = 40; this.x_multiplier = this.wildCard.x_multiplier || 0.5; this.y_multiplier = this.wildCard.y_multiplier || 2; this.frameCount = 24; this.liftOff = true; this.hasShadow = true; this.tintMC_id = 'plane001_tint'; this.shadowMC_id = 'plane001_shadow'; this.shadowXOffset = 0; this.shadowYOffset = 0; this.activeAndMoving = true; this.trailCount = 1; this.trailCountDown = 5; this.trailSize = 50; this.trail_offset = 25; this.anti_type = 'air'; this.anti_offset = 0; break; case 'plane2': this.action = 'liftOff'; this.mcID = 'plane002'; this.tintMC_id = 'plane002_tint'; this.shadowMC_id = 'plane002_shadow'; this.step = 12; this.range = 40; this.x_multiplier = this.wildCard.x_multiplier || 0.5; this.y_multiplier = this.wildCard.y_multiplier || 2; this.frameCount = 24; this.liftOff = true; this.trailCountDown = 1; this.trailCount = 2; this.trailSize = 22; this.hasShadow = true; this.anti_type = 'air'; this.anti_offset = 0; break; case 'ship_plane': this.action = 'waitForLiftOff'; this.mcID = 'ship_plane'; this.trailCount = 2; this.trailSize = 8; this.trailMultiplier = 4; this.step = 10; this.range = 40; this.x_multiplier = 1; this.y_multiplier = 2; this.frameCount = 24; this.liftOff = true; this.hasShadow = true; this.tintMC_id = 'plane001_tint'; this.shadowMC_id = 'plane001_shadow'; this.activeAndMoving = true; this.trailCount = 1; this.trailCountDown = 5; this.anti_type = 'air'; this.trailSize = 50; this.wildCard.liftOffCount = 0; this.idleFrame = 4; break; case 'boat': this.unloadMax = 4; this.range = 15; this.action = 'default'; this.mcID = 'boat001'; this.tintMC_id = 'boat001_tint'; this.step = 7; this.x_multiplier = 2; this.y_multiplier = 2; this.frameCount = 18; this.hasShadow = false; this.depthSwap = true; this.startSoundOnAAM = true; this.startSoundAction = 'boat_start'; this.floorFrame = true; this.cancelBib = true; break; case 'chinook': this.unloadMax = 2; this.range = 25; this.action = 'waitForHeliStart'; this.mcID = 'chinook'; this.shadowMC_id = 'chinook_shadow'; this.step = 8; this.x_multiplier = 2; this.y_multiplier = 2; this.frameCount = 18; this.multiFrame = true; this.frameOffset = 0; this.hasShadow = true; this.shadowXOffset = 0; this.shadowYOffset = 70; this.offsetFrames = 2; this.heliStartPlusX = 15; this.heliStartPlusY = -100; this.fixedFrame = 4; break; case 'apache': this.unloadMax = 4; this.range = 25; this.action = 'waitForHeliStart'; this.mcID = 'apache'; this.hasShadow = true; this.step = 8; this.x_multiplier = 2; this.y_multiplier = 2; this.frameCount = 18; this.multiFrame = true; this.frameOffset = 0; this.offsetFrames = 2; this.tintMC_id = 'apache_tint'; this.shadowMC_id = 'apache_shadow'; this.shadowXOffsetMax = 0; this.shadowYOffsetMax = 70; this.shadowXOffset = 0; this.shadowYOffset = 0; this.shadowStartAtUnitBase = true; this.heliStartPlusX = 25; this.heliStartPlusY = -25; this.startSoundOnAAM = true; this.startSoundAction = 'apache_start'; break; case 'soldier': this.range = 2; this.action = 'default'; this.mcID = 'soldier001'; this.step = 4; this.x_multiplier = 0.5; this.y_multiplier = 0.4; this.frameCount = 18; this.multiFrame = true; this.frameOffset = 1; this.hasShadow = false; this.offsetFrames = 12; this.visible = false; this.activeAndMoving = false; this.maxShotCount = 75; this.maxShootOffset = 4; this.schootMCID = 'soldier001_shoot'; this.tintMC_id = 'soldier001_tint'; this.shootTintMC_id = 'soldier001_shoot_tint'; this.depthSwap = true; this.startSoundOnAAM = true; this.startSoundAction = 'soldier_running'; this.instantTurn = true; break; case 'tank_noShade': this.range = 10; this.action = 'tail'; this.mcID = 'tank_noShade'; this.step = 2; this.x_multiplier = 2; this.y_multiplier = 2; this.frameCount = 18; this.multiFrame = false; this.frameOffset = 1; this.hasShadow = false; this.activeAndMoving = false; this.dropDistance = 20; this.depthSwap = true; this.instantTurn = false; this.floorFrame = true; this.cancelBib = true; this.maxShotCount = 60; break; case 'tankTop': this.action = 'tail'; this.mcID = 'tankTop'; this.step = 4; this.x_multiplier = 0.5; this.y_multiplier = 0.4; this.frameCount = 18; this.multiFrame = false; this.frameOffset = 1; this.hasShadow = false; this.activeAndMoving = false; this.depthSwap = true; this.instantTurn = true; break; case 'marine': this.range = 10; this.action = 'default'; this.mcID = 'marine'; this.step = 4; this.x_multiplier = 0.5; this.y_multiplier = 0.4; this.frameCount = 18; this.multiFrame = true; this.frameOffset = 1; this.hasShadow = false; this.offsetFrames = 12; this.visible = false; this.activeAndMoving = false; this.maxShotCount = 60; this.maxShootOffset = 4; this.schootMCID = 'soldier001_shoot'; this.tintMC_id = 'soldier001_tint'; this.shootTintMC_id = 'soldier001_shoot_tint'; this.depthSwap = true; this.startSoundOnAAM = true; this.startSoundAction = 'soldier_running'; this.instantTurn = false; break; case 'suicide_bomber': this.range = 10; this.action = 'waitForHeliStart'; this.mcID = 'suicide_bomber'; this.step = 4; this.x_multiplier = 0.5; this.y_multiplier = 0.4; this.frameCount = 18; this.multiFrame = true; this.frameOffset = 1; this.hasShadow = false; this.offsetFrames = 12; this.activeAndMoving = false; this.maxShotCount = 60; this.maxShootOffset = 4; this.tintMC_id = 'suicide_bomber_tint'; this.heliStartPlusX = 25; this.heliStartPlusY = -50; this.depthSwap = true; break; case 'rocket': this.range = 14; this.action = 'default'; this.mcID = 'rocket'; this.step = 4; this.x_multiplier = 3; this.y_multiplier = 2; this.frameCount = 18; this.multiFrame = false; this.hasShadow = false; this.visible = true; this.activeAndMoving = true; this.trailCount = 1; this.trailSize = 50; this.trailMultiplier = 20; this.trailCountDown = 5; this.startSoundOnAAM = true; this.startSoundAction = 'rocket_launch'; this.anti_type = 'rocket'; break; case 'sub_rocket': this.range = 14; this.action = 'default'; this.mcID = 'sub_rocket'; this.step = 4; this.x_multiplier = 3; this.y_multiplier = 2; this.frameCount = 18; this.multiFrame = false; this.hasShadow = false; this.visible = true; this.activeAndMoving = true; this.trailCount = 1; this.trailSize = 50; this.trailMultiplier = 20; this.trailCountDown = 5; this.startSoundOnAAM = true; break; case 'plane2': this.action = 'liftOff'; this.mcID = 'plane002'; this.tintMC_id = 'plane002_tint'; this.shadowMC_id = 'plane002_shadow'; this.step = 10; this.range = 60; this.x_multiplier = 0.5; this.y_multiplier = 0.7; this.frameCount = 24; this.liftOff = true; this.trailCountDown = 1; this.trailCount = 2; this.trailSize = 22; this.hasShadow = true; break; case 'space': this.action = 'wait'; this.mcID = 'satellite'; } this.container = param_container; this.unitName = param_newName; if (this.depthSwap) { this.depth_ = param_depth; } else { if (this.mcID == 'sattelite') { this.depth_ = this.container.getNextHighestDepth(); } else { this.depth_ = 800000 + param_depth; } } if (this.mcID == 'tankTop') { this.MC = this.container.attachMovie(this.mcID + '_' + this.colorName, this.unitName, this.depth_); } else { if (this.wildCard._number) { this.MC = this.container.attachMovie(this.mcID, this.unitName, this.depth_ + this.wildCard._number); } else { if (this.mcID == 'sub_rocket') { this.MC = this.container.attachMovie('rocket', this.unitName, this.container.getNextHighestDepth()); this.MC._yscale = 50; this.MC._x = 50; this.action = 'wait_for_sub_launch'; } else { this.MC = this.container.attachMovie(this.mcID, this.unitName, this.container.getNextHighestDepth()); } } } if (this.mcID == 'suicide_bomber') { this.MC.swapDepths(this.container.getNextHighestDepth()); } this.activeAndMoving = false; this.curX = param_startX; this.curY = param_startY; if (param_targetType == 'rocket' || param_targetType == 'sub_rocket') { this.prevX = this.curX; this.prevY = this.curY + 5; this.tintMC = this.MC.tintMC; this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); this.ellipseWidth = this.wildCard.ellipseWidth; this.ellipseHeight = this.wildCard.ellipseHeight; this.ellipseCenterX = this.wildCard.ellipseCenterX; this.ellipseCenterY = this.wildCard.ellipseCenterY; this.ellipseRadiusX = this.ellipseWidth / 2; this.ellipseRadiusY = this.ellipseHeight / 2; this.ellipseAngle = this.wildCard.startAngle; this.ellipseDirectionMultiplier = this.wildCard.directionMultiplier; this.ellipseSpeed = 3; this.ellipseTargetAngle = this.wildCard.targetAngle; this.ellipseFinalAction = this.wildCard.finalAction; } this.tail = param_tail; this.tailNum = param_tailNum; if (this.hasShadow) { this.shadowMC = this.container.attachMovie(this.shadowMC_id, 'shadow_' + this.unitName, this.container.getNextHighestDepth()); this.shadowMC._x = param_startX; this.shadowMC._y = param_startY; this.shadowMC._alpha = this.shadowStartAlpha; } if (this.tintMC_id) { this.tintMC = this.container.attachMovie(this.tintMC_id, 'tint' + this.unitName, this.container.getNextHighestDepth()); this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); } if (this.mcID == 'apache') { this.MC._yscale = 50; this.MC._xscale = 50; this.shadowMC._yscale = 50; this.shadowMC._xscale = 50; this.tintMC._yscale = 50; this.tintMC._xscale = 50; } if (this.mcID == 'ship_plane') { this.MC._yscale = 10; this.MC._xscale = 10; this.tintMC._yscale = 10; this.tintMC._xscale = 10; this.shadowMC._yscale = 10; this.shadowMC._xscale = 10; this.shadowMC._visible = false; } this.targetDot = this.container.attachMovie('redDot', 'targetDot' + this.unitName, param_container.getNextHighestDepth()); var v6 = new Color(this.targetDot); v6.setTransform(this.colorTrans); this.wayPointArr = param_wayPointArr; if (this.liftOff) { this.MC._yscale = 50; this.MC._xscale = 50; this.MC._alpha = 0; this.shadowMC._yscale = 50; this.shadowMC._xscale = 50; this.tintMC._yscale = this.MC._xscale; this.tintMC._xscale = this.tintMC._yscale; } this.result = param_result; this.MC._visible = this.visible; this.tintMC._visible = this.visible; if (this.mcID == 'tank_noShade') { this.MC.shadowMC._visible = false; this.MC.shadowMC._y += 40; } if (this.wildCard.satelliteFrame) { this.MC.gotoAndStop(this.wildCard.satelliteFrame); } this.laserStartMC = this.MC.mc.laserStartMC; if (this.mcID == 'chinook') { this.soundAction('chinook_start'); } if (this.mcID == 'suicide_bomber') { this.MC.swapDepths(this.container.getNextHighestDepth()); } }; _global.Unit = v1; var v2 = v1.prototype; v2.__get__appMC_depth = function () { var v2 = this.container.getNextHighestDepth(); if (this.mcID != 'tankTop') { v2 = Math.floor(this.curY / 10) * 500 + 120 + this.depth_; } else { v2 = this.tail.MC.getDepth() + 1; } if (this.tail.mcID == 'chinook') { v2 = this.tail.MC.getDepth() - 2; } if (this.mcID == 'soldier001' && this.playerNum == 0) { } return v2; }; v2.__set__appMC_depth = function (_param) { return this.__get__appMC_depth(); }; v2.moveUnit = function () { if (this.unit_live_countdown_status) { if (--this.cur_unit_live >= this.max_unit_live) { this.action = 'stop'; } } if (this.mcID == 'tankTop' && this.tail.action == 'tank_shoot') { this.action = 'tank_top_shoot'; } switch (this.action) { case 'shoot': if (this.mcID == 'soldier001') { this.soundAction('soldier_shoot'); } else { this.soundAction('marine_shoot'); } if (this.shotCount == 0) { this.constantDir = this.unitDirection; this.setStep(); this.activeAndMoving = false; this.MC.removeMovieClip(); this.tintMC.removeMovieClip(); this.MC = this.container.attachMovie(this.schootMCID, this.unitName, this.container.getNextHighestDepth()); this.tintMC = this.container.attachMovie(this.shootTintMC_id, 'tint' + this.unitName, this.MC.getDepth() + 1); this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); this.offsetFrames = this.maxShootOffset; this.MC.gotoAndStop(5); this.tintMC.gotoAndStop(5); } if (this.shotCount < this.maxShotCount) { (_global.model.getCityByID(this.tr._city)).image.bulletHoles.play(); if (this.curShootOffset == 0) { this.curShootOffset = 1; } else { this.curShootOffset = 0; } this.MC.gotoAndStop(this.constantDir); this.tintMC.gotoAndStop(this.constantDir); ++this.shotCount; } else { _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties / 3); this.action = 'stop'; } break; case 'tank_shoot': break; case 'tank_top_shoot': this.tail.activeAndMoving = false; this.tail.sound.stop('unit_Tank.wav'); if (this.tail.shotCount < this.tail.maxShotCount) { var v3 = this.MC._currentframe; if (v3 == this.__get__tankTopDirection() * 2 - 1 && this.tank_preshot_count > 25) { this.MC.nextFrame(); this.tank_preshot_count = 0; this.soundAction('tank_shoot'); } else { if (this.tank_preshot_count > 3) { this.MC.gotoAndStop(this.__get__tankTopDirection() * 2 - 1); } } ++this.tail.shotCount; ++this.tank_preshot_count; } else { _global.presenter.updateSingleCity_byID(this.tail.tr._city, this.tail.tr._casualties); this.tail.action = 'stop'; this.action = 'stop'; } break; case 'tank_reset_range': this.range = 40; break; case 'soldier_reset_range': if (this.curX < this.wayPointArr[this.curWayPoint]._x) { this.range = 100; } else { this.range = 25; } break; case 'suicide_fade_out': if (this.MC._alpha > 0 && this.activeAndMoving) { this.MC._alpha -= 2; this.tintMC._alpha = this.MC._alpha; } break; case 'suicide_dissapear': this.soundAction('suicide_scream'); this.activeAndMoving = false; this.MC.gotoAndStop(17); this.tintMC.gotoAndStop(17); if (this.suicide_commando_wait_countDown_cur >= this.suicide_commando_wait_countDown_max) { this.suicide_commando_wait_countDown_max = 0; this.activeAndMoving = true; } else { ++this.suicide_commando_wait_countDown_cur; } this.curX = this.wayPointArr[this.curWayPoint]._x; this.curY = this.wayPointArr[this.curWayPoint]._y; break; case 'suicide_appear': this.action = 'suicide_fade_in'; break; case 'suicide_fade_in': if (this.MC._alpha < 100) { ++this.MC._alpha; this.tintMC._alpha = this.MC._alpha; } break; case 'speedup_success': this.action = 'default'; this.range = 70; this.step = 15; this.x_multiplier = 2; this.y_multiplier = 1; this.MC.gotoAndStop(2); this.tintMC = this.MC.tintMC; this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); break; case 'speedup_die': _global.presenter.fireDefense(this.targetPlayer, 'antiAir_fire'); _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); _global.model.playerArr[this.targetPlayer].anti_inBattle_target = undefined; _global.explosion_sound_by_mc_name('explosion003', this.MC._x); this.killUnit('rocket_self'); break; case 'explode': _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); this.killUnit('default'); break; case 'suicide_explode': _global.explosion_sound_by_mc_name('suicide', this.MC._x); _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); this.killUnit('suicide'); break; case 'rocket_follow_ellipse_with_anti': this.MC.gotoAndStop(3); this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); _global.presenter.fireDefense(this.targetPlayer, 'antiRocket_fire'); this.rocket_follow_ellipse = true; this.action = 'none'; break; case 'rocket_follow_ellipse': this.MC.gotoAndStop(3); this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); this.rocket_follow_ellipse = true; this.action = 'none'; break; case 'rocket_explode_self': _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); _global.model.playerArr[this.targetPlayer].anti_inBattle_target = undefined; this.killUnit('rocket_self'); _global.explosion_sound_by_mc_name('explosion002', this.MC._x); break; case 'rocket_explode_city': _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); _global.explosion_sound_by_mc_name(this.explosion_mc_name, this.MC._x); this.explosionMC = this.container.attachMovie(this.explosion_mc_name, this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.wayPointArr[this.wayPointArr.length - 1]._x; this.explosionMC._y = this.wayPointArr[this.wayPointArr.length - 1]._y; if (this.wildCard.bioload && (_global.model.getCityByID(this.tr._city)).bioload_in_battle) { _global.view.createBioCloud(_global.model.getCityByID(this.tr._city)); } this.killUnit(undefined); break; case 'rocket_explode_city_from_sub': _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); _global.explosion_sound_by_mc_name(this.explosion_mc_name, this.MC._x); this.explosionMC = this.container.attachMovie(this.explosion_mc_name, this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.wayPointArr[this.wayPointArr.length - 1]._x; this.explosionMC._y = this.wayPointArr[this.wayPointArr.length - 1]._y; if (this.wildCard.bioload && (_global.model.getCityByID(this.tr._city)).bioload_in_battle) { _global.view.createBioCloud(_global.model.getCityByID(this.tr._city)); } this.killUnit(undefined); break; case 'bomb': _global.explosion_sound_by_mc_name(this.explosion_mc_name, this.MC._x); _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); this.action = 'flyOff'; this.explosionMC = this.container.attachMovie(this.explosion_mc_name, this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.wayPointArr[this.wayPointArr.length - 1]._x; this.explosionMC._y = this.wayPointArr[this.wayPointArr.length - 1]._y + 100; if (this.wildCard.bioload && (_global.model.getCityByID(this.wildCard.city)).bioload_in_battle) { _global.view.createBioCloud(_global.model.getCityByID(this.wildCard.city)); } this.removeTrail(); break; case 'ship_plane_bomb': _global.presenter.updateSingleCity_byID(this.wildCard._city, this.wildCard._casualties); this.action = 'flyOff'; if (!this.explosion_mc_name) { this.explosion_mc_name = 'explosion_warhead_1'; } _global.explosion_sound_by_mc_name(this.explosion_mc_name, this.MC._x); this.explosionMC = this.container.attachMovie(this.explosion_mc_name, this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.wayPointArr[this.wayPointArr.length - 1]._x; this.explosionMC._y = this.wayPointArr[this.wayPointArr.length - 1]._y + 104; if (this.wildCard.bioload && (_global.model.getCityByID(this.wildCard.city)).bioload_in_battle) { _global.view.createBioCloud(_global.model.getCityByID(this.wildCard.city)); } this.removeTrail(); break; case 'heli_unload': this.activeAndMoving = true; this.soundAction('apache_flyOff'); if (!this.heli_unload_initial_y) { this.heli_unload_initial_y = this.MC._y; } if (this.curY < this.heli_unload_initial_y + 20) { this.curY += 2; this.shadowYOffset -= 2; } if (this.unloadTimer >= 10) { this.resetTailUnload('flyOff'); } else { ++this.unloadTimer; } break; case 'unload': this.soundAction('boat_stop'); this.tintMC._x = this.MC._x; this.tintMC._y = this.MC._y; this.activeAndMoving = false; if (this.unloadTimer == 0 && this.unloadNum == 0 && !this.bool1) { this.bool1 = true; this.MC.removeMovieClip(); this.tintMC.removeMovieClip(); this.MC = this.container.attachMovie('boat001_still', this.unitName, this.depth_); this.tintMC = this.container.attachMovie('boat001_still_tint', 'tint' + this.unitName, this.MC.getDepth() + 1); this.tintMC._x = this.prevX; this.tintMC._y = this.prevY; this.colorObj = new Color(this.tintMC); this.colorObj.setTransform(this.colorTrans); } if (this.unloadTimer >= 10 && this.unloadNum < 5) { this.resetTailUnload('stop'); this.MC.gotoAndStop(this.unloadNum + 2); this.tintMC.gotoAndStop(this.unloadNum + 2); } else { ++this.unloadTimer; } break; case 'flyOff': if (this.unitID == 'boat001') { this.action = 'stop'; } else { if (this.curCountToStop <= 0) { this.activeAndMoving = true; } else { if (this.curCountToStop < this.countDownToStop) { ++this.curCountToStop; } else { if (this.curCountToStop >= this.countDownToStop) { this.sound.stop(); delete this.sound; this.action = 'stop'; } } } ++this.curCountToStop; if (this.sound.getVolume() > 0) { this.sound.setVolume(this.sound.getVolume() - 2); } break; case 'liftOff': break; case 'taxi_a': if (this.TAXI_COUNT_MAX > this.cur_taxi_count) { ++this.cur_taxi_count; this.curX += 0.2; this.curY -= 0.5; } else { this.action = 'liftOff'; } break; case 'taxi_b': if (this.TAXI_COUNT_MAX > this.cur_taxi_count) { ++this.cur_taxi_count; this.curX -= 0.2; this.curY -= 0.5; } else { this.action = 'liftOff'; } break; case 'plane_circular_flight': if (this.plane_airTime > 70) { this.action = 'default'; } ++this.plane_airTime; break; case 'sub_rocket_launch': if (this.sub_launch_timer > 34) { this.action = 'default'; this.soundAction('rocket_launch'); } else { ++this.sub_launch_timer; } } } if ((this.mcID == 'plane001' || this.mcID == 'plane002' || this.mcID == 'ship_plane') && this.activeAndMoving && this.action != 'taxi_a' && this.action != 'taxi_b' && this.action != 'waitForLiftOff') { if (this.PLANE_COUNT_TO_FREE_FLIGHT > this.cur_count_to_free_flight) { ++this.cur_count_to_free_flight; this.soundAction(this.mcID + '_takeOff'); } else { if (this.shadowYOffset < 90) { this.shadowYOffset += 2; } } } if (this.activeAndMoving) { ++this.framesActive; if (this.framesActive == this.trailCountDown) { this.trailActive = true; } if (!this.rocket_follow_ellipse && !this.rocket_do_drop && this.action != 'heli_unload' && this.action != 'taxi_a' && this.action != 'taxi_b' && this.action != 'plane_circular_flight') { this.setStep(); this.prevX = this.curX; this.prevY = this.curY; this.curX += this.xStep; this.curY += this.yStep; } else { if (this.rocket_follow_ellipse) { this.ellipse_step(); } else { if (this.rocket_do_drop) { this.rocket_drop(); } } } if (this.action != 'taxi_a' && this.action != 'taxi_b') { this.updateTrail(); } if (this.atTarget) { this.action = this.wayPointArr[this.curWayPoint]._type; ++this.curWayPoint; this.atTarget = false; } if (this.action == 'plane_circular_flight') { --this.plane_countdown_default; if (!this.plane_angle_center) { this.plane_angle_center = [this.curX + this.plane_circular_modifier[0], this.curY + this.plane_circular_modifier[1]]; } this.setStep(); this.plane_circular_step(); if (this.distanceBetween([this.targetX, this.targetY], this.__get__plane_coords_at_cur_direction()) < 40 && this.plane_countdown_default < 0) { this.action = 'default'; } } } else { if (!this.activeAndMoving) { if (this.mcID == 'soldier001') { if (this.tail.action == 'unload' && this.tail.unloadNum == this.tailNum) { this.action = 'default'; this.prevX = this.tail.curX; this.prevY = this.tail.curY; this.curX = this.wayPointArr[0]._x + _global.model.tools.randRange(0, 5); this.curY = this.wayPointArr[0]._y + _global.model.tools.randRange(0, 5); this.frameOffset = _global.model.tools.randRange(0, 6); this.MC._visible = true; this.tintMC._visible = true; this.activeAndMoving = true; this.tail = false; this.range = _global.model.tools.randRange(5, 8); this.traceMe = true; this.soundAction('soldier_running'); } } else { if (this.mcID == 'marine') { if (this.tail.action == 'heli_unload' && this.tail.unloadNum == this.tailNum) { this.prevX = this.tail.curX; this.prevY = this.tail.curY; this.curX = this.wayPointArr[0]._x + _global.model.tools.randRange(0, 20); this.frameOffset = _global.model.tools.randRange(0, 6); this.curY = this.wayPointArr[0]._y + _global.model.tools.randRange(0, 15); this.MC._visible = true; this.tintMC._visible = true; this.activeAndMoving = true; this.tail = false; this.range = _global.model.tools.randRange(5, 10); this.soundAction('marine_running'); } } else { if (this.mcID == 'tank_noShade') { if (this.action == 'tail' && this.tail.action != 'drop') { this.prevX = this.curX; this.prevY = this.curY; this.curX = this.tail.curX + 2; this.curY = this.tail.curY + 30; this.MC.gotoAndStop(this.__get__unitDirection()); } else { if (this.tail.action == 'drop') { this.unit_live_countdown_status = true; this.tail.soundAction('chinook_flyOff'); if (this.dropDistance > this.dropCount) { ++this.dropCount; this.curY += 2; this.MC.shadowMC._y -= 2; this.MC.shadowMC._visible = true; } else { this.MC.removeMovieClip(); this.MC = this.container.attachMovie('tankBase', this.unitName, this.depth_); this.soundAction('tank_drive'); this.activeAndMoving = true; this.tail.action = 'flyOff'; this.tail = undefined; } } } } else { if (this.mcID == 'tankTop') { this.curX = this.tail.curX; this.curY = this.tail.curY; if (this.action != 'tank_top_shoot') { this.MC.gotoAndStop(this.__get__tankTopDirection() * 2 - 1); if (this.tail.action == 'stop') { this.action = 'stop'; } } } } } } } } }; v2.setStep = function () { if (isNaN(this.curX)) { this.curX = this.MC._x; } if (isNaN(this.curY)) { this.curY = this.MC._y; } if (!this.tail) { this.targetX = this.wayPointArr[this.curWayPoint]._x; this.targetY = this.wayPointArr[this.curWayPoint]._y; } else { this.targetX = this.tail.curX; this.targetY = this.tail.curY; } if (this.targetX > this.curX) { this.xDist = this.targetX - this.curX; this.xTargetStep = Math.floor((this.step / 100) * ((100 / (this.xDist + this.yDist)) * this.xDist)); if (this.xTargetStep > this.xStep && !this.instantTurn) { this.xStep += this.x_multiplier; } } else { this.xDist = this.curX - this.targetX; this.xTargetStep = Math.floor((this.step / 100) * ((100 / (this.xDist + this.yDist)) * this.xDist)) * -1; if (this.xTargetStep < this.xStep && !this.instantTurn) { this.xStep -= this.x_multiplier; } } if (this.targetY > this.curY) { this.yDist = this.targetY - this.curY; this.yTargetStep = Math.floor((this.step / 100) * ((100 / (this.xDist + this.yDist)) * this.yDist)); if (this.yTargetStep > this.yStep && !this.instantTurn) { this.yStep += this.y_multiplier; } } else { this.yDist = this.curY - this.targetY; this.yTargetStep = Math.floor((this.step / 100) * ((100 / (this.xDist + this.yDist)) * this.yDist)) * -1; if (this.yTargetStep < this.yStep && !this.instantTurn) { this.yStep -= this.y_multiplier; } } if (this.instantTurn) { this.xStep = this.xTargetStep; this.yStep = this.yTargetStep; } if (this.curX < this.targetX + this.range && this.curX > this.targetX - this.range && this.curY < this.targetY + this.range && this.curY > this.targetY - this.range) { this.atTarget = true; } if (this.mcID == 'rocket' || this.mcID == 'sub_rocket') { if (this.action == 'default' && this.MC.maskMC) { this.MC.maskMC._x -= this.yStep; } else {} } if (this.mcID == 'apache') { if (this.MC._xscale < 100) { this.MC._xscale += 1; this.MC._yscale = this.MC._xscale; this.tintMC._yscale = this.MC._yscale; this.tintMC._xscale = this.MC._yscale; } if (this.action == 'liftOff' && this.heli_direction_set == 2) { this.prevY = this.fixedPrevY; this.prevX = this.fixedPrevX; this.MC.gotoAndStop(this.fixedFrame); if (this.apache_liftOffCount < this.apache_liftOffCountMax - 8) { this.xStep = 0; this.yStep = -3; } else { this.xStep = 0; this.yStep = -1; } this.shadowYOffset -= this.yStep; ++this.apache_liftOffCount; if (this.apache_liftOffCount >= this.apache_liftOffCountMax) { this.action = 'default'; } } if (this.heli_direction_set < 2) { ++this.heli_direction_set; this.fixedFrame = this.unitDirection; this.fixedPrevX = this.curX; this.fixedPrevY = this.curY; } } if (this.mcID == 'chinook') { if (this.action == 'liftOff') { this.action = 'default'; } } this.updatePan(); }; v2.deg2rad = function (degree) { return degree * 0.0174532925199433; }; v2.rocket_drop = function () { this.prevX = this.curX; this.prevY = this.curY; this.curY += 10; this.targetY = this.wayPointArr[this.curWayPoint]._y; if (this.curY >= this.targetY - 20) { this.atTarget = true; } }; v2.ellipse_step = function () { var v2 = this.deg2rad(this.ellipseAngle); this.prevX = this.curX; this.prevY = this.curY; this.curX = this.ellipseCenterX + this.ellipseRadiusX * Math.cos(v2); this.curY = this.ellipseCenterY + this.ellipseRadiusY * Math.sin(v2); this.ellipseAngle += Math.round((this.xStep + this.yStep) / 1.5) * this.ellipseDirectionMultiplier; this.ellipseAngle %= 360; if (this.ellipseDirectionMultiplier == -1 && (this.ellipseAngle >= this.ellipseTargetAngle || this.ellipseAngle < 50) || this.ellipseDirectionMultiplier == 1 && (this.ellipseAngle <= this.ellipseTargetAngle || this.ellipseAngle < -180)) { this.rocket_follow_ellipse = false; this.rocket_do_drop = true; } this.MC.maskMC._x += 1; }; v2.randRange = function (min, max) { var v1 = Math.floor(Math.random() * (max - min + 1)) + min; return v1; }; v2.resetTailUnload = function (param_next) { ++this.unloadNum; this.unloadTimer = 0; if (this.unloadNum == this.unloadMax) { switch (param_next) { case 'flyOff': this.action = 'flyOff'; this.activeAndMoving = true; break; case 'stop': this.action = 'stop'; } } }; v2.__get__tankTopDirection = function () { this.adjside = this.wayPointArr[0]._x - this.curX; this.oppside = -1 * (this.wayPointArr[0]._y - this.curY); this.angle = Math.atan2(this.oppside, this.adjside); this.angle = Math.round((this.angle / Math.PI) * 180); this.angle += 181; this.frame = Math.round(((this.angle / 360) * 100 / 100) * this.frameCount); return this.frame; }; v2.__get__unitDirection = function () { this.adjside = this.curX - this.prevX; this.oppside = -1 * (this.curY - this.prevY); this.angle = Math.atan2(this.oppside, this.adjside); this.angle = Math.round((this.angle / Math.PI) * 180); this.angle += 181; var v2 = true; if (this.instantTurn && this.mcID != 'soldier001') { if (this.prev_prev_angle == this.prev_angle && this.prev_angle != this.angle) { v2 = true; } else { v2 = false; } } this.prev_prev_angle = this.prev_angle; this.prev_angle = this.angle; if (v2) { this.frame = Math.round(((this.angle / 360) * 100 / 100) * this.frameCount); } if (this.mcID == 'suicide_bomber' && !this.activeAndMoving) { this.frame = 50; } if (this.mcID == 'apache') { if (this.frameFixedAfterLiftOff < 3 && this.action != 'liftOff') { ++this.frameFixedAfterLiftOff; this.frame = this.fixedFrame; } } this.prev_targetX = this.targetX; return this.frame; }; v2.__get__rocketRotation = function () { this.adjside = this.curX - this.prevX; this.oppside = -1 * (this.curY - this.prevY); this.angle = Math.atan2(this.oppside, this.adjside); this.angle = Math.round((this.angle / Math.PI) * 180); this.angle += 181; return this.angle * -1; }; v2.__get__anti_distance = function () { var v2 = Math.sqrt((this.curX - this.anti_pos[0]) * (this.curX - this.anti_pos[0]) + (this.curY - this.anti_pos[1]) * (this.curY - this.anti_pos[1])); return v2; }; v2.__get__anti_direction = function () { var v4 = this.curX - this.anti_pos[0]; var v2 = -1 * (this.curY - this.anti_pos[1]); this.angle = Math.atan2(v2, v4); this.angle = Math.round((this.angle / Math.PI) * 180); this.angle += 181; var v3 = Math.round(((this.angle / 360) * 100 / 100) * 18); return v3; }; v2.__get__plane_distance_to_target = function () { this.targetX = this.wayPointArr[this.curWayPoint]._x; this.targetY = this.wayPointArr[this.curWayPoint]._y; var v2 = Math.sqrt((this.curX - this.targetX) * (this.curX - this.targetX) + (this.curY - this.targetY) * (this.curY - this.targetY)); return v2; }; v2.__get__plane_coords_at_cur_direction = function () { var v4 = this.curX - this.prevX; var v3 = -1 * (this.curY - this.prevY); var v2 = Math.atan2(this.adjside, this.oppside) + 5; this.plane_potential_target_x = Math.cos(v2) * this.__get__plane_distance_to_target() + this.curX; this.plane_potential_target_y = Math.sin(v2) * this.__get__plane_distance_to_target() + this.curY; return [this.plane_potential_target_x, this.plane_potential_target_y]; }; v2.distanceBetween = function (_arr1, _arr2) { var v3 = Math.sqrt((_arr1[0] - _arr2[0]) * (_arr1[0] - _arr2[0]) + (_arr1[1] - _arr2[1]) * (_arr1[1] - _arr2[1])); return v3; }; v2.distanceTo = function (_arr) { var v3 = _arr[0]; var v2 = _arr[1]; var v4 = Math.sqrt((this.curX - v3) * (this.curX - v3) + (this.curY - v2) * (this.curY - v2)); return v4; }; v2.plane_circular_step = function () { this.prevX = this.curX; this.prevY = this.curY; var v2 = this.plane_cur_angle_in_circular_flight * Math.PI / 180; this.curX = this.plane_angle_center[0] + this.plane_circular_radius * Math.cos(v2); this.curY = this.plane_angle_center[1] + this.plane_circular_radius * Math.sin(v2); this.plane_cur_angle_in_circular_flight %= 360; this.plane_circular_radius -= 0.5; this.plane_cur_angle_in_circular_flight += 8 * this.plane_angle_step; }; v2.satellite_explosion = function () { if (!this.satellite_eplosion_initiated) { this.satellite_eplosion_initiated = true; this.explosionMC = this.container.attachMovie('explosion_warhead_4', this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.wildCard.cityX; this.explosionMC._y = this.wildCard.cityY; _global.presenter.updateSingleCity_byID(this.tr._city, this.tr._casualties); } }; v2.killUnit = function (_explosionType) { this.removeTrail(); this.sound.stop(); this.action = 'dying'; this.MC.removeMovieClip(); this.shadowMC.removeMovieClip(); this.tintMC.removeMovieClip(); if (_explosionType) { switch (_explosionType) { case 'rocket_self': this.explosionMC = this.container.attachMovie('explosion003', this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.curX; this.explosionMC._y = this.curY; break; default: this.explosionMC = this.container.attachMovie('explosion001', this.unitName + 'explosion', this.container.getNextHighestDepth()); this.explosionMC._x = this.curX; this.explosionMC._y = this.curY; } } this.unitStatus = 'dead'; if (this.anti_type) { this.anti_offset = 2; _global.view.updateAnti(this); } }; v2.removeUnit = function () {}; v2.removeTrail = function () { this.trailActive = false; if (this.trailSize > 0) { var v2 = 0; while (v2 < this.trailSize + 5) { if (this.container[this.unitName + 'trailLeft' + v2]) { this.container[this.unitName + 'trailLeft' + v2].removeMovieClip(); this.container[this.unitName + 'trailRight' + v2].removeMovieClip(); } else { if (this.container[this.unitName + 'trail' + v2]) { this.container[this.unitName + 'trail' + v2].removeMovieClip(); } } ++v2; } } }; v2.updateTrail = function () { this.bool1 = false; this.bool2 = false; this.bool3 = false; this.bool4 = false; var v3 = 0; while (v3 < this.trailSize) { if (this.trailCount == 2) { if (this.trailActive) { if (!this.container[this.unitName + 'trailLeft' + v3] && !this.trailArr[v3] && !this.bool1) { var v14 = this.container.attachMovie('trail', this.unitName + 'trailLeft' + v3, this.container.getNextHighestDepth()); var v11 = this.container.attachMovie('trail', this.unitName + 'trailRight' + v3, this.container.getNextHighestDepth()); this.trailArr[v3] = true; this.bool1 = true; var v6 = this.container[this.unitName + 'trailLeft' + v3]; var v5 = this.container[this.unitName + 'trailRight' + v3]; var v10 = ((this.angle - 90) / 180) * Math.PI * -1; var v9 = ((this.angle + 90) / 180) * Math.PI * -1; v6._alpha -= _global.model.tools.randRange(this.trailSize - v3, 100 - v3); v5._alpha -= _global.model.tools.randRange(this.trailSize - v3, 100 - v3); v6._x = this.curX + Math.cos(v10) * 15; v6._y = this.curY + Math.sin(v10) * 15; v5._x = this.curX + Math.cos(v9) * 15; v5._y = this.curY + Math.sin(v9) * 15; v6._sizePlus = _global.model.tools.randRange(1, 2); v6._alphaMin = _global.model.tools.randRange(1, 4); v5._sizePlus = _global.model.tools.randRange(1, 2); v5._alphaMin = _global.model.tools.randRange(1, 4); } } if (this.container[this.unitName + 'trailLeft' + v3]) { v6 = this.container[this.unitName + 'trailLeft' + v3]; v5 = this.container[this.unitName + 'trailRight' + v3]; v6._height += v6._sizePlus; v6._width += v6._sizePlus; v6._alpha -= v6._alphaMin; if (v6._alpha <= 0) { v6.removeMovieClip(); v5.removeMovieClip(); } v5._height += v5._sizePlus; v5._width += v5._sizePlus; v5._alpha -= v5._alphaMin; if (v5._alpha <= 0) { v6.removeMovieClip(); v5.removeMovieClip(); } } } else { if (this.trailCount == 1) { --this.countDown_to_rocket_smoke; if (this.trailActive && (this.mcID == 'rocket' && this.countDown_to_rocket_smoke <= 0 || this.mcID != 'rocket')) { if (!this.container[this.unitName + 'trail' + v3] && !this.trailArr[v3] && !this.bool4 && this.action != 'rocket_follow_ellipse' && this.action != 'rocket_follow_ellipse_with_anti') { this.trailArr[v3] = true; this.bool1 = true; if (this.bool1 && !this.bool2) { this.bool2 = true; } else { if (this.bool2 && !this.bool3) { this.bool3 = true; } else { if (this.bool3 && !this.bool4) { this.bool4 = true; } } } var v4 = this.container.attachMovie('trail', this.unitName + 'trail' + v3, this.container.getNextHighestDepth()); v4._height = 8; v4._width = 8; v4.stop(); if (v3 == this.trailSize) { } var v9 = (this.angle / 180) * Math.PI * -1; var v13 = _global.model.tools.randRange(20, 45); var v12 = _global.model.tools.randRange(28, 32); if (this.mcID == 'rocket' || this.mcID == 'sub_rocket') { var v8 = {'x': this.MC.smokeBase._x, 'y': this.MC.smokeBase._y}; this.MC.localToGlobal(v8); v4._x = v8.x + 4; v4._y = v8.y; } else { if (this.mcID == 'ship_plane') { v4._x = this.curX + Math.cos(v9) * this.trail_offset; v4._y = this.curY + 5 + Math.sin(v9) * this.trail_offset; } else { v4._x = this.prevX; v4._y = this.prevY; } } v4._sizePlus = _global.model.tools.randRange(5, 11); v4._alphaMin = _global.model.tools.randRange(3, 15); v4._sizePlus /= 12; v4._alphaMin /= 3; v4._alpha = _global.model.tools.randRange(this.trailSize - v3, 100 - v3); } } if (this.container[this.unitName + 'trail' + v3]) { var v7 = this.container[this.unitName + 'trail' + v3]; v7._height += v7._sizePlus; v7._width += v7._sizePlus; v7._alpha -= v7._alphaMin; if (this.mcID == 'rocket') { v7._y -= 0.3; } if (v7._alpha <= 0) { v7.removeMovieClip(); } } } } ++v3; } }; v2.startSound = function () { if (!this.soundPlaying) { this.soundAction(this.startSoundAction); this.soundPlaying = true; } }; v2.__get__soundPan = function () { return Math.round((this.MC._x / 8 - 50) * 2); }; v2.updatePan = function () { this.sound.setPan(this.__get__soundPan()); }; v2.plane_flight_sound = function () { this.soundAction(this.mcID + '_flight'); }; v2.sound_anti_shoot = function (mc) { if (this.anti_shoot_sound.done || !this.anti_shoot_sound) { this.anti_shoot_sound = new Anti_sound(mc); this.anti_shoot_sound.done = false; if (_global.model.option.playSound) { if (this.anti_type == 'air') { this.anti_shoot_sound.attachSound('building_Anti air gun.wav'); this.anti_shoot_sound.start(0, 8); } else { this.anti_shoot_sound.attachSound('building_Anti rocket fire 4.wav'); this.anti_shoot_sound.start(); } this.anti_shoot_sound.onSoundComplete = function () { this.attachSound(''); this.done = true; }; } } }; v2.sound_anti = function (_str, x) { if (!_global.model.option.playSound) { return undefined; } if (!this.anti_sound) { var v3 = _global.view.srcMC.createEmptyMovieClip('sound_mc', _global.view.srcMC.getNextHighestDepth()); this.anti_sound = new Anti_sound(v3); _global.model.playedSounds_arr.push({'soundObj': this.anti_sound, 'mc': v3}); } if (this.anti_type == 'air' && !this.anti_sound.curSound) { this.anti_sound.curSound = 'rotate_anti'; this.anti_sound.attachSound('building_Anti air rotate.wav'); this.anti_sound.onSoundComplete = function () { this.curSound = undefined; }; this.anti_sound.start(); } else { if (this.anti_type == 'rocket' && !this.anti_sound.curSound) { this.anti_sound.curSound = 'rotate_anti'; this.anti_sound.attachSound('building_Anti air rotate.wav'); this.anti_sound.onSoundComplete = function () { this.curSound = undefined; }; this.anti_sound.start(); } } }; v2.soundAction = function (_str) { if (this.lastPlayedSoundAction != _str && _global.model.option.playSound) { this.lastPlayedSoundAction = _str; switch (_str) { case 'boat_start': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Soldier Motorboat loop.wav'); this.sound.start(0, 999); break; case 'boat_stop': this.sound.stop(); delete this.sound; break; case 'soldier_running': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Soldier running.wav'); this.sound.start(0, 999); break; case 'soldier_shoot': this.sound.stop(); delete this.sound; this.sound = new Sound(this.MC); this.sound.attachSound('unit_Soldier gun.wav'); this.sound.start(0, 11); break; case 'marine_running': this.sound = new Sound(this.MC); this.sound.attachSound('unit_seal running.wav'); this.sound.start(0, 999); break; case 'marine_shoot': this.sound.stop(); delete this.sound; this.sound = new Sound(this.MC); this.sound.attachSound('unit_seal gun.wav'); this.sound.start(0, 5); break; case 'apache_start': this.sound = new Sound(this.MC); this.sound.attachSound('unit_seal chopper.wav'); this.sound.start(0, 999); break; case 'apache_flyOff': this.sound.stop(); delete this.sound; this.sound = new Sound(this.MC); this.sound.attachSound('unit_seal chopper.wav'); this.sound.start(0, 2); break; case 'chinook_start': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Tank chopper.wav'); this.sound.start(0, 999); break; case 'chinook_flyOff': this.sound.stop(); delete this.sound; this.sound = new Sound(this.MC); this.sound.attachSound('unit_Tank chopper.wav'); this.sound.start(0, 2); break; case 'tank_drive': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Tank.wav'); this.sound.start(0, 6); break; case 'tank_shoot': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Tank gun.wav'); this.sound.start(0, 2); break; case 'tank_stop': this.sound.stop(); delete this.sound; break; case 'suicide_scream': this.sound.stop(); delete this.sound; this.sound = new Sound(this.MC); this.sound.attachSound('unit_Suicide scream.wav'); this.sound.start(); break; case 'suicide_explode': this.sound.start(); break; case 'rocket_launch': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Warrocket.wav'); this.sound.start(); break; case 'plane001_takeOff': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Fightertakeoff.wav'); this.sound.start(); this.sound.onSoundComplete = function () { this.attachSound('unit_fighterflight.wav'); this.start(); }; break; case 'plane001_flight': break; case 'plane002_takeOff': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Carrierjet take off.wav'); this.sound.start(); this.sound.onSoundComplete = function () { this.attachSound('unit_Carrierjet flight.wav'); this.start(0, 999); }; break; break; case 'plane002_flight': case 'ship_plane_takeOff': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Fightertakeoff.wav'); this.sound.start(); this.sound.onSoundComplete = function () { this.attachSound('unit_fighterflight.wav'); this.start(); }; break; case 'sat_laser': this.sound = new Sound(this.MC); this.sound.attachSound('unit_Sattelite Lasershot.wav'); this.sound.start(); this.sound.onSoundComplete = function () { this.attachSound('Sattelite attack.wav'); this.start(); this.onSoundComplete = function () {}; }; break; case '_': } } }; v2.debug = false; v2.liftOff = false; v2.maxShotCount = 10; v2.depthSet = false; v2.depthSwap = false; v2.scale_up = false; v2.scale_down = false; v2.trailCountDown = 0; v2.bool1 = false; v2.bool2 = false; v2.bool3 = false; v2.bool4 = false; v2.apache_liftOffCount = 0; v2.apache_liftOffCountMax = 25; v2.heliStartPlusX = 0; v2.heliStartPlusY = 0; v2.suicide_commando_wait_countDown_max = 25; v2.suicide_commando_wait_countDown_cur = 0; v2.rocket_follow_ellipse = false; v2.rocket_do_drop = false; v2.anti_fire_start_distance = 25; v2.shadowStartAlpha = 100; v2.shadowStartAtUnitBase = false; v2.heli_direction_set = 0; v2.frameFixedAfterLiftOff = 0; v2.TAXI_COUNT_MAX = 30; v2.cur_taxi_count = 0; v2.PLANE_COUNT_TO_FREE_FLIGHT = 8; v2.cur_count_to_free_flight = 0; v2.plane_cur_angle_in_circular_flight = 100; v2.plane_cur_angle_on_map = 0; v2.plane_potential_target_x = 0; v2.plane_potential_target_y = 0; v2.plane_circular_flight_center_x = 0; v2.plane_circular_flight_center_y = 0; v2.PLANE_COUNTDOWN_TO_SET_DIRECTION_MAX = 5; v2.plane_cur_countdown_to_set_direction = 0; v2.plane_circular_radius = 100; v2.countDown_antiStart = 50; v2.satellite_lineAlphaStart = 0; v2.satellite_alphaPlus = true; v2.satellite_eplosion_initiated = false; v2.soundPlaying = false; v2.instantTurn = false; v2.floorFrame = false; v2.prev_angle = 0; v2.prev_prev_angle = 0; v2.plane_countdown_default = 6; v2.cancelBib = false; v2.max_unit_live = 5000; v2.cur_unit_live = 0; v2.unit_live_countdown_status = false; v2.traceMe = false; v2.countDown_to_rocket_smoke = 500; v2.plane_circFlight_frames_count = 0; v2.sub_launch_timer = 0; v2.trail_offset = 20; v2.has_fired_laser_sound = false; v2.tank_preshot_count = 0; v2.plane_airTime = 0; v2.addProperty('anti_direction', v2.__get__anti_direction, function () {}); v2.addProperty('anti_distance', v2.__get__anti_distance, function () {}); v2.addProperty('appMC_depth', v2.__get__appMC_depth, v2.__set__appMC_depth); v2.addProperty('plane_coords_at_cur_direction', v2.__get__plane_coords_at_cur_direction, function () {}); v2.addProperty('plane_distance_to_target', v2.__get__plane_distance_to_target, function () {}); v2.addProperty('rocketRotation', v2.__get__rocketRotation, function () {}); v2.addProperty('soundPan', v2.__get__soundPan, function () {}); v2.addProperty('tankTopDirection', v2.__get__tankTopDirection, function () {}); v2.addProperty('unitDirection', v2.__get__unitDirection, function () {}); ASSetPropFlags(_global.Unit.prototype, null, 1); } #endinitclip } movieClip 5247 __Packages.Anti_sound { #initclip if (!_global.Anti_sound) { var v1 = function () { super(); }; _global.Anti_sound = v1; _global.Anti_sound extends Sound; var v2 = v1.prototype; v2.done = true; ASSetPropFlags(_global.Anti_sound.prototype, null, 1); } #endinitclip } movieClip 5248 __Packages.AI_specialization { #initclip if (!_global.AI_specialization) { var v1 = function (_randomize) { if (_randomize) { var v3; v3 = _global.model.tools.randRange(1, 2); if (v3 == 1) { this.p_carrier = 'rocket'; } else { this.p_carrier = 'plane'; } v3 = _global.model.tools.randRange(1, 2); if (v3 == 1) { this.p_common_payload = 'warhead'; } else { this.p_common_payload = 'bioload'; } v3 = _global.model.tools.randrange(1, 3); if (v3 == 1) { this.p_special_unit = 'submarine'; } else { if (v3 == 2) { this.p_special_unit = 'carrier'; } else { this.p_special_unit = 'space'; } } } }; _global.AI_specialization = v1; var v2 = v1.prototype; v2.create_desire_arr = function () { var v3 = new Array(); if (this.p_carrier == 'rocket') { v3.push(2, 2, 2, 5); } else { v3.push(0, 0, 0, 0); } if (this.p_common_payload == 'warhead') { v3.push(2, 2, 2, 5, 0, 0, 0, 0); } else { v3.push(0, 0, 0, 0, 2, 2, 2, 5); } if (_global.model.tools.randRange(1, 2) == 1) { v3.push(1, 1, 1, 5); } else { v3.push(0, 0, 0, 0); } v3.push(1, 1, 1, 5); if (this.p_carrier == 'plane') { v3.push(2, 5); } else { v3.push(0, 0); } if (this.p_special_unit == 1) { v3.push(5, 0, 0, 0); } else { if (this.p_special_unit == 2) { v3.push(1, 5, 0, 0); } else { v3.push(1, 1, 5, 5); } } this.desireArr = v3; }; v2.__set__carrier = function (_str) { this.p_carrier = _str; return this.__get__carrier(); }; v2.__get__carrier = function () { return this.p_carrier; }; v2.__set__common_payload = function (_str) { this.p_common_payload = _str; return this.__get__common_payload(); }; v2.__get__common_payload = function () { return this.p_common_payload; }; v2.__set__special_unit = function (_str) { this.p_special_unit = _str; return this.__get__special_unit(); }; v2.__get__special_unit = function () { return this.p_special_unit; }; v2.addProperty('carrier', v2.__get__carrier, v2.__set__carrier); v2.addProperty('common_payload', v2.__get__common_payload, v2.__set__common_payload); v2.addProperty('special_unit', v2.__get__special_unit, v2.__set__special_unit); ASSetPropFlags(_global.AI_specialization.prototype, null, 1); } #endinitclip } movieClip 5249 __Packages.DecisionPoints { #initclip if (!_global.DecisionPoints) { var v1 = function () {}; _global.DecisionPoints = v1; var v2 = v1.prototype; v2.DeciosionPoints = function () {}; v2.set_points_to_difficulty = function (a_nr) { switch (a_nr) { case 1: this.attack.base = 80; break; case 2: this.attack.base = 86; break; case 3: this.attack.base = 90; break; default: this.attack.base = 86; } }; v2.attack = new Object({'base': 89, 'retalBonus': 20}); v2.preCounter = new Object({'base': 86, 'lastAttackAB_bonus': 10, 'lastAttackBA_bonus': 10, 'minPopForBonus': 20, 'lowPopBonus': 10, 'otherTargetsBonus': 5}); v2.religion = new Object({'base': 40}); v2.propaganda = new Object({'base': 42, 'highReligionBonus': 10}); v2.diplomacy = new Object({'base': 60}); v2.resources = new Object({'base': 50, 'reserveBase': 25, 'maxFunds': 100}); v2.production = new Object({'base': 55, 'enemy_stock_bonus': 15}); v2.research = new Object({'base': 60, 'turnCap': 60, 'techTurnRatioMultiplier': 9}); ASSetPropFlags(_global.DecisionPoints.prototype, null, 1); } #endinitclip } movieClip 5250 __Packages.Tools { #initclip if (!_global.Tools) { var v1 = function () {}; _global.Tools = v1; var v2 = v1.prototype; v2.randRange = function (min, max) { var v1 = Math.floor(Math.random() * (max - min + 1)) + min; return v1; }; v2.reverse_string = function (a_str) { var v2 = new Array(); var v4 = ''; var v1 = a_str.length; while (v1 >= 0) { v2.push(a_str.charAt(v1)); --v1; } v1 = 0; while (v1 < v2.length) { v4 += v2[v1]; ++v1; } return v4; }; ASSetPropFlags(_global.Tools.prototype, null, 1); } #endinitclip } movieClip 5251 __Packages.View { #initclip if (!_global.View) { var v1 = function (param_model, param_presenter, param_srcMC, param_battleSrcMC) { var v2 = new Cloud(); this.model = param_model; AsBroadcaster.initialize(this.model._broadcaster); this.presenter = param_presenter; this.model._broadcaster.addListener(this); this.textFormats = new TextFormats(); this.srcMC = param_srcMC; this.srcMC.view = this; this.srcMC.bg.swapDepths(this.interfaceBGDepth); this.srcMC.infoText.swapDepths(this.infoTextDepth); this.srcMC.infoLine.swapDepths(this.scrollTextDepth); this.srcMC.statsMC.swapDepths(this.statBarDepth); this.srcMC.hatch46.swapDepths(this.exBtnSrcDepth); this.srcMC.btn49.swapDepths(this.exBtnOvrDepth); this.battleSrcMC = param_battleSrcMC; this.fadeClipsTicker = this.srcMC.createEmptyMovieClip('fadeClipsTicker', this.ticker2Depth); this.popupTicker = this.srcMC.createEmptyMovieClip('popupTicker', this.ticker3Depth); this.typeEffectTicker = this.srcMC.createEmptyMovieClip('typeEffectTicker', this.ticker4Depth); this.scrollTicker = this.srcMC.createEmptyMovieClip('scrollTicker', this.ticker5Depth); this.hatchTicker = this.srcMC.createEmptyMovieClip('hatchticker', this.ticker6Depth); AsBroadcaster.initialize(this.btnBroadcaster); this.actionTextMCArr = [undefined, this.srcMC.action_text_resources, this.srcMC.action_text_production, this.srcMC.action_text_research, this.srcMC.action_text_religion, this.srcMC.action_text_preAttack, this.srcMC.action_text_attack, this.srcMC.action_text_defense, this.srcMC.action_text_propaganda, this.srcMC.action_text_diplomacy]; }; _global.View = v1; var v2 = v1.prototype; v2.__set__clipSrc = function (param) { this._clipSrc = param; return this.__get__clipSrc(); }; v2.fadeClip = function (param_clip, param_targetAlpha, param_fade, param_amount, param_isStockBtn) { if (param_fade == 'unset') { if (param_clip._alpha > param_targetAlpha) { param_fade = 'out'; } else { param_fade = 'in'; } } if (this.fadeClipsArr.length == 0) { this.fadeClipsArr.push({'clip': param_clip, 'targetAlpha': param_targetAlpha, 'fade': param_fade, 'amount': param_amount, 'isStockBtn': param_isStockBtn}); this.fadeClipsTicker.onEnterFrame = function () { this.view = this._parent.view; var v9 = 0; var v3 = 0; while (v3 < this.view.fadeClipsArr.length) { var v4 = this.view.fadeClipsArr[v3].clip; var v5 = this.view.fadeClipsArr[v3].targetAlpha; var v6 = this.view.fadeClipsArr[v3].amount; var v7 = this.view.fadeClipsArr[v3].fade; var v8 = this.view.fadeClipsArr[v3].isStockBtn; if (v8) { ++v9; } if (v7 == 'in') { if (v5 > v4._alpha) { if (v4._alpha + v6 > v5) { v4._alpha = v5; } else { v4._alpha += v6; } } else { this.view.fadeClipsArr.splice(v3, 1); } } else { if (v7 == 'out') { if (v5 < v4._alpha) { if (v4._alpha - v6 < v5) { v4._alpha = v5; } else { v4._alpha -= v6; } } else { this.view.fadeClipsArr.splice(v3, 1); } } } ++v3; } if (_global.view.fadeStockActive && v9 == 0) { _global.view.fadeStockBtn_update(); _global.view.fadeStockActive = false; } if (_global.view.fadeClipsArr.length == 0 && !_global.view.fadeStockActive) { delete this.onEnterFrame; } }; } else { var v3 = 0; while (v3 < this.fadeClipsArr.length) { if (this.fadeClipsArr[v3].clip == param_clip) { this.fadeClipsArr.splice(v3, 1); break; } ++v3; } this.fadeClipsArr.push({'clip': param_clip, 'targetAlpha': param_targetAlpha, 'fade': param_fade, 'amount': param_amount, 'isStockBtn': param_isStockBtn}); } }; v2.updateView = function () { if (this.presenter.allow_curAction_approve()) { this.presenter.approveAction(); } this.updateCities(); }; v2.error = function (param1) { this.createMessageWindow('Error occured!', param1); }; v2.welcomeWindow = function () { this.createMessageWindow('Welcome', 'Welcome to the original World Domination II [tm] AI TEST application! '); }; v2.createMessageWindow = function (param_header, param_txt) { this._messageWindow = this._clipSrc.attachMovie('messageWindow', 'messageWindow', 9001); this._messageWindow._x = 238; this._messageWindow._y = 313; this._messageWindow.header.htmlText = param_header; this._messageWindow.drag.onPress = function () { this._parent._alpha = 75; this._parent.startDrag(); }; this._messageWindow.drag.onRelease = function () { this._parent._alpha = 100; this._parent.stopDrag(); }; this._messageWindow.fadeOutAndRemove = function () { this.onEnterFrame = function () { if (this._alpha > 0) { this._alpha -= 20; } else { if (this._alpha <= 0) { this.removeMovieClip(); } } }; }; this._messageWindow.btn.onPress = function () { this._parent.fadeOutAndRemove(); }; this._messageWindow.btn.onRollOver = function () { this.gotoAndStop(2); }; this._messageWindow.btn.onRollOut = function () { this.gotoAndStop(1); }; this._messageWindow.txt.htmlText = param_txt; }; v2.updateSingleCity = function (city, casualties) { city.size_and_frame_in_battle(casualties, true); }; v2.city_shrink_sequence = function (MC, p_targetFrame, extra_string, propaganda_count) { MC.targetFrame = p_targetFrame; MC.step = 1; MC.explosionPlayed = false; MC.extra_string = extra_string; MC.propaganda_count = propaganda_count; MC.randString = _global.model.tools.randRange(10000, 99999); MC.onEnterFrame = function () { if (!this.explosionPlayed) { if (!this.explosion) { this.explosion = this.attachMovie('explosion_dust', 'explosion_dust' + this.randString, this.getNextHighestDepth()); if (!this.explosion) { } this.explosion._x -= 10; this.explosion._y -= 3; this.explosion._yscale = 130; this.explosion._xscale = 130; _global.model.battle._toDeleteExplosionMC_arr.push(this.explosion); } this.explosionPlayed = true; this.explosion = undefined; } switch (this.step) { case 1: if (this._alpha > 0) { this._alpha -= 15; } else { this.step = 2; } break; case 2: this.gotoAndStop(this.targetFrame); if (this.extra_string == 'propaganda') { this.propagandaBeams.play(); if (this.propaganda_count > 1) { this.propagandaBeams2.gotoAndPlay(3); } } this.step = 3; break; case 3: if (this._alpha < 100) { this._alpha += 15; } else { delete this.onEnterFrame; } } }; }; v2.spawnCity = function (city, mapType) { city.image = city.mapMC.attachMovie(city.citySet, 'city' + city.num, city.image_depth); city.image.mc.obj = city; city.image.mc.btnSet = 'city'; city.image.mc.onPress = function () { _global.presenter.citySelect(this.obj); }; city.image._x = city.xPos; city.image._y = city.yPos; city.image.gotoAndStop(city.__get__size_and_frame()); city.image._yscale = 80; city.image._xscale = 80; city.debugTextField = city.image.debugTXT; city.debugTextField.text = 'pop.: ' + city.population; city.debugTextField.embedFonts = true; }; v2.update_flags = function () { var v3 = 0; while (v3 < 6) { this.battleSrcMC['flag' + v3].gotoAndStop('empty'); ++v3; } v3 = 0; while (v3 < this.model.playerArr.length) { if (!this.model.playerArr[v3].alive) { var v2 = this.model.playerArr[v3]; this.battleSrcMC['flag' + v3].gotoAndStop(this.model.playerArr[v2.lastAttackedBy_num].religion_code); var v4 = new Color(this.battleSrcMC['flag' + v3].tintMC); v4.setTransform(this.model.playerArr[v2.lastAttackedBy_num].playerColorTint1); } ++v3; } v3 = 0; while (v3 < this.model.activePlayerArr.length) { v2 = this.model.activePlayerArr[v3]; this.battleSrcMC['flag' + v2.playerNum].gotoAndStop(v2.religion_code); v4 = new Color(this.battleSrcMC['flag' + v2.playerNum].tintMC); v4.setTransform(v2.playerColorTint1); ++v3; } }; v2.remove_city_popups = function () { for (var v2 in this.model.human.cityArr) { this.model.human.cityArr[v2].image.citizensMovie.gotoAndStop(1); } }; v2.updateCities = function () { this.update_flags(); for (var v7 in this.model.playerArr) { for (var v6 in this.model.playerArr[v7].cityArr) { var v3 = this.model.playerArr[v7].cityArr[v6]; v3.image.gotoAndStop(v3.size_and_frame); v3.image.population = v3.population; if (this.model.playerArr[v7] == this.model.human) { v3.image.useHandCursor = false; v3.image.population = v3.population; v3.image.onRollOver = function () { if (_global.view.currentViewType == 'interface' && this.population > 0) { this.citizensMovie.gotoAndStop(2); this.citizensMovie.txt1.text = this.population; this.citizensMovie._yscale = 200; this.citizensMovie._xscale = 200; } }; v3.image.onRollOut = function () { this.citizensMovie.gotoAndStop(1); }; } else { v3.image.mc.roll_num = v7; v3.image.mc.onRollOver = function () { if (_global.view.currentViewType == 'interface') { _global.presenter_interface.roll_over_map(this.roll_num); } }; } v3.curCasualties = 0; v3.prevPopulation = v3.population; v3.explosion.removeMovieClip(); v3.explosion = undefined; v3.debugTextField.text = 'pop: ' + v3.population; if (!this.battleSrcMC['city' + v3.num]) { v3.setMapVars(this.battleSrcMC, this.smallMapCityDepthStart + v3.num, this.model.cityPositions[v7][v6][0], this.model.cityPositions[v7][v6][1]); v3.theme = v3.plr.buildingSet_id; this.spawnCity(v3, 'battleMap'); } if (v3.population < 0) { v3.population = 0; } if (v3._isSelected) { var v5; if (!v3.selectionMC) { v3.selectionMC = v3.mapMC.attachMovie('map_icon_crosshair', 'crosshair' + v3.cityID, v3.image_depth + this.citySelectionDepthStart); } v3.selectionMC._yscale = 200; v3.selectionMC._xscale = 200; v3.selectionObj.mcArray = []; if (v3.selectionObj.attack && !v3.selectionObj.attackMC) { v3.selectionObj.attackMC = v3.selectionMC.attachMovie('map_icon_soldier', 'map_icon_soldier', 1); v3.selectionObj.mcArray.push(v3.selectionObj.attackMC); } if (v3.selectionObj.preAttack && !v3.selectionObj.preAttackMC) { v3.selectionObj.preAttackMC = v3.selectionMC.attachMovie('map_icon_' + v3.selectionObj.preAttackWeapon, 'map_icon_pre', 2); v3.selectionObj.mcArray.push(v3.selectionObj.preAttackMC); } if (v3.selectionObj.propaganda && !v3.selectionObj.preAttackMC) { v3.selectionObj.propagandaMC = v3.selectionMC.attachMovie('map_icon_propaganda', 'map_icon_propaganda', 3); v3.selectionObj.mcArray.push(v3.selectionObj.propagandaMC); } if (v3.selectionObj.ship && v3.selectionObj.shipMC_arr.length != v3.selectionObj.shipCount) { var v4 = 0; while (v4 < v3.selectionObj.shipCount) { v5 = v3.selectionMC.attachMovie('map_icon_special', 'map_icon_special', v4 + 4); v3.selectionObj.shipMC_arr.push(v5); v3.selectionObj.mcArray.push(v5); ++v4; } } v3.alignSelectionMC(); } else { if (v3.hideForSelection) { v3.colorIMG_red = new Color(v3.image); v3.colorIMG_red.setTransform(_global.model.wd_colors.city_red); } else { if (v3.showForSelection && v3.population > 0) { v3.colorIMG_green = new Color(v3.image); v3.colorIMG_green.setTransform(_global.model.wd_colors.city_green); } else { v3.image._alpha = 100; v3.colorIMG_red = new Color(v3.image); v3.colorIMG_red.setTransform(_global.model.wd_colors._default); } } } if (v3.bioloaded && !v3.image.bioCloud_container) { this.createBioCloud(v3); } } } }; v2.resetActionBuildings = function () { var v3 = 0; while (v3 <= 4) { var v4 = _global.model.playerArr[v3]; if (v4.preAttackStatus != 'ready') { this.battleSrcMC['ab' + v3 + '_1'].gotoAndStop(1); this.battleSrcMC['ab' + v3 + '_2'].gotoAndStop(1); } else { if (v4.__get__preLocation() != 1) { this.battleSrcMC['ab' + v3 + '_1'].gotoAndStop(1); } else { if (v4.__get__preLocation() != 2) { this.battleSrcMC['ab' + v3 + '_2'].gotoAndStop(1); } } } ++v3; } }; v2.changeOver = function (_param) { clearInterval(this.presenter_interface.debug_automate_interval_ID); for (var v6 in this.model.playerArr) { var v3 = this.model.playerArr[v6]; var v4 = 0; while (v4 < v3.regardArr.length) { if (v3.regardArr[v4] > 100) { v3.regardArr[v4] = 100; } else { if (v3.regardArr[v4] < 0) { v3.regardArr[v4] = 0; } } ++v4; } if (v3.preAttackWeapon.weaponName == 'ship') { this.battleSrcMC['carrier' + v3.playerNum].gotoAndStop(2); } this.battleSrcMC['carrier' + v3.playerNum].gotoAndStop(v3.shipFrame); var v5 = new Color(this.battleSrcMC['carrier' + v3.playerNum].mc.carrier_tint); v5.setTransform(v3.playerColorTint1); } this.setMapFrames(); this.setFaceFrames(); this.curActionText('none'); this.presenter.remove_played_sound_objects(); switch (_param) { case 'toBattle': _global.model.satellite_sound_playing = false; this.view_interface.interfaceMC._visible = false; this.currentViewType = 'battle'; this.battleSrcMC._yscale = 100; this.battleSrcMC._xscale = 100; this.battleSrcMC._x = 0; this.battleSrcMC._y = 0; this.setABDepth(); _global.model.deselectCities('all'); if (this.presenter.check_ch_active('kill_all')) { this.presenter.explode_all(); } if (this.presenter.check_ch_active('tech')) { this.presenter.deactivate_ch('tech'); this.model.human.techTree.force_invent_tech_ch(); this.model.human.weaponStock.activateAll(); } if (this.presenter.check_ch_active('stock')) { this.presenter.deactivate_ch('stock'); this.model.human.weaponStock.max_stock(); } if (this.presenter.check_ch_active('cash')) { this.presenter.deactivate_ch('cash'); this.model.human.money = 1000; } if (this.presenter.check_ch_active('nessy')) { this.battleSrcMC.nessy.play(); } if (this.presenter.check_ch_active('orca')) { this.battleSrcMC.orca.play(); } if (this.presenter.check_ch_active('bush')) { this.presenter.deactivate_ch('bush'); this.presenter.explode_self(); } break; case 'toInterface': _global.view_interface.interfaceMC.shortMSG_textField.scroll = 0; this.model.active_ambient_sounds = new Array(); this.presenter_interface.blockAllBtns = false; this.view_interface.interfaceMC._visible = true; this.battleSrcMC._yscale = 46; this.battleSrcMC._xscale = 46; this.battleSrcMC._x = 205; this.battleSrcMC._y = 135; this.currentViewType = 'interface'; if (this.model.human.preAttackStatus == 'ready' || this.model.human.preAttackStatus == 'active') { this.model.__set__userSelectedActionBtn('preAttack'); } this.presenter_interface.removeBioClips(); this.presenter_interface.attachBioClips(); this.presenter.stop_continues_sound_objects(); this.presenter_interface.resetBtns(); _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_3', 5); break; case 'toPlayerLost': this.interface_before_end_game_sequence('lost'); break; case 'toPlayerWin': this.interface_before_end_game_sequence('win'); } }; v2.to_interface_timed_3 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); for (var v4 in _global.view_interface.actionBtn_arr) { var v3 = this.view_interface.actionBtn_arr[v4]; if (v3.actionName != this.model.human.turnAction_1.__get__action() && v3.actionName != this.model.human.turnAction_2.__get__action()) { v3.isSetAction = false; } else { if (!v3.isSetAction) { v3.__set__state(1); v3.updateBtn(); } } _global.view_interface.btn_arr[v4].pressed = false; } _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_3_A', 5); }; v2.to_interface_timed_3_A = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); this.model.deselectCities(this.model.__get__userSelectedActionBtn()); this.model.__set__userSelectedStockBtn(undefined); this.model.__set__userSelectedActionBtn(undefined); _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_3_B', 5); }; v2.to_interface_timed_3_B = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); this.model.resetUserSelections(); _global.model_interface.cur_pressed_action_btn = undefined; _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_3_C', 5); }; v2.to_interface_timed_3_C = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter_interface.updateView_debug_1(); }; v2.to_interface_timed_4 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); this.presenter_interface.update_leaderFaces(); }; v2.to_interface_timed_5 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_6', 5); }; v2.interface_before_end_game_sequence = function (a_status) { _level0.endGameMC.presenter_interface.blockAllBtns = true; this.view_interface.interfaceMC._visible = true; this.battleSrcMC._yscale = 46; this.battleSrcMC._xscale = 46; this.battleSrcMC._x = 205; this.battleSrcMC._y = 135; this.presenter_interface.updateView(); clearInterval(this.endgame_interval_1_id); this.endgame_interval_1_id = setInterval(this, 'end_game_sequence', 3000, a_status); this.presenter.stop_continues_sound_objects(); }; v2.end_game_sequence = function (a_status) { clearInterval(this.endgame_interval_1_id); _level0.endGameMC._visible = true; _level0.endGameMC.gotoAndStop(a_status); this.view_interface.interfaceMC._visible = false; this.endgame_interval_1_id = setInterval(this, 'end_game_sequence_2', 2000, a_status); }; v2.end_game_sequence_2 = function (a_status) { _root.hs_score = _global.model.human.score; clearInterval(this.endgame_interval_1_id); var v8; if (a_status == 'lost') { v8 = _level0.createEmptyMovieClip('loose_sound', _level0.getNextHighestDepth()); var v5 = new Sound(v8); v5.attachSound('Loose.Mp3'); v5.start(); } if (this.model.corrupt_highscore) { this.model.human.score = 0; } var v7 = new Object({'win': 'After killing most of the world\'s population, your country stands victorious in its quest for world domination. ', 'lost': 'Your country was destroyed. <br/> You lost the war for World Domination. '}); var v10 = new Object({'win': '', 'lost': ''}); _level0.endGameMC.gotoAndStop(a_status + 2); _level0.endGameMC.txt1.htmlText = v7[a_status]; _level0.endGameMC.txt2.text = 0; _level0.endGameMC.txt3.htmlText = ''; _level0.endGameMC.score_count = 0; _level0.endGameMC.satellite_multiplier_count = this.model.human.satellites_used; _level0.endGameMC.cur_satellite_count = 0; _level0.endGameMC.flag_bonus = 0; for (var v4 in this.model.playerArr) { if (this.model.playerArr[v4].lastAttackedBy_num == 0) { ++_level0.endGameMC.flag_bonus; } } _level0.endGameMC.cur_flag_bonus = 0; _level0.endGameMC.txt_1 = ''; _level0.endGameMC.txt_2 = ''; _level0.endGameMC.sound.stop(); _level0.endGameMC.sound = new Sound(_level0.endGameMC); _level0.endGameMC.sound.attachSound('Score counter.Mp3'); _level0.endGameMC.sound.start(0, 9999); _level0.endGameMC.cur_sequence = 1; _level0.endGameMC.winloose = a_status; _level0.endGameMC.count1 = 0; _level0.endGameMC.count2 = 0; if (!this.model.corrupt_highscore) { _level0.endGameMC.onEnterFrame = function () { switch (this.cur_sequence) { case 1: this.maxPlus = _global.model.human.score / 100; this.score_count += _global.model.tools.randRange(1, this.maxPlus); if (this.score_count >= _global.model.human.score) { this.score_count = _global.model.human.score; this.sound.stop(); this.cur_sequence = 2; } this.txt2.text = _global.presenter_interface.display_format_dot_notation(this.score_count); break; case 2: if (this.satellite_multiplier_count) { ++this.count1; if (this.count1 > 40) { this.sound.attachSound('Satelite multiplier.Mp3'); this.sound.start(); this.count1 = 0; ++this.cur_satellite_count; this.txt_1 = 'Space satellite multiplier: x ' + this.cur_satellite_count + ' <br/> '; } if (this.count1 == 2 && this.cur_satellite_count > 0) { this.txt2.text = ''; this.score_count *= 2; } if (this.count1 == 6 && this.cur_satellite_count > 0) { this.txt2.text = _global.presenter_interface.display_format_dot_notation(this.score_count); } if (this.cur_satellite_count == this.satellite_multiplier_count && this.count1 > 7) { this.cur_sequence = 3; } } else { this.cur_sequence = 3; } break; case 3: if (this.flag_bonus) { ++this.count2; if (this.count2 > 40) { this.sound.attachSound('Country domination bonus.Mp3'); this.sound.start(); this.count2 = 0; ++this.cur_flag_bonus; this.txt_2 = 'Flag bonus (250.000): x ' + this.cur_flag_bonus + ' <br/> '; } if (this.count2 == 2 && this.cur_flag_bonus > 0) { this.txt2.text = ''; this.score_count += 250000 * this.cur_flag_bonus; } if (this.count2 == 6 && this.cur_flag_bonus > 0) { this.txt2.text = _global.presenter_interface.display_format_dot_notation(this.score_count); } if (this.cur_flag_bonus == this.flag_bonus && this.count2 > 7) { delete this.onEnterFrame; } } else { this.cur_sequence = 4; } break; case 4: this.btnMC_submitScore.gotoAndStop(2); this.btnMC_submitScore.txtMC_submit.txt.text = 'Submit highscore'; this.btnMC_submitScore.btn_submit.onPress = function () { if (_global.model.get_demo_version_name() == 'Miniclip') { this._parent._parent.highscore.gotoAndStop(2); } if (_global.model.get_demo_version_name() == '2dplay') { _global.model.submit_2dplay_score(); } else { this._parent._parent.highscore.loadMovie('http://www.youdagames.com/highscores/flash.php'); this._parent._parent.fade_out._alpha = 55; } }; delete this.onEnterFrame; } _level0.endGameMC.txt3.htmlText = this.txt_1 + this.txt_2; }; } else { _level0.endGameMC.txt2.text = '!!CHEATED!!'; } if (_global.model.zs66hj8s) { _level0.endGameMC.demo_MC.txtMC_buy.txt.text = 'BUY FULL VERSION'; _level0.endGameMC.demo_MC.btn_buy.onPress = function () { _global.presenter_interface.btn_pressed_full(); }; } else { _level0.endGameMC.demo_MC._visible = false; } _level0.endGameMC.btn_website.onPress = function () { getURL(_global.model.full_version_url, '_blank'); }; _level0.endGameMC.txtMC_website.txt.text = 'Website'; _level0.endGameMC.txtMC_new.txt.text = 'New Game'; _level0.endGameMC.btn_new.onPress = function () { _global.presenter.btn_pressed_new_game(); }; }; v2.setMapFrames = function () { var v5 = 0; while (v5 < 6) { this.battleSrcMC['land0' + v5].gotoAndStop(1); this.battleSrcMC['water_overlay_' + v5].gotoAndStop(2); ++v5; } for (v5 in _global.model.playerArr) { var v3 = _global.model.playerArr[v5]; var v4 = this.battleSrcMC['land0' + v3.mapSide]; this.battleSrcMC['land0' + v3.mapSide].gotoAndStop(v3.religion_code); this.battleSrcMC['water_overlay_' + v3.mapSide].gotoAndStop(1); } }; v2.setFaceFrames = function () { var v5 = 0; while (v5 < 6) { this.srcMC['face' + v5].gotoAndStop('empty'); ++v5; } for (v5 in _global.model.playerArr) { var v3 = _global.model.playerArr[v5]; var v4 = this.srcMC['face' + v3.playerNum]; v4.gotoAndStop(v3.faceFrame); } }; v2.playSubMC = function (_obj) { _global.model.cur_sub_launch_num = _obj._player; var v4 = this.battleSrcMC['sub_' + _obj._locPlr + '_' + _obj._locPos].tintMC; var v5 = new Color(v4); v5.setTransform(_global.model.playerArr[_obj._player].playerColorTint1); this.battleSrcMC['sub_' + _obj._locPlr + '_' + _obj._locPos].subMC.play(); v4.play(); _global.play_sound_by_event('sub_surface', v4._x); }; v2.playCarrierMC = function (_obj) { if (_obj._locPlr) { this.battleSrcMC['carrier' + _obj._locPlr].gotoAndStop(2); } if (_obj._player || _obj._player == 0) { this.battleSrcMC['carrier' + _obj._player].gotoAndStop(2); } var v4 = new Color(this.battleSrcMC['carrier' + _obj._player].mc.carrier_tint); v4.setTransform(_global.model.playerArr[_obj._player].playerColorTint1); }; v2.reset_schemeMC = function () { this.battleSrcMC.curActionDisplay.schemeMC.gotoAndStop(2); this.battleSrcMC.curActionDisplay.schemeMC.gotoAndStop(1); var v2 = 0; while (v2 < 5) { if (!this.model.playerArr[v2].alive) { this.battleSrcMC.curActionDisplay.schemeMC['mc' + v2]._alpha = 30; } else { this.battleSrcMC.curActionDisplay.schemeMC['mc' + v2]._alpha = 100; } ++v2; } }; v2.curActionText = function (_str, _plrNum) { switch (_str) { case 'factory': _str = 'production'; break; break; case 'silo': case 'airfield': break; case 'Air_still': break; case 'antiRocket_still': } if (_str != this.cur_actionDisplay_frame) { this.cur_actionDisplay_frame = _str; this.reset_schemeMC(); } if (_str != 'none') { if (this.battleSrcMC.curActionDisplay._alpha < 20) { this.fadeClip(this.battleSrcMC.curActionDisplay, 80, 'in', 20, false); } this.battleSrcMC.curActionDisplay.gotoAndStop(_str); } else { this.battleSrcMC.curActionDisplay.gotoAndStop(1); this.fadeClip(this.battleSrcMC.curActionDisplay, 0, 'out', 20, false); } this.battleSrcMC.curActionDisplay.schemeMC['mc' + _plrNum].gotoAndStop(2); this.battleSrcMC.curActionDisplay.schemeMC['mc' + _plrNum].gotoAndStop(1); var v5 = new Color(this.battleSrcMC.curActionDisplay.schemeMC['mc' + _plrNum]); v5.setTransform(_global.model.playerArr[_plrNum].playerColorTint1); }; v2.updateAnti = function (unit) { if (!unit.anti_mc_name) { unit.anti_mc_name = 'ab' + unit.anti_num + '_' + _global.model.playerArr[unit.targetPlayer].anti_loc; } if (!unit.anti_active) { return undefined; } var v4 = this.battleSrcMC[unit.anti_mc_name].mc.mc; var v6 = v4._currentframe; var v5 = unit.__get__anti_direction(); if (v4._currentframe != v5) { unit.sound_anti('move'); } v4.gotoAndPlay(v5 * 2 - 1); if (unit.__get__anti_distance() < 170) { if (unit.anti_offset == 1) { unit.anti_offset = 2; } else { unit.anti_offset = 1; } } if (unit.anti_offset == 1) { v4.nextFrame(); unit.sound_anti_shoot(v4); } if (unit.countDown_antiStart <= 0) { if (v4._alpha < 100) { v4._alpha += 10; } } else { --unit.countDown_antiStart; } if (unit.unitStatus == 'dead' || !unit) { if (v4._currentframe / Math.floor(v4._currentframe / 2) == 2) { v4.prevFrame(); } } }; v2.createBioCloud = function (city) { city.bioloaded = true; var v5; if (!city.image.bioCloud_container) { city.bioCloud_container = city.image.createEmptyMovieClip('bioCloud_container', city.image.getNextHighestDepth()); city.bioCloud_container.city = city; var v4 = 0; while (v4 < this.cloudMax) { city.bioCloud_arr.push(city.bioCloud_container.attachMovie('bioCloud', 'bioCloud_' + v4, city.image.bioCloud_container.getNextHighestDepth())); ++v4; } for (v4 in city.bioCloud_arr) { var v3 = city.bioCloud_arr[v4]; v3.spawn(); } } }; v2.createClouds = function () { var v3; var v5 = 0; while (v5 < this.cloudPacks) { var v4 = 0; while (v4 < this.cloudMax) { v3 = this.battleSrcMC.attachMovie('cloud', 'cloud' + v5 + '_' + v4, this.battleSrcMC.getNextHighestDepth()); v3.startLoc = {'_x': this.cloudCenterPositions[v5][0] + _global.model.tools.randRange(-30, 30), '_y': this.cloudCenterPositions[v5][1] + _global.model.tools.randRange(-30, 30)}; v3.initialLoc(); v3._alpha = 30; v3._yscale = _global.model.tools.randRange(800, 1100); v3._xscale = v3._yscale; v3.yRadius = _global.model.tools.randRange(10, 30); v3.xRadius = v3.yRadius; v3.angleChange = _global.model.tools.randRange(-9, 9); this.cloudArr.push(v3); ++v4; } ++v5; } }; v2.cloud_interval_func = function () { for (var v3 in this.cloudArr) { var v2 = this.cloudArr[v3]; v2.frame_step(); } }; v2.cloudTicker_initiate = function () { if (!this.cloudArr[0]) { this.createClouds(); this.cloudIntervalID = setInterval(this, 'cloud_interval_func', 3500); } }; v2.createUnitTicker = function () { this.battleSrcMC.ticker_count = 0; this.battleSrcMC.onEnterFrame = function () { ++this.ticker_count; if (_global.model.battle._activeUnitsArr.length == 0 && _global.model.attackingSubs_arr.length == 0 || this.ticker_count > 800) { if (!_global.presenter.check_ch_active('kill_all')) { delete _global.view.battleSrcMC.onEnterFrame; clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter.allUnitsDone_intervalID = setInterval(_global.presenter, 'allUnitsDone', 2500); return undefined; } } else { if (_global.model.battleMC_units_active) { if (_global.model.battleCounter <= 0) { if (!_global.model.lastUnitWasBuilding) { _global.model.battleCounter = 1; _global.model.battleTimerArr[_global.model.battleTimerIndex]; ++_global.model.unitStartNum; } else { _global.model.battleCounter = 1; ++_global.model.unitStartNum; } } --_global.model.battleCounter; } for (var v14 in _global.model.battle._activeUnitsArr) { var v3 = _global.model.battle._activeUnitsArr[v14]; if (!_global.model.battle._activeUnitsArr[v14]._building) { if (!v3.tail && v3.startNum == _global.model.unitStartNum && !v3.activeAndMoving && v3.action != 'stop') { _global.view.curActionText('none'); v3.activeAndMoving = true; if (v3.startSoundOnAAM) { v3.startSound(); } _global.model.lastUnitWasBuilding = false; } if (v3.unitStatus == 'dead' || v3.action == 'stop') { if (v3.mcID == 'boat001') { v3.MC.gotoAndStop(6); } _global.model.battle._toDeleteUnitsArr.push(v3); _global.model.battle._activeUnitsArr.splice(v14, 1); if (v3.mcID == 'marine' || v3.mcID == 'soldier001') { v3.activeAndMoving = false; return undefined; } } if (v3.action == 'die') { v3.killUnit(); } if (v3.action == 'dying') { if (v3.shadowMC._x == 0) { } } if (v3.activeAndMoving && v3.wildCard.satellite) { _global.presenter_interface.play_satellite_sound(); if (v3.MC._x < v3.wildCard.targetX) { v3.curX += 3; ++v3.curY; v3.MC.mc.gotoAndStop(Math.round(v3.MC._x / 26)); } else { if (v3.action != 'fire' && v3.action != 'idle' && v3.action != 'firing_clear') { v3.action = 'fire'; v3.satellite_explosion(); } else { if (v3.action == 'fire') { v3.MC.mc.clear(); if (!v3.has_fired_laser_sound) { v3.soundAction('sat_laser'); v3.has_fired_laser_sound = true; } v3.satellite_lineAlpha = v3.satellite_lineAlphaStart; if (v3.satellite_lineAlphaStart < 100 && v3.satellite_alphaPlus) { v3.satellite_lineAlphaStart += 15; } else { if (v3.satellite_lineAlphaStart >= 100) { v3.satellite_alphaPlus = false; } } if (!v3.satellite_alphaPlus) { v3.satellite_lineAlphaStart -= 5; if (v3.satellite_lineAlphaStart <= 0) { v3.action = 'stop'; break; } } v3.satellite_line_xOffset = -4; v3.satellite_line_xLocation = v3.wildCard.cityX - v3.MC._x - v3.MC.mc._x; v3.satellite_line_yLocation = v3.wildCard.cityY - v3.MC._y - v3.MC.mc._y; var v13 = v3.wildCard.laser_hex_color; var v9 = _global.presenter.brighter_hex_by_steps(v13, 2); var v11 = _global.presenter.brighter_hex_by_steps(v9, 2); var v10 = _global.presenter.brighter_hex_by_steps(v11, 3); var v8 = new Array(v9, v9, v11, v10, v10, '0xFFFFFF', '0xFFFFFF', '0xFFFFFF'); var v4 = 0; while (v4 < 4) { var v5 = v3.MC.mc.laserStartMC._x; var v6 = v3.MC.mc.laserStartMC._y; v3.MC.mc.moveTo(v5, v6 - v4); v3.MC.mc.lineStyle(1, Number(v8[6 - v4]), v3.satellite_lineAlpha); v3.MC.mc.lineTo(v3.satellite_line_xLocation + v4, v3.satellite_line_yLocation - v4); v3.MC.mc.moveTo(v5, v6 + v4); v3.MC.mc.lineStyle(1, Number(v8[6 - v4]), v3.satellite_lineAlpha); v3.MC.mc.lineTo(v3.satellite_line_xLocation, v3.satellite_line_yLocation + v4); v3.MC.lineAlpha -= 15; ++v4; } if (v3.satellite_line_xOffset >= 4) { v3.satellite_line_xOffset = -4; } else { ++v3.satellite_line_xOffset; } } } } } if (v3.action == 'waitForLiftOff' && v3.activeAndMoving) { ++v3.wildCard.liftOffCount; if (Number(v3.wildCard.liftOffCount) >= Number(v3.wildCard._number * 20)) { v3.action = 'liftOff'; } } else { if (v3.mcID == 'sub_rocket' && v3.action == 'wait_for_sub_launch') { if (_global.model.cur_sub_launch_num == v3.wildCard.sub_launch_num) { v3.action = 'sub_rocket_countDown_1'; } } else { if (v3.action == 'sub_rocket_countDown_1') { if (v3.sub_launch_timer > 34) { v3.action = 'sub_rocket_launch'; } ++v3.sub_launch_timer; } else { v3.moveUnit(); v3.MC._y = v3.curY; v3.MC._x = v3.curX; if (v3.MC._xscale < 100 && v3.activeAndMoving && !v3.scale_down && !v3.scale_up && v3.action != 'taxi_a' && v3.action != 'taxi_b' && v3.mcID != 'ship_plane' && (v3.mcID != 'plane001' && v3.mcID != 'plane002' || v3.PLANE_COUNT_TO_FREE_FLIGHT <= v3.cur_count_to_free_flight)) { if ((v3.mcID == 'plane001' || v3.mcID == 'plane002') && v3.MC._xscale < 80) { v3.MC._xscale += 2; v3.MC._yscale += 2; if (v3.hasShadow) { v3.shadowMC._xscale += 2; v3.shadowMC._yscale += 2; } if (v3.tintMC_id) { v3.tintMC._yscale = v3.MC._xscale; v3.tintMC._xscale = v3.tintMC._yscale; } } } if (v3.scale_up && v3.MC._xscale > 50 && v3.activeAndMoving) { v3.MC._xscale -= 1; } if (v3.scale_down && v3.MC._xscale < 100 && v3.activeAndMoving) { v3.MC._xscale += 2; } if (v3.MC._alpha < 100 && v3.activeAndMoving && v3.mcID != 'suicide_bomber') { v3.MC._alpha += 10; if (v3.tintMC_id) { } } if (v3.mcID == 'ship_plane' && v3.MC._xscale < 70 && v3.action != 'waitForLiftOff') { ++v3.MC._xscale; ++v3.MC._yscale; ++v3.tintMC._xscale; ++v3.tintMC._yscale; ++v3.shadowMC._xscale; ++v3.shadowMC._yscale; } } } } if (v3.action == 'waitForHeliStart') { if (_global.model.heliStart[v3.playerNum][0]) { v3.curX = _global.model.heliStart[v3.playerNum][0] + v3.heliStartPlusX; v3.MC._x = v3.curX; v3.curY = _global.model.heliStart[v3.playerNum][1] + v3.heliStartPlusY; v3.MC._y = v3.curY; if (v3.mcID != 'suicide_bomber') { v3.action = 'liftOff'; } else { if (v3.mcID == 'suicide_bomber') { v3.action = 'suicide_fade_out'; v3.wayPointArr[0]._x = _global.model.heliStart[v3.playerNum][0]; v3.wayPointArr[0]._y = _global.model.heliStart[v3.playerNum][1] - 70; v3.wayPointArr[1]._x = _global.model.heliStart[v3.playerNum][0]; v3.wayPointArr[1]._y = _global.model.heliStart[v3.playerNum][1] - 70; } } } if (v3.mcID == 'suicide_bomber') { v3.MC.swapDepths(v3.container.getNextHighestDepth()); } } if (v3.action != 'unload') { if (v3.action == 'plane_circular_flight') { ++v3.plane_circFlight_frames_count; } if (v3.multiFrame && v3.activeAndMoving) { var v12 = 0; if (v3.action == 'liftOff') { v12 = v3.fixedFrame * v3.offsetFrames - (v3.offsetFrames - 1) + v3.frameOffset; } else { v12 = v3.__get__unitDirection() * v3.offsetFrames - (v3.offsetFrames - 1) + v3.frameOffset; } v3.MC.gotoAndStop(v12); if (v3.frameOffset < v3.offsetFrames) { ++v3.frameOffset; } else { v3.frameOffset = 1; } } else { if (v3.mcID != 'tankTop' && v3.mcID != 'rocket' && v3.mcID != 'sub_rocket' && v3.action != 'plane_circular_flight') { if ((v3.mcID == 'soldier001' || v3.mcID == 'marine') && v3.activeAndMoving || v3.mcID != 'soldier001' && v3.mcID != 'marine') { v3.MC.gotoAndStop(v3.__get__unitDirection()); } } } if (v3.action == 'plane_circular_flight' && v3.plane_circFlight_frames_count > 3) { v3.MC.gotoAndStop(v3.__get__unitDirection()); } else { if (v3.mcID == 'rocket' || v3.mcID == 'sub_rocket') { v3.MC._rotation = v3.rocketRotation; if (v3.__get__anti_distance() < 150 && !v3.result) { v3.action = 'rocket_explode_self'; } if (v3.anti_active && v3.activeAndMoving && v3.anti_pos[0] == 0 && !_global.model.playerArr[v3.targetPlayer].anti_inBattle_target) { v3.anti_pos[0] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[0]; v3.anti_pos[1] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[1]; _global.model.playerArr[v3.targetPlayer].anti_inBattle_target = v3; } if (_global.model.playerArr[v3.targetPlayer].anti_inBattle_target == v3 && !v3.anti_initiated && v3.anti_active && v3.__get__anti_distance() < 400) { _global.view.updateAnti(v3); } } } if (v3.mcID == 'ship_plane') { if (v3.action == 'waitForLiftOff') { v3.MC.gotoAndStop(v3.idleFrame); } else { v3.MC.gotoAndStop(v3.__get__unitDirection()); v3.shadowMC._visible = true; } if (v3.anti_active && v3.activeAndMoving && v3.anti_pos[0] == 0 && !_global.model.playerArr[v3.targetPlayer].anti_inBattle_target) { v3.anti_pos[0] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[0]; v3.anti_pos[1] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[1]; _global.model.playerArr[v3.targetPlayer].anti_inBattle_target = v3; } if (_global.model.playerArr[v3.targetPlayer].anti_inBattle_target == v3 && !v3.anti_initiated && v3.anti_active && v3.__get__anti_distance() < 400) { _global.view.updateAnti(v3); } v3.MC._x = v3.curX; v3.MC._y = v3.curY; v3.MC._alpha = 100; } if (v3.hasShadow) { v3.shadowMC.mc.gotoAndStop(v3.MC._currentframe); v3.shadowMC._x = v3.curX + v3.shadowXOffset; v3.shadowMC._y = v3.curY + v3.shadowYOffset; } if (v3.tintMC_id) { v3.tintMC.gotoAndStop(v3.MC._currentframe); v3.tintMC._x = v3.curX; v3.tintMC._y = v3.curY; } } if (v3.depthSwap) { if (v3.MC.getDepth() != v3.__get__appMC_depth()) { v3.MC.swapDepths(v3.__get__appMC_depth()); } if (v3.tintMC) { v3.tintMC.swapDepths(v3.MC.getDepth() + 1); } } } if (v3.anti_type == 'air') { if (v3.anti_active && v3.activeAndMoving && v3.anti_pos[0] == 0 && !_global.model.playerArr[v3.targetPlayer].anti_inBattle_target) { v3.anti_pos[0] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[0]; v3.anti_pos[1] = _global.model.playerArr[v3.targetPlayer].anti_pos_arr[1]; _global.model.playerArr[v3.targetPlayer].anti_inBattle_target = v3; } if (_global.model.playerArr[v3.targetPlayer].anti_inBattle_target == v3 && !v3.anti_initiated && v3.anti_active) { _global.view.updateAnti(v3); } } if (v3.action == 'shoot') { var v12 = v3.__get__unitDirection() * v3.offsetFrames - (v3.offsetFrames - 1) + v3.frameOffset; v3.MC.gotoAndStop(v12); v3.tintMC.gotoAndStop(v12); if (v3.frameOffset < v3.offsetFrames) { ++v3.frameOffset; } else { v3.frameOffset = 1; } } if (v3.mcID == 'chinook' && !v3.activeAndMoving) { v12 = v3.fixedFrame * v3.offsetFrames - (v3.offsetFrames - 1) + v3.frameOffset; v3.MC.gotoAndStop(v12); if (v3.frameOffset < v3.offsetFrames) { ++v3.frameOffset; } else { v3.frameOffset = 1; } } if (_global.model.battle._activeUnitsArr[v14]._building && _global.model.battleMC_units_active) { _global.model.battleCounter = 0; var v7 = _global.model.battle._activeUnitsArr[v14].obj; if (_global.model.unitStartNum == v7._startNum) { _global.model.battle._activeUnitsArr.splice(v14, 1); if (v7._building == 'sub' && !v7._addToSubArr) { _global.view.playSubMC(v7); } else { if (v7._building == 'ship') { } } } } } } }; }; v2.play_AB_selectMC = function (_str) { _global.play_sound_by_building(_str); var v9 = false; var v8 = false; var v11 = false; var v10 = false; var v4; for (var v12 in _global.model.playerAB_position_arr) { v4 = _global.model.playerAB_position_arr[v12].building_name; if (_str == 'preAttack') { if (v4 == 'airfield' && !v9) { v9 = true; _global.play_sound_by_building('airfield'); } else { if (v4 == 'silo' && !v8) { v8 = true; _global.play_sound_by_building('silo'); } else { if (v4 == 'sub' && !v11) { v11 = true; _global.play_sound_by_building('sub'); } else { if (v4 == 'space' && !v10) { v10 = true; _global.play_sound_by_building('space'); } } } } } else { if (_str == 'attack') { if (v4 == 'hatch') { _global.play_sound_by_building('hatch'); } } } } if (_str == 'propaganda') { this.presenter.doPropaganda(); } var v5 = 0; while (v5 < 5) { var v3 = this.model.get_playerAB_mc(v5, _str); var v7 = v3.citySelectMC; if (v7) { switch (_str) { case 'diplomacy': v3.mc.mc.play(); break; case 'production': v3.mc.mc.play(); break; case 'tech': v3.mc.mc.play(); break; case 'religion': v3.mc.mc.play(); break; case 'tech': v3.mc.mc.play(); break; case 'hatch': v3.mc.mc.play(); break; case 'attack': v3.mc.mc.play(); break; case 'preAttack': v3.mc.mc.play(); } v7.play(); this.curActionText(_str, v5); } ++v5; } }; v2.initiate_AB_interval = function () { var v2 = this.AB_interval_start_index; while (v2 < this.model.actionNames_arr.length) { ++this.AB_interval_start_index; if (this.model.string_is_used_action(this.model.actionNames_arr[v2])) { this.play_AB_selectMC(this.model.actionNames_arr[v2]); return undefined; } ++v2; } this.submarine_interval_ID = setInterval(this, 'submarineSequence', 8000); this.presenter.stop_continues_sound_objects(); this.model.battleMC_units_active = true; clearInterval(this.AB_interval_ID); }; v2.timedSubmarine = function (obj) { this.playSubMC(obj); }; v2.submarineSequence = function () { var v2 = this.model.attackingSubs_arr[0]; if (v2) { this.model.attackingSubs_arr.splice(0, 1); this.timedSubmarine(v2); } else { clearInterval(this.submarine_interval_ID); this.model.attackingSubs_arr = []; } }; v2.interval_func = function () { this.initiate_AB_interval(); }; v2.showActionBuildingFromObj = function (_obj) { var v3 = _obj; var v4 = _global.model.playerArr[v3._player]; var v7; var v5; if (!v3._fixedLoc) { if (v4 == this.model.human) { } if (!v4.__get__preLocation() || !v4.preBuilding_this_turn) { v7 = v4.nextActionBuilding; } else { if (v4.__get__preLocation() == 1) { v4.building1Shown = true; v7 = 2; } else { if (v4.__get__preLocation() == 2) { v4.building2Shown = true; v7 = 1; } } } v5 = this.battleSrcMC['ab' + v3._player + '_' + v7]; } else { v5 = this.battleSrcMC['ab' + v3._player + '_' + v4.__get__preLocation()]; } if (v4 == this.model.human) { for (var v8 in _obj) { } } v5.gotoAndStop(v3._frame); v5.mc.gotoAndStop(v4.religion_code); if (v3._frame == 'airfield' && (v4.playerNum == 2 || v4.playerNum == 3)) { v5.mc.mc_.gotoAndStop(2); } if (v3._frame == 'propaganda') { v4._propagandaMC = v5; } if (v3._frame == 'religion' && _global.presenter.check_ch_active('disco')) { v5.mc.gotoAndStop('disco'); } _global.presenter_interface.play_ambient_sound_by_building_frame(v3._frame); if (v3._frame == 'propaganda_2') { var v9 = new Color(v5.mc.beamMC); v9.setTransform(_global.model.playerArr[v3._player].playerColorTint1); _global.presenter.updateSingleCity_byID(v3._targetCity_id, 0, true, v3._player); _global.presenter.update_propaganda_plus(v3._player); } v5.mc.gotoAndStop(v4.religion_code); this.fadeClip(v5, 100, 'in', 5, false); if (v3._setHeliStart) { v4.heliStart = [v5._x - 15, v5._y + 25]; _global.model.heliStart[v3._player] = [v5._x - 15, v5._y + 25]; } if (v3._frame == 'ship') { this.playCarrierMC(v3); } if (v3._setPreStart && !v4.__get__preLocation()) { v4.preStart = [v5._x, v5._y + 25]; v4.__set__preLocation(v7); } if (v3._anti_arr[0]) { v4.anti_active = v3._anti_arr[0]; v4.anti_type = v3._anti_arr[1]; v4.anti_pos_arr = [v5._x, v5._y]; v4.anti_loc = v7; } if (v3._frame == 'religion' && _global.presenter.check_ch_active('disco')) { v5.mc.gotoAndStop('disco'); } return v5; }; v2.getIntervalBuildingsArray = function () { if (!this.showBuildingsFromArray(_global.model.battle.toShowLastABArr)) { clearInterval(_global.model.actionBuildingInterval); this.presenter.endBattle(); } }; v2.showBuildingsFromArray = function (_array) { _global.view.curActionText(_array._frame, _array._player); var v4 = _array; if (!v4._empty) { var v5 = _global.model.playerArr[v4._player]; if (v5.playerNum == 0) { } var v6; var v3; if (!v4._fixedLoc) { v6 = v5.nextActionBuilding; v3 = this.battleSrcMC['ab' + v4._player + '_' + v6]; } else { v3 = this.battleSrcMC['ab' + v4._player + '_' + v5.__get__preLocation()]; } v3.gotoAndStop(v4._frame); v3.mc.gotoAndStop(v5.religion_code); if (v4._frame == 'airfield' && (v5.playerNum == 2 || v5.playerNum == 3)) { v3.mc.mc.gotoAndStop(2); } this.fadeClip(v3, 100, 'in', 5, false); if (v4._setPreStart) { v5.preStart = [v3._x, v3._y + 25]; v5.__set__preLocation(v6); } if (v4._anti_arr[0]) { v5.anti_active = v4._anti_arr[0]; v5.anti_type = v4._anti_arr[1]; v5.anti_pos_arr = [v3._x, v3._y]; v5.anti_loc = v6; v3.mc._alpha = 0; } _global.model.heliStart[v4._player] = [v3._x - 15, v3._y + 25]; return true; } else { return false; } }; v2.set_crash_text = function (a_str) { _level0.crashText.text = 'Code report: ' + a_str; }; v2.setABDepth = function () { for (var v7 in _global.model.playerArr) { var v3 = _global.model.playerArr[v7]; var v5 = this.battleSrcMC['ab' + v3.playerNum + '_' + 1]; var v4 = this.battleSrcMC['ab' + v3.playerNum + '_' + 2]; var v6 = this.battleSrcMC['flag' + v3.playerNum]; v5.swapDepths(Math.floor(v5._y / 10) * 500 + 2); v4.swapDepths(Math.floor(v4._y / 10) * 500 + 1); v6.swapDepths(Math.floor(v4._y / 10) * 500 + 3); } }; v2.someString = 'blaat'; v2.interfaceBGDepth = 210; v2.actionLightDepthStart = 211; v2.actionTextDepthStart = 221; v2.ticker1Depth = 250; v2.ticker2Depth = 251; v2.infoTextDepth = 252; v2.scrollTextDepth = 253; v2.ticker3Depth = 254; v2.ticker4Depth = 255; v2.ticker5Depth = 256; v2.ticker6Depth = 257; v2.statBarDepth = 258; v2.exBtnSrcDepth = 259; v2.exBtnOvrDepth = 260; v2.smallMapCityDepthStart = 270; v2.playerOutlineDepthStart = 350; v2.cloudTickerDepth = 360; v2.citySelectionDepthStart = 1500; v2.nextUnusedDepthPleaseRenameThisVarBecauseItsTooLong = 1500; v2.popupDepthStart = 4000; v2.btnArr = [0, 0]; v2.btnSet_actions = new Array(); v2.btnSet_stock = new Array(); v2.actionTextMCArr = new Array(); v2.fadeClipsArr = new Array(); v2.openPopupsArr = new Array(); v2.btnBroadcaster = new Object(); v2.fadeStockBtnArr = new Array(); v2.fadeStockActive = false; v2.typeEffectArr = new Array(); v2.scrollTextStartIndex = 0; v2.scrollTickerActive = false; v2.scrollMaxChars = 60; v2.currentViewType = 'interface'; v2.allowTextEffect = false; v2.textEffectInterval = 12; v2.curTextEffectIntervalCount = 0; v2.cloudArr = []; v2.cloudPacks = 0; v2.cloudMax = 17; v2.cloudCenterPositions = new Array([416, 350], [180, 180], [650, 150], [180, 480], [640, 470]); v2.AB_interval_start_index = 0; v2.addProperty('clipSrc', function () {}, v2.__set__clipSrc); ASSetPropFlags(_global.View.prototype, null, 1); } #endinitclip } movieClip 5252 __Packages.View_interface { #initclip if (!_global.View_interface) { var v1 = function (_interfaceMC) { _interfaceMC.btn1.onPress = function () {}; this.interfaceMC = _interfaceMC; this.stockRequirements_list = new StockRequirements_list(); this.stockBtn_data = new StockBtn_data(); this.stockBtn_arr = new Array(); this.actionBtn_arr = new Array(); this.btn_arr = new Array(); this.actionBtn_arr[0] = undefined; this.stockBtn_arr[0] = undefined; this.shortMSG_textField = this.interfaceMC.shortMSG_textField; var v5 = 1; while (v5 < this.stockBtn_data.dataArr.length) { var _obj = this.stockBtn_data.dataArr[v5]; var v3 = new Btn_stock(_obj.id, _obj.name, _obj.label, this.interfaceMC['stockPanel' + _obj.stockPanelNum][_obj.overlayMC_name], this.interfaceMC['stockPanel' + _obj.stockPanelNum][_obj.labelTF_name], this.interfaceMC['stockPanel' + _obj.stockPanelNum][_obj.scrnMC_name], this.interfaceMC['stockPanel' + _obj.stockPanelNum][_obj.scrnTF_name], this.interfaceMC['stockPanel' + _obj.stockPanelNum][_obj.btnSwitchMC_name], _obj.weaponName, _obj.stockPanelNum, _obj.deactivate_in_demo); v3.overlayMC._btnObj = v3; v3.overlayMC.onPress = function () { _global.presenter_interface.btnPress(this._btnObj.index_in_arr); }; v3.overlayMC.onRollOver = function () { _global.presenter_interface.btnRoll_on(this._btnObj.index_in_arr); }; v3.overlayMC.onRollOut = function () { _global.presenter_interface.btnRoll_on(-1); }; v3.resetClips(); this.stockBtn_arr.push(v3); this.__set__infoLine('welcome'); ++v5; } v5 = 1; while (v5 < 10) { this.actionBtn_arr[v5] = new Btn_action(this.actionNames_arr[v5], this.actionLabels_arr[v5], this.interfaceMC['btn' + v5], this.interfaceMC['scrn' + v5], this.interfaceMC['switch' + v5], this.interfaceMC['txtMC' + v5].txt); var v4 = this.actionBtn_arr[v5]; v4.overlayMC._btnObj = v4; v4.overlayMC.onPress = function () { _global.presenter_interface.btnPress(this._btnObj.index_in_arr); }; v4.overlayMC.onRollOver = function () { _global.presenter_interface.btnRoll_on(this._btnObj.index_in_arr); }; v4.overlayMC.onRollOut = function () { _global.presenter_interface.btnRoll_off(-1); }; v4.setLabelText(); v4.updateBtn(); ++v5; } this.actionTube1 = new Btn_tube(this.interfaceMC.btn44, this.interfaceMC.tubeMC1); this.actionTube1.btnMC._btnObj = this.actionTube1; this.actionTube1.actionNum = 1; this.actionTube1.associatedTA = _global.model.human.turnAction_1; this.actionTube1.btnMC.onPress = function () { _global.presenter_interface.btnPressed_tube(this._btnObj); }; this.actionTube2 = new Btn_tube(this.interfaceMC.btn45, this.interfaceMC.tubeMC2); this.actionTube2.btnMC._btnObj = this.actionTube2; this.actionTube2.actionNum = 2; this.actionTube2.associatedTA = _global.model.human.turnAction_2; this.actionTube2.btnMC.onPress = function () { _global.presenter_interface.btnPressed_tube(this._btnObj); }; this.turnBtn = new Btn_turn(this.interfaceMC.btn46, this.interfaceMC.actionHatch3); v5 = 1; while (v5 < this.actionBtn_arr.length) { var v6 = this.actionBtn_arr[v5]; v6.index_in_arr = Math.max(this.btn_arr.push({'_btn': v6}) - 1, 0); ++v5; } v5 = 1; while (v5 < this.stockBtn_arr.length) { v6 = this.stockBtn_arr[v5]; v6.index_in_arr = this.btn_arr.push({'_btn': this.stockBtn_arr[v5]}) - 1; ++v5; } this.btn_sound = new Btn_musicSwitch(this.interfaceMC.btn38, this.interfaceMC.switch38, 'sound'); this.btn_sound.overlayMC._obj = this.btn_sound; this.btn_sound.overlayMC.onPress = function () { _global.presenter_interface.btnPressed_option(this._obj.option); }; this.btn_music = new Btn_musicSwitch(this.interfaceMC.btn39, this.interfaceMC.switch39, 'music'); this.btn_music.overlayMC._obj = this.btn_music; this.btn_music.overlayMC.onPress = function () { _global.presenter_interface.btnPressed_option(this._obj.option); }; this.scrollBtn_msg_up = new Btn_simple(this.interfaceMC.btn_scroll_MSG_up_overlay, this.interfaceMC.btn_scroll_MSG_up); this.scrollBtn_msg_down = new Btn_simple(this.interfaceMC.btn_scroll_MSG_down_overlay, this.interfaceMC.btn_scroll_MSG_down); this.interfaceMC.btn_scroll_MSG_up_overlay.onPress = function () { _global.presenter_interface.btnPressed_scroll_MSG('up'); }; this.interfaceMC.btn_scroll_MSG_down_overlay.onPress = function () { _global.presenter_interface.btnPressed_scroll_MSG('down'); }; this.interfaceMC.btn40.onPress = function () { if (_global.model.userSelectedActionBtn != 'diplomacy') { _global.presenter_interface.btnPress(8); } if (_global.model.playerArr[1].alive && !_global.model.human.ceaseFireArr[1]._status) { _global.model.userSelectedDiplomacyLeader = 1; } _global.presenter_interface.updateView(); }; this.interfaceMC.btn41.onPress = function () { if (_global.model.userSelectedActionBtn != 'diplomacy') { _global.presenter_interface.btnPress(8); } if (_global.model.playerArr[2].alive && !_global.model.human.ceaseFireArr[2]._status) { _global.model.userSelectedDiplomacyLeader = 2; } _global.presenter_interface.updateView(); }; this.interfaceMC.btn42.onPress = function () { if (_global.model.userSelectedActionBtn != 'diplomacy') { _global.presenter_interface.btnPress(8); } if (_global.model.playerArr[3].alive && !_global.model.human.ceaseFireArr[3]._status) { _global.model.userSelectedDiplomacyLeader = 3; } _global.presenter_interface.updateView(); }; this.interfaceMC.btn43.onPress = function () { if (_global.model.userSelectedActionBtn != 'diplomacy') { _global.presenter_interface.btnPress(8); } if (_global.model.playerArr[4].alive && !_global.model.human.ceaseFireArr[4]._status) { _global.model.userSelectedDiplomacyLeader = 4; } _global.presenter_interface.updateView(); }; v5 = 1; while (v5 < 5) { this.interfaceMC['stat' + v5 + '1'].num = v5; this.interfaceMC['stat' + v5 + '1'].onRollOver = function () { _global.presenter_interface.roll_over_stat('regard', this.num); _global.view_interface.interfaceMC['leaderStar_roll_' + this.num + '1'].play(); }; this.interfaceMC['stat' + v5 + '1'].onRollOut = function () { _global.view_interface.infoLine = 'null'; }; this.interfaceMC['stat' + v5 + '2'].num = v5; this.interfaceMC['stat' + v5 + '2'].onRollOver = function () { _global.presenter_interface.roll_over_stat('population'); _global.view_interface.interfaceMC['leaderStar_roll_' + this.num + '2'].play(); }; this.interfaceMC['stat' + v5 + '2'].onRollOut = function () { _global.view_interface.infoLine = 'null'; }; ++v5; } this.interfaceMC.txtMC_help.txt.text = 'HELP'; this.interfaceMC.btn_help.onPress = function () { _global.model.userSelectedActionBtn = 'help'; _global.model.userSelectedHelpTopic = 'help_index'; _global.presenter_interface.updateView(); }; this.interfaceMC.txtMC_fullscreen.txt.text = 'FULL SCREEN'; this.interfaceMC.btn_fullscreen.onPress = function () { if (_global.model.fullscreen) { _global.model.fullscreen = false; fscommand('fullscreen', 'false'); } else { _global.model.fullscreen = true; fscommand('fullscreen', 'true'); } }; v5 = 1; while (v5 < 6) { this.interfaceMC['map_overlay_btn' + v5].gotoAndStop(2); ++v5; } this.__set__infoLine('welcome'); }; _global.View_interface = v1; var v2 = v1.prototype; v2.update_stockPanelMask = function (_num, _frm) { this.interfaceMC.stockPanel.maskMC['mc' + _num].gotoAndStop(_frm); }; v2.actionName2TubeLabel = function (_str) { for (var v2 in this.actionNames_arr) { if (this.actionNames_arr[v2] == _str) { return this.actionTubeLabels_arr[v2]; } } }; v2.actionName2label = function (_str) { for (var v2 in this.actionNames_arr) { if (this.actionNames_arr[v2] == _str) { return this.actionLabels_arr[v2]; } } }; v2.update_stockPanel_alpha = function (_num, __alpha) { this.interfaceMC['stockPanel' + _num].targetAlpha = __alpha; this.interfaceMC['stockPanel' + _num].onEnterFrame = function () { if (this._alpha > this.targetAlpha + 5) { this._alpha -= 20; } else { if (this._alpha < this.targetAlpha - 5) { this._alpha += 20; } } if (Math.max(this._alpha, this.targetAlpha) - Math.min(this._alpha, this.targetAlpha) < 21) { this._alpha = this.targetAlpha; delete this.onEnterFrame; } }; }; v2.infoLine_interfal_func = function () { clearInterval(this.infoLine_interval_id); this.infoLine_interval_id = undefined; this.interfaceMC.infoLine.gotoAndStop(1); }; v2.__set__infoLine = function (_str) { clearInterval(this.infoLine_interval_id); this.infoLine_interval_id = setInterval(this, 'infoLine_interfal_func', 4500); this.interfaceMC.infoLine.gotoAndStop(_str); return this.__get__infoLine(); }; v2.update_statBar = function (_num, _val) { this.interfaceMC['statBar' + _num].statMask._xscale = _val; }; v2.update_statMoney = function (_val) { if (_val <= 0) { this.interfaceMC.statTxt.text = '$ out of funds'; } else { this.interfaceMC.statTxt.text = '$ ' + Math.round(_val) + '.000.000 '; } }; v2.update_hover_states = function (_index) {}; v2.__set__shortMSG_text = function (_arr) { this.shortMSG_textField.text = ''; var v3 = 0; while (v3 < _arr.length) { var v2 = _arr[v3]; if (v2._msg != '' && v2._msg) { this.shortMSG_textField.htmlText += v2._msg + '<br />'; } ++v3; } this.scroll_msg_txt(); return this.__get__shortMSG_text(); }; v2.set_color_dot = function (a_num, a_frame) { this.interfaceMC['colorDotMC' + a_num].gotoAndStop(a_frame); }; v2.update_leaderFace = function (_playerNum, _frame, _alive, _inactive, _played_noise) { var v3 = this.interfaceMC['leaderMC' + _playerNum]; if (_inactive) { v3._visible = false; return undefined; } else { v3._visible = true; } if (_alive) { v3.gotoAndStop('leaderLife'); v3._visible = true; v3.aliveMC.gotoAndStop(_frame); v3.deadMC.gotoAndStop(_frame); } else { v3.aliveMC._visible = false; v3.gotoAndStop('leaderDead'); if (_played_noise) { v3.aliveMC.gotoAndStop(20); v3.deadMC._visible = true; v3.deadMC.gotoAndStop(_frame); } else { v3.playDead = true; v3.deadMC._visible = true; v3.deadMC.gotoAndStop(_frame); _global.play_sound_by_action('interface_noise'); v3.gotoAndPlay(24); } } }; v2.set_centerScreenFunc = function (_type) { switch (_type) { case 'default': this.set_centerScreen_btns_default(); break; case 'hide': this.set_centerScreen_btns_hide(); } }; v2.set_centerScreen_btns_hide = function () { this.interfaceMC.centerScreen.btnAccept.gotoAndStop('empty'); this.interfaceMC.centerScreen.btnCancel.gotoAndStop('empty'); }; v2.set_centerScreen_btns_default = function () { this.interfaceMC.centerScreen.btnAccept.gotoAndStop('off'); this.interfaceMC.centerScreen.btnCancel.gotoAndStop('off'); this.interfaceMC.centerScreen.btnAccept.onRollOver = function () { this.gotoAndStop('over'); }; this.interfaceMC.centerScreen.btnAccept.onRollOut = function () { this.gotoAndStop('off'); }; this.interfaceMC.centerScreen.btnAccept.onPress = function () { _global.presenter_interface.btnPressed_accept(); }; this.interfaceMC.centerScreen.btnCancel.onPress = function () { _global.play_sound_by_action('interface_acceptAction_btn'); _global.presenter_interface.btnPressed_cancel(); }; this.interfaceMC.centerScreen.btnCancel.onRollOver = function () { this.gotoAndStop('over'); }; this.interfaceMC.centerScreen.btnCancel.onRollOut = function () { this.gotoAndStop('off'); }; }; v2.set_production_specialStats = function (_arr) { var v2 = 0; while (v2 < _arr.length) { this.interfaceMC.centerScreen.slide3['stat' + v2].maskMC._xscale = (_arr[v2][0] / _arr[v2][1]) * 100; ++v2; } }; v2.set_productionText = function (_str1, _str2, _str3) { this.interfaceMC.centerScreen.txt1.htmlText = _str1; this.interfaceMC.centerScreen.txt2.htmlText = _str2; this.interfaceMC.centerScreen.txt2.setTextFormat(_global.view.textFormats.interface_production_1); this.interfaceMC.centerScreen.txt3.htmlText = _str3; }; v2.set_researchText = function (_str1, _str2, _str3) { this.interfaceMC.centerScreen.txt1.htmlText = _str1; this.interfaceMC.centerScreen.txt1.setTextFormat(_global.view.textFormats.interface_production_2); this.interfaceMC.centerScreen.txt2.htmlText = _str2; this.interfaceMC.centerScreen.txt2.setTextFormat(_global.view.textFormats.interface_production_1); this.interfaceMC.centerScreen.txt3.htmlText = _str3; this.interfaceMC.centerScreen.txt3.setTextFormat(_global.view.textFormats.interface_production_1); }; v2.set_top_plrColor = function (_num, _clr) { this.interfaceMC['plrColor' + _num].gotoAndStop(_clr); return undefined; }; v2.set_centerScreenFunc_help = function (a_info) { var v4 = this.interfaceMC.centerScreen; v4.gotoAndStop(a_info.pgName); if (a_info._btnIndex) { v4.btnIndex._visible = true; v4.btnIndex.onPress = function () { _global.model.userSelectedHelpTopic = 'help_index'; _global.presenter_interface.updateView(); }; } else { v4.btnIndex._visible = false; } if (a_info._btnPrev) { v4.btnPrev._visible = true; v4.btnPrev._str = a_info._pgName; v4.btnPrev.onPress = function () { _global.model.userSelectedHelpTopic = _global.presenter_interface.help_data.get_prev(this._str); _global.presenter_interface.updateView(); }; } else { v4.btnPrev._visible = false; } if (a_info._btnNext) { v4.btnNext._visible = true; v4.btnNext._str = a_info._pgName; v4.btnNext.onPress = function () { _global.model.userSelectedHelpTopic = _global.presenter_interface.help_data.get_next(this._str); _global.presenter_interface.updateView(); }; } else { v4.btnNext._visible = false; } for (var v6 in a_info._btnArr) { var v3 = a_info._btnArr[v6]; v4[v3._mcName].goto = v3._trgtString; v4[v3._mcName].onPress = function () { _global.model.userSelectedHelpTopic = this.goto; _global.presenter_interface.updateView(); }; } v4.mc1.stop(); }; v2.scroll_msg_txt = function (_str) { switch (_str) { case 'up': --this.interfaceMC.shortMSG_textField.scroll; break; case 'down': ++this.interfaceMC.shortMSG_textField.scroll; } var v2 = this.interfaceMC.shortMSG_textField.scroll; if (v2 == 1) { this.scrollBtn_msg_up.img.gotoAndStop(2); } else { this.scrollBtn_msg_up.img.gotoAndStop(1); } if (v2 == this.interfaceMC.shortMSG_textField.maxscroll) { this.scrollBtn_msg_down.img.gotoAndStop(2); } else { this.scrollBtn_msg_down.img.gotoAndStop(1); } }; v2.play_leaderMC_sequence = function (num) {}; v2.update_highScore = function (a_amnt) { this.interfaceMC.txtMC_score.txt.text = a_amnt; }; v2.actionNames_arr = new Array(undefined, 'resources', 'production', 'research', 'religion', 'attack', 'preAttack', 'defense', 'propaganda', 'diplomacy', 'skip_action'); v2.actionLabels_arr = new Array(undefined, 'RESOURCES', 'PRODUCTION', 'TECHNOLOGY', 'MASS MEDIA', 'DIRECT ATTACK', 'PREPARED ATTACK', 'DEFENSE', 'PROPAGANDA', 'DIPLOMACY', 'SKIP'); v2.actionTubeLabels_arr = new Array(undefined, 'RESOURCES', 'PRODUCTION', 'TECHNOLOGY', 'MASS MEDIA', 'DIRECT <br />ATTACK', 'PREPARED <br /> ATTACK', 'DEFENSE', 'PROPAGANDA', 'DIPLOMACY'); v2.stockPanel_mask_states_arr = new Array([0], [3], [0], [0], [3], [2, 2, 2, 2, 2, 2, 1, 1, 2], [1, 1, 1, 1, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 1], [3], [3]); v2.addProperty('infoLine', function () {}, v2.__set__infoLine); v2.addProperty('shortMSG_text', function () {}, v2.__set__shortMSG_text); ASSetPropFlags(_global.View_interface.prototype, null, 1); } #endinitclip } movieClip 5253 __Packages.StockRequirements_list { #initclip if (!_global.StockRequirements_list) { var v1 = function () { this._default = new Object(); this._default.active = false; this._default.state2_arr = ['false']; this._default.state4_arr = ['false']; this.resources = new Object(); this.resources.active = false; this.resources.state4_arr = ['false']; this.production = new Object(); this.production.active = false; this.production.state2_arr = ['false']; this.production.state4_arr = ['false']; this.research = new Object(); this.research.active = false; this.research.state2_arr = ['nextInvention']; this.research.state3_arr = ['nextInvention']; this.research.state4_arr = ['false']; this.religion = new Object(); this.religion.active = false; this.religion.state2_arr = ['false']; this.religion.state4_arr = ['false']; this.preAttack = new Object(); this.preAttack.active = true; this.preAttack.state2_arr = ['preAttackRelated', 'isActive', 'weaponInStock', 'isPayload_pre', 'isCarrier_pre']; this.preAttack.state3_arr = ['??']; this.preAttack.state4_arr = ['inactive']; this.attack = new Object(); this.attack.active = true; this.attack.state2_arr = ['attackRelated', 'isActive', 'weaponInStock', 'spy_allowed']; this.attack.state4_arr = ['inactive']; this.defense = new Object(); this.defense.active = true; this.defense.state2_arr = ['defenseRelated', 'weaponInStock']; this.defense.state4_arr = ['inactive']; this.propaganda = new Object(); this.propaganda.active = false; this.propaganda.state2_arr = ['false']; this.propaganda.state4_arr = ['false']; this.diplomacy = new Object(); this.diplomacy.active = false; this.diplomacy.state2_arr = ['false']; this.diplomacy.state4_arr = ['false']; }; _global.StockRequirements_list = v1; var v2 = v1.prototype; ASSetPropFlags(_global.StockRequirements_list.prototype, null, 1); } #endinitclip } movieClip 5254 __Packages.StockBtn_data { #initclip if (!_global.StockBtn_data) { var v1 = function () { this.dataArr = new Array(); this.dataArr[0] = undefined; this.dataArr[1] = new StockBtn_data_obj(1, 'roc1', '10 meg', 'rocket1', 1, false); this.dataArr[2] = new StockBtn_data_obj(2, 'roc2', '25 meg', 'rocket2', 1, false); this.dataArr[3] = new StockBtn_data_obj(3, 'roc3', '50 meg', 'rocket3', 1, true); this.dataArr[4] = new StockBtn_data_obj(4, 'roc4', '95 meg', 'rocket4', 1, true); this.dataArr[5] = new StockBtn_data_obj(5, 'Air1', 'Fighter', 'plane1', 2, false); this.dataArr[6] = new StockBtn_data_obj(6, 'Air2', 'Bomber', 'plane2', 2, true); this.dataArr[7] = new StockBtn_data_obj(7, 'SpeC1', 'Submarine', 'sub', 3, false); this.dataArr[8] = new StockBtn_data_obj(8, 'SpeC2', 'Aircraft Carrier', 'ship', 3, true); this.dataArr[9] = new StockBtn_data_obj(9, 'SpeC3', 'Space Rocket', 'space', 3, true); this.dataArr[10] = new StockBtn_data_obj(10, 'SpeC4', 'Satellite', 'specialLoad', 3, true); this.dataArr[11] = new StockBtn_data_obj(11, 'war1', '10 meg', 'warhead1', 4, false); this.dataArr[12] = new StockBtn_data_obj(12, 'war2', '25 meg', 'warhead2', 4, false); this.dataArr[13] = new StockBtn_data_obj(13, 'war3', '50 meg', 'warhead3', 4, true); this.dataArr[14] = new StockBtn_data_obj(14, 'war4', '95 meg', 'warhead4', 4, true); this.dataArr[15] = new StockBtn_data_obj(15, 'bio1', '10 meg', 'bioload1', 5, false); this.dataArr[16] = new StockBtn_data_obj(16, 'bio2', '25 meg', 'bioload2', 5, false); this.dataArr[17] = new StockBtn_data_obj(17, 'bio3', '50 meg', 'bioload3', 5, true); this.dataArr[18] = new StockBtn_data_obj(18, 'bio4', '95 meg', 'bioload4', 5, true); this.dataArr[19] = new StockBtn_data_obj(19, 'sol1', 'Soldiers', 'soldier1', 6, false); this.dataArr[20] = new StockBtn_data_obj(20, 'sol2', 'Seals', 'soldier2', 6, false); this.dataArr[21] = new StockBtn_data_obj(21, 'sol3', 'Tank', 'soldier3', 6, true); this.dataArr[22] = new StockBtn_data_obj(22, 'sol4', 'Specials', 'soldier4', 6, true); this.dataArr[23] = new StockBtn_data_obj(23, 'spy1', 'spy 1', 'spy1', 7, false); this.dataArr[24] = new StockBtn_data_obj(24, 'spy2', 'spy 2', 'spy2', 7, false); this.dataArr[25] = new StockBtn_data_obj(25, 'spy3', 'spy 3', 'spy3', 7, true); this.dataArr[26] = new StockBtn_data_obj(25, 'spy4', 'spy 4', 'spy4', 7, true); this.dataArr[27] = new StockBtn_data_obj(25, 'anti1', 'Aircraft', 'antiAir', 8, false); this.dataArr[28] = new StockBtn_data_obj(25, 'anti2', 'Rocket', 'antiRocket', 8, false); var v2 = 1; while (v2 < this.dataArr.length) { this.dataArr[v2].overlayMC_name = 'btn' + (v2 + 9); this.dataArr[v2].scrnMC_name = 'scrn' + (v2 + 9); this.dataArr[v2].btnSwitchMC_name = 'switch' + (v2 + 9); this.dataArr[v2].scrnTF_name = 'scrnTxt' + (v2 + 9); this.dataArr[v2].labelTF_name = 'stockTxt' + v2; ++v2; } }; _global.StockBtn_data = v1; var v2 = v1.prototype; ASSetPropFlags(_global.StockBtn_data.prototype, null, 1); } #endinitclip } movieClip 5255 __Packages.StockBtn_data_obj { #initclip if (!_global.StockBtn_data_obj) { var v1 = function (_id, _name, _label, _weaponName, _stockPanelNum, _deactivate_in_demo) { this.id = _id; this.name = _name; this.label = _label; this.weaponName = _weaponName; this.stockPanelNum = _stockPanelNum; this.deactivate_in_demo = _deactivate_in_demo; }; _global.StockBtn_data_obj = v1; var v2 = v1.prototype; ASSetPropFlags(_global.StockBtn_data_obj.prototype, null, 1); } #endinitclip } movieClip 5256 __Packages.Sub_sub_presenter_interface { #initclip if (!_global.Sub_sub_presenter_interface) { var v1 = function () {}; _global.Sub_sub_presenter_interface = v1; var v2 = v1.prototype; v2.updateView_debug_1 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.view.remove_city_popups(); if (this.model.human.diplomacyPendingArr[0]) { this.model.__set__userSelectedActionBtn('diplomacyPending'); } if (_global.model.zs66hj8s) { _global.view.srcMC.get_full_version_btn.onPress = function () { getURL(_global.model.get_demo_version_url(), '_blank'); }; } else { _global.view.srcMC.get_full_version_btn._visible = false; _global.view.srcMC.get_full_version_text._visible = false; _global.view.srcMC.demo_stock_overlay.gotoAndStop(1); _global.view.srcMC.demo_stock_overlay._visible = false; } this.view_interface.__set__shortMSG_text(this.model.human.shortMSG_arr); _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_2', 5); }; v2.updateView_debug_2 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); for (var v9 in this.view_interface.stockBtn_arr) { var v3 = this.view_interface.stockBtn_arr[v9]; var v4 = this.model.human.weaponStock.getWeaponByName(v3.relatedWeapon); var v5 = true; var v7 = true; var v6 = true; if (v4.active) { v3.__set__stockAmount(v4.__get__inStock() - v4.inUse); } else { v3.__set__stockAmount(-1); } for (var v8 in this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state2_arr) { if (!this.stock_req_check_single(this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state2_arr[v8], v3)) { v5 = false; break; } } for (v8 in this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state4_arr) { if (!this.stock_req_check_single(this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state4_arr[v8], v3)) { v6 = false; break; } } if (v6) { v3.__set__state(4); } else { if (v5) { v3.__set__state(2); } else { v3.__set__state(1); } } if (v3.relatedWeapon == this.model.__get__userSelectedStockBtn()) { v3.__set__state(3); } if (v4.weaponName == 'specialLoad' && this.model.__get__userSelectedCarrier() != 'space') { v3.__set__state(1); } } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_3', 5); }; v2.updateView_debug_3 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); for (var v4 in this.view_interface.actionBtn_arr) { var v3 = this.view_interface.actionBtn_arr[v4]; if (!this.model.human.getNextTurnAction()) { if (v3.actionName != this.model.human.turnAction_1.__get__action() && v3.actionName != this.model.human.turnAction_2.__get__action()) { v3.__set__handCursor(false); } } else { v3.__set__handCursor(true); } if (v3.isSetAction) { v3.__set__state(3); } else { if (v3.__get__pressed()) { v3.__set__state(2); } else { if (v3.actionName == 'preAttack' && this.model.human.preAttackStatus == 'ready') { v3.__set__state(4); } else { v3.__set__state(1); } } } } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_4', 5); }; v2.updateView_debug_4 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); if ((this.model.human.getNextTurnAction()).num == 1) { if (this.model.__get__userSelectedActionBtn()) { this.view_interface.actionTube1.__set__state('open'); } else { this.view_interface.actionTube1.__set__state('closed'); } if (this.model.human.turnAction_2.__get__action()) { this.view_interface.actionTube2.__set__state('set'); } else { this.view_interface.actionTube2.__set__state('closed'); } } else { if ((this.model.human.getNextTurnAction()).num == 2) { if (this.model.__get__userSelectedActionBtn()) { this.view_interface.actionTube2.__set__state('open'); } else { this.view_interface.actionTube2.__set__state('closed'); } if (this.model.human.turnAction_1.__get__action()) { this.view_interface.actionTube1.__set__state('set'); } else { this.view_interface.actionTube1.__set__state('closed'); } } else { if (!this.model.human.getNextTurnAction() && !this.blockAllBtns) { this.view_interface.actionTube1.__set__state('set'); this.view_interface.actionTube2.__set__state('set'); this.view_interface.turnBtn.__set__state('open'); this.view_interface.turnBtn.btnMC.gotoAndStop(1); this.view_interface.turnBtn.btnMC.onPress = function () { _global.presenter_interface.blockAllBtns = true; _global.presenter_interface.btnPressed_turn(); }; } } } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_5', 5); }; v2.updateView_debug_5 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); if (this.model.human.getNextTurnAction()) { this.view_interface.turnBtn.__set__state('closed'); } var v5 = 0; while (v5 < this.view_interface.actionNames_arr.length) { if (this.view_interface.actionNames_arr[v5] == this.model.__get__userSelectedActionBtn()) { var v3; switch (this.view_interface.stockPanel_mask_states_arr[v5][0]) { case 0: var v4 = 1; while (v4 < 9) { var v6 = Number(v4); this.view_interface.update_stockPanel_alpha(v6, 100); ++v4; } break; case 1: var v4 = 1; while (v4 < 9) { var v6 = Number(v4); if (this.view_interface.stockPanel_mask_states_arr[v5][v6] == 1) { v3 = 100; } else { v3 = 0; } this.view_interface.update_stockPanel_alpha(v6, v3); ++v4; } break; case 2: var v4 = 1; while (v4 < 9) { var v6 = Number(v4); if (this.view_interface.stockPanel_mask_states_arr[v5][v6] == 1) { v3 = 100; } else { v3 = 0; } this.view_interface.update_stockPanel_alpha(v6, v3); ++v4; } break; case 3: var v4 = 1; while (v4 < 9) { var v6 = Number(v4); this.view_interface.update_stockPanel_alpha(v6, 0); ++v4; } } } ++v5; } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_6', 5); }; v2.updateView_debug_6 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); if (_global.model.view_leader_MCs_played == 'done') { var v5 = 1; while (v5 < this.model.playerArr.length) { var v6 = this.model.playerArr[v5]; var v3 = this.view_interface.interfaceMC['leaderMC' + v5]; var v8; v3.num = v5; var v7 = 0; v3.cfIcon1.gotoAndStop(1); v3.cfIcon2.gotoAndStop(1); v3.cfIcon3.gotoAndStop(1); var v4 = 1; while (v4 < v6.ceaseFireArr.length) { if (v6.ceaseFireArr[v4]._status) { ++v7; v3['cfIcon' + v7].gotoAndStop(2); var v9 = new Color(v3['cfIcon' + v7]); v9.setTransform(this.model.playerArr[v4].playerColorTint1); } ++v4; } if (this.model.human.ceaseFireArr[v5]._status) { v9 = new Color(v3.iconCeaseFire); v9.setTransform(this.model.human.playerColorTint1); v3.iconCeaseFire.gotoAndStop(2); v3.iconCeaseFire.txt.text = this.model.human.ceaseFireArr[v5]._turnsLeft; } else { v3.iconCeaseFire.gotoAndStop(1); } if (v6.bioloaded) { v3.iconBio.gotoAndStop(2); } else { v3.iconBio.gotoAndStop(1); } v8 = this.view_interface.interfaceMC['leaderStat' + v5 + '_' + 1].maskMC; v8._yscale = v6.regardArr[0]; v8 = this.view_interface.interfaceMC['leaderStat' + v5 + '_' + 2].maskMC; v8._yscale = this.model.populationPercentage(v6); ++v5; } } else { if (_global.model.view_leader_MCs_played == 'false') { this.set_leader_face_MC_sequence(); } } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_7', 9); }; v2.updateView_debug_7 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); if (this.model.__get__userSelectedActionBtn() == 'preAttack') { if (this.model.human.preAttackStatus == 'ready') { this.view_interface.update_stockPanel_alpha(0, 0); this.view_interface.update_stockPanel_alpha(1, 0); this.view_interface.update_stockPanel_alpha(2, 0); this.view_interface.update_stockPanel_alpha(3, 0); this.view_interface.update_stockPanel_alpha(4, 100); this.view_interface.update_stockPanel_alpha(5, 100); } } if ((this.model.__get__userSelectedCarrier()).weaponName == 'space') { this.view_interface.update_stockPanel_alpha(3, 100); this.view_interface.update_stockPanel_alpha(4, 0); this.view_interface.update_stockPanel_alpha(5, 0); } if (this.model.human.preAttackStatus == 'ready') { } if (this.model.__get__userSelectedActionBtn() == 'attack') { if (this.model.human.spy_readiness >= 25) { } } _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_8', 9); }; v2.updateView_debug_8 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); this.view_interface.btn_sound.__set__state(this.model.option.sound); this.view_interface.btn_music.__set__state(this.model.option.music); _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_9', 9); }; v2.updateView_debug_9 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); this.view.updateCities(); _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_10', 9); }; v2.updateView_debug_10 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter_interface.update_statistics(); _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_11', 9); }; v2.updateView_debug_11 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter_interface.update_centerScreenContent(); _global.presenter.allUnitsDone_intervalID = setInterval(this, 'updateView_debug_12', 9); }; v2.updateView_debug_12 = function () { clearInterval(_global.presenter.allUnitsDone_intervalID); _global.presenter_interface.view_interface.update_highScore(_global.model.human.score); _global.presenter.allUnitsDone_intervalID = setInterval(_global.view, 'to_interface_timed_4', 9); }; v2.stock_req_check_single = function (_req, _btn) { var v3 = false; var v4 = _global.model.human.weaponStock.getWeaponByName(_btn.relatedWeapon); switch (_req) { return v3; case 'isActive': if (v4.active) { v3 = true; } return v3; case 'weaponInStock': if (v4.__get__inStock() > 0) { v3 = true; } return v3; case 'isPayload_pre': if (v4.weaponCategory == 'payload') { if (this.model.human.preAttackStatus == 'ready') { v3 = true; } else { v3 = false; } } else { v3 = true; } return v3; case 'isCarrier_pre': if (v4.weaponCategory == 'carrier') { if (this.model.human.preAttackStatus != 'ready') { v3 = true; } else { v3 = false; } } else { v3 = true; } return v3; case 'preAttackRelated': if (v4.weaponCategory == 'carrier' || v4.weaponCategory == 'payload' || v4.weaponCategory == 'specialCarrier' || v4.weaponCategory == 'specialLoad') { if (v4.weaponCategory == 'payload') { if ((this.model.__get__userSelectedCarrier()).weaponLevel >= v4.weaponLevel) { v3 = true; } else { v3 = false; } } else { v3 = true; } } else { v3 = false; } return v3; case 'attackRelated': if (v4.weaponCategory == 'conventional') { v3 = true; } else { v3 = false; } return v3; case 'inactive': if (!v4.active) { v3 = true; } else { v3 = false; } return v3; case 'defenseRelated': if (v4.weaponCategory == 'anti') { v3 = true; } else { v3 = false; } return v3; case 'spy_allowed': if (v4.weaponCategory == 'spy') { if (this.model.human.spy_readiness / 25 >= v4.weaponLevel) { v3 = true; } } else { return true; } return v3; case 'false': return false; return v3; } return v3; }; v2.update_leaderFaces = function () { if (this.model.view_leader_MCs_played == 'done') { var v3 = 0; while (v3 < 6) { this.view_interface.update_leaderFace(v3, 1, true, true); ++v3; } v3 = 0; while (v3 < this.model.playerArr.length) { var v2 = this.model.playerArr[v3]; this.view_interface.update_leaderFace(v2.playerNum, v2.faceFrame, v2.alive, false, v2.dead_avatar_played); if (!v2.dead_avatar_played && !v2.alive) { v2.dead_avatar_played = true; } ++v3; } } else { if (this.model.view_leader_MCs_played == 'false') { var v3 = 0; while (v3 < 6) { this.view_interface.interfaceMC['leaderMC' + v3].gotoAndPlay(v3); ++v3; } } } }; v2.set_leader_face_MC_sequence = function () { this.update_leaderFaces(); this.model.view_leader_MCs_played = 'pending'; this.model.view_leader_MCs_played_max = this.model.playerArr.length; this.model.view_leader_MCs_sequence_interval_id = setInterval(this, 'do_leader_face_MC_sequence_itteration', 500); }; v2.testVar = 'test'; v2.minimalProductionInvestment = 0; v2.megaton_by_level_arr = ['', '10 megaton', '25 megaton', '50 megaton', '95 megaton']; v2.blockAllBtns = false; v2.block_start_btn = false; ASSetPropFlags(_global.Sub_sub_presenter_interface.prototype, null, 1); } #endinitclip } movieClip 5257 __Packages.Model_interface { #initclip if (!_global.Model_interface) { var v1 = function () {}; _global.Model_interface = v1; var v2 = v1.prototype; v2.__set__selected_action_name = function (_str) { this._selected_action_name = _str; return this.__get__selected_action_name(); }; v2.__get__selected_action_name = function () { return _global.model.userSelectedActionBtn; }; v2.__set__cur_pressed_action_btn = function (_btn) { if (this.__get__cur_pressed_action_btn()) { (this.__get__cur_pressed_action_btn()).__set__pressed(false); } this._cur_pressed_action_btn = _btn; return this.__get__cur_pressed_action_btn(); }; v2.__get__cur_pressed_action_btn = function () { return this._cur_pressed_action_btn; }; v2.addProperty('cur_pressed_action_btn', v2.__get__cur_pressed_action_btn, v2.__set__cur_pressed_action_btn); v2.addProperty('selected_action_name', v2.__get__selected_action_name, v2.__set__selected_action_name); ASSetPropFlags(_global.Model_interface.prototype, null, 1); } #endinitclip } movieClip 5258 __Packages.Btn_action { #initclip if (!_global.Btn_action) { var v1 = function (_str1, _str2, _overlayMC, _mc1, _mc2, _tf) { this.overlayMC = _overlayMC; this.actionName = _str1; this.label = _str2; this.scrnMC = _mc1; this.btnSwitch = _mc2; this.tf = _tf; this.p_bioloaded = false; }; _global.Btn_action = v1; var v2 = v1.prototype; v2.__set__pressed = function (_bln) { this._pressed = _bln; if (this.isSetAction) { this.__set__state(3); } else { if (_bln) { this.__set__state(2); } else { this.__set__state(1); } } return this.__get__pressed(); }; v2.__get__pressed = function () { return this._pressed; }; v2.__set__btnStatus = function (_str) { this._btnStatus = _str; return this.__get__btnStatus(); }; v2.__get__btnStatus = function () { return this._btnStatus; }; v2.setLabelText = function () { this.tf.text = this.label; this.tf.setTextFormat(_global.view.textFormats.interface_actionText_1); this.tf.embedFonts = true; }; v2.__set__btnState = function (_nr) { this._btnState = _nr; return this.__get__btnState(); }; v2.__get__btnState = function () { return this._btnState; }; v2.__set__hover = function (_bln) { this._hover = _bln; this.updateBtn(); return this.__get__hover(); }; v2.__get__hover = function () { return this._hover; }; v2.__set__state = function (_nr) { this._state = _nr; this.updateBtn(); return this.__get__state(); }; v2.updateBtn = function () { switch (this._state) { case 1: if (this.__get__hover()) { this.tf.textColor = 16777215; this.scrnMC.gotoAndStop(4); } else { this.tf.textColor = 11184810; this.scrnMC.gotoAndStop(1); } this.btnSwitch.gotoAndStop(1); break; case 2: if (this.__get__hover()) { this.tf.textColor = 16777215; } else { this.tf.textColor = 0; } this.scrnMC.gotoAndStop(2); this.btnSwitch.gotoAndStop(2); break; case 3: if (this.__get__hover()) { this.tf.textColor = 16777215; } else { this.tf.textColor = 0; } this.scrnMC.gotoAndStop(3); this.btnSwitch.gotoAndStop(3); break; case 4: this.tf.textColor = 16777215; this.scrnMC.gotoAndStop(4); this.btnSwitch.gotoAndStop(1); } }; v2.__get__state = function () { return this._state; }; v2.__set__handCursor = function (_bln) { if (_bln) { this.overlayMC.gotoAndStop(1); } else { this.overlayMC.gotoAndStop(2); } return this.__get__handCursor(); }; v2.__set__bioloaded = function (_bln) { this.p_bioloaded = _bln; if (_bln) { this.scrnMC.bioMC1.gotoAndPlay(2); this.scrnMC.bioMC2.gotoAndPlay(2); } else { this.scrnMC.bioMC1.gotoAndStop(1); this.scrnMC.bioMC2.gotoAndStop(1); } return this.__get__bioloaded(); }; v2.__get__bioloaded = function () { return this.p_bioloaded; }; v2.type = 'action'; v2.hoverable = true; v2._hover = false; v2._btnState = 0; v2._pressed = false; v2._state = 1; v2.addProperty('bioloaded', v2.__get__bioloaded, v2.__set__bioloaded); v2.addProperty('btnState', v2.__get__btnState, v2.__set__btnState); v2.addProperty('btnStatus', v2.__get__btnStatus, v2.__set__btnStatus); v2.addProperty('handCursor', function () {}, v2.__set__handCursor); v2.addProperty('hover', v2.__get__hover, v2.__set__hover); v2.addProperty('pressed', v2.__get__pressed, v2.__set__pressed); v2.addProperty('state', v2.__get__state, v2.__set__state); ASSetPropFlags(_global.Btn_action.prototype, null, 1); } #endinitclip } movieClip 5259 __Packages.Sub_presenter { #initclip if (!_global.Sub_presenter) { var v1 = function () {}; _global.Sub_presenter = v1; var v2 = v1.prototype; v2.turnResults = function () { this.model.reset_playerAB_position_arr(); this.model.attackingSubs_arr = []; this.model.attackingSubs_arr_index = 0; this.model.turnResultsArr = []; this.model.battleMC_units_active = false; for (var v71 in this.model.activePlayerArr) { var v56 = true; var v13 = this.model.activePlayerArr[v71]; v13.shortMSG_arr = []; v13.turnBattleCasualties = 0; v13.turnBattleKills = 0; v13.turnPropagandaCasualties = 0; v13.turnResourcesGained = 0; if (v13.spy_readiness < 0) { v13.spy_readiness = 0; } if (isNaN(v13.spy_readiness)) { v13.spy_readiness = 50; } v13.spy_readiness = Math.min(v13.spy_readiness + 25, 100); var v5 = 0; while (v5 < v13.regardArr.length) { if (v13.ceaseFireArr[v5]._status) { v13.regardArr[v5] += 2; } if (v13.regardArr[v5] < 100) { ++v13.regardArr[v5]; if (this.model.difficulty_level == 0) { ++v13.regardArr[v5]; ++v13.regardArr[v5]; } if (this.model.difficulty_level == 1) { ++v13.regardArr[v5]; } } if (v13.regardArr[v5] < 50) { ++v13.regardArr[v5]; if (this.model.difficulty_level == 0) { ++v13.regardArr[v5]; } } if (v13.regardArr[v5] < 30) { ++v13.regardArr[v5]; } if (v13.regardArr[v5] > 100) { v13.regardArr[v5] = 100; } if (v13.playedBy == 'AI') { var v69 = 1; while (v69 < v13.regardArr.length) { v13.regardArr[v69] += this.model.difficulty_level; ++v69; } } ++v5; } if (!this.model.playerArr[v13.primary_enemy].alive) { v13.primary_enemy = this.model.get_random_set_enemy(v13, v13.secundary_enemy); } if (!this.model.playerArr[v13.secundary_enemy].alive) { v13.secundary_enemy = this.model.get_random_set_enemy(v13, v13.primary_enemy); } if (v13.__get__religion() > 11) { v13.religion -= this.model.tools.randRange(5, 10); } if (v13.money < -1 && v13.playedBy == 'human') { this.model.error('money', v13.playerNum, v13.money); } if (v13.money < 0) { v13.money = 1; } if (v13.special_person) { v13.money += 3; } if (v13.preAttackStatus == 'ready' && v13.turnAction_1.__get__action() != 'preAttack' && v13.turnAction_2.__get__action() != 'preAttack') { this.model.turnResultsArr.push({'_plr': v13.playerNum, '_item': 'cancel_pre'}); v13.preAttackStatus = 'inactive'; } if (v13.turnAction_1.__get__action() != 'preAttack' && v13.turnAction_2.__get__action() != 'preAttack') { v13.__set__preLocation(undefined); } if (v13.__get__preLocation() && v13.preAttackStatus != 'ready') { v13.__set__preLocation(undefined); } for (v69 in v13.diplomacyAcceptedArr) { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'diplomacyAccepted', '_arr': v13.diplomacyAcceptedArr[v69]}); } for (v69 in v13.diplomacyRejectedArr) { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'diplomacyRejected', '_arr': v13.diplomacyRejectedArr[v69]}); } for (v69 in v13.cityArr) { var v9 = v13.cityArr[v69]; if (v9.bioloaded) { v9.removeBioload(); } } v13.weaponStock.removeBioload(); v13.bioloadedActionsArr = []; v13.bioloadedStockArr = []; v13.bioloaded = false; v13.diplomacyAcceptedArr = []; v13.diplomacyRejectedArr = []; v13.preBuilding_this_turn = false; for (v69 in v13.diplomacy_offeredLastTurn) { var v21 = v13.diplomacy_offeredLastTurn[v69]; if (v21 > 0) { --v13.diplomacy_offeredLastTurn[v69]; } else { if (v21 <= 0) { v13.diplomacy_offeredLastTurn[v69] = false; } } } for (v69 in v13.weaponStock.weaponArr) { v13.weaponStock.weaponArr[v69].inUse = 0; } this.view.AB_interval_start_index = 0; for (v69 in v13.turnActionArr) { var v4 = v13.turnActionArr[v69]; switch (v4.__get__action()) { case 'resources': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'resources', '_value': '0', '_plusmin': 'plus'}); break; case 'production': for (var v8 in v4.productionInvestmentArr) { if (v4.productionInvestmentArr[v8][1] > 0) { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'produce2', '_value': v4.productionInvestmentArr[v8][0], '_amount': v4.productionInvestmentArr[v8][1], '_group': v4.productionInvestmentArr[v8][2], '_money': v4.productionInvestmentArr[v8][3]}); } } this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'production_building'}); break; break; case 'produce': case 'research': for (var v8 in v4.researchArr) { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'research', '_value': v4.researchArr[v8].techID, 'amount': 1}); } for (v8 in v4.inventArr) { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'research', '_value': v4.inventArr[v8].techID, 'amount': 1}); } this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'research_building'}); break; case 'religion': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'religion', '_value': 0, '_plusmin': 'plus'}); break; case 'preAttack': if (v13.preAttackStatus == 'active' || v13.preAttackStatus == 'inactive') { v56 = false; var v16 = v4.preAttackCarrier.weaponID; var v26 = v4.preAttackPayload.weaponID; var v57 = v4.targetCity.cityID; var v11; if (v4.preAttackCarrier.weaponType == 'rocket') { v11 = 'silo'; } else { if (v4.preAttackCarrier.weaponType == 'plane') { v11 = 'airfield'; } else { if (v4.preAttackCarrier.weaponType == 'sub') { v11 = 'sub'; this.model.turnResultsArr.push({'_item': 'battle', '_player': v13.playerNum, '_weapon': v4.preAttackCarrier.weaponID, '_action': 1, '_dontReduce': true}); } else { if (v4.preAttackCarrier.weaponType == 'ship') { v11 = 'ship'; this.model.turnResultsArr.push({'_item': 'battle', '_player': v13.playerNum, '_weapon': v4.preAttackCarrier.weaponID, '_action': 1, '_dontReduce': true, '_dontBeAnAss': true}); } else { v11 = v4.preAttackCarrier.weaponType; } } } } this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'setPreAttack', '_value': 'ready', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_weapon': v4.preAttackCarrier.weaponID, '_carrier': v16, '_payload': v26, '_city': v4.targetCity.cityID, '_frame': v11, '_blocked': false}); } else { if (v13.preAttackStatus == 'ready') { v13.preBuilding_this_turn = true; var v16 = v4.preAttackCarrier.weaponID; var v26 = v4.preAttackPayload.weaponID; var v57 = v4.targetCity.cityID; var v17 = false; var v38; var v28; var v18; if (v4.preAttackCarrier.weaponType == 'rocket') { var v11 = 'silo'; } else { if (v4.preAttackCarrier.weaponType == 'plane') { var v11 = 'airfield'; } else { if (v4.preAttackCarrier.weaponType == 'sub') { v18 = 2; } else { if (v4.preAttackCarrier.weaponType == 'ship') { v17 = true; v38 = new Array(); v28 = 2; } else { var v11 = v4.preAttackCarrier.weaponType; } } } } this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'battle', '_value': 'preAttack', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_weapon': v16, '_carrier': v16, '_payload': v26, '_city': v4.targetCity.cityID, '_blocked': false, '_casualties': 0, '_frame': v11, '_result': true, '_isShip': v17, '_attack_arr': v4.ship_attack_arr, '_result_arr': v38, '_action': v18}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'setPreAttack', '_value': 'inactive'}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'regard', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'regard', '_value': 'preAttack', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_wpnLevel': v4.preAttackPayload.weaponLevel}); } } break; case 'attack': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'battle', '_value': 'attack', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_weapon': v4.attackWeapon.weaponID, '_city': v4.targetCity.cityID, '_casualties': 0, '_result': true, '_spyArr': undefined, '_spyBuilding': v4.spyBuilding}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'regard', '_value': 'attack', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_wpnLevel': v4.attackWeapon.weaponLevel}); if (v4.attackWeapon.weaponType == 'spy') { this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'reset_spy_readiness', '_value': 0}); } break; case 'preCounter': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'defense', '_value': v4.attackWeapon.weaponID, '_result': false, '_frame': v4.attackWeapon.weaponName}); break; case 'defense': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'defense', '_value': v4.attackWeapon.weaponID, '_results': false, '_frame': v4.attackWeapon.weaponName}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'regard', '_value': 'propaganda', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum}); break; case 'propaganda': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'propaganda', '_a': v13.playerNum, '_b': v4.targetPlayer.playerNum, '_city': v4.targetCity.cityID, '_value': 0}); break; case 'diplomacy': this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'diplomacy', '_value': 'call', '_leader': v4.diplomacyLeader, '_option': v4.diplomacyOption}); this.model.turnResultsArr.push({'_player': v13.playerNum, '_item': 'regard', '_value': 'diplomacy', '_a': v13.playerNum, '_b': v4.diplomacyLeader, '_diplomacy': true}); } } } for (v71 in this.model.turnResultsArr) { var v3 = this.model.turnResultsArr[v71]; switch (v3._item) { case 'resources': if (_global.model.playerArr[v3._player].playedBy == 'human') { v3._value = Math.round(_global.model.playerArr[v3._player].population / this.model.difficulty_level_specific_vars.player_resources_divider[this.model.difficulty_level]); } else { v3._value = Math.round(_global.model.playerArr[v3._player].population / this.model.difficulty_level_specific_vars.enemy_resources_divider[this.model.difficulty_level]); } v3._plusmin = 'plus'; break; case 'religion': if (_global.model.playerArr[v3._player].playedBy == 'human') { v3._value = this.model.difficulty_level_specific_vars.player_religion_addition[this.model.difficulty_level]; } else { v3._value = this.model.difficulty_level_specific_vars.enemy_religion_addition[this.model.difficulty_level]; } break; case 'battle': if (v3._value == 'preAttack' && !v3._isShip) { var v10 = _global.model.playerArr[v3._player].weaponStock.getWeaponByID(v3._payload); var v29 = v10.maxKills; if (this.model.playerArr[v3._a].playedBy == 'AI' && this.model.playerArr[v3._b].playedBy == 'human') { v3._casualties = Math.round(_global.model.tools.randRange(v29, v29 * 1.2)); } else { v3._casualties = Math.round(_global.model.tools.randRange(v29 / 1.5, v29)); } if (!v3._casualties || isNaN(v3._casualties)) { v3._casualties = 0; } for (v69 in this.model.turnResultsArr) { if (this.model.turnResultsArr[v69]._item == 'defense') { var v7 = this.model.turnResultsArr[v69]; if ((_global.model.playerArr[v7._player].weaponStock.getWeaponByID(v7._value)).weaponName == (_global.model.playerArr[v3._player].weaponStock.getWeaponByID(v3._carrier)).counteredBy && v3._b == v7._player) { if (v3._isShip) { var v8 = 0; while (v8 < 3) { if (this.model.tools.randRange(0, 3) == 3) { v3._result_arr.push({'_num': v8, '_result': false, '_casualties': 0}); v7._restult = true; } else { v3._result_arr.push({'_num': v8, '_result': true, '_casualties': _global.model.tools.randRange(v10.maxKills / 2, v10.maxKills)}); } ++v8; } break; } else { if (this.model.tools.randRange(1, 9) != 5) { v3._casualties = 0; v3._result = false; v7._result = true; break; } else { v3._result = true; v7._result = true; v3._pass_anti = true; break; } } } } } var v33 = this.model.human.weaponStock.getWeaponByID(v3._payload); if (v33.weaponName.slice(0, -1) == 'bioload' && v3._result) { if ((this.model.human.weaponStock.getWeaponByID(v3._weapon)).weaponName == 'sub') { for (var v68 in this.model.turnResultsArr) { var v12 = this.model.turnResultsArr[v68]; if (v12._player == v3._player && v12._isSub) { v12._bioload = true; } } } v3._bioload = true; var v27 = this.model.createBioHazardArr(Number(v33.weaponName.substr(v33.weaponName.length - 1, 1))); (this.model.getCityByID(v3._city)).bioload_in_battle = true; this.model.turnResultsArr.push({'_item': 'bioload', '_value': 'deactivate', '_plr': v3._b, '_arr': v27}); } } else { if (v3._isShip) { this.model.playerArr[v3._player].shipFrame = 2; v3._action = 2; var v30 = false; for (var v70 in this.model.turnResultsArr) { if (this.model.turnResultsArr[v70]._item == 'defense' && v3._b == this.model.turnResultsArr[v70]._player) { var v19 = this.model.turnResultsArr[v70]; if ((this.model.playerArr[v3._a].weaponStock.getWeaponByID(v19._value)).weaponName == 'antiAir') { v30 = true; v19._result = true; } } } var v8 = 0; while (v8 < 3) { var v10 = this.model.playerArr[v3._player].weaponStock.getWeaponByID(v3._attack_arr[v8].wpn); var v14 = true; var v20 = Math.round(this.model.tools.randRange(v10.maxKills / 2, v10.maxKills)); var v25 = this.model.tools.randRange(1, 3); if (v30 && v25 == 2) { v14 = false; v20 = 0; } v3._result_arr.push({'_num': v8, '_result': v14, '_casualties': v20}); if (v10.weaponName.slice(0, -1) == 'bioload' && v14) { v3._attack_arr[v8]._bioload = true; var v27 = this.model.createBioHazardArr(Number(v10.weaponName.substr(v10.weaponName.length - 1, 1))); (this.model.getCityByID(v3._attack_arr[v8].city)).bioload_in_battle = true; this.model.turnResultsArr.push({'_item': 'bioload', '_value': 'deactivate', '_plr': v3._b, '_arr': v27}); } ++v8; } } else { if (v3._value == 'attack') { var v31 = _global.model.human.weaponStock.getWeaponByID(v3._weapon); if (v31.weaponType != 'spy') { v3._casualties = Math.round(_global.model.tools.randRange(v31.maxKills / 2, v31.maxKills)); } else { v3._spyArr = this.createSpyStealArray(v3._a, v3._b, v31.weaponLevel); v3._casualties = 0; v3._frame = v3._spyBuilding; } } } } if (v3._attack_arr) { for (v69 in v3._attack_arr) { var v15 = this.model.human.weaponStock.getWeaponByID(v3._attack_arr[v69].wpn); if (v15.weaponName.slice(0, -1) == 'bioload') { v3._attack_arr[v69]._bioload = true; v27 = this.model.createBioHazardArr(Number(v15.weaponName.substr(v15.weaponName.length - 1, 1))); (this.model.getCityByID(v3._attack_arr[v69].city)).bioload_in_battle = true; this.model.turnResultsArr.push({'_item': 'bioload', '_value': 'deactivate', '_plr': v3._b, '_arr': v27}); } } } if (!isNaN(v3._casualties) && v3._casualties) { v9 = this.model.getCityByID(v3._city); if (v3._casualties > v9.population - v9.battle_loop_casualties) { v3._casualties = v9.population - v9.battle_loop_casualties; v9.propaganda_exclude = true; } v9.battle_loop_casualties += v3._casualties; _global.model.playerArr[v3._b].turnBattleCasualties += v3._casualties; _global.model.playerArr[v3._a].turnBattleKills += v3._casualties; if (!_global.model.playerArr[v3._b].lastAttackedBy_casualties || _global.model.playerArr[v3._b].lastAttackedBy_casualties < v3._casualties) { _global.model.playerArr[v3._b].lastAttackedBy_num = v3._a; _global.model.playerArr[v3._b].lastAttackedBy_casualties = v3._casualties; } _global.presenter.addToHighscore(v3._a, 1, v3._casualties); } if (v3._isShip) { var v6 = 0; while (v6 < v3._result_arr.length) { if (!isNaN(v3._result_arr[v6]._casualties) && v3._result_arr[v6]._casualties) { v9 = _global.model.getCityByID(v3._attack_arr[v6].city); if (v3._result_arr[v6]._casualties > v9.population - v9.battle_loop_casualties) { v3._result_arr[v6]._casualties = v9.population - v9.battle_loop_casualties; v9.propaganda_exclude = true; } v9.battle_loop_casualties += v3._result_arr[v6]._casualties; _global.model.playerArr[v3._b].turnBattleCasualties += v3._result_arr[v6]._casualties; _global.model.playerArr[v3._a].turnBattleKills += v3._result_arr[v6]._casualties; if (!_global.model.playerArr[v3._b].lastAttackedBy_casualties || _global.model.playerArr[v3._b].lastAttackedBy_casualties < v3._result_arr[v6]._casualties) { _global.model.playerArr[v3._b].lastAttackedBy_num = v3._a; _global.model.playerArr[v3._b].lastAttackedBy_casualties = v3._result_arr[v6]._casualties; } _global.presenter.addToHighscore(v3._a, 1, v3._result_arr[v6]._casualties); } ++v6; } } break; break; case 'propaganda': case 'diplomacy': } } for (v71 in this.model.playerArr) { v13 = this.model.playerArr[v71]; var v44 = true; var v41 = true; if (v13.preAttackStatus == 'ready' && v13.alive) { if (v13.turnAction_1.__get__action() == 'preAttack') { v44 = false; } if (v13.turnAction_2.__get__action() == 'preAttack') { v41 = false; } if (v44) { v13.turnAction_1.doReset(); } else { if (v41) { v13.turnAction_2.doReset(); } } v13.preAttackStatus = 'inactive'; } if (v13.playerNum == 0) { } } }; v2.createSpyStealArray = function (plr_a_nr, plr_b_nr, spyLevel) { var v5 = new Array(); var v13 = new Array(); var v11 = new Array(); var v7 = this.model.playerArr[plr_b_nr]; var v4; var v19 = this.model.spy_stat_obj['spy' + spyLevel]; var v12 = this.model.tools.randRange(1, v19.weaponStealMax); if (v7.special_person) { v12 = 1; } var v9 = 0; var v20 = 'resources'; var v8; var v15 = Math.round((v7.money / 100) * this.model.tools.randRange(spyLevel * 10, v19.moneyStealPrcMax)); if (v15 > _global.model.difficulty_level_specific_vars.spy_steal_money_max[_global.model.difficulty_level]) { v15 = _global.model.difficulty_level_specific_vars.spy_steal_money_max[_global.model.difficulty_level]; } v11.push(v15); if (v7.special_person && v15 > 20) { v15 = 20; } for (var v18 in v7.weaponStock.weaponArr) { v4 = v7.weaponStock.weaponArr[v18]; if (!v7.special_person) { if (v4.weaponLevel <= spyLevel && v4.__get__inStock() > 0 && v4.weaponType != 'spy') { v5.push(v4.weaponID); } } else { if (v4.weaponLevel <= 1 && v4.__get__inStock() > 0 && v4.weaponType != 'spy') { v5.push(v4.weaponID); } } } for (var v17 in this.model.turnResultsArr) { if (this.model.turnResultsArr[v17]._player == plr_a_nr) { var v3 = 0; while (v3 < this.model.spyActions_arr.length) { if (this.model.turnResultsArr[v17]._item == this.model.spyActions_arr[v3]) { v8 = this.model.spyActions_arr[v3]; break; } ++v3; } } } for (var v16 in this.model.spyActions_arr) { if (this.model.spyActions_arr[v16] != v8) { v13.push(this.model.spyActions_arr[v16]); } } v11.push(v13[this.model.tools.randRange(0, v13.length - 1)]); if (v5.length < v12) { v12 = v5.length; } var v6 = 0; while (v6 < v12) { v9 = this.model.tools.randRange(0, v5.length - 1); v11.push(v5[v9]); v5.splice(v9, 1); _global.presenter.addToHighscore(plr_a_nr, 2, 1); ++v6; } return v11; }; ASSetPropFlags(_global.Sub_presenter.prototype, null, 1); } #endinitclip } movieClip 5260 __Packages.Presenter { #initclip if (!_global.Presenter) { var v1 = function (param_model) { super(); this.__set__model(param_model); }; _global.Presenter = v1; _global.Presenter extends Sub_presenter; var v2 = v1.prototype; v2.__set__model = function (_param) { this._model = _param; return this.__get__model(); }; v2.__get__model = function () { return this._model; }; v2.__set__view = function (_param) { this._view = _param; return this.__get__view(); }; v2.__get__view = function () { return this._view; }; v2.updateMiniMap = function () { (this.__get__view()).updateCities(); }; v2.setOutlineColor = function () { for (var v3 in (this.__get__model()).playerArr) { var v2 = (this.__get__model()).playerArr[v3]; (this.__get__view()).mapOutlineColorObj['outlineTrans' + v2.playerNum].setTransform(v2.playerColorTint1); (this.__get__view()).faceOutlineColorObj['outlineTrans' + v2.playerNum].setTransform(v2.playerColorTint1); } }; v2.btn_pressed_new_game = function () { _global.stopAllSounds(); _level0.stopAllSounds(); _level0.endGameMC.sound.stop(); (this.__get__model()).theme_sound.stop(); delete _level0.endGameMC.onEnterFrame; delete _global.model; delete _global.model_interface; delete _global.model_gameMenu; _root.gotoAndPlay(2); }; v2.initBattle = function () { (this.__get__model()).battle.resetBattle(); (this.__get__model()).battle.createToSpawnUnitsArr(); var v17 = 0; var v9 = new Array(); var v13 = 0; for (var v19 in (this.__get__model()).battle._toSpawnUnitsArr) { if (!(this.__get__model()).battle._toSpawnUnitsArr[v19]._building) { var v5 = (this.__get__model()).battle._toSpawnUnitsArr[v19]; var v10 = (this.__get__model()).playerArr[v5.player].playerColorTint1; var v12 = (this.__get__model()).playerArr[v5.player].playerColor; v13 += 5; (this.__get__model()).battle._activeUnitsArr.push(new Unit(v5.unitID, (this.__get__view()).battleSrcMC, ((this.__get__model()).playerArr[v5.player].weaponStock.getWeaponByID(v5.weaponID)).weaponType, 'unit' + ++v17, v5.startX, v5.startY, v5.wayPointArr, v5.result, v5.tail, v5.tailNum, v5.force_MC, v10, v5.startNum, v13, v5.targetPlayer, v5.tr, v5.player, v12, v5.wildCard, v5.explosion_name)); if (v5.tail) { v9.push(v5.unitID); } } else { var v14 = (this.__get__model()).battle._toSpawnUnitsArr[v19]; (this.__get__model()).battle._activeUnitsArr.push({'_building': true, 'obj': v14}); } if ((this.__get__model()).battle._toSpawnUnitsArr[v19]._addToSubArr) { (this.__get__model()).attackingSubs_arr.push((this.__get__model()).battle._toSpawnUnitsArr[v19]); } } for (v19 in v9) { var v8 = v9[v19]; for (var v4 in (this.__get__model()).battle._activeUnitsArr) { var v7 = (this.__get__model()).battle._activeUnitsArr[v4]; if (v7.unitID == v8) { for (var v16 in (this.__get__model()).battle._activeUnitsArr) { var v6 = (this.__get__model()).battle._activeUnitsArr[v16]; if (v7.tail == v6.unitID) { v7.tail = v6; } } } } } v19 = 0; var v18 = []; var v3 = _global.model.battle.all_turn_buildings_arr; v4 = 0; while (v4 < v3.length) { if (v3[v4].tr._spyBuilding) { for (v16 in v3) { if (v3[v16]._frame == v3[v4]._frame && v3[v4] != v3[v16] && v3[v16]._player == v3[v4]._player) { v3[v4]._frame = 'spyCenter'; } } } if (!(this.__get__model()).loop_playerAB_position_arr('isDouble', v3[v4]._player, v3[v4]._frame)) { if (v3[v4]._frame != 'propaganda_2') { var v11 = (this.__get__view()).showActionBuildingFromObj(v3[v4]); this.add_to_playerAB_position_arr(v3[v4]._player, v3[v4]._frame, v11); } else { if (_global.model.playerArr[v3[v4]._player].preLocation) { var v11 = this.get_preAB_mc(v3[v4]._player); this.add_to_playerAB_position_arr(v3[v4]._player, v3[v4]._frame, v11); } } } ++v4; } this.set_playerAB_position_arr_action_names(); (this.__get__view()).AB_interval_ID = setInterval(this.__get__view(), 'interval_func', 1600); if (_global.debug.skip_battle_animation) { _global.presenter.allUnitsDone_intervalID = setInterval(_global.presenter, 'allUnitsDone', 100); } else { (this.__get__view()).createUnitTicker(); } }; v2.add_to_playerAB_position_arr = function (_plrNum, _aname, _mc) { for (var v6 in (this.__get__model()).playerAB_position_arr) { var v2 = (this.__get__model()).playerAB_position_arr[v6]; if (v2._num == _plrNum && (!v2.building_name || v2.building_name == '')) { (this.__get__model()).playerAB_position_arr[v6].building_name = _aname; (this.__get__model()).playerAB_position_arr[v6].building_MC = _mc; break; } } }; v2.set_playerAB_position_arr_action_names = function () { for (var v4 in (this.__get__model()).playerAB_position_arr) { var v2 = (this.__get__model()).playerAB_position_arr[v4]; for (var v3 in (this.__get__model()).building_names_to_actions_arr) { if ((this.__get__model()).building_names_to_actions_arr[v3].building_name == v2.building_name) { v2.action_name = (this.__get__model()).building_names_to_actions_arr[v3].action_name; } } } }; v2.get_preAB_mc = function (_plrNum) { var v3 = (this.__get__view()).battleSrcMC['ab' + _plrNum + '_' + _global.model.playerArr[_plrNum].preLocation]; return v3; }; v2.allUnitsDone = function () { clearInterval(this.allUnitsDone_intervalID); var v5 = 0; for (var v6 in (this.__get__model()).battle._toDeleteUnitsArr) { var v4 = (this.__get__model()).battle._toDeleteUnitsArr[v6]; ++v5; v4.explosionMC.removeMovieClip(); v4.MC.removeMovieClip(); v4.tintMC.removeMovieClip(); v4.shadowMC.removeMovieClip(); false; if (v5 > 20) { break; } } var v3 = 0; while (v3 < (this.__get__model()).battle._toDeleteExplosionMC_arr.length) { (this.__get__model()).battle._toDeleteExplosionMC_arr[v3].removeMovieClip(); (this.__get__model()).battle._toDeleteExplosionMC_arr.splice(v3, 1); if (v3 > 20) { break; } ++v3; } _global.presenter.allUnitsDone_intervalID = setInterval(_global.presenter, 'endBattle', 25); }; v2.showLastActionBuildings = function () { (this.__get__model()).actionBuildingInterval = setInterval(this.__get__view(), 'getIntervalBuildingsArray', 2000); }; v2.endBattle = function () { clearInterval(this.allUnitsDone_intervalID); _global.model.battleTimerArr = []; _global.model.battleCounter = 20; _global.model.battleTimerIndex = 0; _global.model.unitStartNum = 0; for (var v3 in (this.__get__model()).playerArr) { (this.__get__model()).playerArr[v3].resetBuildingsShown(); } _global.presenter.allUnitsDone_intervalID = setInterval(_global.presenter, 'initInterface_1', 25); }; v2.doTR_from_battle = function (tr) { var v27; var v4; var v24 = ' ok '; switch (tr._item) { case 'battle': if (!tr._spyArr) { for (var v7 in (this.__get__model()).playerArr) { for (var v21 in (this.__get__model()).playerArr[v7].cityArr) { var v13 = (this.__get__model()).playerArr[v7].cityArr[v21]; if (v13.cityID == tr._city && !isNaN(tr._casualties) && tr._casualties) { v13.total_battle_casualties += tr._casualties; } } } if (tr._isShip) { var v6 = 0; while (v6 < tr._attack_arr.length) { var v11 = tr._attack_arr[v6]; var v12 = tr._result_arr[v6]; ((this.__get__model()).getCityByID(v11.city)).total_battle_casualties += v12._casualties; ++v6; } } } else { var v5 = (this.__get__model()).playerArr[tr._a]; var v10 = (this.__get__model()).playerArr[tr._b]; var v14 = ''; var v18 = ''; if (v10.money >= tr._spyArr[0]) { v5.money += tr._spyArr[0]; v10.money -= tr._spyArr[0]; } else { tr._spyArr[0] = v10.money; v10.money = 0; v5.money += tr._spyArr[0]; } var v7 = 2; while (v7 < tr._spyArr.length) { v4 = tr._spyArr[v7]; if ((v5.weaponStock.getWeaponByID(v4)).active) { v14 += 'WEAPON: ' + (v5.weaponStock.getWeaponByID(v4)).prettyName + ' <br/> '; v18 += 'STOLEN: ' + (v5.weaponStock.getWeaponByID(v4)).prettyName + ' <br/> '; (v5.weaponStock.getWeaponByID(v4)).__set__inStock((v5.weaponStock.getWeaponByID(v4)).__get__inStock() + 1); if ((v10.weaponStock.getWeaponByID(v4)).__get__inStock()) { (v10.weaponStock.getWeaponByID(v4)).__set__inStock((v10.weaponStock.getWeaponByID(v4)).__get__inStock() - 1); } } else { v14 += ' TECHNOLOGY: ' + (v5.weaponStock.getWeaponByID(v4)).prettyName + ' <br/> '; (v5.weaponStock.getWeaponByID(v4)).active = true; v5.techTree.inventTechByName((v5.weaponStock.getWeaponByID(v4)).relatedTechName); } ++v7; } if (tr._spyArr[0] > 0) { v5.shortMSG_arr.push({'_type': 'spy', '_msg': 'YOUR SPY STOLE <br/> $' + tr._spyArr[0] + '.000.000,<br/> ' + v14}); v10.shortMSG_arr.push({'_type': 'spy', '_msg': 'AN ENEMY SPY STOLE <br/> $' + tr._spyArr[0] + '.000.000,<br/> ' + v18}); } else { if (tr._spyArr[1]) { v5.shortMSG_arr.push({'_type': 'spy', '_msg': 'YOUR SPY STOLE <br/>' + v14}); v10.shortMSG_arr.push({'_type': 'spy', '_msg': 'A ENEMY SPY STOLE <br/>' + v18}); } else { if (tr._spyArr.length < 1) { v5.shortMSG_arr.push({'_type': 'spy', '_msg': 'YOUR SPY DID NOT STEAL ANYTHING'}); v10.shortMSG_arr.push({'_type': 'spy', '_msg': 'AN ENEMY SPY WAS STOPPED'}); } } } } return v24; case 'resources': if (tr._plusmin == 'plus') { (this.__get__model()).playerArr[tr._player].money += tr._value; (this.__get__model()).playerArr[tr._player].turnResourcesGained += tr._value; _global.presenter.addToHighscore(tr._player, 5, tr._value); } else { (this.__get__model()).playerArr[tr._player].money -= tr._value; } return v24; case 'religion': (this.__get__model()).playerArr[tr._player].religion += tr._value; _global.presenter.addToHighscore(tr._player, 6, tr._value); return v24; case 'propaganda': var v8 = (this.__get__model()).playerArr[tr._a]; var v15 = (this.__get__model()).playerArr[tr._b]; var v23 = (this.__get__model()).getCityByID(tr._city); var v28; var v17; var v22 = v8.__get__religion() - v15.__get__religion(); if (v22 < 0) { v22 = 0; } var v19 = 0; if (v8.__get__population() - v15.__get__population() > 20) { v19 = -1; } if (v8.__get__population() - v15.__get__population() > 40) { v19 = -2; } if (v8.__get__population() - v15.__get__population() > 80) { v19 = -4; } if (v15.__get__population() - v8.__get__population() > 20) { v19 = 1; } if (v15.__get__population() - v8.__get__population() > 40) { v19 = 2; } if (v15.__get__population() - v8.__get__population() > 80) { v19 = 4; } if (v8.__get__religion() > v15.__get__religion()) { v17 = Math.round(v22); } else { v17 = 0; } if (v8.playedBy == 'AI') { if (v17 > 25) { v17 = 25; } } else { if (v17 > 15) { v17 = 15; } } v17 = Math.max(0, v17 + v19); if (v15.__get__religion() == 100) { v17 = 0; } var v16 = 0; v16 = Math.min(Math.round(((v23.population - v23.total_battle_casualties) / 100) * (v17 + 5)), 40); v16 = Math.round(v16 / 2); v23.propagandaMin.push(v16); if (v16 > 0) { v8.shortMSG_arr.push({'_type': 'propagandaGained', '_msg': 'You gained ' + v16 + '.000.000 citizens from propaganda'}); v15.shortMSG_arr.push({'_type': 'propagandaLost', '_msg': 'You lost ' + v16 + '.000.000 citizens from propaganda'}); } v15.turnPropagandaCasualties += v16; _global.presenter.addToHighscore(v8, 7, v16); var v9 = new Array(); for (var v21 in v8.cityArr) { var v13 = v8.cityArr[v21]; if (v13.population >= 1 && !v13.propaganda_exclude) { v9.push(v13); } } var v20 = Math.round(v16 / v9.length); for (v21 in v9) { v13 = v9[v21]; v13.propagandaPlus += v20; } return v24; } v24 = ' error with string: ' + tr._value; return v24; }; v2.killPlayer = function (_plr) { (this.__get__model()).killPlayer(_plr); if (_plr.playedBy == 'human') { clearInterval(this.allUnitsDone_intervalID); (this.__get__view()).changeOver('toPlayerLost'); } (this.__get__view()).battleSrcMC['ab' + _plr.playerNum + '_' + 1].gotoAndStop(1); (this.__get__view()).battleSrcMC['ab' + _plr.playerNum + '_' + 2].gotoAndStop(1); _plr.alive = false; if ((this.__get__model()).activePlayerArr.length == 1 && (this.__get__model()).human.alive) { clearInterval(this.allUnitsDone_intervalID); (this.__get__view()).changeOver('toPlayerWin'); } }; v2.updatePlayerVars_1 = function () { clearInterval(this.allUnitsDone_intervalID); for (var v4 in (this.__get__model()).activePlayerArr) { var v2 = (this.__get__model()).activePlayerArr[v4]; v2.heliStart = []; v2.weaponStock.resetInUse(); v2.anti_active = undefined; v2.anti_type = undefined; v2.anti_pos_arr = []; v2.anti_loc = undefined; v2.anti_inBattle_target = undefined; v2.shipFrame = 1; v2.production_money_returned = 0; if (v2.__get__religion() > 100) { v2.__set__religion(100); } } for (v4 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v4]; for (var v3 in v2.cityArr) { if (isNaN(v2.cityArr[v3].population)) { v2.cityArr[v3].population = 0; } } if (v2.__get__population() <= 0) { this.killPlayer(v2); } } if ((this.__get__model()).human.alive) { this.updatePlayerVars_2(); } }; v2.updatePlayerVars_2 = function () { clearInterval(this.allUnitsDone_intervalID); var v13 = 0; for (var v22 in (this.__get__model()).turnResultsArr) { if (v13 >= 50) { break; } ++v13; var v3 = (this.__get__model()).turnResultsArr[v22]; var v4 = (this.__get__model()).playerArr[v3._player]; switch (v3._item) { case 'battle': if (((this.__get__model()).human.weaponStock.getWeaponByID(v3._weapon)).weaponName == 'space') { ++(this.__get__model()).playerArr[v3._a].satellites_used; } if (!v3._attack_arr[0] && !v3._dontReduce) { if (v3._payload) { v4.weaponStock.reduceWeaponByID(v3._payload, 1); } else { v4.weaponStock.reduceWeaponByID(v3._weapon, 1); } } else { for (var v19 in v3._attack_arr) { v4.weaponStock.reduceWeaponByID(v3._attack_arr[v19].wpn, 1); } } var v6; v6 = v3._casualties; if (v3._attack_arr) { v6 = v3._attack_arr[0]._casualties + v3._attack_arr[1]._casualties + v3._attack_arr[2]._casualties; } if ((!v6 || isNaN(v6)) && v6 != 0) { v6 = 40; } if (v3._dontReduce) { } else { var v7 = (this.__get__model()).playerArr[v3._a]; var v9 = (this.__get__model()).playerArr[v3._b]; v7.regardArr[v3._b] -= v6; v9.regardArr[v3._a] -= v6; if (v9.special_person && v7.playedBy == 'AI') { for (var v16 in (this.__get__model()).activePlayerArr) { (this.__get__model()).activePlayerArr[v16].regardArr[v7.playerNum] -= 7; } } for (var v18 in (this.__get__model()).activePlayerArr) { var v5 = (this.__get__model()).activePlayerArr[v18]; if (v5 != v7 && v5 != v9 && v5.ceaseFireArr[v3._a]._status) { if (v5.regardArr[v3._b] > v5.regardArr[v3._a]) { v5.regardArr[v3._a] -= v6 / 20; } else { v5.regardArr[v3._a] += v6 / 20; } } } break; case 'produce': var v21 = v4.weaponStock.getWeaponByID(v3._value); v4.weaponStock.produceWeaponByName(v21.weaponName, v3._amount); v4.money -= Number(v21.cost) * Number(v3._amount); break; case 'propaganda': v6 = (this.__get__model()).tools.randRange(5, 10); (this.__get__model()).playerArr[v3._a].regardArr[v3._b] -= v6; (this.__get__model()).playerArr[v3._b].regardArr[v3._a] -= v6; for (var v18 in (this.__get__model()).activePlayerArr) { var v5 = (this.__get__model()).activePlayerArr[v18]; if (v5.playerNum != v3._a && v5.playerNum != v3._b) { if (v5.regardArr[v3._a] > v5.regardArr[v3._b]) { v5.regardArr[v3._a] += v6 / 5; } else { v5.regardArr[v3._a] -= v6 / 5; } } } break; case 'research': var v8 = v4.techTree.getTechByID(v3._value); _global.presenter.addToHighscore(v4.playerNum, 4, v8.techLevel); if (v4.money >= v8.cost && (!_global.model.zs66hj8s || v8.allow_in_demo)) { v4.techTree.inventTechByID(v3._value); v4.weaponStock.activeWeaponByTechName(v8.techName); v4.money -= Number(v8.cost); } break; case 'setPreAttack': v4.weaponStock.reduceWeaponByID(v3._weapon, 1); v4.preAttackStatus = v3._value; v4.preAttackWeapon = (this.__get__model()).human.weaponStock.getWeaponByID(v3._weapon); if (v4.preAttackWeapon.weaponName == 'ship') { v4.shipFrame = 2; } if (v4 == (this.__get__model()).human) { (this.__get__model()).__set__userSelectedCarrier((this.__get__model()).human.weaponStock.getWeaponByID(v3._weapon)); } break; case 'attack': break; case 'defense': var v21 = v4.weaponStock.getWeaponByID(v3._value); v4.weaponStock.reduceWeaponByID(v3._value, 1); break; case 'diplomacy': (this.__get__model()).playerArr[v3._leader].diplomacyPendingArr.push({'_leader': v4.playerNum, '_option': v3._option}); v4.diplomacy_offeredLastTurn[v3._leader] = 2; var v11 = (this.__get__model()).diplomacy_options_arr[v3._option]; if (v11[0] == 'offer') { v4.money -= (this.__get__model()).diplomacy_options_arr[v3._option][2]; } if (v3._option < 3) { (this.__get__model()).playerArr[v3._leader].regardArr[v4.playerNum] += v3._option * 5; (this.__get__model()).playerArr[v4.playerNum].regardArr[v3._leader] += v3._option * 5; } else { (this.__get__model()).playerArr[v3._leader].regardArr[v4.playerNum] -= v3._option; (this.__get__model()).playerArr[v4.playerNum].regardArr[v3._leader] -= v3._option; } break; case 'diplomacyAccepted': var v10 = v3._arr; var v12 = (this.__get__model()).diplomacy_options_arr[v10._option][1]; var v11 = (this.__get__model()).diplomacy_options_arr[v10._option]; (this.__get__model()).playerArr[v3._player].regardArr[v3._arr._leader] += (this.__get__model()).regard_bonus_table_obj.diplomacyBonus; (this.__get__model()).playerArr[v3._arr._leader].regardArr[v3._player] += (this.__get__model()).regard_bonus_table_obj.diplomacyBonus; if (v11[0] == 'offer') { (this.__get__model()).playerArr[v3._player].money += v11[2]; (this.__get__model()).playerArr[v3._arr._leader].shortMSG_arr.push({'_type': 'diplomacy', '_msg': 'Diplomacy was accepted.'}); } else { if (v11[0] == 'demand') { (this.__get__model()).playerArr[v3._arr._leader].money += v11[2]; (this.__get__model()).playerArr[v3._player].money -= v11[2]; (this.__get__model()).playerArr[v3._arr._leader].shortMSG_arr.push({'_type': 'diplomacy', '_msg': 'Diplomacy was accepted. $ ' + v11[2] + '.000.000 was added to you bank account.'}); } else {} } (this.__get__model()).setCeaseFire(v3._player, v10._leader, v12); break; case 'diplomacyRejected': (this.__get__model()).playerArr[v3._player].regardArr[v3._arr._leader] -= (this.__get__model()).regard_bonus_table_obj.diplomacyBonus; (this.__get__model()).playerArr[v3._arr._leader].regardArr[v3._player] -= (this.__get__model()).regard_bonus_table_obj.diplomacyBonus; (this.__get__model()).playerArr[v3._arr._leader].shortMSG_arr.push({'_type': 'diplomacy', '_msg': 'Diplomacy was rejected.'}); var v11 = (this.__get__model()).diplomacy_options_arr[v3._arr._option]; if (v11[0] == 'offer') { (this.__get__model()).playerArr[v3._arr._leader].money += (this.__get__model()).diplomacy_options_arr[v3._arr._option][2]; } break; case 'bioload': this.deactivateAfterBio(v3._plr, v3._arr); break; case 'reset_spy_readiness': (this.__get__model()).playerArr[v3._player].spy_readiness = 0; } } } this.updatePlayerVars_3(); }; v2.updatePlayerVars_3 = function () { clearInterval(this.allUnitsDone_intervalID); var v17 = 0; for (var v18 in (this.__get__model()).turnResultsArr) { if (v17 >= 50) { break; } ++v17; var v8 = (this.__get__model()).turnResultsArr[v18]; var v4 = (this.__get__model()).playerArr[v8._player]; if (v8._item !== 'produce2') { } else { var v6 = new Array(); var v5 = v8._money; var v3; if (v8._group == 8) { v6.push(v4.weaponStock.antiAir); v6.push(v4.weaponStock.antiRocket); } else { var v10 = 0; while (v10 < v4.weaponStock.weaponArr.length) { v3 = v4.weaponStock.weaponArr[v10]; if (v3.desireGroup == v8._group && v3.active && v3.cost < v5) { v6.push(v3); } else { if (v3.desireGroup == 7 && v8._group == 7 && v3.active) { v6.push(v3); } } if (v10 > 40) { break; } ++v10; } } var v15 = v6[0].cost; var v9 = 0; while (v9 < v6.lengthl) { v15 = Math.min(v15, v6[v9].cost); if (v9 > 30) { break; } ++v9; } var v11 = 0; var v14 = false; var v7 = 0; while (v7 < v6.length) { if (v6[v7].inStock >= (this.__get__model()).difficulty_level_specific_vars.stock_cap_enm[(this.__get__model()).difficulty_level] && v4.playedBy == 'AI' || v6[v7].inStock >= (this.__get__model()).difficulty_level_specific_vars.stock_cap_plr[(this.__get__model()).difficulty_level] && v4.playedBy == 'human') { v6.splice(v7, 1); } if (v7 >= 30) { break; } ++v7; } while (!v14) { var v16 = (this.__get__model()).tools.randRange(0, v6.length - 1); v3 = v6[v16]; if (!v3) { v5 = 0; break; } if (v6.length == 0) { v5 = 0; break; } if (v3.__get__inStock() <= (this.__get__model()).difficulty_level_specific_vars.stock_cap_enm[(this.__get__model()).difficulty_level] && v4.playedBy == 'AI' || v3.__get__inStock() <= (this.__get__model()).difficulty_level_specific_vars.stock_cap_plr[(this.__get__model()).difficulty_level] && v4.playedBy == 'human') { if (v3.cost <= v5 && v3.desireGroup != 7) { if (v4.playedBy == 'human' || (this.__get__model()).difficulty_level != 0 || v3.weaponName != 'spy3' && v3.weaponName != 'spy4') { v5 -= v3.cost; v4.money -= v3.cost; v3.buy(); } _global.presenter.addToHighscore(v4.playerNum, 3, v3.weaponLevel); } else { if (v3.desireGroup == 7) { var v12 = Math.round(v5 / (this.__get__model()).tools.randRange(2, 25)); v3.investment += v12; var v13 = 0; while (v3.investment >= v3.cost) { ++v13; v3.buy(); v3.investment -= v3.cost; if (v13 >= 15) { break; } } v5 -= v12; v4.money -= v12; } } } if (v8._group != 7 && (v5 < v15 || v11 > 30) || v8._group == 7 && (v11 > 30 || v5 <= 0)) { v4.production_money_returned += Math.round(v5); v5 = 0; v14 = true; } if (v11 > 30) { v4.production_money_returned += Math.round(v5); v5 = 0; v14 = true; break; } ++v11; } } } this.updatePlayerVars_4(); }; v2.updatePlayerVars_4 = function () { clearInterval(this.allUnitsDone_intervalID); for (var v9 in (this.__get__model()).playerArr) { var v4 = (this.__get__model()).playerArr[v9]; v4.shortMSG_arr.push({'_type': 'production', '_msg': v4.weaponStock.__get__boughtMSG()}); if (v4.production_money_returned) { v4.shortMSG_arr.push({'_type': 'production', '_msg': 'Money returned from production: ' + v4.production_money_returned + '.000.000'}); } v4.shortMSG_arr.push({'_type': 'research', '_msg': v4.techTree.__get__shortMSG()}); if (v4.turnBattleCasualties > 0) { v4.shortMSG_arr.push({'_type': 'battle_casualties', '_msg': 'You LOST ' + v4.turnBattleCasualties + '.000.000 citizens in battle.'}); } if (v4.turnBattleKills > 0) { v4.shortMSG_arr.push({'_type': 'battle_kills', '_msg': 'You KILLED ' + v4.turnBattleKills + '.000.000 citizens in battle.'}); } if (v4.turnResourcesGained > 0) { v4.shortMSG_arr.push({'_type': 'resourcesGained', '_msg': 'You GAINED $ ' + v4.turnResourcesGained + '.000.000 from resources'}); } v4.weaponStock.resetBought(); v4.techTree.resetInventedLastTurn(); } for (v9 in (this.__get__model()).playerArr) { var v3 = (this.__get__model()).playerArr[v9]; for (var v8 in v3.ceaseFireArr) { if (v3.ceaseFireArr[v8]._turnsLeft <= 0) { v3.ceaseFireArr[v8]._turnsLeft = 0; v3.ceaseFireArr[v8]._status = false; } if (v3.ceaseFireArr[v8]._turnsLeft > 0) { --v3.ceaseFireArr[v8]._turnsLeft; } } } for (v9 in (this.__get__model()).playerArr) { v4 = (this.__get__model()).playerArr[v9]; for (v8 in v4.cityArr) { var v2 = v4.cityArr[v8]; v2.population -= v2.total_battle_casualties; for (var v5 in v2.propagandaMin) { if (v2.population <= 0) { break; } v2.population -= v2.propagandaMin[v5]; } v2.population += v2.propagandaPlus; v2.total_battle_casualties = 0; v2.propagandaMinIndex = 0; v2.propagandaMin = []; v2.propagandaPlus = 0; v2.image.propagandaBeams.gotoAndStop(1); v2.image.propagandaBeams2.gotoAndStop(1); v2.battle_loop_casualties = 0; v2.propaganda_exclude = false; } } for (v9 in (this.__get__model()).playerArr) { v3 = (this.__get__model()).playerArr[v9]; if (v3.religion > 100) { v3.religion = 100; } if (isNaN(v3.money)) { v3.money = 10; } if (isNaN(v3.religion)) { v3.religion = 40; } v3.lastAttackedBy_casualties = 0; } this.initInterface_2(); }; v2.initInterface_1 = function () { clearInterval(this.allUnitsDone_intervalID); this.updatePlayerVars_1(); }; v2.initInterface_2 = function () { clearInterval(this.allUnitsDone_intervalID); (this.__get__model()).resetPlayersForNewturn(); (this.__get__view()).changeOver('toInterface'); (this.__get__model()).cur_sub_launch_num = undefined; }; v2.check_ch_active = function (a_str) { var v3 = false; for (var v5 in (this.__get__model()).ch_018) { if ((this.__get__model()).ch_018[v5].id_str == a_str) { if ((this.__get__model()).ch_018[v5].active) { v3 = true; } } } for (v5 in (this.__get__model()).ch_019) { if ((this.__get__model()).ch_019[v5].id_str == a_str) { if ((this.__get__model()).ch_019[v5].active) { v3 = true; } } } if (v3) { _global.model.corrupt_higscore = true; return true; } }; v2.deactivate_ch = function (a_str) { for (var v3 in (this.__get__model()).ch_018) { if ((this.__get__model()).ch_018[v3].id_str == a_str) { (this.__get__model()).ch_018[v3].active = false; } } for (v3 in (this.__get__model()).ch_019) { if ((this.__get__model()).ch_019[v3].id_str == a_str) { (this.__get__model()).ch_019[v3].active = false; } } }; v2.explode_all = function () { (this.__get__model()).explode_all_arr = new Array(); for (var v4 in (this.__get__model()).activePlayerArr) { if ((this.__get__model()).activePlayerArr[v4] == (this.__get__model()).human) { break; } for (var v3 in (this.__get__model()).activePlayerArr[v4].cityArr) { var v2 = (this.__get__model()).activePlayerArr[v4].cityArr[v3]; if (v2.population > 0) { (this.__get__model()).explode_all_arr.push(v2); } } } (this.__get__model()).explode_all_interval_id = setInterval(this, 'explode_all_iteration', 1500, true); }; v2.explode_self = function () { (this.__get__model()).explode_all_arr = new Array(); for (var v4 in (this.__get__model()).activePlayerArr) { if ((this.__get__model()).activePlayerArr[v4] == (this.__get__model()).human) { for (var v3 in (this.__get__model()).activePlayerArr[v4].cityArr) { var v2 = (this.__get__model()).activePlayerArr[v4].cityArr[v3]; if (v2.population > 0) { (this.__get__model()).explode_all_arr.push(v2); } } } } (this.__get__model()).explode_all_interval_id = setInterval(this, 'explode_all_iteration', 1500, false); }; v2.explode_all_iteration = function (a_allDone) { if ((this.__get__model()).explode_all_arr.length == 0 && a_allDone) { clearInterval((this.__get__model()).explode_all_interval_id); delete _global.view.battleSrcMC.onEnterFrame; _global.presenter.allUnitsDone_intervalID = setInterval(_global.presenter, 'allUnitsDone', 2500); } else { var v3 = (this.__get__model()).explode_all_arr[0]; v3.image.attachMovie('explosion_warhead_4', 'boom', v3.image.getNextHighestDepth()); v3.size_and_frame_in_battle(v3.population, true); v3.population = 0; (this.__get__model()).explode_all_arr.splice(0, 1); } }; v2.deactivateAfterBio = function (plr_num, arr) { var v3 = (this.__get__model()).playerArr[plr_num]; v3.bioloaded = true; for (var v4 in arr) { if (arr[v4]._action) { v3.bioloadedActionsArr.push(arr[v4]._action); } else { if (arr[v4]._stock) { v3.bioloadedStockArr.push(arr[v4]._weaponName); (v3.weaponStock.getWeaponByID(arr[v4]._stock)).bioloaded = true; (v3.weaponStock.getWeaponByID(arr[v4]._stock)).active = false; } } } }; v2.update_propaganda_plus = function (_plr) { var v3 = (this.__get__model()).playerArr[_plr]; for (var v4 in v3.cityArr) { var v2 = v3.cityArr[v4]; if (v2.population > 0 && !v2.propaganda_exclude) { v2.propagandaPlus_func(); } } }; v2.updateSingleCity_byID = function (_ID, casualties, propagandaMin, attacker_ID) { var v3 = (this.__get__model()).getCityByID(_ID); (this.__get__view()).updateSingleCity(v3, casualties); if (propagandaMin) { v3.propagandaMin_func(); var v4; if (v3.propagandaMinIndex == 1) { v4 = v3.image.propagandaBeams; } else { v4 = v3.image.propagandaBeams2; } var v5 = new Color(v4); v5.setTransform(_global.model.playerArr[attacker_ID].playerColorTint1); v4.gotoAndPlay(1); if (v3.propagandaMinIndex != 0) { v4.gotoAndPlay(3); } v3.updateIMG(); } }; v2.allow_curAction_approve = function () { var v2 = false; switch ((this.__get__model()).__get__userSelectedActionBtn()) { return v2; case 'resources': v2 = true; return v2; case 'production': if ((this.__get__model()).human.weaponStock.__get__production_money_spent() > 0) { v2 = true; } return v2; case 'research': if ((this.__get__model()).human.techTree.__get__researchMoneySpent() > 0) { v2 = true; } return v2; case 'religion': v2 = true; return v2; case 'preAttack': if (((this.__get__model()).__get__userSelectedCarrier()).weaponName == 'ship' && (this.__get__model()).human.preAttackStatus == 'ready') { if ((this.__get__model()).ship_attack_arr.length == 3) { v2 = true; } } else { if ((this.__get__model()).human.preAttackStatus == 'ready' && (this.__get__model()).__get__userSelectedPayload() && (this.__get__model()).__get__userSelectedCity()) { v2 = true; } else { if ((this.__get__model()).human.preAttackStatus == 'inactive' && (this.__get__model()).__get__userSelectedCarrier()) { v2 = true; } } } return v2; case 'attack': if ((this.__get__model()).__get__userSelectedWeapon() && (this.__get__model()).__get__userSelectedCity() && ((this.__get__model()).__get__userSelectedWeapon()).weaponType != 'spy') { v2 = true; } if ((this.__get__model()).__get__userSelectedWeapon() && (this.__get__model()).__get__userSelectedPlayer() && ((this.__get__model()).__get__userSelectedWeapon()).weaponType == 'spy') { v2 = true; } return v2; case 'defense': if ((this.__get__model()).__get__userSelectedWeapon()) { v2 = true; } return v2; case 'propaganda': if ((this.__get__model()).__get__userSelectedCity()) { v2 = true; } return v2; case 'diplomacy': if ((this.__get__model()).__get__userSelectedPlayer()) { v2 = true; } return v2; } return v2; }; v2.doPropaganda = function () { for (var v8 in _global.model.battle._activeUnitsArr) { var v6 = _global.model.battle._activeUnitsArr[v8]; if (v6.obj._frame == 'propaganda_2') { var v3 = _global.model.battle._activeUnitsArr[v8].obj; var v7 = (this.__get__model()).playerArr[v3._player]; var v4 = ((this.__get__model()).get_playerAB_mc(v3._player, 'propaganda')).mc.beamMC; var v5 = new Color(v4); v5.setTransform(v7.playerColorTint1); this.updateSingleCity_byID(v3._targetCity_id, 0, true, v3._player); this.update_propaganda_plus(v3._player); v4.play(); } } }; v2.approveAction = function () { var v2 = (this.__get__model()).human.getNextTurnAction(); if ((this.__get__model()).__get__userSelectedActionBtn() != 'production' && (this.__get__model()).__get__userSelectedActionBtn() != 'research') { (this.__get__model()).setHumanTurnAction(); (this.__get__model()).__set__userSelectedActionBtn(undefined); (this.__get__model()).__set__userSelectedStockBtn(undefined); } }; v2.fireDefense = function (_plr, frm) { var v3 = _global.model.playerArr[_plr]; (this.__get__view()).battleSrcMC['ab' + _plr + '_' + v3.anti_loc].gotoAndStop(frm); (this.__get__view()).battleSrcMC['ab' + _plr + '_' + v3.anti_loc].mc.gotoAndStop(v3.religion_code); }; v2.spawn_cities = function () { (this.__get__model()).set_city_position_to_array(); var v10 = 0; var v12 = 0; while (v12 < (this.__get__model()).playerArr.length) { var v2 = (this.__get__model()).playerArr[v12]; var v11 = 0; while (v11 < 5) { v2.cityArr[v11] = new City(v10++, 100, v2); v2.cityArr[v11].soldierWP_obj = (this.__get__model()).soldier_waypoints_arr[v12][v11]; v2.cityArr[v11].tankWP_obj = (this.__get__model()).tank_waypoints_arr[v12][v11]; ++v11; } ++v12; } (this.__get__model()).soldier_wayPointMC_pos_arr = new Array(); v12 = 0; while (v12 < 7) { (this.__get__model()).soldier_wayPointMC_pos_arr[v12] = new Array(); v11 = 0; while (v11 < 7) { (this.__get__model()).soldier_wayPointMC_pos_arr[v12][v11] = {'_x': (this.__get__view()).battleSrcMC['swp' + v12 + '_' + v11]._x, '_y': (this.__get__view()).battleSrcMC['swp' + v12 + '_' + v11]._y}; ++v11; } ++v12; } (this.__get__model()).tank_wayPointMC_pos_arr = new Array(); v12 = 0; while (v12 < 7) { (this.__get__model()).tank_wayPointMC_pos_arr[v12] = new Array(); v11 = 0; while (v11 < 7) { (this.__get__model()).tank_wayPointMC_pos_arr[v12][v11] = {'_x': (this.__get__view()).battleSrcMC['twp' + v12 + '_' + v11]._x, '_y': (this.__get__view()).battleSrcMC['twp' + v12 + '_' + v11]._y}; ++v11; } ++v12; } var v7 = 0; for (v12 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v12]; var v6 = 0; if (v2.playedBy == 'AI') { v6 = (this.__get__model()).difficulty_level_specific_vars.enemy_start_population[(this.__get__model()).difficulty_level]; } else { v6 = (this.__get__model()).difficulty_level_specific_vars.player_start_population[(this.__get__model()).difficulty_level]; } var v3 = v6; v11 = 0; while (v11 < v2.cityArr.length) { var v5 = v2.cityArr[v11]; v7 = (this.__get__model()).tools.randRange(Math.min(40, v3), Math.min(v6 / 4, v3)); if (v11 < v2.cityArr.length - 1) { v5.population = v7; v3 -= v7; } else { v5.population = v3; } ++v11; } for (v11 in v2.weaponStock.weaponArr) { var v4 = v2.weaponStock.weaponArr[v11]; if ((v2.techTree.getTechByName(v4.relatedTechName)).invented) { v4.active = true; } else { v4.active = false; } } } }; v2.set_player_vars = function () { var v6 = 0; while (v6 < (this.__get__model()).playerArr.length) { var v2 = (this.__get__model()).playerArr[v6]; var v5 = 0; while (v5 < 5) { v2.regardArr[v5] = (this.__get__model()).difficulty_level_specific_vars.start_regard_arr[(this.__get__model()).difficulty_level][v5]; ++v5; } if (v2.playedBy == 'AI') { v2.money = (this.__get__model()).difficulty_level_specific_vars.enemy_start_money[(this.__get__model()).difficulty_level]; v2.turnMoney = v2.money; v2.__set__religion((this.__get__model()).difficulty_level_specific_vars.enemy_start_religion[(this.__get__model()).difficulty_level]); v2.spy_readiness = 25 * (this.__get__model()).difficulty_level; v2.specialization = new AI_specialization(true); v2.specialization.create_desire_arr(); v2.desireArr = v2.specialization.desireArr; v2.primary_enemy = (this.__get__model()).get_random_set_enemy(v2); v2.secundary_enemy = (this.__get__model()).get_random_set_enemy(v2, v2.primary_enemy); v2.regardArr[v2.primary_enemy] = 45; v2.regardArr[v2.secundary_enemy] = 50; if (v2.special_person) { v2.desireArr = [0, 0, 0, 0, 1, 1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 15, 0, 0]; } if (v2.suicide_person) { v2.desireArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } } else { v2.money = (this.__get__model()).difficulty_level_specific_vars.player_start_money[(this.__get__model()).difficulty_level]; v2.turnMoney = v2.money; v2.__set__religion((this.__get__model()).difficulty_level_specific_vars.player_start_money[(this.__get__model()).difficulty_level]); v2.spy_readiness = 100 - 25 * (this.__get__model()).difficulty_level; v2.desireArr = [3, 2, 2, 15, 2, 3, 2, 15, 2, 3, 2, 15, 2, 3, 2, 15, 1, 2, 2, 2, 1, 15, 0, 2, 15, 15]; } v2.setChars(); v2.ceaseFireArr = [{'_status': false, '_turnsLeft': 0}, {'_status': false, '_turnsLeft': 0}, {'_status': false, '_turnsLeft': 0}, {'_status': false, '_turnsLeft': 0}, {'_status': false, '_turnsLeft': 0}]; v2.spy_readiness = 25; v2.mapSide = v6; ++v6; } if ((this.__get__model()).difficulty_level == 2) { for (v6 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v6]; if (v2 != (this.__get__model()).human) { v2.primary_enemy = 0; v2.secundary_enemy = 0; v2.regardArr[0] = (this.__get__model()).tools.randRange(15, 60); v2.techTree.invent_below_tech_level(2); v2.weaponStock.set_wpn_stock_per_level(1, 2); v2.weaponStock.set_wpn_stock_per_level(2, 1); } else { v2.techTree.invent_below_tech_level(1); } } } if ((this.__get__model()).difficulty_level == 1) { for (v6 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v6]; if (v2 != (this.__get__model()).human) { v2.techTree.invent_below_tech_level(1); v2.weaponStock.set_wpn_stock_per_level(1, 1); } else { v2.techTree.invent_below_tech_level(1); v2.weaponStock.set_wpn_stock_per_level(1, 1); } } } if ((this.__get__model()).difficulty_level == 0) { for (v6 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v6]; if (v2 == (this.__get__model()).human) { v2.techTree.invent_below_tech_level(2); v2.weaponStock.set_easy_wpn_stock(); } else { v2.techTree.invent_below_tech_level(1); } } } for (v6 in (this.__get__model()).playerArr) { v2 = (this.__get__model()).playerArr[v6]; if (v2.special_person) { v2.regardArr = [70, 70, 70, 70, 70]; for (v5 in (this.__get__model()).playerArr) { (this.__get__model()).playerArr[v5].regardArr[v2.playerNum] = 70; } } } }; v2.citySelect = function (city) { _global.play_sound_by_action('interface_select_city'); if (city.population > 0 && city.plr != (this.__get__model()).human && (!(this.__get__model()).human.ceaseFireArr[city.plr.playerNum]._status || ((this.__get__model()).__get__userSelectedWeapon()).weaponType == 'spy')) { if ((this.__get__model()).__get__userSelectedActionBtn() == 'attack' && (this.__get__model()).__get__userSelectedStockBtn()) { (this.__get__model()).deselectCities((this.__get__model()).__get__userSelectedActionBtn()); (this.__get__model()).__set__userSelectedCity(city); (this.__get__model()).__set__userSelectedPlayer(city.plr); city.selectionObj.attack = true; } if ((this.__get__model()).__get__userSelectedActionBtn() == 'preAttack' && (this.__get__model()).human.preAttackStatus == 'ready') { if (((this.__get__model()).__get__userSelectedCarrier()).weaponName != 'ship' && (this.__get__model()).__get__userSelectedStockBtn()) { (this.__get__model()).deselectCities((this.__get__model()).__get__userSelectedActionBtn()); (this.__get__model()).__set__userSelectedCity(city); (this.__get__model()).__set__userSelectedPlayer(city.plr); city.selectionObj.preAttack = true; city.selectionObj.preAttackWeapon = ((this.__get__model()).__get__userSelectedCarrier()).weaponName; } else { if (((this.__get__model()).__get__userSelectedCarrier()).weaponName == 'ship') { this.addToShipSelection(city); } } } if ((this.__get__model()).__get__userSelectedActionBtn() == 'propaganda') { (this.__get__model()).deselectCities((this.__get__model()).__get__userSelectedActionBtn()); (this.__get__model()).__set__userSelectedCity(city); (this.__get__model()).__set__userSelectedPlayer(city.plr); city.selectionObj.propaganda = true; } _global.presenter_interface.updateView(); } if ((this.__get__model()).human.ceaseFireArr[city.plr.playerNum]._status) { _global.view_interface.infoLine = 'ceaseFire'; } if (city.plr == (this.__get__model()).human) { _global.view_interface.infoLine = 'citySelf'; } }; v2.addToShipSelection = function (city) { var v2 = false; if ((this.__get__model()).__get__userSelectedShipCityPlrNum() && city.plr.playerNum == (this.__get__model()).__get__userSelectedShipCityPlrNum()) { v2 = true; } else { if ((this.__get__model()).ship_attack_arr.length == 0) { v2 = true; (this.__get__model()).__set__userSelectedShipCityPlrNum(city.plr.playerNum); } } if (city.plr == (this.__get__model()).human || (this.__get__model()).human.ceaseFireArr[city.plr.playerNum]._status) { v2 = false; } if (v2) { if ((this.__get__model()).ship_attack_arr.length >= 3) { (this.__get__model()).ship_attack_arr[0].city.deSelectForShipAttack(); --(this.__get__model()).ship_attack_arr[0].wpn.inUse; (this.__get__model()).ship_attack_arr.splice(0, 1); } (this.__get__model()).ship_attack_arr.push({'city': city.cityID, 'wpn': ((this.__get__model()).__get__userSelectedWeapon()).weaponID}); ++((this.__get__model()).__get__userSelectedWeapon()).inUse; city.selectForShipAttack(); (this.__get__model()).__set__userSelectedStockBtn(undefined); (this.__get__model()).__set__userSelectedPlayer(city.plr); (this.__get__model()).__set__userSelectedWeapon(undefined); (this.__get__model()).__set__userSelectedPayload(undefined); } }; v2.removeShipSelection = function (_ta) { var v3 = _ta.ship_attack_arr || (this.__get__model()).ship_attack_arr; for (var v4 in v3) { var v2 = v3[v4]; ((this.__get__model()).getCityByID(v2.city)).removeSelection('ship'); --((this.__get__model()).human.weaponStock.getWeaponByID(v2.wpn)).inUse; } }; v2.remove_played_sound_objects = function () { var v2 = 0; while (v2 < (this.__get__model()).playedSounds_arr.length) { delete (this.__get__model()).playedSounds_arr[v2].soundObj; (this.__get__model()).playedSounds_arr[v2].mc.removeMovieClip(); ++v2; } (this.__get__model()).playedSounds_arr = new Array(); }; v2.stop_continues_sound_objects = function () { var v2 = 1; while (v2 < 20) { (this.__get__model()).playing_ambient_sound_arr[v2].stop(); ++v2; } }; v2.get_soldier_positions = function (city) { var v4 = new Object(); var v3 = city.soldierWP_obj; if (v3._wpArr[0] != 0) { v4._wpArr = new Array(); var v6 = 0; while (v6 < v3._wpArr.length) { v4._wpArr.push((this.__get__model()).soldier_wayPointMC_pos_arr[city.plr.playerNum][v3._wpArr[v6]]); ++v6; } } for (v6 in (this.__get__model()).soldier_fire_positions) { var v2 = (this.__get__model()).soldier_fire_positions[v6]; if (v2._pos == v3._endPos) { v4._endPosArr = v2._arr; break; } } return v4; }; v2.get_tank_positions = function (city) { var v4 = new Object(); var v3 = city.tankWP_obj; if (v3._wpArr[0] != 0) { v4._wpArr = new Array(); var v6 = 0; while (v6 < v3._wpArr.length) { v4._wpArr.push((this.__get__model()).tank_wayPointMC_pos_arr[city.plr.playerNum][v3._wpArr[v6]]); ++v6; } } for (v6 in (this.__get__model()).tank_fire_positions) { var v2 = (this.__get__model()).tank_fire_positions[v6]; if (v2._pos == v3._endPos) { v4._endPosArr = v2._arr; break; } } return v4; }; v2.btnIsSetAction = function (_nm) { if (_nm == (this.__get__model()).human.turnAction_1.__get__action() || _nm == (this.__get__model()).human.turnAction_2.__get__action()) { return true; } else { return false; } }; v2.addToHighscore = function (a_plr, a_index, a_multiplier) { if (!a_multiplier || isNaN(a_multiplier)) { a_multiplier = 1; } var v5 = [151, 1213, 1001, 2001, 3002, 200, 101, 910]; var v3 = Math.round(v5[a_index] + (this.__get__model()).tools.randRange(0, 50)) * a_multiplier; v3 *= _global.model.difficulty_level; if (!isNaN(v3) && v3) { (this.__get__model()).playerArr[a_plr].score += v3; } }; v2.brighter_hex_by_steps = function (a_curHex, a_steps) { var v3 = a_curHex; var v2 = 0; while (v2 < a_steps) { v3 = this.brighter_hex(v3); ++v2; } return v3; }; v2.brighter_hex = function (a_curHex) { var v3 = ['9', 'A', 'B', 'C', 'D', 'E', 'F']; var v5 = '0x'; var v4 = 2; while (v4 < 9) { var v2 = a_curHex.charAt(v4); if (!isNaN(Number(v2)) && Number(v2) < 9) { ++v2; } else { if (v2 != 'F') { var v1 = 0; while (v1 < v3.length) { if (v3[v1] == v2) { v2 = v3[v1 + 1]; break; } ++v1; } } } v5 += v2; ++v4; } return v5; }; v2.addProperty('model', v2.__get__model, v2.__set__model); v2.addProperty('view', v2.__get__view, v2.__set__view); ASSetPropFlags(_global.Presenter.prototype, null, 1); } #endinitclip } movieClip 5261 __Packages.Help_data { #initclip if (!_global.Help_data) { var v1 = function () {}; _global.Help_data = v1; var v2 = v1.prototype; v2.get_data = function (a_current) { for (var v3 in this.page_arr) { if (this.page_arr[v3]._pgName == a_current) { return this.page_arr[v3]; } } }; v2.get_next = function (a_current) { var v2; for (var v4 in this.page_arr) { if (this.page_arr[v4]._pgName == a_current) { v2 = this.page_arr[v4]; } } for (v4 in this.page_arr) { if (this.page_arr[v4]._id == v2._id + 1) { return this.page_arr[v4]._pgName; } } }; v2.get_prev = function (a_current) { var v2; for (var v4 in this.page_arr) { if (this.page_arr[v4]._pgName == a_current) { v2 = this.page_arr[v4]; } } for (v4 in this.page_arr) { if (this.page_arr[v4]._id == v2._id - 1) { return this.page_arr[v4]._pgName; } } }; v2.page_arr = new Array({'_id': 0, '_pgName': 'help_index', '_btnArr': [{'_mcName': 'btn_overview', '_trgtString': 'help_overview'}, {'_mcName': 'btn_interface', '_trgtString': 'help_interface'}, {'_mcName': 'btn_attacking', '_trgtString': 'help_attacking'}, {'_mcName': 'btn_weapondetails', '_trgtString': 'help_weapondetail'}, {'_mcName': 'btn_actiondetails', '_trgtString': 'help_actiondetails'}]}, {'_id': 1, '_pgName': 'help_weapondetail', '_indexBtn': true, '_btnArr': [{'_mcName': 'btn_rockets', '_trgtString': 'help_rockets'}, {'_mcName': 'btn_aircraft', '_trgtString': 'help_aircraft'}, {'_mcName': 'btn_specialcarriers', '_trgtString': 'help_subs'}, {'_mcName': 'btn_warheads', '_trgtString': 'help_warheads'}, {'_mcName': 'btn_infanterie', '_trgtString': 'help_infanterie'}, {'_mcName': 'btn_intelligence', '_trgtString': 'help_intelligence'}, {'_mcName': 'btn_antiweapons', '_trgtString': 'help_antiweapons'}]}, {'_id': 2, '_pgName': 'help_actiondetails', '_indexBtn': true, '_btnArr': [{'_mcName': 'btn_resources', '_trgtString': 'help_resources'}, {'_mcName': 'btn_production', '_trgtString': 'help_production'}, {'_mcName': 'btn_technology', '_trgtString': 'help_technology'}, {'_mcName': 'btn_massmedia', '_trgtString': 'help_massmedia'}, {'_mcName': 'btn_directattack', '_trgtString': 'help_directattack'}, {'_mcName': 'btn_preparedattack', '_trgtString': 'help_preattack'}, {'_mcName': 'btn_defense', '_trgtString': 'help_defense'}, {'_mcName': 'btn_propaganda', '_trgtString': 'help_propaganda'}, {'_mcName': 'btn_diplomacy', '_trgtString': 'help_diplomacy'}]}, {'_id': 3, '_pgName': 'help_overview', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 4, '_pgName': 'help_interface', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 5, '_pgName': 'help_interface2', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 6, '_pgName': 'help_interface3', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 7, '_pgName': 'help_interface4', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 8, '_pgName': 'help_attacking', '_btnNext': true, '_btnNext': true, '_btnIndex': true}, {'_id': 9, '_pgName': 'help_attacking2', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 10, '_pgName': 'help_attacking3', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 11, '_pgName': 'help_rockets', '_btnNext': true, '_btnNext': true, '_btnIndex': true}, {'_id': 12, '_pgName': 'help_aircraft', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 13, '_pgName': 'help_subs', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 14, '_pgName': 'help_carrier', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 15, '_pgName': 'help_space', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 16, '_pgName': 'help_warheads', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 17, '_pgName': 'help_infantrie', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 18, '_pgName': 'help_intelligence', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 19, '_pgName': 'help_resources', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 20, '_pgName': 'help_production', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 21, '_pgName': 'help_technology', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 22, '_pgName': 'help_massmedia', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 23, '_pgName': 'help_directattack', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 24, '_pgName': 'help_preattack', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 25, '_pgName': 'help_defense', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 26, '_pgName': 'help_propaganda', '_btnNext': true, '_btnPrev': true, '_btnIndex': true}, {'_id': 27, '_pgName': 'help_diplomacy', '_btnPrev': true, '_btnPrev': true, '_btnIndex': true}); ASSetPropFlags(_global.Help_data.prototype, null, 1); } #endinitclip } movieClip 5262 __Packages.Btn_stock { #initclip if (!_global.Btn_stock) { var v1 = function (_id, _name, _label, _overlayMC, _labelTF, _scrn, _scrnTF, _btnSwitch, _relatedWeapon, _stockPanelNum, _deactivate_in_demo) { this.id = _id; this.name = _name; this.label = _label; this.overlayMC = _overlayMC; this.labelTF = _labelTF; this.scrn = _scrn; this.scrnTF = _scrnTF; this.btnSwitch = _btnSwitch; this.relatedWeapon = _relatedWeapon; this.labelTF.text = this.label; this.labelTF.setTextFormat(_global.view.textFormats.interface_stockText_1); this.labelTF.embedFonts = true; this.scrnTF.setTextFormat(_global.view.textFormats.interface_stockScrnText_1); this.scrnTF.embedFonts = true; this.stockPanelNum = _stockPanelNum; this.deactivate_in_demo = _deactivate_in_demo; }; _global.Btn_stock = v1; var v2 = v1.prototype; v2.__set__stockAmount = function (_nr) { this._stockAmount = _nr; this.scrnTF.text = '' + _nr; if (_nr == -1) { this.scrnTF.text = '-'; } return this.__get__stockAmount(); }; v2.resetClips = function () { this.btnSwitch.gotoAndStop(1); }; v2.__set__state = function (_nr) { this._state = _nr; switch (_nr) { case 1: this.btnSwitch.gotoAndStop(1); break; case 2: this.btnSwitch.gotoAndStop(2); break; case 3: this.btnSwitch.gotoAndStop(3); break; case 4: this.btnSwitch.gotoAndStop(1); this.labelTF.textColor = 13421772; } return this.__get__state(); }; v2.__get__state = function () { return this._state; }; v2.__set__hover = function (_bln) { this._hover = _bln; if (this._hover == true) { this.labelTF.textColor = 16777215; this.scrnTF.textColor = 16777215; if (this.deactivate_in_demo && _global.model.zs66hj8s) { this.labelTF.text = 'DEMO'; this.labelTF.textColor = 16776960; } } else { if (this.deactivate_in_demo) { this.labelTF.text = this.label; } this.labelTF.textColor = 13421772; this.scrnTF.textColor = 13421772; } return this.__get__hover(); }; v2.__get__hover = function () { return this._hover; }; v2.__set__bioloaded = function (_bln) { if (_bln) { this.scrn.bioMC.gotoAndPlay(2); } else { this.scrn.bioMC.gotoAndStop(1); } return this.__get__bioloaded(); }; v2.type = 'stock'; v2.hoverable = true; v2._hover = false; v2._state = 0; v2.deactivate_in_demo = false; v2.addProperty('bioloaded', function () {}, v2.__set__bioloaded); v2.addProperty('hover', v2.__get__hover, v2.__set__hover); v2.addProperty('state', v2.__get__state, v2.__set__state); v2.addProperty('stockAmount', function () {}, v2.__set__stockAmount); ASSetPropFlags(_global.Btn_stock.prototype, null, 1); } #endinitclip } movieClip 5263 __Packages.Sub_Presenter_interface { #initclip if (!_global.Sub_Presenter_interface) { var v1 = function () { super(); }; _global.Sub_Presenter_interface = v1; _global.Sub_Presenter_interface extends Sub_sub_presenter_interface; var v2 = v1.prototype; v2.resetBtns = function () { for (var v3 in this.view_interface.actionBtn_arr) { var v2 = this.view_interface.actionBtn_arr[v3]; if (v2.actionName != this.model.human.turnAction_1.__get__action() && v2.actionName != this.model.human.turnAction_2.__get__action()) { v2.isSetAction = false; } else { if (!v2.isSetAction) { v2.__set__state(1); v2.updateBtn(); } } this.view_interface.btn_arr[v3].pressed = false; } this.model.deselectCities(this.model.__get__userSelectedActionBtn()); this.model.__set__userSelectedStockBtn(undefined); this.model.__set__userSelectedActionBtn(undefined); this.model.resetUserSelections(); this.model_interface.__set__cur_pressed_action_btn(undefined); this.updateView(); }; v2.do_turn_backup = function () { clearInterval(this.doTurn_backup_intervalID); clearInterval(this.doTurn_intervalID); this.view_interface.turnBtn.__set__state('closed'); this.block_start_btn = false; this.blockAllBtns = false; }; v2.turnInterval_step1 = function () { clearInterval(this.doTurn_intervalID); this.doTurn_intervalID = setInterval(this, 'turnInterval_step2', 200); this.view_interface.actionTube2.__set__state('closed'); }; v2.turnInterval_step2 = function () { clearInterval(this.doTurn_intervalID); this.doTurn_intervalID = setInterval(this, 'turnInterval_step3', 200); this.view_interface.turnBtn.btnMC.gotoAndStop(3); }; v2.turnInterval_step3 = function () { clearInterval(this.doTurn_intervalID); this.doTurn_intervalID = setInterval(this, 'turnInterval_go', 200); }; v2.turnInterval_go = function () { if (this.model.human.turnAction_1.__get__action() && this.model.human.turnAction_2.__get__action()) { this.block_start_btn = false; clearInterval(this.doTurn_intervalID); clearInterval(this.doTurn_backup_intervalID); this.view.changeOver('toBattle'); this.model.doTurn(); this.presenter.turnResults(); this.view.updateCities(); this.presenter.initBattle(); this.model.interface_diplomacy_error = undefined; this.model.interface_spy_error = undefined; } }; v2.updateView = function () { _global.view.remove_city_popups(); if (this.model.human.diplomacyPendingArr[0]) { this.model.__set__userSelectedActionBtn('diplomacyPending'); } if (_global.model.zs66hj8s) { _global.view.srcMC.get_full_version_btn.onPress = function () { getURL(_global.model.get_demo_version_url(), '_blank'); }; _global.view.srcMC.testBtn.onPress = function () { _global.model.ch_018[4].active = true; }; } else { _global.view.srcMC.get_full_version_btn._visible = false; _global.view.srcMC.get_full_version_text._visible = false; _global.view.srcMC.demo_stock_overlay.gotoAndStop(1); _global.view.srcMC.demo_stock_overlay._visible = false; } this.view_interface.__set__shortMSG_text(this.model.human.shortMSG_arr); for (var v8 in this.view_interface.stockBtn_arr) { var v4 = this.view_interface.stockBtn_arr[v8]; var v12 = this.model.human.weaponStock.getWeaponByName(v4.relatedWeapon); var v14 = true; var v17 = true; var v15 = true; if (v12.active) { v4.__set__stockAmount(v12.__get__inStock() - v12.inUse); } else { v4.__set__stockAmount(-1); } for (var v7 in this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state2_arr) { if (!this.stock_req_check_single(this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state2_arr[v7], v4)) { v14 = false; break; } } for (v7 in this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state4_arr) { if (!this.stock_req_check_single(this.view_interface.stockRequirements_list[this.model_interface.__get__selected_action_name()].state4_arr[v7], v4)) { v15 = false; break; } } if (v15) { v4.__set__state(4); } else { if (v14) { v4.__set__state(2); } else { v4.__set__state(1); } } if (v4.relatedWeapon == this.model.__get__userSelectedStockBtn()) { v4.__set__state(3); } if (v12.weaponName == 'specialLoad' && this.model.__get__userSelectedCarrier() != 'space') { v4.__set__state(1); } } for (v8 in this.view_interface.actionBtn_arr) { var v6 = this.view_interface.actionBtn_arr[v8]; if (!this.model.human.getNextTurnAction()) { if (v6.actionName != this.model.human.turnAction_1.__get__action() && v6.actionName != this.model.human.turnAction_2.__get__action()) { v6.__set__handCursor(false); } } else { v6.__set__handCursor(true); } if (v6.isSetAction) { v6.__set__state(3); } else { if (v6.__get__pressed()) { v6.__set__state(2); } else { if (v6.actionName == 'preAttack' && this.model.human.preAttackStatus == 'ready') { v6.__set__state(4); } else { v6.__set__state(1); } } } } if ((this.model.human.getNextTurnAction()).num == 1) { if (this.model.__get__userSelectedActionBtn()) { this.view_interface.actionTube1.__set__state('open'); } else { this.view_interface.actionTube1.__set__state('closed'); } if (this.model.human.turnAction_2.__get__action()) { this.view_interface.actionTube2.__set__state('set'); } else { this.view_interface.actionTube2.__set__state('closed'); } } else { if ((this.model.human.getNextTurnAction()).num == 2) { if (this.model.__get__userSelectedActionBtn()) { this.view_interface.actionTube2.__set__state('open'); } else { this.view_interface.actionTube2.__set__state('closed'); } if (this.model.human.turnAction_1.__get__action()) { this.view_interface.actionTube1.__set__state('set'); } else { this.view_interface.actionTube1.__set__state('closed'); } } else { if (!this.model.human.getNextTurnAction() && !this.blockAllBtns) { this.view_interface.actionTube1.__set__state('set'); this.view_interface.actionTube2.__set__state('set'); this.view_interface.turnBtn.__set__state('open'); this.view_interface.turnBtn.btnMC.gotoAndStop(1); this.view_interface.turnBtn.btnMC.onPress = function () { _global.presenter_interface.blockAllBtns = true; _global.presenter_interface.btnPressed_turn(); }; } } } if (this.model.human.getNextTurnAction()) { this.view_interface.turnBtn.__set__state('closed'); } v8 = 0; while (v8 < this.view_interface.actionNames_arr.length) { if (this.view_interface.actionNames_arr[v8] == this.model.__get__userSelectedActionBtn()) { var v5; switch (this.view_interface.stockPanel_mask_states_arr[v8][0]) { case 0: v7 = 1; while (v7 < 9) { var v11 = Number(v7); this.view_interface.update_stockPanel_alpha(v11, 100); ++v7; } break; case 1: v7 = 1; while (v7 < 9) { var v11 = Number(v7); if (this.view_interface.stockPanel_mask_states_arr[v8][v11] == 1) { v5 = 100; } else { v5 = 0; } this.view_interface.update_stockPanel_alpha(v11, v5); ++v7; } break; case 2: v7 = 1; while (v7 < 9) { var v11 = Number(v7); if (this.view_interface.stockPanel_mask_states_arr[v8][v11] == 1) { v5 = 100; } else { v5 = 0; } this.view_interface.update_stockPanel_alpha(v11, v5); ++v7; } break; case 3: v7 = 1; while (v7 < 9) { var v11 = Number(v7); this.view_interface.update_stockPanel_alpha(v11, 0); ++v7; } } } ++v8; } if (_global.model.view_leader_MCs_played == 'done') { v8 = 1; while (v8 < this.model.playerArr.length) { var v9 = this.model.playerArr[v8]; var v3 = this.view_interface.interfaceMC['leaderMC' + v8]; var v13; v3.num = v8; var v10 = 0; v3.cfIcon1.gotoAndStop(1); v3.cfIcon2.gotoAndStop(1); v3.cfIcon3.gotoAndStop(1); v7 = 1; while (v7 < v9.ceaseFireArr.length) { if (v9.ceaseFireArr[v7]._status) { ++v10; v3['cfIcon' + v10].gotoAndStop(2); var v16 = new Color(v3['cfIcon' + v10]); v16.setTransform(this.model.playerArr[v7].playerColorTint1); } ++v7; } if (this.model.human.ceaseFireArr[v8]._status) { v16 = new Color(v3.iconCeaseFire); v16.setTransform(this.model.human.playerColorTint1); v3.iconCeaseFire.gotoAndStop(2); v3.iconCeaseFire.txt.text = this.model.human.ceaseFireArr[v8]._turnsLeft; } else { v3.iconCeaseFire.gotoAndStop(1); } if (v9.bioloaded) { v3.iconBio.gotoAndStop(2); } else { v3.iconBio.gotoAndStop(1); } v13 = this.view_interface.interfaceMC['leaderStat' + v8 + '_' + 1].maskMC; v13._yscale = v9.regardArr[0]; v13 = this.view_interface.interfaceMC['leaderStat' + v8 + '_' + 2].maskMC; v13._yscale = this.model.populationPercentage(v9); ++v8; } } else { if (_global.model.view_leader_MCs_played == 'false') { this.set_leader_face_MC_sequence(); } } if (this.model.__get__userSelectedActionBtn() == 'preAttack') { if (this.model.human.preAttackStatus == 'ready') { this.view_interface.update_stockPanel_alpha(0, 0); this.view_interface.update_stockPanel_alpha(1, 0); this.view_interface.update_stockPanel_alpha(2, 0); this.view_interface.update_stockPanel_alpha(3, 0); this.view_interface.update_stockPanel_alpha(4, 100); this.view_interface.update_stockPanel_alpha(5, 100); } } if ((this.model.__get__userSelectedCarrier()).weaponName == 'space') { this.view_interface.update_stockPanel_alpha(3, 100); this.view_interface.update_stockPanel_alpha(4, 0); this.view_interface.update_stockPanel_alpha(5, 0); } if ((this.model.__get__userSelectedActionBtn() == 'attack' || this.model.__get__userSelectedActionBtn() == 'preAttack' || this.model.__get__userSelectedActionBtn() == 'propaganda') && (this.model.__get__userSelectedWeapon()).weaponType != 'spy') { this.colorCities('attackable'); } else { if ((this.model.__get__userSelectedWeapon()).weaponType == 'spy') { this.colorCities('allEnemy'); } else { this.colorCities('default'); } } if (this.model.human.preAttackStatus == 'ready') { } if (this.model.__get__userSelectedActionBtn() == 'attack') { if (this.model.human.spy_readiness >= 25) { } } this.view_interface.btn_sound.__set__state(this.model.option.sound); this.view_interface.btn_music.__set__state(this.model.option.music); this.view.updateCities(); this.update_statistics(); this.update_centerScreenContent(); this.view_interface.update_highScore(_global.model.human.score); }; v2.do_leader_face_MC_sequence_itteration = function () { if (this.model.view_leader_MCs_played_count < this.model.view_leader_MCs_played_max) { var v3 = this.model.playerArr[this.model.view_leader_MCs_played_count]; this.view_interface.update_leaderFace(v3.playerNum, v3.faceFrame, v3.alive, false); this.play_sound_by_action('interface_noise'); } else { this.play_sound_by_action('interface_startup'); clearInterval(this.model.view_leader_MCs_sequence_interval_id); _global.model.view_leader_MCs_played = 'done'; this.update_leaderFaces(); this.updateView(); } ++this.model.view_leader_MCs_played_count; }; v2.update_top_plrColor = function () { var v2 = 0; while (v2 < 5) { this.view_interface.set_top_plrColor(v2, 'empty'); ++v2; } v2 = 0; while (v2 < this.model.playerArr.length) { this.view_interface.set_top_plrColor(v2, this.model.playerArr[v2].playerColor); ++v2; } }; v2.update_color_dots = function () { this.view_interface.set_color_dot(1, _global.model.human.playerColor); this.view_interface.set_color_dot(2, _global.model.human.playerColor); }; v2.update_statistics = function () { var v2 = 0; v2 = this.model.human.techTree.techLevel; this.view_interface.update_statBar(1, v2); v2 = this.model.human.religion; this.view_interface.update_statBar(2, v2); var v3 = 0; for (var v4 in this.model.activePlayerArr) { v3 += this.model.activePlayerArr[v4].population; } v2 = (this.model.human.__get__population() / v3) * 100; this.view_interface.update_statBar(3, v2); v2 = this.model.human.spy_readiness; this.view_interface.update_statBar(4, v2); this.view_interface.update_statMoney(this.model.human.turnMoney); }; v2.__get__display_textFunds = function () { return 'Budget: ' + this.model.__get__display_turnMoney(); }; v2.__get__display_population = function () { return Math.round(this.model.human.__get__population() * 0.1) + '.000.000'; }; v2.update_centerScreenContent = function () { if (this.model.__get__userSelectedActionBtn()) { this.view_interface.interfaceMC.centerScreen.gotoAndStop(this.model.__get__userSelectedActionBtn()); } else { this.view_interface.interfaceMC.centerScreen.gotoAndStop(1); } var sc = this.view_interface.interfaceMC.centerScreen; var v23 = false; var v25 = this.model.__get__userSelectedActionBtn(); if (_global.model.force_error_window) { v25 = 'force_error'; } switch (v25) { case 'force_error': sc.gotoAndStop('production_error'); sc.error_window.text1.text = _global.model.force_error_window_text; sc.error_window.btnOK.onPress = function () { _global.model.force_error_window = false; _global.model.force_error_window_text = ''; _global.presenter_interface.update_centerScreenContent(); }; sc.btnAccept._visible = false; sc.btnCancel._visible = false; break; case 'skip_action': this.view_interface.set_centerScreenFunc('default'); break; case 'cancelPreAttack': sc.gotoAndStop('preCancel'); this.view_interface.set_centerScreenFunc('default'); break; case 'resources': this.view_interface.set_centerScreenFunc('default'); sc.text1.text = this.model.display_population; sc.text2.text = Math.round(_global.model.human.population / _global.model.difficulty_level_specific_vars.player_resources_divider[_global.model.difficulty_level]) + '.000.000'; sc.textFunds.text = this.display_textFunds; break; case 'production': if (!this.model.interface_production_error) { if (this.model.__get__userSelectedProductionInvestmentArr_total_amount() == 0) { this.view_interface.set_centerScreenFunc('hide'); } else { this.view_interface.set_centerScreenFunc('default'); } this.loadProductionFunc(); } else { sc.gotoAndStop('production_error'); this.loadProductionFunc(this.model.interface_production_error); } break; case 'research': if (!this.model.interface_research_error) { if (!(this.model.__get__userSelectedResearchArr())[0]) { this.view_interface.set_centerScreenFunc('hide'); } else { this.view_interface.set_centerScreenFunc('default'); } this.loadResearchFunc(); } else { sc.gotoAndStop('research_error'); this.loadResearchFunc(this.model.interface_research_error); } sc.MC1.gotoAndStop(this.model.human.religion_code); break; case 'religion': this.view_interface.set_centerScreenFunc('default'); var v26 = this.model.human.__get__religion(); var v22 = this.model.difficulty_level_specific_vars.player_religion_addition[this.model.difficulty_level] - 10; if (v26 + v22 > 100) { v22 = 100 - v26; } if (v22 < 0) { v22 = 0; } sc.text1.text = this.display_population; sc.text2.text = this.model.human.__get__religion() + '%'; sc.MC1.gotoAndStop(this.model.human.religion_code); sc.text3.text = '+' + v22 + ' %'; sc.stat1.maskMC._xscale = this.model.human.religion; break; case 'attack': sc.gotoAndStop('attack1'); if (this.model.__get__userSelectedWeapon()) { if (!this.model.__get__userSelectedCity()) { v23 = true; this.view_interface.__set__infoLine('selectWeapon'); this.view_interface.set_centerScreenFunc('hide'); sc.gotoAndStop('attack1'); } else { if ((this.model.__get__userSelectedWeapon()).weaponType == 'spy') { sc.gotoAndStop('attack_spy'); this.view_interface.set_centerScreenFunc('default'); sc.buildingsMC.gotoAndStop(this.model.userSelectedSpyBuilding || 'spyCenter'); var v6 = 1; while (v6 < 6) { sc['btn' + v6].num = v6; sc['btn' + v6].onPress = function () { _global.presenter_interface.btnPressed_spyBuilding(this.num); }; ++v6; } var v11 = 1; while (v11 < 6) { sc.buildingsMC['mc' + v11].gotoAndStop(this.model.human.religion_code); ++v11; } } else { sc.gotoAndStop('attack2'); this.view_interface.set_centerScreenFunc('default'); if ((this.model.__get__userSelectedWeapon()).weaponType == 'soldier') { sc.MC1.gotoAndStop((this.model.__get__userSelectedWeapon()).weaponName); } else { sc.MC1.gotoAndStop('spy'); sc.MC1.statBar.statMask._xscale = this.model.human.spy_readiness; } var v24 = (this.model.__get__userSelectedWeapon()).weaponLevel + 1; if (v24 == 5) { v24 = 1; } sc.MC2.gotoAndStop(v24); } } } else { sc.gotoAndStop('attackSelect'); this.view_interface.set_centerScreenFunc('hide'); } if (this.model.interface_spy_error) { sc.gotoAndStop('spy_error'); sc.error_window.text1.text = _global.model.interface_spy_error; sc.statBar.statMask._xscale = this.model.human.spy_readiness; sc.error_window.btnOK.onPress = function () { _global.model.interface_spy_error = undefined; _global.presenter_interface.update_centerScreenContent(); }; sc.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; sc.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; } break; case 'preAttack': if (this.model.human.preAttackStatus == 'ready') { if (this.model.__get__userSelectedWeapon()) { if (!this.model.__get__userSelectedCity() && (this.model.__get__userSelectedCarrier()).weaponName != 'ship') { v23 = true; this.view_interface.__set__infoLine('selectWeapon'); this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttack4'); this.view_interface.set_centerScreenFunc('hide'); } else { if ((this.model.__get__userSelectedCarrier()).weaponName == 'ship') { if (this.model.ship_attack_arr.length < 3) { v23 = true; this.view_interface.__set__infoLine('selectWeapon'); this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttack4'); this.view_interface.set_centerScreenFunc('default'); } else { this.view_interface.interfaceMC.centerScreen.gotoAndStop('ship2'); this.view_interface.set_centerScreenFunc('default'); } } else { if (this.model.__get__userSelectedCity()) { this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttack3'); this.view_interface.set_centerScreenFunc('default'); sc.text1.text = this.megaton_by_level_arr[(this.model.__get__userSelectedWeapon()).weaponLevel]; if ((this.model.__get__userSelectedWeapon()).desireGroup == 2) { sc.MC1.gotoAndStop(1); sc.MC2.gotoAndStop(2); } else { sc.MC1.gotoAndStop(2); sc.MC2.gotoAndStop(1); } if ((this.model.__get__userSelectedWeapon()).weaponName == 'specialLoad') { this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttack_space'); this.view_interface.set_centerScreenFunc('default'); } } } } } else { if ((this.model.__get__userSelectedCarrier()).weaponName != 'ship') { this.view_interface.__set__infoLine('selectCity'); this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttack2'); this.view_interface.set_centerScreenFunc('default'); } else { this.view_interface.__set__infoLine('selectCity'); this.view_interface.interfaceMC.centerScreen.gotoAndStop('ship1'); this.view_interface.set_centerScreenFunc('default'); this.view_interface.interfaceMC.centerScreen.planeCount.gotoAndStop(this.model.ship_attack_arr.length + 1); if (this.model.ship_attack_arr.length == 3) { this.view_interface.interfaceMC.centerScreen.mc_select.gotoAndStop(2); } } } } else { if (this.model.__get__userSelectedWeapon()) { sc.gotoAndStop('preAttack1'); sc.MC1.gotoAndStop((this.model.__get__userSelectedWeapon()).weaponName); sc.MC2.gotoAndStop((this.model.__get__userSelectedWeapon()).weaponName); this.view_interface.set_centerScreenFunc('default'); if ((this.model.__get__userSelectedWeapon()).weaponName == 'space') { sc.MC2.satIMG.gotoAndStop(this.model.human.__get__religion()); } } else { this.view_interface.__set__infoLine('selectWeapon'); this.view_interface.interfaceMC.centerScreen.gotoAndStop('preAttackSelect'); this.view_interface.set_centerScreenFunc('hide'); } } break; case 'defense': if (this.model.__get__userSelectedWeapon()) { this.view_interface.set_centerScreenFunc('default'); sc.mc1.gotoAndStop((this.model.__get__userSelectedWeapon()).weaponName); if (sc.mc1._currentframe == 2) { sc.mc2.gotoAndStop(1); } else { sc.mc2.gotoAndStop(2); } } else { this.view_interface.__set__infoLine('selectWeapon'); sc.gotoAndStop('defenseSelect'); this.view_interface.set_centerScreenFunc('hide'); } break; case 'propaganda': if (this.model.__get__userSelectedCity()) { this.view_interface.set_centerScreenFunc('default'); sc.gotoAndStop('propaganda2'); sc.text1.text = 'Propaganda strength: ' + this.model.human.__get__religion() + ' %'; } else { v23 = true; this.view_interface.__set__infoLine('selectCity'); sc.gotoAndStop('propaganda1'); this.view_interface.set_centerScreenFunc('hide'); } break; case 'diplomacy': if (!_global.model.interface_diplomacy_error) { var v12 = 1; var v9 = 0; while (v9 < 5) { sc['leaderMC' + v9].gotoAndStop('black'); ++v9; } var v3 = 0; while (v3 < this.model.playerArr.length) { var v8 = this.model.playerArr[v3]; if (v8 != this.model.human) { var v7 = sc['leaderMC' + v12]; if (!this.model.human.ceaseFireArr[v8.playerNum]._status && v8.alive) { v7.gotoAndStop(v8.faceFrame); v7.num = v3; v7.onPress = function () { _global.presenter_interface.btnPressed_diplomacy('leader', this.num); }; } else { v7.gotoAndStop('black'); } if (v3 == this.model.userSelectedDiplomacyLeader) { sc['leaderSelected' + v12].gotoAndStop(2); } else { sc['leaderSelected' + v12].gotoAndStop(1); } ++v12; } ++v3; } v3 = 0; while (v3 < this.model.diplomacy_options_arr.length) { var v5 = this.model.diplomacy_options_arr[v3]; var v4 = sc['btn' + (v3 + 1)]; if (v5[0] == 'offer') { sc['text' + (v3 + 1)].text = 'turns no attack, I pay $ ' + v5[2] + ' mln'; } if (v5[0] == 'demand') { sc['text' + (v3 + 1)].text = 'turns no attack pay me $ ' + v5[2] + ' mln'; } if (v3 == this.model.userSelectedDiplomacyOption) { v4.gotoAndStop(2); sc['text' + (v3 + 1)].textColor = 65280; } else { v4.gotoAndStop(1); sc['text' + (v3 + 1)].textColor = 16777215; } v4.gotoAndStop(1); v4.text1.text = v5[1]; v4.option = v3; v4.onPress = function () { _global.presenter_interface.btnPressed_diplomacy('option', this.option); }; ++v3; } if (!this.model.userSelectedDiplomacyLeader || this.model.userSelectedDiplomacyOption == undefined) { this.view_interface.set_centerScreenFunc('hide'); } else { this.view_interface.set_centerScreenFunc('default'); } sc.textFunds.text = this.display_textFunds; } else { sc.gotoAndStop('diplomacy_error'); sc.error_window.text1.text = _global.model.interface_diplomacy_error; sc.error_window.btnOK.onPress = function () { _global.model.interface_diplomacy_error = undefined; _global.presenter_interface.update_centerScreenContent(); }; sc.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; sc.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; } break; case 'diplomacyPending': if (!_global.model.interface_diplomacy_error) { this.curDiplomacyObj = this.model.human.diplomacyPendingArr[0]; this.curDiplomacyOptionArr = this.model.diplomacy_options_arr[this.curDiplomacyObj._option]; if (this.curDiplomacyOptionArr[0] == 'offer') { sc.gotoAndStop('diplomacyOffer'); } else { if (this.curDiplomacyOptionArr[0] == 'demand') { sc.gotoAndStop('diplomacyDemand'); } } sc.leaderMC1.gotoAndStop(this.model.playerArr[this.curDiplomacyObj._leader].faceFrame); sc.btn1.text1.text = this.curDiplomacyOptionArr[1]; sc.btn1.gotoAndStop(1); sc.text1.text = ' $ ' + this.curDiplomacyOptionArr[2] + '.000.000'; this.view_interface.set_centerScreenFunc('default'); var v13; var v28 = {'ra': 0, 'rb': 0, 'ga': 0, 'gb': 0, 'ba': 0, 'bb': 0, 'aa': 0, 'ab': 0}; var v10 = 0; while (v10 < 5) { v13 = new Color(sc.mcapMC.schemeMC['mc' + v10]); v13.setTransform({'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0}); ++v10; } var v27 = new Color(sc.mapMC.schemeMC['mc' + this.curDiplomacyObj._leader]); v27.setTransform(_global.model.playerArr[this.curDiplomacyObj._leader].playerColorTint1); sc.textFunds.text = this.display_textFunds; } else { sc.gotoAndStop('diplomacy_error'); sc.error_window.text1.text = _global.model.interface_diplomacy_error; sc.error_window.btnOK.onPress = function () { _global.model.interface_diplomacy_error = undefined; _global.presenter_interface.update_centerScreenContent(); }; sc.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; sc.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; } break; case 'help': if (!this.model.userSelectedHelpTopic) { this.model.userSelectedHelpTopic = 'help_index'; } else { sc.gotoAndStop(this.model.userSelectedHelpTopic); this.view_interface.set_centerScreenFunc_help(this.help_data.get_data(this.model.userSelectedHelpTopic)); } sc.btnIndex_c.onPress = function () { _global.presenter_interface.btnPressed_index_c(this); }; break; case 'cheat': sc.btnIndex_c.onPress = function () { if (!_global.presenter_interface.do_ch_func(sc.chTXT.text)) { _global.model.userSelectedActionBtn = undefined; _global.presenter_interface.updateView(); } else { _global.presenter_interface.update_centerScreenContent(); } }; } this.__set__citiesSelectable(v23); }; v2.do_ch_func = function (a_str) { _global.model.corrupt_highscore = true; for (var v4 in this.model.ch_018) { if (this.model.ch_018[v4].str == a_str) { if (this.model.ch_018[v4].active) { this.model.ch_018[v4].active = false; } else { this.model.ch_018[v4].active = true; } _global.play_sound_by_action('interface_select_tech'); return false; } } for (v4 in this.model.ch_019) { if (this.model.ch_019[v4].str == a_str) { _global.model.force_error_window = true; _global.model.force_error_window_text = this.model.ch_019[v4].msg; _global.play_sound_by_action('interface_select_tech'); return true; } } return false; }; v2.colorCities = function (_str) { var v4 = 0; while (v4 < this.model.playerArr.length) { var v3 = this.model.playerArr[v4]; for (var v5 in v3.cityArr) { var v2 = v3.cityArr[v5]; v2.hideForSelection = false; v2.showForSelection = false; switch (_str) { case 'default': v2.hideForSelection = false; v2.showForSelection = false; break; case 'attackable': if (this.model.human.ceaseFireArr[v3.playerNum]._status || v3 == this.model.human) { v2.hideForSelection = true; } else { v2.showForSelection = true; } if (this.model.__get__userSelectedActionBtn() == 'preAttack' && this.model.__get__userSelectedShipCityPlrNum() && this.model.__get__userSelectedShipCityPlrNum() != v2.plr.playerNum) { v2.hideForSelection = true; } break; case 'allEnemy': if (v3 != this.model.human) { v2.showForSelection = true; } else { v2.hideForSelection = true; } } } ++v4; } }; v2.__set__citiesSelectable = function (_bln) { for (var v4 in this.model.playerArr) { for (var v3 in this.model.playerArr[v4].cityArr) { if (_bln) { this.model.playerArr[v4].cityArr[v3].image.mc.gotoAndStop(2); } else { this.model.playerArr[v4].cityArr[v3].image.mc.gotoAndStop(1); } } } return this.__get__citiesSelectable(); }; v2.__get__citiesSelectable = function () { return true; }; v2.setSliderValue = function () { var v3 = ''; var v4 = ''; var v5 = ''; if (this.model.__get__userSelectedActionBtn() !== 'production') { } else { this.model._userSelectedProductionInvestmentArr[this.pressedSliderObj.num][1] = this.pressedSliderObj.curVal; this.model._userSelectedProductionInvestmentArr[this.pressedSliderObj.num][3] = (this.model.human.turnMoney / 100) * this.pressedSliderObj.curVal; var v2 = 0; while (v2 < this.model._userSelectedProductionInvestmentArr.length) { if (this.model._userSelectedProductionInvestmentArr[v2][1] > 0) { v3 += this.model._userSelectedProductionInvestmentArr[v2][0] + '<br />'; v4 += this.model._userSelectedProductionInvestmentArr[v2][1] + ' % ( $ ' + this.format_for_production((this.model.human.turnMoney / 100) * this.model._userSelectedProductionInvestmentArr[v2][1]) + ' )' + '<br />'; } ++v2; } v5 = 'total estimated amount: ' + this.format_for_production(Math.round((this.model.human.turnMoney / 100) * this.model.__get__userSelectedProductionInvestmentArr_total_amount())); this.view_interface.set_productionText(v3, v4, v5); } }; v2.format_for_production = function (a_nr) { var v4 = a_nr * 1000000 + ''; v4 = _global.model.tools.reverse_string(v4); var v3 = ''; var v2 = 0; while (v2 < v4.length) { if (v2 == 3 || v2 == 6 || v2 == 9) { v3 += '.'; } v3 += v4.charAt(v2); ++v2; } v3 = _global.model.tools.reverse_string(v3); return v3; }; v2.set_sliders_after_error = function () { this.setSliderValue(); var v3; var v2 = 0; while (v2 < 11) { v3 = this.view_interface.interfaceMC.centerScreen['slide' + v2].sliderBtn; v3._x = (v3._parent.maxW._width / 100) * this.model._userSelectedProductionInvestmentArr[v2][1]; ++v2; } }; v2.set_research_after_error = function () { this.model.__set__userSelectedResearchArr([]); var v2; var v7 = ' '; var v6 = ' '; var v8 = ''; var v5 = 0; var v3 = 0; while (v3 < this.model.human.techTree.techArr.length) { v2 = this.model.human.techTree.techArr[v3]; if (v2.preOrder) { v7 += v2.techName + ' <br /> '; v6 += v2.cost + '.000.000 <br /> '; v5 += v2.cost; (this.model.__get__userSelectedResearchArr()).push({'techID': v2.techID}); } ++v3; } this.model.researchMoneySpend = v5; v8 = 'estimated total: ' + v5 + '.000.000'; this.view_interface.set_researchText(v7, v6, v8); this.loadResearchFunc(); }; v2.slider_action = function (__obj) { this.pressedSliderObj = __obj; if (!__obj._bg) { this.pressedSliderObj.regPoint = __obj._mc._xmouse; } else { this.pressedSliderObj.regPoint = 0; } this.pressedSliderObj.curVal = 0; this.pressedSliderObj.type = __obj.type; this.pressedSliderObj.num = __obj.num; this.sliderListener.onMouseMove = function () { var v3 = _global.presenter_interface.pressedSliderObj; var v5 = v3._mc._parent._xmouse - v3.regPoint; var v4 = v3._mc._parent.maxW._width; var v6 = v3._mc._parent.maxW._x; var v2 = 0; if (v5 > v4 / 2) { v2 = Math.round((v4 / 100) * v5 / 10) * 10; } else { v2 = Math.floor((v4 / 100) * v5 / 10) * 10; } if (v2 < 0) { v2 = 0; } if (v2 > 100) { v2 = 100; } if (v2 > _global.model[_global.model.userSelectedActionBtn + 'InvestementPercLeft'](v3.num)) { v2 = _global.model[_global.model.userSelectedActionBtn + 'InvestementPercLeft'](v3.num); } v3._mc._x = (v4 / 100) * v2; if (_global.presenter_interface.pressedSliderObj.curVal != v2) { _global.play_sound_by_action('interface_slider_bleep'); } _global.presenter_interface.pressedSliderObj.curVal = v2; _global.presenter_interface.setSliderValue(); if (_global.model.productionInvestementPercLeft(99) != 100) { _global.view_interface.set_centerScreenFunc('default'); } else { _global.view_interface.set_centerScreenFunc('hide'); } }; this.sliderListener.onMouseUp = function () { _global.presenter_interface.setSliderValue(); _global.presenter_interface.pressedSliderObj = undefined; Mouse.removeListener(_global.presenter_interface.sliderListener); }; Mouse.addListener(this.sliderListener); if (__obj._bg) { this.sliderListener.onMouseMove(); } }; v2.loadProductionFunc = function (a_error) { if (a_error) { var v6 = this.view_interface.interfaceMC.centerScreen; v6.error_window.text1.htmlText = a_error; v6.error_window.btnOK.onPress = function () { _global.model.interface_production_error = undefined; _global.presenter_interface.update_centerScreenContent(); _global.presenter_interface.set_sliders_after_error(); }; v6.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; v6.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; return undefined; } var v5 = new Array(); var v3 = 0; while (v3 < this.model.human.weaponStock.weaponArr.length) { var v4 = this.model.human.weaponStock.weaponArr[v3]; if (v4.desireGroup == 7) { v5.push([v4.investment, v4.cost]); } ++v3; } this.view_interface.set_production_specialStats(v5); v3 = 1; while (v3 < 9) { var _obj = new Object(); _obj.num = v3; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBtn._obj = _obj; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBtn.onPress = function () { if (!_global.model.human.techTree.allow_production_by_group(_global.model._userSelectedProductionInvestmentArr[this._obj.num][2])) { _global.model.interface_production_error = 'You have not yet invented this Technology'; _global.presenter_interface.updateView(); } else { this._obj._mc = this; _global.presenter_interface.slider_action(this._obj); } }; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBG._obj = _obj; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBG.onPress = function () { if (!_global.model.human.techTree.allow_production_by_group(_global.model._userSelectedProductionInvestmentArr[this._obj.num][2])) { _global.model.interface_production_error = 'You have not yet invented this Technology'; _global.presenter_interface.updateView(); } else { this._obj._mc = this._parent.sliderBtn; this._obj._bg = true; _global.presenter_interface.slider_action(this._obj); } }; ++v3; } }; v2.removeBioClips = function () { for (var v2 in this.view_interface.actionBtn_arr) { this.view_interface.actionBtn_arr[v2].bioloaded = false; } for (v2 in this.view_interface.stockBtn_arr) { this.view_interface.stockBtn_arr[v2].bioloaded = false; } }; v2.attachBioClips = function () { for (var v7 in this.model.human.bioloadedActionsArr) { var v5 = this.model.human.bioloadedActionsArr[v7]; for (var v6 in this.view_interface.actionBtn_arr) { var v3 = this.view_interface.actionBtn_arr[v6]; if (v3.actionName == v5) { v3.__set__bioloaded(true); } } } for (v7 in this.model.human.bioloadedStockArr) { var v4 = this.model.human.bioloadedStockArr[v7]; for (v6 in this.view_interface.stockBtn_arr) { var v2 = this.view_interface.stockBtn_arr[v6]; if (v2.relatedWeapon == v4) { v2.__set__bioloaded(true); } } } }; v2.loadResearchFunc = function (a_error) { if (a_error) { var v11 = this.view_interface.interfaceMC.centerScreen; v11.error_window.text1.htmlText = a_error; v11.error_window.btnOK.onPress = function () { _global.model.interface_research_error = undefined; _global.presenter_interface.update_centerScreenContent(); _global.presenter_interface.set_research_after_error(); }; v11.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; v11.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; return undefined; } var v8 = 1; while (v8 < 8) { var v5 = new Array(); var v4 = 0; while (v4 < this.model.human.techTree.techArr.length) { var v7 = this.model.human.techTree.techArr[v4]; if (v7.desireGroup == this.model._userSelectedResearchInvestmentArr[v8][2]) { v5.push(v7); } ++v4; } var v6; v4 = 0; while (v4 < v5.length) { if (!v5[v4].invented && (!_global.model.zs66hj8s || v5[v4].allow_in_demo)) { v6 = v5[v4]; break; } ++v4; } var v3 = this.view_interface.interfaceMC.centerScreen['tech' + v8]; v3.text1.text = '$ ' + v6.cost + '.000.000'; if (this.model.human.turnMoney < v6.cost + this.model.researchMoneySpend) { v3.text1.textColor = 13369344; } else { v3.text1.textColor = 0; } if (!v6) { v3.gotoAndStop('allInvented'); v3.text1.text = ' -- '; if (_global.model.zs66hj8s) { v3.gotoAndStop('demo'); } } else { if (!v6.preOrder) { v3.gotoAndStop(v6.techLevel); } else { v3.gotoAndStop(v6.techLevel + 4); if (_global.model.zs66hj8s) { v3.gotoAndStop('demo'); } } } v3._obj = {'_tech': v6, '_mc': v3}; v3.onPress = function () { _global.presenter_interface.btnPressed_techBox(this._obj); }; ++v8; } }; v2.play_sound_by_obj = function (_obj) { var v7 = new Object(); var v6 = this.view.srcMC.createEmptyMovieClip('sound' + this.model.soundCount++, this.view.srcMC.getNextHighestDepth()); var v3 = new Sound(v6); var v4 = 0; var v5 = 0; v3.attachSound(_obj._soundName); if (_obj._pan) { v3.setPan(_obj._pan); } if (_obj._loops) { v4 = _obj._loops; } if (_obj._startAt) { v5 = _obj._startAt; } if (_obj._vol) { v3.setVolume(_obj._vol); } v3.start(v5, v4); if (!_obj._continues) { this.model.playedSounds_arr.push({'soundObj': v3, 'mc': v6}); } return undefined; }; v2.play_sound_by_action = function (_action) { if (!_global.model.option.playSound) { return undefined; } for (var v4 in this.model.action_to_sound_arr) { var v3 = this.model.action_to_sound_arr[v4]; if (v3._actionName == _action) { this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.play_sound_by_building = function (_building, _plrNum) { if (!_global.model.option.playSound) { return undefined; } for (var v5 in this.model.building_to_sound_arr) { var v3 = this.model.building_to_sound_arr[v5]; if (v3._buildingName == _building) { if (v3._varSoundName !== 'religion') { } else { v3._soundName = 'Massmedia ' + this.model.tools.randRange(1, 4) + '.wav'; } this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.play_sound_by_event = function (_event, _panX) { if (!_global.model.option.playSound) { return undefined; } for (var v5 in this.model.event_to_sound_arr) { var v3 = this.model.event_to_sound_arr[v5]; if (v3._eventName == _event) { v3._pan = this.getPanBy_x(_panX) || 0; this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.getPanBy_x = function (_xNum) { var v1 = (_xNum / 8 - 50) * 2; return v1; }; v2.explosion_sound_by_mc_name = function (_str, _mcx) { for (var v4 in this.model.explosion_MC_to_sound_arr) { var v2 = this.model.explosion_MC_to_sound_arr[v4]; if (v2._mcName == _str) { v2._pan = this.getPanBy_x(_mcx); this.play_sound_by_obj(v2); return undefined; } } }; v2.reset_leader_stat_bars = function () { var v3; var v2 = 0; while (v2 < 6) { v3 = this.view_interface.interfaceMC['leaderStat' + v2 + '_' + 1].maskMC; v3._yscale = 0; v3 = this.view_interface.interfaceMC['leaderStat' + v2 + '_' + 2].maskMC; v3._yscale = 0; ++v2; } }; v2.roll_over_stat = function (p_str, p_plr_num) { switch (p_str) { case 'regard': var v3 = ''; for (var v6 in this.model.playerArr) { if (this.model.playerArr[v6].playerNum == p_plr_num) { var v4 = this.model.playerArr[v6]; var v2 = v4.regardArr[0]; if (v2 > 75) { v3 = 'regard5'; } else { if (v2 > 55) { v3 = 'regard4'; } else { if (v2 > 45) { v3 = 'regard3'; } else { if (v2 > 25) { v3 = 'regard2'; } else { v3 = 'regard1'; } } } } } } this.view_interface.__set__infoLine(v3); break; case 'population': this.view_interface.__set__infoLine(p_str); } }; v2.addProperty('citiesSelectable', v2.__get__citiesSelectable, v2.__set__citiesSelectable); v2.addProperty('display_population', v2.__get__display_population, function () {}); v2.addProperty('display_textFunds', v2.__get__display_textFunds, function () {}); ASSetPropFlags(_global.Sub_Presenter_interface.prototype, null, 1); } #endinitclip } movieClip 5264 __Packages.Presenter_interface { #initclip if (!_global.Presenter_interface) { var v1 = function () { super(); this.sliderListener = new Object(); this.help_data = new Help_data(); }; _global.Presenter_interface = v1; _global.Presenter_interface extends Sub_Presenter_interface; var v2 = v1.prototype; v2.debug_automate_func = function (_nr) { clearInterval(this.debug_automate_interval_ID); }; v2.btnPressed_accept = function () { var v4 = this.model.__get__userSelectedActionBtn(); if (v4 == 'skip_action' || v4 == 'resources' || v4 == 'production' && this.model.__get__userSelectedProductionInvestmentArr_total_amount() > 0 || v4 == 'research' && (this.model.__get__userSelectedResearchArr()).length > 0 || v4 == 'religion' || v4 == 'attack' && this.model.__get__userSelectedCity() && this.model.__get__userSelectedWeapon() || (v4 == 'preAttack' && (this.model.human.preAttackStatus == 'ready' && this.model.__get__userSelectedWeapon() && this.model.__get__userSelectedCity()) || this.model.human.preAttackStatus != 'ready' && this.model.__get__userSelectedWeapon() || this.model.human.preAttackStatus == 'ready' && (this.model.__get__userSelectedCarrier()).weaponName == 'ship' && this.model.ship_attack_arr.length > 0) || v4 == 'defense' && this.model.__get__userSelectedWeapon() || v4 == 'propaganda' && this.model.__get__userSelectedCity() || v4 == 'diplomacy' && this.model.userSelectedDiplomacyLeader != undefined && this.model.userSelectedDiplomacyOption != undefined && (this.model.diplomacy_options_arr[this.model.userSelectedDiplomacyOption][2] <= this.model.human.turnMoney || this.model.diplomacy_options_arr[this.model.userSelectedDiplomacyOption][0] == 'demand')) { for (var v5 in this.view_interface.actionBtn_arr) { var v3 = this.view_interface.actionBtn_arr[v5]; if (v3.actionName == this.model_interface.__get__selected_action_name()) { v3.isSetAction = true; } } (this.model_interface.__get__cur_pressed_action_btn()).isSetAction = true; this.model.setHumanTurnAction(); this.resetBtns(); this.play_sound_by_action('interface_acceptAction_btn'); } if (v4 == 'diplomacy' && this.model.diplomacy_options_arr[this.model.userSelectedDiplomacyOption][2] > this.model.human.turnMoney && this.model.diplomacy_options_arr[this.model.userSelectedDiplomacyOption][0] == 'demand') { this.model.interface_diplomacy_error = 'Not enough money'; this.update_centerScreenContent(); return undefined; } if (v4 == 'diplomacyPending' && (this.curDiplomacyOptionArr[0] == 'demand' && this.model.human.turnMoney >= this.curDiplomacyOptionArr[2] || this.curDiplomacyOptionArr[0] == 'offer')) { this.accept_pending_diplomacy(); this.play_sound_by_action('interface_acceptAction_btn'); return undefined; } if (v4 == 'diplomacyPending' && this.model.human.turnMoney < this.curDiplomacyOptionArr[2]) { _global.model.interface_diplomacy_error = 'Not enough money'; this.update_centerScreenContent(); return undefined; } if (v4 == 'cancelPreAttack') { this.play_sound_by_action('interface_acceptAction_btn'); this.model.__set__userSelectedCarrier(undefined); this.model.__set__userSelectedWeapon(undefined); this.model.human.preAttackStatus = 'inactive'; this.model.__set__userSelectedActionBtn(undefined); this.resetBtns(); } }; v2.btnPress = function (_arrIndex) { var v8 = this.view_interface.btn_arr[_arrIndex]._btn.type; if (!this.blockAllBtns) { switch (v8) { case 'action': if (this.model.__get__userSelectedActionBtn() == 'diplomacyPending') { return undefined; } this.model.interface_research_error = undefined; this.model.interface_production_error = undefined; this.model.interface_diplomacy_error = undefined; (this.model.__get__userSelectedWeapon()).inUse = 0; var v5 = this.view_interface.btn_arr[_arrIndex]._btn; if (!this.model.human.__get__allActionsSet() && !v5.__get__bioloaded()) { if (this.model.__get__userSelectedActionBtn() == v5.actionName) { this.model.__set__userSelectedActionBtn(undefined); v5.__set__pressed(false); this.play_sound_by_action('interface_actionBtn_off'); } else { if (!v5.isSetAction) { this.play_sound_by_action('interface_actionBtn_on'); this.btnPressed_cancel(); this.model.__set__userSelectedActionBtn(v5.actionName); this.model_interface.__set__cur_pressed_action_btn(v5); v5.__set__pressed(true); } } } if (v5.isSetAction) { this.play_sound_by_action('interface_actionBtn_off'); if (v5.actionName == this.model.human.turnAction_1.__get__action()) { this.btnPressed_tube(this.view_interface.actionTube1); } else { this.btnPressed_tube(this.view_interface.actionTube2); } } break; case 'stock': if (this.model.human.__get__allActionsSet()) { return undefined; } var v7 = this.view_interface.btn_arr[_arrIndex]._btn; var v4 = v7.stockPanelNum; var v3 = this.model.human.weaponStock.getWeaponByName(v7.relatedWeapon); (this.model.__get__userSelectedCity()).removeSelection('all'); this.model.__set__userSelectedCity(undefined); if ((this.model.__get__userSelectedActionBtn() == 'attack' && (v4 == 6 || v4 == 7) && (v3.weaponType != 'spy' || v3.weaponType == 'spy' && this.model.human.spy_readiness / 25 >= v3.weaponLevel) || this.model.__get__userSelectedActionBtn() == 'preAttack' && v3.weaponName != 'specialLoad' && (this.model.human.preAttackStatus == 'ready' && (v4 == 4 || v4 == 5) && v3.weaponLevel <= (this.model.__get__userSelectedCarrier()).weaponLevel || this.model.human.preAttackStatus != 'ready' && (v4 == 1 || v4 == 2 || v4 == 3)) || (this.model.__get__userSelectedCarrier()).weaponName == 'space' && v3.weaponName == 'specialLoad' && this.model.__get__userSelectedActionBtn() == 'preAttack' || this.model.__get__userSelectedActionBtn() == 'defense' && v4 == 8) && (v3.__get__inStock() - v3.inUse > 0 && v3.active)) { if (this.model.__get__userSelectedStockBtn() == v7.relatedWeapon) { (this.model.__get__userSelectedWeapon()).inUse = 0; this.model.__set__userSelectedStockBtn(undefined); this.model.__set__userSelectedWeapon(undefined); } else { if ((this.model.__get__userSelectedCarrier()).weaponName != 'ship') { (this.model.__get__userSelectedWeapon()).inUse = 0; ++v3.inUse; } if ((this.model.__get__userSelectedCarrier()).weaponName == 'ship' && this.model.ship_attack_arr.length < 3 || (this.model.__get__userSelectedCarrier()).weaponName != 'ship') { this.model.__set__userSelectedWeapon(v3); this.model.__set__userSelectedStockBtn(v7.relatedWeapon); _global.play_sound_by_action('interface_select_stock'); } } } if (v3.weaponType == 'spy' && this.model.human.spy_readiness / 25 < v3.weaponLevel && v3.__get__inStock() > 0) { this.model.interface_spy_error = 'Your spy readiness is not high enough to use this spy. <br> Choose a different spy or wait a few turns. '; this.updateView(); } if (!this.model.__get__userSelectedActionBtn() && v3.__get__inStock() > 0 && v3.active) { if ((v4 == 6 || v4 == 7) && !this.model.human.__get__allActionsSet()) { this.btnPress(4); this.btnPress(_arrIndex); _global.play_sound_by_action('interface_select_stock'); } if (this.model.human.preAttackStatus != 'ready' && (v4 == 1 || v4 == 2 || v4 == 3) || this.model.human.preAttackStatus == 'ready' && (v4 == 4 || v4 == 5) && v3.weaponLevel <= (this.model.__get__userSelectedCarrier()).weaponLevel) { this.btnPress(5); this.btnPress(_arrIndex); _global.play_sound_by_action('interface_select_stock'); } if (v4 == 8 && !this.model.human.__get__allActionsSet()) { this.btnPress(6); this.btnPress(_arrIndex); _global.play_sound_by_action('interface_select_stock'); } if (this.model.human.preAttackStatus == 'ready' && v3.weaponName == 'specialLoad' && (this.model.__get__userSelectedCarrier()).weaponName == 'space') { this.btnPress(5); this.btnPress(_arrIndex); _global.play_sound_by_action('interface_select_stock'); } } } this.updateView(); } }; v2.accept_pending_diplomacy = function () { if (this.curDiplomacyOptionArr[0] == 'demand') { this.model.human.turnMoney -= this.curDiplomacyOptionArr[2]; } this.model.human.diplomacyAcceptedArr.push(this.model.human.diplomacyPendingArr.shift()); this.resetBtns(); this.updateView(); }; v2.reject_pending_diplomacy = function () { this.model.human.diplomacyRejectedArr.push(this.model.human.diplomacyPendingArr.shift()); this.resetBtns(); this.updateView(); }; v2.btnPressed_cancel = function (_actionName) { var v4 = _actionName || this.model.__get__userSelectedActionBtn(); switch (v4) { case 'research': for (var v3 in this.model.human.techTree.techArr) { var v2 = this.model.human.techTree.techArr[v3]; v2.preOrder = false; } this.resetBtns(); break; case 'production': this.resetBtns(); break; case 'diplomacyPending': this.reject_pending_diplomacy(); this.resetBtns(); break; case 'attack': (this.model.__get__userSelectedWeapon()).inUse = 0; this.resetBtns(); break; case 'preAttack': (this.model.__get__userSelectedWeapon()).inUse = 0; if (this.model.human.preAttackStatus == 'ready' && (this.model.__get__userSelectedCarrier()).weaponName != 'ship') { this.model.__set__userSelectedActionBtn('cancelPreAttack'); } else { if ((this.model.__get__userSelectedCarrier()).weaponName == 'ship') { this.presenter.removeShipSelection(); } this.resetBtns(); } this.updateView(); break; case 'cancelPreAttack': this.presenter.removeShipSelection(); this.resetBtns(); break; default: this.resetBtns(); } }; v2.btnPressed_turn = function () { this.view_interface.turnBtn.__set__state('green'); clearInterval(this.doTurn_backup_intervalID); this.doTurn_backup_intervalID = setInterval(this, 'do_turn_backup', 2000); if (!this.block_start_btn) { if (this.model.human.turnAction_1.__get__action() && this.model.human.turnAction_2.__get__action()) { clearInterval(this.doTurn_intervalID); this.doTurn_intervalID = setInterval(this, 'turnInterval_step1', 200); this.blockAllBtns = true; this.block_start_btn = true; this.view_interface.actionTube1.__set__state('closed'); } else { this.blockAllBtns = false; } } }; v2.btnPressed_tube = function (_btn) { if (_btn.associatedTA.__get__action() && !this.blockAllBtns) { this.play_sound_by_action('interface_open_tube'); var v3 = _btn.associatedTA.__get__action(); if (v3 == 'preAttack' && (this.model.__get__userSelectedCarrier()).weaponName == 'ship') { this.presenter.removeShipSelection(_btn.associatedTA); } this.model.deselectCities(v3); this.model.human.turnMoney += _btn.associatedTA.researchMoneySpend; this.model.human.turnMoney += _btn.associatedTA.productionMoneySpend; if (this.model.diplomacy_options_arr[_btn.associatedTA.diplomacyOption][0] == 'offer') { this.model.human.turnMoney += this.model.diplomacy_options_arr[_btn.associatedTA.diplomacyOption][2]; } this.btnPressed_cancel(v3); _btn.associatedTA.doReset(); this.model.resetUserSelections(); this.resetBtns(); this.updateView(); } else { if (!this.model.__get__userSelectedActionBtn() && !this.blockAllBtns) { this.model.__set__userSelectedActionBtn('skip_action'); this.updateView(); this.play_sound_by_action('interface_open_tube'); } } }; v2.btnPressed_scroll_MSG = function (_str) { this.view_interface.scroll_msg_txt(_str); }; v2.btnRoll_on = function (_index) { this.view_interface.btn_arr[this.model_interface.cur_hover_btn_array_index]._btn.hover = false; if (this.model.human.getNextTurnAction()) { this.model_interface.cur_hover_btn_array_index = _index; this.view_interface.btn_arr[_index]._btn.hover = true; } }; v2.full_version_mc_sound_start = function () { if (!this.model.option.music) { this.btnPressed_option('music'); } }; v2.btnPressed_option = function (_str, dont_update) { switch (_str) { case 'sound': this.model.option.setSound(); break; case 'music': if (this.model.option.music) { this.model.theme_sound.stop(); } else { this.model.theme_sound.start(0, 1); this.model.theme_sound.onSoundComplete = function () { this.start(0, 1); }; } this.model.option.setMusic(); } if (!dont_update) { this.updateView(); } }; v2.init_theme_snd = function () { if (!this.model.option.music) { this.btnPressed_option('music', true); } }; v2.btnPressed_diplomacy = function (_cat, _num) { switch (_cat) { case 'leader': _global.play_sound_by_action('interface_select_diplo_leader'); this.model.userSelectedDiplomacyLeader = _num; break; case 'option': var v3 = this.model.diplomacy_options_arr[_num]; if (this.model.human.turnMoney < v3[2] && v3[0] == 'offer') { _global.model.interface_diplomacy_error = 'Not enough money'; this.update_centerScreenContent(); } else { this.model.userSelectedDiplomacyOption = _num; _global.play_sound_by_action('interface_select_diplo_option'); } } this.updateView(); }; v2.btnPressed_techBox = function (_obj) { var v6 = _obj._tech; var v12 = false; var v10 = false; var v11; var v14; if (!v6) { return undefined; } if (v6.preOrder) { v6.preOrder = false; _global.play_sound_by_action('interface_select_tech'); } else { if (this.model.human.turnMoney >= v6.cost + this.model.researchMoneySpend || this.model.human.turnMoney >= v6.cost && !this.model.researchMoneySpend) { v12 = true; } else { v12 = false; v11 = 'Not enough money!'; _global.play_sound_by_action('interface_select_tech_false'); } if (v6.desireGroup == 7 && this.model.human.techTree.__get__allow_special()) { v10 = true; } else { if (v6.desireGroup != 7) { v10 = true; } else { v10 = false; v11 = 'You need to invent 4 complete technologies before you can start inventing special weapons.'; } } if (_global.model.zs66hj8s && !v6.allow_in_demo) { v10 = false; v11 = 'This technologie are only available in de FULL VERSION.'; } if (v10 && v12) { v6.preOrder = true; } else { if (v11) { _global.model.interface_research_error = v11 + ' <br /> '; } if (v14) { _global.model.interface_research_error += v14; } } _global.play_sound_by_action('interface_select_tech'); } var v9 = ' '; var v8 = ' '; var v13 = ''; var v7 = 0; var v3; this.model.__set__userSelectedResearchArr([]); var v4 = 0; while (v4 < this.model.human.techTree.techArr.length) { v3 = this.model.human.techTree.techArr[v4]; if (v3.preOrder) { v9 += v3.prettyName + '<br /> '; v8 += v3.cost + '.000.000 <br /> '; v7 += v3.cost; (this.model.__get__userSelectedResearchArr()).push({'techID': v3.techID}); } ++v4; } this.model.researchMoneySpend = v7; v13 = 'estimated total: ' + v7 + '.000.000'; this.view_interface.set_researchText(v9, v8, v13); this.loadResearchFunc(); this.updateView(); }; v2.btn_pressed_full = function () { _level0.full_version_MC._visible = true; _level0.full_version_MC.play(); }; v2.load_full_version_btns = function (mc) { mc.txtMC_buy.txt.text = 'BUY FULL VERSION'; mc.btn_buy.onPress = function () { switch (_global.model.get_demo_version_name()) { case 'Affiliates': var v3 = unescape(_root._url); var v5 = v3.lastIndexOf('_'); var v7 = v3.lastIndexOf('.swf'); var v6 = v3.slice(0, v7); var v4 = v6.slice(v5 + 1); getURL('https://www.regnow.com/softsell/nph-softsell.cgi?items=16153-6&action=add_to_cart&affiliate=' + v4, '_blank'); break; case 'Miniclip': getURL('http://www.miniclip.com/buy_worlddominationii.htm', '_blank'); break; case 'Totallygame': getURL('http://www.youdagames.com/World+Domination+2-game-info-107/', '_blank'); break; case 'NewGrounds': getURL('https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=1071719', '_blank'); break; case 'Arcadetown': getURL(_global.model.get_demo_version_url(), '_blank'); break; case 'Craziness': getURL('https://secure.bmtmicro.com/servlets/Orders.ShoppingCart?CLR=0&CID=2249&PRODUCTID=22490032&AID=712006', '_blank'); break; case 'Agame': getURL(_global.model.get_demo_version_url(), '_blank'); } }; 'Craziness'; mc.txtMC_back.txt.text = 'BACK'; mc.btn_back.onPress = function () { _level0.full_version_MC.gotoAndStop(1); _level0.full_version_MC._visible = false; }; _level0.full_version_MC.bg.onPress = function () {}; _level0.full_version_MC.bg.useHandCursor = false; }; v2.btnPressed_spyBuilding = function (_num) { _global.play_sound_by_action('interface_select_spy_building'); this.model.userSelectedSpyBuilding = this.model.spyBuildingArr[_num]; this.update_centerScreenContent(); }; v2.btnRoll_off = function () { this.view_interface.btn_arr[this.model_interface.cur_hover_btn_array_index]._btn.hover = false; this.model_interface.cur_hover_btn_array_index = -1; }; v2.btnPressed_index_c = function (a_mc) { if (this.model.m11 == 'xx1231') { this.model.__set__userSelectedActionBtn('cheat'); this.updateView(); } if (a_mc._parent.input_.chTXT.text == 'youda') { this.model.m11 = 'xx1231'; this.model.__set__userSelectedActionBtn('cheat'); this.updateView(); } a_mc._parent.input_.nextFrame(); }; v2.__set__citiesSelectable = function (_bln) { for (var v4 in this.model.playerArr) { for (var v3 in this.model.playerArr[v4].cityArr) { if (_bln) { this.model.playerArr[v4].cityArr[v3].image.mc.gotoAndStop(2); } else { this.model.playerArr[v4].cityArr[v3].image.mc.gotoAndStop(1); } } } return this.__get__citiesSelectable(); }; v2.__get__citiesSelectable = function () { return true; }; v2.setSliderValue = function () { var v3 = ''; var v4 = ''; var v5 = ''; if (this.model.__get__userSelectedActionBtn() !== 'production') { } else { this.model._userSelectedProductionInvestmentArr[this.pressedSliderObj.num][1] = this.pressedSliderObj.curVal; this.model._userSelectedProductionInvestmentArr[this.pressedSliderObj.num][3] = (this.model.human.turnMoney / 100) * this.pressedSliderObj.curVal; var v2 = 0; while (v2 < this.model._userSelectedProductionInvestmentArr.length) { if (this.model._userSelectedProductionInvestmentArr[v2][1] > 0) { v3 += this.model._userSelectedProductionInvestmentArr[v2][0] + '<br />'; v4 += this.model._userSelectedProductionInvestmentArr[v2][1] + ' % ( $ ' + this.format_for_production((this.model.human.turnMoney / 100) * this.model._userSelectedProductionInvestmentArr[v2][1]) + ' )' + '<br />'; } ++v2; } v5 = 'total estimated amount: ' + this.format_for_production(Math.round((this.model.human.turnMoney / 100) * this.model.__get__userSelectedProductionInvestmentArr_total_amount())); this.view_interface.set_productionText(v3, v4, v5); } }; v2.format_for_production = function (a_nr) { var v4 = a_nr * 1000000 + ''; v4 = _global.model.tools.reverse_string(v4); var v3 = ''; var v2 = 0; while (v2 < v4.length) { if (v2 == 3 || v2 == 6 || v2 == 9) { v3 += '.'; } v3 += v4.charAt(v2); ++v2; } v3 = _global.model.tools.reverse_string(v3); return v3; }; v2.display_format_dot_notation = function (a_nr) { var v4 = a_nr + ''; v4 = _global.model.tools.reverse_string(v4); var v3 = ''; var v2 = 0; while (v2 < v4.length) { if (v2 == 3 || v2 == 6 || v2 == 9) { v3 += '.'; } v3 += v4.charAt(v2); ++v2; } v3 = _global.model.tools.reverse_string(v3); return v3; }; v2.set_sliders_after_error = function () { this.setSliderValue(); var v3; var v2 = 0; while (v2 < 11) { v3 = this.view_interface.interfaceMC.centerScreen['slide' + v2].sliderBtn; v3._x = (v3._parent.maxW._width / 100) * this.model._userSelectedProductionInvestmentArr[v2][1]; ++v2; } }; v2.set_research_after_error = function () { this.model.__set__userSelectedResearchArr([]); var v2; var v7 = ' '; var v6 = ' '; var v8 = ''; var v5 = 0; var v3 = 0; while (v3 < this.model.human.techTree.techArr.length) { v2 = this.model.human.techTree.techArr[v3]; if (v2.preOrder) { v7 += v2.prettyName + ' <br /> '; v6 += v2.cost + '.000.000 <br /> '; v5 += v2.cost; (this.model.__get__userSelectedResearchArr()).push({'techID': v2.techID}); } ++v3; } this.model.researchMoneySpend = v5; v8 = 'estimated total: ' + v5 + '.000.000'; this.view_interface.set_researchText(v7, v6, v8); this.loadResearchFunc(); }; v2.slider_action = function (__obj) { this.pressedSliderObj = __obj; if (!__obj._bg) { this.pressedSliderObj.regPoint = __obj._mc._xmouse; } else { this.pressedSliderObj.regPoint = 0; } this.pressedSliderObj.curVal = 0; this.pressedSliderObj.type = __obj.type; this.pressedSliderObj.num = __obj.num; this.sliderListener.onMouseMove = function () { var v3 = _global.presenter_interface.pressedSliderObj; var v5 = v3._mc._parent._xmouse - v3.regPoint; var v4 = v3._mc._parent.maxW._width; var v6 = v3._mc._parent.maxW._x; var v2 = 0; if (v5 > v4 / 2) { v2 = Math.round((v4 / 100) * v5 / 10) * 10; } else { v2 = Math.floor((v4 / 100) * v5 / 10) * 10; } if (v2 < 0) { v2 = 0; } if (v2 > 100) { v2 = 100; } if (v2 > _global.model[_global.model.userSelectedActionBtn + 'InvestementPercLeft'](v3.num)) { v2 = _global.model[_global.model.userSelectedActionBtn + 'InvestementPercLeft'](v3.num); } v3._mc._x = (v4 / 100) * v2; if (_global.presenter_interface.pressedSliderObj.curVal != v2) { _global.play_sound_by_action('interface_slider_bleep'); } _global.presenter_interface.pressedSliderObj.curVal = v2; _global.presenter_interface.setSliderValue(); if (_global.model.productionInvestementPercLeft(99) != 100) { _global.view_interface.set_centerScreenFunc('default'); } else { _global.view_interface.set_centerScreenFunc('hide'); } }; this.sliderListener.onMouseUp = function () { _global.presenter_interface.setSliderValue(); _global.presenter_interface.pressedSliderObj = undefined; Mouse.removeListener(_global.presenter_interface.sliderListener); }; Mouse.addListener(this.sliderListener); if (__obj._bg) { this.sliderListener.onMouseMove(); } }; v2.roll_over_map = function (a_num) { if (this.model.playerArr[a_num].alive) { var v3 = new Color(this.view_interface.interfaceMC['leader_flash' + a_num]); v3.setTransform(this.model.playerArr[a_num].playerColorTint1); this.view_interface.interfaceMC['leader_flash' + a_num].play(); } }; v2.loadProductionFunc = function (a_error) { if (a_error) { var v6 = this.view_interface.interfaceMC.centerScreen; v6.error_window.text1.htmlText = a_error; v6.error_window.btnOK.onPress = function () { _global.model.interface_production_error = undefined; _global.presenter_interface.update_centerScreenContent(); _global.presenter_interface.set_sliders_after_error(); }; v6.error_window.btnOK.onRollOver = function () { this.gotoAndStop(2); }; v6.error_window.btnOK.onRollOut = function () { this.gotoAndStop(1); }; return undefined; } var v5 = new Array(); var v3 = 0; while (v3 < this.model.human.weaponStock.weaponArr.length) { var v4 = this.model.human.weaponStock.weaponArr[v3]; if (v4.desireGroup == 7) { v5.push([v4.investment, v4.cost]); } ++v3; } this.view_interface.set_production_specialStats(v5); v3 = 1; while (v3 < 9) { var _obj = new Object(); _obj.num = v3; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBtn._obj = _obj; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBtn.onPress = function () { if (!_global.model.human.techTree.allow_production_by_group(_global.model._userSelectedProductionInvestmentArr[this._obj.num][2])) { _global.model.interface_production_error = 'You have not yet invented this Technology'; _global.presenter_interface.updateView(); } else { this._obj._mc = this; _global.presenter_interface.slider_action(this._obj); } }; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBG._obj = _obj; this.view_interface.interfaceMC.centerScreen['slide' + v3].sliderBG.onPress = function () { if (!_global.model.human.techTree.allow_production_by_group(_global.model._userSelectedProductionInvestmentArr[this._obj.num][2])) { _global.model.interface_production_error = 'You have not yet invented this Technology'; _global.presenter_interface.updateView(); } else { this._obj._mc = this._parent.sliderBtn; this._obj._bg = true; _global.presenter_interface.slider_action(this._obj); } }; ++v3; } }; v2.removeBioClips = function () { for (var v2 in this.view_interface.actionBtn_arr) { this.view_interface.actionBtn_arr[v2].bioloaded = false; } for (v2 in this.view_interface.stockBtn_arr) { this.view_interface.stockBtn_arr[v2].bioloaded = false; } }; v2.attachBioClips = function () { for (var v7 in this.model.human.bioloadedActionsArr) { var v5 = this.model.human.bioloadedActionsArr[v7]; for (var v6 in this.view_interface.actionBtn_arr) { var v3 = this.view_interface.actionBtn_arr[v6]; if (v3.actionName == v5) { v3.__set__bioloaded(true); } } } for (v7 in this.model.human.bioloadedStockArr) { var v4 = this.model.human.bioloadedStockArr[v7]; for (v6 in this.view_interface.stockBtn_arr) { var v2 = this.view_interface.stockBtn_arr[v6]; if (v2.relatedWeapon == v4) { v2.__set__bioloaded(true); } } } }; v2.launch_space_rocket_sound = function () { this.play_sound_by_event('space_launch'); }; v2.play_sound_by_obj = function (_obj) { var v7 = new Object(); var v6 = this.view.srcMC.createEmptyMovieClip('sound' + this.model.soundCount++, this.view.srcMC.getNextHighestDepth()); var v3 = new Sound(v6); var v4 = 0; var v5 = 0; v3.attachSound(_obj._soundName); if (_obj._pan) { v3.setPan(_obj._pan); } if (_obj._loops) { v4 = _obj._loops; } if (_obj._startAt) { v5 = _obj._startAt; } if (_obj._vol) { v3.setVolume(_obj._vol); } v3.start(v5, v4); if (!_obj._continues) { this.model.playedSounds_arr.push({'soundObj': v3, 'mc': v6}); } return undefined; }; v2.play_ambient_sound_by_building_frame = function (_frame) { if (!_global.model.option.playSound) { return undefined; } for (var v5 in this.model.active_ambient_sounds) { if (this.model.active_ambient_sounds[v5] == _frame) { return undefined; } } if (!this.view.srcMC['ambient_sound_' + this.model.ambient_sound_index]) { this.view.srcMC.createEmptyMovieClip('ambient_sound_' + this.model.ambient_sound_index, this.view.srcMC.getNextHighestDepth()); } var v6 = this.view.srcMC['ambient_sound_' + this.model.ambient_sound_index]; var v3 = new Sound(v6); for (v5 in this.model.ambient_sound_arr) { if (this.model.ambient_sound_arr[v5]._building == _frame) { this.model.playing_ambient_sound_arr[this.model.ambient_sound_index].stop(); v3.attachSound(this.model.ambient_sound_arr[v5]._soundName); v3.start(0, 9999); v3.setVolume(21); this.model.playing_ambient_sound_arr[this.model.ambient_sound_index] = v3; this.model.next_ambient_sound_index(); } } }; v2.play_sound_by_action = function (_action) { if (!_global.model.option.playSound) { return undefined; } for (var v4 in this.model.action_to_sound_arr) { var v3 = this.model.action_to_sound_arr[v4]; if (v3._actionName == _action) { this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.play_sound_by_building = function (_building, _plrNum) { if (!_global.model.option.playSound) { return undefined; } for (var v5 in this.model.building_to_sound_arr) { var v3 = this.model.building_to_sound_arr[v5]; if (v3._buildingName == _building) { if (v3._varSoundName !== 'religion') { } else { v3._soundName = 'Massmedia ' + this.model.tools.randRange(1, 4) + '.wav'; } this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.play_satellite_sound = function () { if (_global.model.satellite_sound_playing) { return undefined; } _global.model.satellite_sound_playing = true; this.play_sound_by_event('satellite_flight'); }; v2.play_sound_by_event = function (_event, _panX) { if (!_global.model.option.playSound) { return undefined; } for (var v5 in this.model.event_to_sound_arr) { var v3 = this.model.event_to_sound_arr[v5]; if (v3._eventName == _event) { v3._pan = this.getPanBy_x(_panX) || 0; this.play_sound_by_obj(v3); return undefined; } } return undefined; }; v2.getPanBy_x = function (_xNum) { var v1 = (_xNum / 8 - 50) * 2; return v1; }; v2.explosion_sound_by_mc_name = function (_str, _mcx) { for (var v4 in this.model.explosion_MC_to_sound_arr) { var v2 = this.model.explosion_MC_to_sound_arr[v4]; if (v2._mcName == _str) { v2._pan = this.getPanBy_x(_mcx); this.play_sound_by_obj(v2); return undefined; } } }; v2.reset_leader_stat_bars = function () { var v4; var v3 = 0; while (v3 < 6) { v4 = this.view_interface.interfaceMC['leaderStat' + v3 + '_' + 1].maskMC; v4._yscale = 0; v4 = this.view_interface.interfaceMC['leaderStat' + v3 + '_' + 2].maskMC; v4._yscale = 0; var v5 = new Color(this.view_interface.interfaceMC['leaderStat' + v3 + '_' + 1]); var v6 = _global.model.playerArr[v3]; v5.setTransform(v6.playerColorTint1); ++v3; } }; v2.roll_over_stat = function (p_str, p_plr_num) { switch (p_str) { case 'regard': var v3 = ''; for (var v6 in this.model.playerArr) { if (this.model.playerArr[v6].playerNum == p_plr_num) { var v4 = this.model.playerArr[v6]; var v2 = v4.regardArr[0]; if (v2 > 75) { v3 = 'regard5'; } else { if (v2 > 55) { v3 = 'regard4'; } else { if (v2 > 45) { v3 = 'regard3'; } else { if (v2 > 25) { v3 = 'regard2'; } else { v3 = 'regard1'; } } } } } } this.view_interface.__set__infoLine(v3); break; case 'population': this.view_interface.__set__infoLine(p_str); } }; v2.addProperty('citiesSelectable', v2.__get__citiesSelectable, v2.__set__citiesSelectable); ASSetPropFlags(_global.Presenter_interface.prototype, null, 1); } #endinitclip } movieClip 5265 __Packages.Btn_tube { #initclip if (!_global.Btn_tube) { var v1 = function (_btnMC, _tubeMC) { this.tubeMC = _tubeMC; this.tubeMC.txtMC.txt.embedFonts = true; this.tubeMC.txtMC._alpha = 65; this.btnMC = _btnMC; this.tubeMC.targetState = 1; }; _global.Btn_tube = v1; var v2 = v1.prototype; v2.__set__state = function (_str) { if (this.__get__state() != _str) { this.setOverlayText(); switch (_str) { case 'closed': this.tubeMC.targetFrame = 1; break; case 'open': this.tubeMC.targetFrame = 10; break; case 'set': this.__set__handCursor(true); this.tubeMC.targetFrame = 11; } this._state = _str; this.tubeMC.onEnterFrame = function () { if (this._currentframe > this.targetFrame) { this.prevFrame(); if (this._currentframe == 9) { _global.play_sound_by_action('interface_close_tube'); } } else { if (this._currentframe < this.targetFrame) { this.nextFrame(); if (this._currentframe == 2) { _global.play_sound_by_action('interface_open_tube'); } } else { this.gotoAndStop(this.targetFrame); delete this.onEnterFrame; } } }; } return this.__get__state(); }; v2.__set__handCursor = function (_bln) { if (!_bln) { this.btnMC.gotoAndStop(2); } else { this.btnMC.gotoAndStop(1); } return this.__get__handCursor(); }; v2.setOverlayText = function () { this._overlayText = ''; if (this.associatedTA.__get__action()) { this._overlayText = _global.view_interface.actionName2label(this.associatedTA.__get__action()); if (this._overlayText == 'DIRECT ATTACK' || this._overlayText == 'PREPARED ATTACK') { this.tubeMC.txtMC.gotoAndStop(2); } else { this.tubeMC.txtMC.gotoAndStop(1); } } else { if (_global.model.userSelectedActionBtn) { this._overlayText = _global.view_interface.actionName2label(_global.model.userSelectedActionBtn); if (this._overlayText == 'DIRECT ATTACK' || this._overlayText == 'PREPARED ATTACK') { this.tubeMC.txtMC.gotoAndStop(2); } else { this.tubeMC.txtMC.gotoAndStop(1); } } } if (this._overlayText) { this.tubeMC.txtMC.txt.htmlText = this._overlayText; this.tubeMC.txtMC.txt.setTextFormat(_global.view.textFormats.interface_tubeText_1); this.tubeMC.txtMC.txt.embedFonts = true; } }; v2.getPverlayText = function () { return this._overlayText; }; v2.__get__state = function () { return this._state; }; v2.type = 'tube'; v2._state = 'closed'; v2.addProperty('handCursor', function () {}, v2.__set__handCursor); v2.addProperty('state', v2.__get__state, v2.__set__state); ASSetPropFlags(_global.Btn_tube.prototype, null, 1); } #endinitclip } movieClip 5266 __Packages.Btn_turn { #initclip if (!_global.Btn_turn) { var v1 = function (_btnMC, _imgMC) { this.btnMC = _btnMC; this.imgMC = _imgMC; }; _global.Btn_turn = v1; var v2 = v1.prototype; v2.__set__state = function (_str) { if (this._state != _str) { switch (_str) { case 'closed': _global.play_sound_by_action('interface_open_turnBtn'); this.imgMC.targetFrame = 1; this.__set__handCursor(false); break; case 'open': _global.play_sound_by_action('interface_close_turnBtn'); this.imgMC.targetFrame = 11; this.__set__handCursor(false); break; case 'green': this.imgMC.targetFrame = 12; this.__set__handCursor(false); } this._state = _str; this.imgMC.onEnterFrame = function () { if (this._currentframe < this.targetFrame) { this.nextFrame(); } else { if (this._currentframe > this.targetFrame) { this.prevFrame(); } else { this.gotoAndStop(this.targetFrame); delete this.onEnterFrame; } } }; } return this.__get__state(); }; v2.__set__handCursor = function (_bln) { return this.__get__handCursor(); }; v2.__get__state = function () { return this._state; }; v2.pressed = false; v2._state = 'closed'; v2.addProperty('handCursor', function () {}, v2.__set__handCursor); v2.addProperty('state', v2.__get__state, v2.__set__state); ASSetPropFlags(_global.Btn_turn.prototype, null, 1); } #endinitclip } movieClip 5267 __Packages.Btn_simple { #initclip if (!_global.Btn_simple) { var v1 = function (_srcMC, _img) { this.srcMC = _srcMC; this.img = _img; }; _global.Btn_simple = v1; var v2 = v1.prototype; ASSetPropFlags(_global.Btn_simple.prototype, null, 1); } #endinitclip } movieClip 5268 __Packages.Btn_musicSwitch { #initclip if (!_global.Btn_musicSwitch) { var v1 = function (_overlayMC, _imgMC, _option) { this.overlayMC = _overlayMC; this.imgMC = _imgMC; this._state = false; this.option = _option; }; _global.Btn_musicSwitch = v1; var v2 = v1.prototype; v2.__set__state = function (_bln) { if (_bln != this._state) { this._state = _bln; if (!_bln) { this.imgMC.gotoAndStop(2); } else { this.imgMC.gotoAndStop(1); } } return this.__get__state(); }; v2.__get__state = function () { return this._state; }; v2.__set__handCursor = function (_bln) { if (!_bln) { this.overlayMC.gotoAndStop(2); } else { this.overlayMC.gotoAndStop(1); } return this.__get__handCursor(); }; v2.addProperty('handCursor', function () {}, v2.__set__handCursor); v2.addProperty('state', v2.__get__state, v2.__set__state); ASSetPropFlags(_global.Btn_musicSwitch.prototype, null, 1); } #endinitclip } movieClip 5269 __Packages.TextFormats { #initclip if (!_global.TextFormats) { var v1 = function () { this.scrollText = new TextFormat(); this.scrollText.font = 'Arial'; this.scrollText.size = 11; this.scrollText.color = 16777215; this.infoText = new TextFormat(); this.infoText.font = 'Arial'; this.infoText.size = 10; this.infoText.color = 16763904; this.infoLineText = new TextFormat(); this.infoLineText.font = 'Arial'; this.infoLineText.size = 14; this.infoLineText.color = 16763904; this.stockBtnText1 = new TextFormat(); this.stockBtnText1.font = 'Arial'; this.stockBtnText1.size = 10; this.stockBtnText1.color = 0; this.stockBtnText1.align = 'center'; this.stockBtnText2 = new TextFormat(); this.stockBtnText2.font = 'Arial'; this.stockBtnText2.size = 10; this.stockBtnText2.color = 16777215; this.stockBtnText2.align = 'center'; this.stockBtnText3 = new TextFormat(); this.stockBtnText3.font = 'Arial'; this.stockBtnText3.size = 10; this.stockBtnText3.color = 11184810; this.stockBtnText3.align = 'center'; this.stockBtnText4 = new TextFormat(); this.stockBtnText4.font = 'Arial'; this.stockBtnText4.size = 10; this.stockBtnText4.color = 16763904; this.stockBtnText4.align = 'center'; this.stockBtnText5 = new TextFormat(); this.stockBtnText5.font = 'Arial'; this.stockBtnText5.size = 10; this.stockBtnText5.color = 13303610; this.stockBtnText5.align = 'center'; this.stockBtnText6 = new TextFormat(); this.stockBtnText6.font = 'Arial'; this.stockBtnText6.size = 10; this.stockBtnText6.color = 12218369; this.stockBtnText6.align = 'center'; this.popupText1 = new TextFormat(); this.popupText1.font = 'Arial'; this.popupText1.size = 10; this.popupText1.color = 13303610; this.popupText1.align = 'right'; this.popupText2 = new TextFormat(); this.popupText2.font = 'Arial'; this.popupText2.size = 10; this.popupText2.color = 11590402; this.popupText2.align = 'right'; this.popupText3 = new TextFormat(); this.popupText3.font = 'Arial'; this.popupText3.size = 10; this.popupText3.color = 16720418; this.popupText3.align = 'right'; this.popupText4 = new TextFormat(); this.popupText4.font = 'Arial'; this.popupText4.size = 10; this.popupText4.color = 13303610; this.popupText4.align = 'center'; this.hatchText1 = new TextFormat(); this.hatchText1.font = 'Arial'; this.hatchText1.size = 11; this.hatchText1.color = 8947848; this.hatchText2 = new TextFormat(); this.hatchText2.font = 'Arial'; this.hatchText2.size = 11; this.hatchText2.color = 8947848; this.interface_actionText_1 = new TextFormat(); this.interface_actionText_1.font = 'Arial'; this.interface_actionText_1.size = 12; this.interface_actionText_1.color = 16777215; this.interface_actionText_2 = new TextFormat(); this.interface_actionText_2.font = 'Arial'; this.interface_actionText_2.size = 12; this.interface_actionText_2.color = 11184810; this.interface_stockText_1 = new TextFormat(); this.interface_stockText_1.font = 'Arial'; this.interface_stockText_1.size = 10; this.interface_stockScrnText_1 = new TextFormat(); this.interface_stockScrnText_1.font = 'Arial'; this.interface_stockScrnText_1.size = 14; this.interface_tubeText_1 = new TextFormat(); this.interface_tubeText_1.font = 'Arial'; this.interface_tubeText_1.size = 12; this.interface_tubeText_1.align = 'center'; this.interface_production_1 = new TextFormat(); this.interface_production_1.font = 'Arial'; this.interface_production_1.size = 10; this.interface_production_1.align = 'right'; this.interface_production_2 = new TextFormat(); this.interface_production_2.font = 'Arial'; this.interface_production_2.size = 10; this.interface_production_2.align = 'left'; }; _global.TextFormats = v1; var v2 = v1.prototype; v2.__resolve = function (_param) {}; ASSetPropFlags(_global.TextFormats.prototype, null, 1); } #endinitclip } movieClip 5270 __Packages.WD2_messages { #initclip if (!_global.WD2_messages) { var v1 = function () {}; _global.WD2_messages = v1; var v2 = v1.prototype; v2.action_production_initial_infoText = 'Please choose a weapon from your arsenal on the left. <br> Only weapons displayed in orange can be purchased, other weapons are inactive and need to be invented first. Choose the \'technology\' action for this'; v2.action_production_initial_infoLine = 'Production: Select weapons'; v2.action_research_initial_infoLine = 'Research technology: Select from your arsenal'; v2.action_research_initial_infoText = 'Choose a technology to invent from your arsenal'; v2.action_resources_initial_infoLine = 'Resources: Increase your money'; v2.action_resources_initial_infoText = 'Increase your money by gathering resources.'; v2.action_religion_initial_infoLine = 'Religion: Defend agains propaganda attacks'; v2.action_religion_initial_infoText = 'Increase the religion level of your people and prevent propaganda attacks'; v2.action_preAttack_initial_infoLine = 'Prepaired attack: '; v2.action_preAttack_initial_infoText = 'Prepare an attack. Select a rocket or plane from your arsenal. You can launch this weapon in the next turn'; v2.action_dirattack_initial_infoLine = 'Attack the enemy!'; v2.action_dirattack_initial_infoText = 'Select a weapon from your arsenal to attack the enemy'; v2.action_defense_initial_infoLine = 'Defend against a prepaired attack'; v2.action_defense_initial_infoText = 'Select anti-air or anti-rocket defense from your arsenal'; v2.action_propaganda_initial_infoLine = 'Propaganda attack on an enemy city:'; v2.action_propaganda_initial_infoText = 'Select an enemy city on the map to perform the propaganda attack on '; v2.action_diplomacy_initial_infoLine = 'Diplomacy: Select an player'; v2.action_diplomacy_initial_infoText = 'Choose an opponent to perform the diplomacy action on'; ASSetPropFlags(_global.WD2_messages.prototype, null, 1); } #endinitclip } movieClip 5271 __Packages.Battle { #initclip if (!_global.Battle) { var v1 = function () { this.model = _global.model; this._activeUnitsArr = new Array(); this._toDeleteUnitsArr = new Array(); this._toShowTimedABArr = new Array(); this._toShowInBattleABArr = new Array(); this._toShowInitABArr = new Array(); this._toShowLastABArr = new Array(); this._toDeleteExplosionMC_arr = new Array(); }; _global.Battle = v1; var v2 = v1.prototype; v2.createBattleScriptVars = function () { this.resetBattle(); this.createToShowABArray(); _global.model.battleTimerArr = []; var v7 = 0; while (v7 < 15) { _global.model.battleTimerArr.push(_global.model.tools.randRange(50, 60)); ++v7; } this.tmpBattleArr = []; this.randUnitOrderArr = []; for (v7 in _global.model.turnResultsArr) { var v3 = _global.model.turnResultsArr[v7]; if (v3._item == 'battle' || v3._item == 'diplomacy' || v3._item == 'resources' || v3._item == 'propaganda' || v3._item == 'religion') { this.tmpBattleArr.push(v3); } } for (v7 in this._toShowInBattleABArr) { } var v5 = 0; var v4 = 0; while (v4 <= _global.model.orderOfActions_arr.length) { v7 = 0; while (v7 < this.tmpBattleArr.length) { if (this.tmpBattleArr[v7]._item == _global.model.orderOfActions_arr[v5]) { this.randUnitOrderArr.push(this.tmpBattleArr[v7]); } ++v7; } ++v5; ++v4; } for (v7 in this.randUnitOrderArr) { var v6 = _global.presenter.doTR_from_battle(this.randUnitOrderArr[v7]); } }; v2.createToSpawnUnitsArr = function () { this.createBattleScriptVars(); for (var v65 in this.randUnitOrderArr) { var v53 = this.randUnitOrderArr[v65]; var v28 = _global.model.playerArr[v53._player]; var v48 = v53._weapon; var v20 = _global.model.human.weaponStock.getWeaponByID(v48); var v6 = (_global.model.human.weaponStock.getWeaponByID(v53._payload)).explosion_mc_name; var v57 = v28.startLocation[0]; var v56 = v28.startLocation[1]; var v5 = _global.model.getCityByID(v53._city); var v4 = v5.xPos; var v3 = v5.yPos; var v31 = new Array(); var v54 = 'unit' + v65; var v15 = Number(v65) + 1; var v58 = new Object(); if (v53._item == 'battle') { switch (v20.weaponName) { case 'soldier1': var v33 = _global.model.boatStartingPosition[v5.plr.playerNum][2]; var v36 = _global.model.boatStartingPosition[v53._player][2]; var v9 = v36; while (v9 != v33) { v31.push({'_x': _global.model.boatWayPointPositions[v9][0], '_y': _global.model.boatWayPointPositions[v9][1], '_type': 'default'}); ++v9; if (v9 > _global.model.boatWayPointPositions.length - 1) { v9 = 0; } } v31.push({'_x': _global.model.boatStartingPosition[v5.plr.playerNum][0], '_y': _global.model.boatStartingPosition[v5.plr.playerNum][1], '_type': 'unload'}); this._toSpawnUnitsArr.push({'unitID': v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.boatStartingPosition[v53._player][0], 'startY': _global.model.boatStartingPosition[v53._player][1], 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'boat', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); var v7 = new Array(); var v41 = 0; var v13 = _global.presenter.get_soldier_positions(v5); v3 -= 20; for (var v59 in _global.model.soldierSpawnArr1) { v7 = []; v7.push({'_x': _global.model.landUnitsArr[v5.plr.playerNum][0], '_y': _global.model.landUnitsArr[v5.plr.playerNum][1], '_type': 'spawn'}); var v8 = 0; while (v8 < v13._wpArr.length) { v7.push({'_x': v13._wpArr[v8]._x, '_y': v13._wpArr[v8]._y, '_type': 'default'}); ++v8; } v7.push({'_x': v4 + v13._endPosArr[v41][0] + _global.model.tools.randRange(-3, 3), '_y': v3 + v13._endPosArr[v41][1] + _global.model.tools.randRange(-3, 3), '_type': 'soldier_reset_range'}); v7.push({'_x': v4, '_y': v3, '_type': 'shoot'}); this._toSpawnUnitsArr.push({'unitID': 'tail' + v54 + v59, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.landUnitsArr[v53.city.playerNum][0], 'startY': _global.model.landUnitsArr[v53.city.playerNum][1], 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v7, 'result': v53._result, 'tail': v54, 'tailNum': v41++, 'force_MC': 'soldier', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); } break; case 'soldier2': v31.push({'_x': _global.model.marine_landUnitsArr[v5.plr.playerNum][0] + 35, '_y': _global.model.marine_landUnitsArr[v5.plr.playerNum][1] - 10, '_type': 'heli_unload'}); this._toSpawnUnitsArr.push({'unitID': v54, 'player': v53._player, 'weaponID': v48, 'startX': 0, 'startY': 0, 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'apache', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); var v7 = new Array(); var v41 = 0; var v13 = _global.presenter.get_soldier_positions(v5); for (var v59 in _global.model.soldierSpawnArr1) { v7 = []; v7.push({'_x': _global.model.marine_landUnitsArr[v5.plr.playerNum][0], '_y': _global.model.marine_landUnitsArr[v5.plr.playerNum][1], '_type': 'spawn'}); var v8 = 0; while (v8 < v13._wpArr.length) { v7.push({'_x': v13._wpArr[v8]._x, '_y': v13._wpArr[v8]._y, '_type': 'default'}); ++v8; } v7.push({'_x': v4 + v13._endPosArr[v41][0] + _global.model.tools.randRange(-3, 3), '_y': v3 + v13._endPosArr[v41][1] + _global.model.tools.randRange(-3, 3), '_type': 'soldier_reset_range'}); v7.push({'_x': v4, '_y': v3, '_type': 'shoot'}); this._toSpawnUnitsArr.push({'unitID': 'tail' + v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.landUnitsArr[v53.city.playerNum][0], 'startY': _global.model.landUnitsArr[v53.city.playerNum][1], 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v7, 'result': v53._result, 'tail': v54, 'tailNum': v41++, 'force_MC': 'marine', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); } break; case 'soldier3': v31.push({'_x': _global.model.landUnitsArr[v5.plr.playerNum][0], '_y': _global.model.landUnitsArr[v5.plr.playerNum][1] - 40, '_type': 'drop'}); this._toSpawnUnitsArr.push({'unitID': v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.chinookStartPositions[v53._player][0], 'startY': _global.model.chinookStartPositions[v53._player][1], 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'chinook', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); var v16 = new Array(); var v13 = _global.presenter.get_tank_positions(v5); var v8 = 0; while (v8 < v13._wpArr.length) { if (v8 != v13._wpArr.length - 1) { v16.push({'_x': v13._wpArr[v8]._x, '_y': v13._wpArr[v8]._y, '_type': 'default'}); } else { v16.push({'_x': v13._wpArr[v8]._x, '_y': v13._wpArr[v8]._y, '_type': 'tank_reset_range'}); } ++v8; } var v30 = _global.model.tools.randRange(0, 2); v16.push({'_x': v4 + v13._endPosArr[0][0], '_y': v3 + v13._endPosArr[0][1], '_type': 'tank_shoot'}); this._toSpawnUnitsArr.push({'unitID': 'tail' + v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.chinookStartPositions[v53._player][0] - 210, 'startY': _global.model.chinookStartPositions[v53._player][1] - 210, 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v16, 'result': v53._result, 'tail': v54, 'tailNum': 1, 'force_MC': 'tank_noShade', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); var v26 = new Array(); v26.push({'_x': v4, '_y': v3, '_type': 'tank_shoot'}); this._toSpawnUnitsArr.push({'unitID': 'tail' + v54 + 'tail', 'player': v53._player, 'weaponID': v48, 'startX': _global.model.chinookStartPositions[v53._player][0] - 40, 'startY': _global.model.chinookStartPositions[v53._player][1] - 40, 'trgtX': v4 + v13._endPosArr[v30][0], 'trgtY': v3 + v13._endPosArr[v30][1], 'wayPointArr': v26, 'result': v53._result, 'tail': 'tail' + v54, 'tailNum': 2, 'force_MC': 'tankTop', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); break; case 'soldier4': v31.push({'_x': 0, '_y': 0, '_type': 'suicide_dissapear'}); v31.push({'_x': 0, '_y': 0, '_type': 'suicide_dissapear'}); v31.push({'_x': _global.model.suicide_spawn_array[v53._b][0], '_y': _global.model.suicide_spawn_array[v53._b][1], '_type': 'suicide_appear'}); var v13 = _global.presenter.get_tank_positions(v5); var v8 = 0; while (v8 < v13._wpArr.length) { if (v13._wpArr[v8]._x) { v31.push({'_x': v13._wpArr[v8]._x, '_y': v13._wpArr[v8]._y, '_type': 'default'}); } ++v8; } v31.push({'_x': v4, '_y': v3, '_type': 'suicide_explode'}); this._toSpawnUnitsArr.push({'unitID': v54, 'player': v53._player, 'weaponID': v48, 'startX': 0, 'startY': 0, 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': 1, 'force_MC': 'suicide_bomber', 'startNum': v15, 'tr': v53, 'explosion_name': v6}); } switch (v20.weaponType) { case 'rocket': var v27 = 30; var v63 = 30; v58 = new Object(); var v14 = _global.model.playerArr[v53._player].preStart[0] + 10; var v19 = _global.model.playerArr[v53._player].preStart[1] - 42; v58.ellipseWidth = Math.max(v14, v4) - Math.min(v14, v4); v58.ellipseHeight = 340; v58.ellipseCenterX = Math.min(v14, v4) + v58.ellipseWidth / 2; v58.ellipseCenterY = Math.min(v3, v19) - 40; if (v14 > v4) { v58.directionMultiplier = 1; v58.startAngle = 0; } else { v58.directionMultiplier = -1; v58.startAngle = 180; } var v35; if (v3 < _global.model.playerArr[v53._player].preStart[1]) { v35 = v3 - v27; } else { v35 = _global.model.playerArr[v53._player].preStart[1] - v27; } if (v53._result) { v31.push({'_x': _global.model.playerArr[v53._player].preStart[0] + 10, '_y': v58.ellipseCenterY, '_type': 'rocket_follow_ellipse'}); v31.push({'_x': v4, '_y': v3, '_type': 'rocket_explode_city'}); if (v58.startAngle == 0) { v58.targetAngle = -180; } else { v58.targetAngle = 360; } v58.finalAction = 'rocket_explode_city'; } else { v31.push({'_x': _global.model.playerArr[v53._player].preStart[0] + 10, '_y': v58.ellipseCenterY, '_type': 'rocket_follow_ellipse_with_anti'}); if (v58.startAngle == 0) { v58.targetAngle = -180; } else { v58.targetAngle = 360; } v31.push({'_x': v4, '_y': v3 - 100, '_type': 'rocket_explode_self'}); v58.finalAction = 'rocket_explode_self'; v58.anti = true; v58.antiNum = v53._b; } if (v53._bioload) { v58.bioload = true; } if (v53._pass_anti) { v58.anti = true; v58.antiNum = v53._b; } this._toSpawnUnitsArr.push({'unitID': 'unit' + v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.playerArr[v53._player].preStart[0] + 10, 'startY': _global.model.playerArr[v53._player].preStart[1] - 21, 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'rocket', 'startNum': v15, 'targetPlayer': v53._b, 'tr': v53, 'wildCard': v58, 'explosion_name': v6}); break; case 'plane': var v24; v58 = new Object(); var v45 = new Array(); if (v20.weaponName == 'plane1') { v24 = 'plane1'; } else { if (v20.weaponName == 'plane2') { v24 = 'plane2'; } } switch (v53._player) { case 0: v58.plane_angle_step = -1; v58.plane_angle_start = 180; v58.plane_angle_center = [273, 298]; v58.circular_modifier_flyTo = [-100, 0]; v58.circular_modifier_center = [100, 0]; v58.circular_radius = 100; v58.x_multiplier = 2; v58.y_multiplier = 1; break; case 1: v58.plane_angle_step = -1; v58.plane_angle_start = 0; v58.plane_angle_center = [175, 75]; v58.circular_modifier_flyTo = [100, 0]; v58.circular_modifier_center = [-100, 0]; v58.x_multiplier = 2; v58.y_multiplier = 1; v58.circular_radius = 100; break; case 2: v58.plane_angle_step = 1; v58.plane_angle_start = 180; v58.plane_angle_center = [619, 100]; v58.circular_modifier_flyTo = [-100, 0]; v58.circular_modifier_center = [100, 0]; v58.circular_radius = 100; break; case 3: v58.plane_angle_step = 1; v58.plane_angle_start = 0; v58.plane_angle_center = [230, 500]; v58.circular_modifier_flyTo = [100, 0]; v58.circular_modifier_center = [-100, 0]; v58.x_multiplier = 1; v58.y_multiplier = 1; v58.circular_radius = 100; break; case 4: v58.plane_angle_step = -1; v58.plane_angle_start = 180; v58.plane_angle_center = [570, 500]; v58.circular_modifier_flyTo = [-100, 0]; v58.circular_modifier_center = [100, 0]; v58.circular_radius = 100; v58.x_multiplier = 2; v58.y_multiplier = 1; } v58.city = v53._city; if (v53._bioload) { v58.bioload = true; } v31.push({'_x': _global.model.liftOff_location[v53._player][0], '_y': _global.model.liftOff_location[v53._player][1], '_type': 'default'}); v31.push({'_x': v58.plane_angle_center[0] + v58.circular_modifier_flyTo[0], '_y': v58.plane_angle_center[1] + v58.circular_modifier_flyTo[1], '_type': 'plane_circular_flight'}); if (v53._result) { v3 -= 100; v31.push({'_x': v4, '_y': v3, '_type': 'bomb'}); } else { v31.push({'_x': v4, '_y': v3, '_type': 'speedup_die'}); v58.anti = true; v58.antiNum = v53._b; } if (v53._pass_anti) { v58.anti = true; v58.antiNum = v53._b; } this._toSpawnUnitsArr.push({'unitID': 'unit' + v54, 'player': v53._player, 'weaponID': v48, 'startX': _global.model.playerArr[v53._player].preStart[0] + 10, 'startY': _global.model.playerArr[v53._player].preStart[1] - 25, 'trgtX': v4, 'trgtY': v3 + 100, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': v24, 'startNum': v15, 'targetPlayer': v53._b, 'tr': v53, 'wildCard': v58, 'explosion_name': v6}); break; case 'sub': if (v53._action == 1) { this._toSpawnUnitsArr.push({'_building': 'sub', '_startNum': v15, '_player': v53._player, '_locPlr': v53._player, '_locPos': 1, '_frame': 'sub', 'tr': v53}); } if (v53._action == 2) { this._toSpawnUnitsArr.push({'_building': 'sub', '_player': v53._player, '_startNum': v15, '_locPlr': v53._b, '_locPos': 2, '_frame': 'sub', '_trgtCity': v53._city, '_casualties': v53._casualties, 'tr': v53, '_addToSubArr': true}); var v27 = 30; var v63 = 30; v58 = new Object(); v58.sub_launch_num = v53._player; v58.bioload = v53._bioload; var v14 = _global.view.battleSrcMC['sub_' + v53._b + '_2']._x + 21; var v19 = _global.view.battleSrcMC['sub_' + v53._b + '_2']._y + 55; v58.ellipseWidth = Math.max(v14, v4) - Math.min(v14, v4); v58.ellipseHeight = 340; v58.ellipseCenterX = Math.min(v14, v4) + v58.ellipseWidth / 2; v58.ellipseCenterY = Math.min(v3, v19) - 40; if (v14 > v4) { v58.directionMultiplier = 1; v58.startAngle = 0; } else { v58.directionMultiplier = -1; v58.startAngle = 180; } if (v3 < v19) { var v35 = v3 - v27; } else { var v35 = v19 - v27; } v31.push({'_x': v14, '_y': v58.ellipseCenterY, '_type': 'rocket_follow_ellipse'}); if (v58.startAngle == 0) { v58.targetAngle = -180; } else { v58.targetAngle = 360; } v31.push({'_x': v4, '_y': v3, '_type': 'rocket_explode_city_from_sub'}); v58.finalAction = 'rocket_explode_city_from_sub'; this._toSpawnUnitsArr.push({'unitID': 'unit' + v54, 'player': v53._player, 'weaponID': v48, 'startX': v14, 'startY': v19, 'trgtX': v4, 'trgtY': v3, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'sub_rocket', 'startNum': v15, 'targetPlayer': v53._b, 'tr': v53, 'wildCard': v58, 'explosion_name': v6, '_casualties': v53._casualties}); } break; case 'ship': if (v53._action == 1) { } else { if (v53._action == 2) { var v17 = 0; for (var v49 in v53._attack_arr) { v31 = []; v6 = (_global.model.human.weaponStock.getWeaponByID(v53._attack_arr[v49].wpn)).explosion_mc_name; v58 = new Object(); v58._number = Number(v49); v58._city = v53._attack_arr[v49].city; v58._casualties = v53._result_arr[v49]._casualties; if (v53._attack_arr[v49]._bioload) { v58.bioload = true; v58.city = v53._attack_arr[v49].city; } v31.push({'_x': _global.view.battleSrcMC['carrier' + v53._player]._x - 112, '_y': _global.view.battleSrcMC['carrier' + v53._player]._y + 54, '_type': 'default'}); var v12 = _global.view.battleSrcMC['carrier' + v53._player]._y + 54; var v10 = (_global.model.getCityByID(v53._attack_arr[v49].city)).yPos; var v21 = _global.view.battleSrcMC['carrier' + v53._player]._x - 112; var v18 = (_global.model.getCityByID(v53._attack_arr[v49].city)).xPos; if (Math.max(v12, v10) - Math.min(v12, v10) <= 200 && v18 > v21) { var v11 = (_global.model.getCityByID(v53._attack_arr[v49].city)).yPos; if (v12 < v10) { v11 += 150; } else { v11 -= 150; } v31.push({'_x': _global.view.battleSrcMC['carrier' + v53._player]._x - 112, '_y': v11, '_type': 'default'}); } if (v53._result_arr[Number(v49)]._result) { v31.push({'_x': (_global.model.getCityByID(v53._attack_arr[v49].city)).xPos, '_y': (_global.model.getCityByID(v53._attack_arr[v49].city)).yPos - 100, '_type': 'ship_plane_bomb'}); } else { v58.anti = true; v58.antiNum = v53._b; v31.push({'_x': (_global.model.getCityByID(v53._attack_arr[v49].city)).xPos, '_y': (_global.model.getCityByID(v53._attack_arr[v49].city)).yPos - 100, '_type': 'explode'}); } this._toSpawnUnitsArr.push({'unitID': 'unit_ship' + Number(v49), 'player': v53._player, 'weaponID': v48, 'startX': _global.view.battleSrcMC['carrier' + v53._player]._x + _global.model.ship_plane_start_arr[v17][0], 'startY': _global.view.battleSrcMC['carrier' + v53._player]._y + _global.model.ship_plane_start_arr[v17][1], 'trgtX': (_global.model.getCityByID(v53._attack_arr[v49].city)).xPos, 'trgtY': (_global.model.getCityByID(v53._attack_arr[v49].city)).yPos, 'wayPointArr': v31, 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'force_MC': 'ship_plane', 'startNum': v15, 'targetPlayer': v53._b, 'tr': v53, 'wildCard': v58, 'explosion_name': v6}); ++v17; } } } break; case 'space': v58 = new Object(); v58.targetX = _global.model.satellite_pos_arr[v53._player]._x; v58.targetY = _global.model.satellite_pos_arr[v53._player]._y; v58.satellite = true; v58.cityX = v4; v58.cityY = v3; v58.satelliteFrame = _global.model.playerArr[v53._player].religion_code; v58.laser_hex_color = _global.model.playerArr[v53._player].hexColorTint_str; this._toSpawnUnitsArr.push({'unitID': 'satellite' + v54, 'player': v53._player, 'weaponID': v48, 'startX': -120, 'startY': _global.model.satellite_height_arr[v53._player], 'result': v53._result, 'tail': undefined, 'tailNum': undefined, 'startNum': v15, 'targetPlayer': v53._b, 'tr': v53, 'wildCard': v58, 'explosion_name': v6}); break; case 'spy': this._toSpawnUnitsArr.push({'_building': v53._frame, '_startNum': v15, '_player': v53._player, '_frame': v53._frame, 'tr': v53}); } } else { switch (v53._item) { case 'diplomacy': this._toSpawnUnitsArr.push({'_building': 'diplomacy', '_startNum': v15, '_player': v53._player, '_frame': 'diplomacy', 'tr': v53}); break; case 'propaganda': this._toSpawnUnitsArr.push({'_building': 'propaganda_2', '_startNum': v15, '_player': v53._player, '_frame': 'propaganda_2', '_targetCity_id': v53._city, 'tr': v53}); break; case 'resources': this._toSpawnUnitsArr.push({'_building': 'resources', '_startNum': v15, '_player': v53._player, '_frame': 'resources', 'tr': v53}); break; case 'religion': this._toSpawnUnitsArr.push({'_building': 'religion', '_startNum': v15, '_player': v53._player, '_frame': 'religion', 'tr': v53}); break; case 'produce': this._toSpawnUnitsArr.push({'_building': 'produce', '_startNum': v15, '_player': v53._player, '_frame': 'produce', 'tr': v53}); } } } }; v2.createToShowABArray = function () { var v15 = 0; var v14 = 0; while (v14 <= 1) { var v4 = _global.model.turnResultsArr[v15]; var v3 = ''; var v17 = v4._weapon; var v16 = _global.model.human.weaponStock.getWeaponByID(v17); var v5 = ''; var v6 = false; var v7 = false; var v10 = false; var v9 = false; var v8 = [false]; var v12; var v11; if (v14 == 0 && v4._item) { v10 = true; switch (v4._item) { case 'battle': v5 = 'init'; switch (v16.weaponName) { case 'soldier1': v3 = 'base'; break; case 'soldier2': v3 = 'helipad'; v7 = true; break; case 'soldier3': v3 = 'helipad'; v7 = true; break; case 'soldier4': v3 = 'hatch'; v7 = true; } switch (v16.weaponType) { case 'plane': v6 = true; v3 = 'airfield'; v9 = true; break; case 'rocket': v6 = true; v3 = 'silo'; v9 = true; break; case 'ship': if (!v4._dontBeAnAss) { v3 = 'ship'; v6 = true; v9 = true; } else { v5 = undefined; } break; case 'sub': v3 = 'sub'; v9 = false; break; case 'space': v3 = 'space'; v9 = true; } break; case 'setPreAttack': if (v4._value == 'ready') { v6 = true; v5 = 'last'; v3 = v4._frame; } else { v3 = undefined; v5 = undefined; } break; default: v10 = false; } } else { if (v14 == 1 && v4._item) { v10 = true; switch (v4._item) { case 'production_building': v5 = 'last'; v3 = 'factory'; break; case 'research_building': v5 = 'last'; v3 = 'tech'; break; case 'defense': v5 = 'last'; if (v4._result) { if ((_global.model.human.weaponStock.getWeaponByID(v4._value)).weaponName == 'antiAir') { v8 = [true, 'air']; v3 = 'antiAir_fire'; } else { v8 = [true, 'rocket']; v3 = 'antiRocket_fire'; } } else { v5 = 'last'; v3 = v4._frame + '_still'; } break; case 'diplomacy': v5 = 'inBattle'; v3 = 'diplomacy'; break; case 'propaganda': v5 = 'inBattle'; v3 = 'propaganda'; v12 = v4._city; v11 = v4._player; break; case 'regard': v5 = undefined; break; case 'bioload': v5 = undefined; break; default: v10 = false; } } } if (v10 && !v4._spyArr) { switch (v5) { case 'timed': this._toShowTimedABArr.push({'_player': v4._player, '_frame': v3, '_setPreStart': v6, '_setHeliStart': v7, '_anti_arr': v8, '_value1': v12, '_value2': v11, '_building': true}); break; case 'init': var v13 = true; for (var v24 in this._toShowInitABArr) { if (v3 == this._toShowInitABArr[v24]._frame && v4._player == this._toShowInitABArr[v24]._player) { v13 = false; } } if (v13) { this._toShowInitABArr.push({'_player': v4._player, '_frame': v3, '_setPreStart': v6, '_fixedLoc': v9, '_setHeliStart': v7, '_anti_arr': v8, '_value1': v12, '_value2': v11, '_building': true}); } break; case 'inBattle': this._toShowInBattleABArr.push({'_player': v4._player, '_frame': v3, '_setPreStart': v6, '_setHeliStart': v7, '_anti_arr': v8, '_value1': v12, '_value2': v11, '_building': true}); break; case 'last': var v13 = true; for (var v24 in this._toShowLastABArr) { if (v3 == this._toShowLastABArr[v24]._frame && v4._player == this._toShowLastABArr[v24]._player) { v13 = false; } } if (v13) { this._toShowLastABArr.push({'_player': v4._player, '_frame': v3, '_setPreStart': v6, '_setHeliStart': v7, '_anti_arr': v8, '_value1': v12, '_value2': v11, '_building': true}); } } } if (v15 < _global.model.turnResultsArr.length - 1) { ++v15; } else { v15 = 0; ++v14; } } }; v2.__get__all_turn_buildings_arr = function () { var v2 = new Array(); for (var v6 in this._toShowInitABArr) { v2.push(this._toShowInitABArr[v6]); } for (var v8 in this._toShowLastABArr) { v2.push(this._toShowLastABArr[v8]); } for (var v7 in this._toShowTimedABArr) { v2.push(this._toShowTimedABArr[v7]); } for (var v5 in this._toShowInBattleABArr) { v2.push(this._toShowInBattleABArr[v5]); } for (var v4 in this._toSpawnUnitsArr) { if (this._toSpawnUnitsArr[v4]._building) { v2.push(this._toSpawnUnitsArr[v4]); } } for (var v3 in v2) { } return v2; }; v2.__get__curLastAB = function () { if (this._toShowLastABArr.length != 0) { return this._toShowLastABArr.shift(); } else { return {'_empty': true}; } }; v2.__get__toShowTimedABArr = function () { if (this._toShowTimedABArr.length != 0) { return this._toShowTimedABArr.shift(); } else { return {'_empty': true}; } }; v2.__get__toShowInitABArr = function () { if (this._toShowInitABArr.length != 0) { return this._toShowInitABArr.shift(); } else { return {'_empty': true}; } }; v2.__get__toShowInBattleABArr = function () { if (this._toShowInBattleABArr.length != 0) { return this._toShowInBattleABArr.shift(); } else { return {'_empty': true}; } }; v2.__get__toShowLastABArr = function () { if (this._toShowLastABArr.length != 0) { return this._toShowLastABArr.shift(); } else { return {'_empty': true}; } }; v2.__set__curAB = function (_param) { return this.__get__curAB(); }; v2.getLiftOffPos = function (startPos, weaponType, playerNum) { this._toShowLastABArr = []; var v2 = new Array(); switch (playerNum) { return v2; case 0: if (weaponType == 'plane') { v2 = [580, 195]; } if (weaponType == 'soldier') { v2 = [580, 195]; } return v2; case 1: if (weaponType == 'plane') { v2 = [260, 160]; } if (weaponType == 'soldier') { v2 = [260, 160]; } return v2; case 2: if (weaponType == 'plane') { v2 = [580, 195]; } if (weaponType == 'soldier') { v2 = [580, 195]; } return v2; case 3: if (weaponType == 'plane') { v2 = [280, 415]; } if (weaponType == 'soldier') { v2 = [280, 415]; } return v2; case 4: if (weaponType == 'plane') { v2 = [580, 415]; } if (weaponType == 'soldier') { v2 = [580, 415]; } return v2; } return v2; }; v2.resetBattle = function () { this.unitCount = 0; this._toShowTimedABArr = []; this._toShowInitABArr = []; this._toShowInBattleABArr = []; this._toShowLastABArr = []; this._toSpawnUnitsArr = []; }; v2._toSpawnUnitsArr = new Array(); v2.unitCount = 0; v2.addProperty('all_turn_buildings_arr', v2.__get__all_turn_buildings_arr, function () {}); v2.addProperty('curAB', function () {}, v2.__set__curAB); v2.addProperty('curLastAB', v2.__get__curLastAB, function () {}); v2.addProperty('toShowInBattleABArr', v2.__get__toShowInBattleABArr, function () {}); v2.addProperty('toShowInitABArr', v2.__get__toShowInitABArr, function () {}); v2.addProperty('toShowLastABArr', v2.__get__toShowLastABArr, function () {}); v2.addProperty('toShowTimedABArr', v2.__get__toShowTimedABArr, function () {}); ASSetPropFlags(_global.Battle.prototype, null, 1); } #endinitclip } movieClip 5272 __Packages.WD_colors { #initclip if (!_global.WD_colors) { var v1 = function () {}; _global.WD_colors = v1; var v2 = v1.prototype; v2.WDII_colors = function () {}; v2.color_red = {'ra': 50, 'rb': 255, 'ga': 0, 'gb': 0, 'ba': 0, 'bb': 0, 'aa': 75, 'ab': 0}; v2.color_blu = {'ra': 15, 'rb': 0, 'ga': 74, 'gb': 0, 'ba': 100, 'bb': 255, 'aa': 100, 'ab': 0}; v2.color_gre = {'ra': 0, 'rb': 0, 'ga': 50, 'gb': 255, 'ba': 0, 'bb': 0, 'aa': 75, 'ab': 0}; v2.color_yel = {'ra': 50, 'rb': 255, 'ga': 50, 'gb': 255, 'ba': 0, 'bb': 0, 'aa': 75, 'ab': 0}; v2.color_ora = {'ra': 100, 'rb': 91, 'ga': 62, 'gb': 40, 'ba': 0, 'bb': 0, 'aa': 100, 'ab': 0}; v2.color_pur = {'ra': 70, 'rb': 0, 'ga': 40, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0}; v2.city_red = {'ra': 100, 'rb': 200, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 75, 'ab': 0}; v2.city_green = {'ra': 50, 'rb': 0, 'ga': 100, 'gb': 100, 'ba': 50, 'bb': 0, 'aa': 75, 'ab': 0}; v2._default = {'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0}; ASSetPropFlags(_global.WD_colors.prototype, null, 1); } #endinitclip } movieClip 5273 __Packages.Option { #initclip if (!_global.Option) { var v1 = function () {}; _global.Option = v1; var v2 = v1.prototype; v2.setSound = function () { if (!this.sound) { this.sound = true; } else { this.sound = false; } }; v2.__get__playSound = function () { return this.sound; }; v2.setMusic = function () { if (!this.music) { this.music = true; } else { this.music = false; } }; v2.__get__playMusic = function () { return this.music; }; v2.sound = true; v2.music = true; v2.addProperty('playMusic', v2.__get__playMusic, function () {}); v2.addProperty('playSound', v2.__get__playSound, function () {}); ASSetPropFlags(_global.Option.prototype, null, 1); } #endinitclip } movieClip 5274 __Packages.Model { #initclip if (!_global.Model) { var v1 = function () { super(); this.playing_ambient_sound_arr = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this.battle = new Battle(); this.tools = new Tools(); this.text_messages = new WD2_messages(); this.turnResultsArr = new Array(); this.wd_colors = new WD_colors(); this.option = new Option(); this.playedSounds_arr = new Array(); this.soundCount = 0; this.difficulty_level_specific_vars = new Object(); var v5 = this.difficulty_level_specific_vars; v5.stock_cap_plr = new Array(4, 4, 4); v5.stock_cap_enm = new Array(4, 4, 4); v5.enemy_start_money = new Array(50, 65, 60); v5.player_start_money = new Array(80, 65, 55); v5.spy_alert_money = new Array(180, 150, 100); v5.enemy_start_religion = new Array(30, 40, 60); v5.player_start_relgion = new Array(80, 60, 20); v5.spy_steal_money_max = new Array(90, 120, 150); v5.start_regard_arr = new Array([80, 80, 80, 80, 80], [65, 65, 65, 65, 65], [50, 50, 50, 50, 50]); if (!this.zs66hj8s) { v5.player_start_population = new Array(500, 450, 400); } else { v5.player_start_population = new Array(250, 250, 200); } if (!this.zs66hj8s) { v5.enemy_start_population = new Array(450, 450, 450); } else { v5.enemy_start_population = new Array(200, 250, 205); } v5.player_resources_divider = new Array(9, 11, 13); v5.enemy_resources_divider = new Array(9, 10, 12); v5.enemy_religion_addition = new Array(45, 35, 25); v5.player_religion_addition = new Array(30, 30, 25); this.active_ambient_sounds = new Array(); this.spy_stat_obj = new Object(); this.spy_stat_obj.spy1 = new Object(); this.spy_stat_obj.spy1.weaponStealMax = 5; this.spy_stat_obj.spy1.moneyStealPrcMax = 20; this.spy_stat_obj.spy2 = new Object(); this.spy_stat_obj.spy2.weaponStealMax = 7; this.spy_stat_obj.spy2.moneyStealPrcMax = 40; this.spy_stat_obj.spy3 = new Object(); this.spy_stat_obj.spy3.weaponStealMax = 9; this.spy_stat_obj.spy3.moneyStealPrcMax = 60; this.spy_stat_obj.spy4 = new Object(); this.spy_stat_obj.spy4.weaponStealMax = 12; this.spy_stat_obj.spy4.moneyStealPrcMax = 80; this.regard_bonus_table_obj = new Object(); var v4 = this.regard_bonus_table_obj; v4.preAttack = new Object(); v4.preAttack.attack = new Object(); v4.preAttack.defend = new Object(); v4.preAttack.attack.baseBonus = 8; v4.preAttack.defend.baseBonus = 8; v4.preAttack.bystander = new Object(); v4.preAttack.bystander.baseBonus = 6; v4.preAttack.wpnLevelDef = 4; v4.attack = new Object(); v4.attack.attack = new Object(); v4.attack.attack.baseBonus = 5; v4.attack.defend = new Object(); v4.attack.defend.baseBonus = 6; v4.attack.bystander = new Object(); v4.attack.bystander.baseBonus = 4; v4.attack.wpnLevelMultiplier = 4; v4.propaganda = new Object(); v4.propaganda.attack = new Object(); v4.propaganda.defend = new Object(); v4.propaganda.bystander = new Object(); v4.propaganda.attack.baseBonuss = 6; v4.propaganda.defend.baseBonus = 6; v4.propaganda.bystander.baseBonus = 4; v4.no_retal_bonus = 3; v4.sameReligion_bonus = 4; v4.standard_regard_bonus = 4; v4.diplomacyBonus = 3; System.security.allowDomain('www.youdagames.com', 'youdagames.com', 'http://www.youdagames.com'); _root.hs_list = false; _root.hs_score = 0; _root.is_time = false; _root.hs_gameid = 39; _root.hs_requesturl = 'www.totallygame.com'; }; _global.Model = v1; _global.Model extends Sub_model; var v2 = v1.prototype; v2.get_cur_preAttack_arr = function (param_player) { var v7 = []; for (var v10 in this.activePlayerArr) { if (this.activePlayerArr[v10].preAttackStatus == 'ready' && this.activePlayerArr[v10].playerNum != param_player.playerNum && !param_player.ceaseFireArr[this.activePlayerArr[v10].playerNum]._status) { for (var v9 in this.activePlayerArr[v10].turnActionArr) { var v2 = this.activePlayerArr[v10].strength; v7.push({'player': this.activePlayerArr[v10], 'turnAction': this.activePlayerArr[v10].turnActionArr[v9], 'weapon': this.activePlayerArr[v10].turnActionArr[v9].attackWeapon, '_strength': v2}); } } } return v7; }; v2.set_city_position_to_array = function () { var v4 = 0; while (v4 < this.playerArr.length) { var v3 = 0; while (v3 < this.cityPositions.length) { this.cityPositions[v4][v3] = [_global.view.battleSrcMC['citypos' + v4 + '_' + v3]._x, _global.view.battleSrcMC['citypos' + v4 + '_' + v3]._y]; ++v3; } ++v4; } }; v2.get_random_set_enemy = function (a_plr, a_num) { var v2 = new Array(); var v6 = 0; for (var v5 in this.playerArr) { if (this.playerArr[v5] != a_plr && this.playerArr[v5].playerNum != a_num && this.playerArr[v5].alive) { v2.push(this.playerArr[v5]); } } v6 = this.tools.randRange(0, v2.length - 1); if (!v6) { v6 = 0; } return v6; }; v2.getPlayerData = function (param_action, param_player) { switch (param_action) { case 'smallestCitySize': var v3 = param_player.cityArr[0].population; for (var v8 in param_player.cityArr) { if (param_player.cityArr[v8].population > 0) { v3 = Math.min(v3, param_player.cityArr[v8].population); } } return v3; break; case 'largestCitySize': var v3 = param_player.cityArr[0].population; for (var v8 in param_player.cityArr) { v3 = Math.max(v3, param_player.cityArr[v8].population); } return v3; break; case 'largestCity': var v3 = param_player.cityArr[0]; for (var v8 in param_player.cityArr) { if (v3.population < param_player.cityArr[v8].population) { v3 = param_player.cityArr[v8]; } } return v3; break; case 'largestCityOnTheMapSize': var v3 = 0; for (var v8 in this.activePlayerArr) { for (var v6 in this.activePlayerArr[v8].cityArr) { v3 = Math.max(this.activePlayerArr[v8].cityArr[v6].population, v3); } } return v3; break; case 'playerStrength': return param_player.techLevel; break; case 'weaponStock': return param_player.weaponStockLevel; break; case 'largestNuclKill': var v4 = ['warhead1', 'warhead2', 'warhead3', 'warhead4']; var v5 = (param_player.weaponStock.getWeaponByName(v4[0])).maxKills; for (var v8 in v4) { if ((param_player.techTree.getTechByName(v4[v8])).invented) { v5 = Math.max((param_player.weaponStock.getWeaponByName(v4[v8])).maxKills, v5); } } return v5; break; case 'largestBioKill': var v4 = ['bioload1', 'bioload2', 'bioload3', 'bioload4']; var v5 = (param_player.weaponStock.getWeaponByName(v4[0])).maxKills; for (var v8 in v4) { if ((param_player.techTree.getTechByName(v4[v8])).invented) { v5 = Math.max((param_player.weaponStock.getWeaponByName(v4[v8])).maxKills, v5); } } return v5; break; case 'techCount': var v7 = 0; for (var v8 in param_player.techTree.techArr) { if (param_player.techTree.techArr[v8].invented) { ++v7; } } return v7; } }; v2.calcPoints = function (param_player) { var v4 = 0; var v8 = 0; var v6 = 0; var v14 = 0; var v16 = 0; var v12 = 0; v8 = this.decisionPoints.attack.base - param_player.lowestRegardNum / 2; if (v8 < 0) { v8 = 0; } if (param_player.preAttackStatus == 'ready') { v8 += 200; } if (param_player.preAttackStatus != 'ready' && param_player.weaponStock.availableWeaponsArr.length <= 0 && !param_player.weaponStock.spyAvailable) { v4 += v8; v8 = -999; } else { if (param_player.preAttackStatus == 'ready' && !param_player.weaponStock.payloadAvailable(param_player.preAttackWeapon)) { v4 += v8; v8 = -999; } } if (param_player.special_person) { if ((param_player.weaponStock.getWeaponByName('ship')).inStock < 0) { v4 += v8; v8 = -999; } else { if ((param_player.weaponStock.getWeaponByName('warhead3')).inStock < 3) { v4 += v8; v8 = -999; } } } if (param_player.suicide_person) { if ((param_player.weaponStock.getWeaponByName('soldier4')).inStock < 2) { v4 += v8; v8 = -999; } } var v5 = this.get_cur_preAttack_arr(param_player); param_player.preCounterEnemy = []; for (var v15 in v5) { var v3 = 0; var v7 = v5[v15].player; v3 = this.decisionPoints.preCounter.base - param_player.regardArr[v7.playerNum]; if (this.decisionPoints.preCounter.minPopForBonus > param_player.population) { v3 += this.decisionPoints.preCounter.lowPopBonus; } if (v3 > v6) { v6 = v3; param_player.preCounterEnemy = [v5[v15]]; } else { if (v3 == v6) { param_player.preCounterEnemy.push(v5[v15]); } } } v14 = this.decisionPoints.religion.base - param_player.religion; var v9 = 0; for (v15 in this.activePlayerArr) { if (this.activePlayerArr[v15].population > v9) { v9 = this.activePlayerArr[v15].population; } } v14 += Math.round((param_player.population / v9) * 100) - param_player.religion - 20; var v13 = this.decisionPoints.propaganda.base; if (param_player.religion < 30) { v14 += v13; } if (param_player.religion > 90) { v13 += this.decisionPoints.propaganda.highReligionBonus * 2; } else { if (param_player.religion > 60) { v13 += this.decisionPoints.propaganda.highReligionBonus; } } v16 = this.tools.randRange(0, 90); if (this.tools.randRange(1, 3) == 2) { v16 = 0; } if (param_player.money < 150) { v12 = this.decisionPoints.resources.base - Math.round(param_player.weaponStockLevel); v12 += this.decisionPoints.resources.reserveBase - param_player.money / this.decisionPoints.resources.maxFunds / 100; } if (param_player.special_person) { if ((param_player.weaponStock.getWeaponByName('ship')).inStock < 1) { v12 += 250; } if ((param_player.weaponStock.getWeaponByName('warhead3')).inStock < 3) { v12 += 250; } } var v11 = param_player.weaponStockLevel; v4 += this.decisionPoints.production.base - Math.round(v11); var v20 = 0; var v24 = 0; for (v15 in this.activePlayerArr) { if (this.activePlayerArr[v15].weaponStockLevel > v11) { v4 += this.decisionPoints.production.enemy_stock_bonus; } } v4 += v20 / this.activePlayerArr.length; v4 += param_player.money; if (param_player.money <= 20) { v12 += v4; v4 = 0; } var v17 = 0; var v18 = 0; if (param_player.special_person && v4 > 0) { if (!(param_player.techTree.getTechByName('ship')).invented) { v17 += v4; v4 = -10; } else { if (!(param_player.techTree.getTechByName('warhead3')).invented) { v17 += v4; v4 = -10; } } } if (param_player.suicide_person && v4 > 0) { if (!(param_player.techTree.getTechByName('soldier4')).invented) { v18 += v4; } } var v23 = Math.min(this.decisionPoints.research.turnCap, this.turn); var v19 = this.getPlayerData('largestNuclKill', param_player) + this.getPlayerData('largestBioKill', param_player); var v10 = Math.min(this.decisionPoints.research.base, this.getPlayerData('largestCityOnTheMapSize', param_player) - v19); v10 += v17; v10 += v18; v10 += (this.turn / this.getPlayerData('techCount', param_player)) * this.decisionPoints.research.techTurnRatioMultiplier; v10 += param_player.money; if (param_player.money <= Math.round(param_player.population / this.difficulty_level_specific_vars.enemy_resources_divider[this.difficulty_level]) * 2) { v12 += v10; v10 = 10; } if (param_player.special_person && (param_player.techTree.getTechByName('ship')).invented && (param_player.techTree.getTechByName('warhead3')).invented && v10 > 0) { v4 += v10; v10 = -100; } param_player.actionArr = [{'id': '_attack', 'amount': v8}, {'id': 'preCounter', 'amount': v6, 'target': param_player.preCounterEnemy}, {'id': 'propaganda', 'amount': v13}, {'id': 'diplomacy', 'amount': v16}, {'id': 'religion', 'amount': v14}, {'id': 'resources', 'amount': v12}, {'id': 'produce', 'amount': v4}, {'id': 'research', 'amount': v10}]; for (v15 in param_player.actionArr) { if (param_player.isBioloaded(param_player.actionArr[v15].id)) { param_player.actionArr[v15].splice(Number(v15), 1); } } if (param_player.special_person && (param_player.weaponStock.getWeaponByName('ship')).inStock > 0 && (param_player.weaponStock.getWeaponByName('warhead3')).inStock > 1) { v8 += 50; } param_player.actionArr.sortOn('amount', Array.NUMERIC | Array.DESCENDING); param_player.turnAction_1.action = param_player.actionArr[0].id; param_player.turnAction_2.action = param_player.actionArr[1].id; if (param_player.actionArr[0].amount - 50 > param_player.actionArr[1].amount && param_player.actionArr[0].id == '_attack') { param_player.turnAction_2.action = '_attack'; } }; v2.selectCounterWeapon = function (param_player, param_plr_TA, param_enemy, param_nmy_TA) { if (param_nmy_TA.attackWeapon.weaponType == 'rocketload' && param_player.weaponStock.antiRocket.inStock > 0) { param_plr_TA.attackWeapon = param_player.weaponStock.antiRocket; } else { if (param_nmy_TA.attackWeapon.weaponType == 'plane' && param_player.weaponStock.antiAir.inStock > 0) { param_plr_TA.attackWeapon = param_player.weaponStock.antiAir; } else { return 'none'; } } }; v2.getTarget = function (param_player, param_TA) { switch (param_TA.__get__action()) { case 'reset': return false; break; case 'set_attack': param_TA.__set__action('attack'); return true; break; case '_attack': var v73 = true; var v72 = true; var v85 = true; var v61 = false; var v9; var v64 = param_player.preAttackWeapon; if (param_TA.num == 1) { v9 = param_player.turnAction_2; if (param_player.turnAction_2.__get__action() == 'attack') { v73 = true; v72 = false; } else { if (param_player.turnAction_2.__get__action() == 'preAttack') { v73 = false; v72 = true; } else { if (param_player.turnAction_2.__get__action() == '_attack') { v73 = true; v72 = true; v61 = true; } } } } else { if (param_TA.num == 2) { v9 = param_player.turnAction_1; if (param_player.turnAction_1.__get__action() == 'attack') { v73 = true; v72 = false; } else { if (param_player.turnAction_1.__get__action() == 'preAttack') { v73 = false; v72 = true; } else { if (param_player.turnAction_1.__get__action() == '_attack') { v73 = true; v72 = true; v61 = true; } } } } } var v47 = 0; var v86 = 0; for (var v20 in this.activePlayerArr) { if (this.activePlayerArr[v20].playerNum != param_player.playerNum && !param_player.ceaseFireArr[this.activePlayerArr[v20].playerNum]._status) { var v21 = 100 - param_player.regardArr[this.activePlayerArr[v20].playerNum]; if (v21 < 0) { } if (this.activePlayerArr[v20].religion_code != param_player.religion_code) { } if (this.activePlayerArr[v20].playerNum == param_player.primary_enemy) { v21 += 1; } if (this.activePlayerArr[v20].playerNum == param_player.secundary_enemy) { } if (v21 > v47) { v47 = v21; param_TA.targetPlayer = this.activePlayerArr[v20]; } } } var v42 = new Array(); for (v20 in this.activePlayerArr) { if (this.activePlayerArr[v20] != param_player && !param_player.ceaseFireArr[this.activePlayerArr[v20].playerNum]._status) { v42.push(this.activePlayerArr[v20]); } } if (!param_TA.targetPlayer) { var v51 = 100; for (v20 in v42) { if (this.activePlayerArr[v20] != param_player && this.activePlayerArr[v20].population > 0 && param_player.regardArr[this.activePlayerArr[v20].playerNum] <= v51 && !param_player.ceaseFireArr[this.activePlayerArr[v20].playerNum]._status) { v51 = param_player.regardArr[this.activePlayerArr[v20].playerNum]; param_TA.targetPlayer = this.activePlayerArr[v20]; } } } if (!param_TA.targetPlayer) { param_TA.targetPlayer = v42[this.tools.randRange(0, v42.length - 1)]; } if (!param_TA.targetPlayer) { return false; } if (v61 && this.tools.randRange(0, 2)) { v61 = false; v9.__set__action('reset'); } var v13 = param_player.weaponStock.__get__availableWeaponsArr(); param_TA.targetCity = undefined; param_TA.attackWeapon = undefined; v13.sortOn('maxKills', Array.NUMERIC | Array.DESCENDING); var v27 = 0; var v26; var v70 = false; var v29 = 0; var v30; var v67 = false; var v68 = 0; var v36 = false; if (v61 && param_player.preAttackStatus == 'ready') { for (v20 in param_player.weaponStock.weaponArr) { var v35 = param_player.weaponStock.weaponArr[v20]; if ((v35.weaponCategory == 'payload' || v35.weaponCategory == 'specialLoad') && v35.__get__inStock() > 0 && v35.weaponLevel <= v64.weaponLevel && v35.active) { v70 = true; } if (v35.weaponCategory == 'conventional' && v35.__get__inStock() > 0 && v35.active) { v67 = true; } } if (!v70 || !v67) { v61 = false; v9.__set__action('reset'); } } if (v61 || param_player.preAttackWeapon.weaponName == 'ship') { if (param_player.preAttackStatus == 'ready') { if (param_player.preAttackWeapon.weaponName == 'ship' && !v9.ship_attack_arr) { var v12 = param_player.weaponStock.__get__instock_active_payloads_perStock(); var v83 = 0; var v82 = false; var v49 = new Array(); var v37 = new Array(); var v88 = new Array(); var v19 = 0; while (v19 < v12.length) { if (v12[v19].weaponLevel > 3) { v12.splice(v19, 1); } ++v19; } param_TA.__set__action('preAttack'); param_TA.preAttackCarrier = param_player.preAttackWeapon; if (v12.length < 3) { v83 = 3 - v12.length; v82 = true; } v20 = 0; while (v20 < 3) { var v22 = 0; var v33; var v32; var v5 = 0; while (v5 < v12.length) { var v7 = v12[v5]; if (v7.maxKills > v22 && v7.weaponLevel < 4) { v22 = v7.maxKills; v33 = v7; v32 = v5; } ++v5; } v49.push(v33); v12.splice(v32, 1); ++v20; } for (v20 in param_TA.targetPlayer.cityArr) { var v25 = param_TA.targetPlayer.cityArr[v20]; if (v25.population > 0) { v37.push(v25); } } param_TA.ship_attack_arr = new Array(); v20 = 0; while (v20 < 3) { var v40 = this.tools.randRange(0, v37.length - 1); param_TA.ship_attack_arr.push({'city': v37[v40].cityID, 'wpn': v49[v20].weaponID}); ++v20; } for (v20 in v13) { v35 = v13[v20]; if (v35.weaponCategory == 'conventional' && v35.maxKills > v29) { v29 = v35.maxKills; v30 = v35; } } for (v20 in param_TA.targetPlayer.cityArr) { v25 = param_TA.targetPlayer.cityArr[v20]; if (v25.population > 0) { v9.__set__action('attack'); v9.targetCity = v25; v9.attackWeapon = v30; v9.targetPlayer = param_TA.targetPlayer; break; } } } else { var v46 = param_player.weaponStock.__get__instock_active_payloads(); for (v20 in v13) { v35 = v13[v20]; if (v35.weaponCategory == 'conventional' && v35.maxKills > v29) { v29 = v35.maxKills; v30 = v35; } } v26 = param_player.weaponStock.get_MaxKillPayload(v64); v27 = v26.maxKills; v68 = v27 + v29; var v50 = 0; for (v20 in param_TA.targetPlayer.cityArr) { var v25 = param_TA.targetPlayer.cityArr[v20]; if (v25.population < v68 && v25.population > v50 && v25.population > 0) { v50 = v25.population; v36 = true; param_TA.__set__action('preAttack'); param_TA.targetCity = v25; param_TA.attackWeapon = v26; param_TA.preAttackPayload = v26; param_TA.preAttackCarrier = param_player.preAttackWeapon; v9.__set__action('set_attack'); v9.targetCity = v25; v9.attackWeapon = v30; v9.targetPlayer = param_TA.targetPlayer; } } if (!v36) { param_TA.__set__action('preAttack'); param_TA.targetCity = this.select_random_city(param_TA.targetPlayer); param_TA.attackWeapon = v26; param_TA.preAttackPayload = v26; param_TA.preAttackCarrier = param_player.preAttackWeapon; v9.__set__action('attack'); v9.attackWeapon = v30; v9.targetCity = this.select_random_city(param_TA.targetPlayer); v9.targetPlayer = param_TA.targetPlayer; } } } else { var v79 = this.tools.randRange(1, 2); if (v79 == 1) { param_TA.__set__action('preAttack'); v9.__set__action('reset'); param_TA.preAttackCarrier = param_player.weaponStock.randomAvailableCarrier; } if (v79 == 2) { param_TA.__set__action('attack'); param_TA.targetCity = this.select_random_city(param_TA.targetPlayer); v9.targetPlayer = param_TA.targetPlayer; v9.__set__action('reset'); var v69 = []; for (v20 in v13) { v35 = v13[v20]; if (v35.weaponType == 'soldier') { v69.push(v35); } } param_TA.attackWeapon = v69[this.tools.randRange(0, 3)]; } } } else { if (!v61) { var v46 = param_player.weaponStock.__get__instock_active_payloads(); v27 = 0; if (param_player.preAttackStatus == 'ready') { for (v20 in v46) { v35 = v46[v20]; if (v35.weaponCategory == 'payload' && v35.maxKills > v27 && v35.weaponLevel <= param_player.preAttackWeapon.weaponLevel) { v27 = v35.maxKills; v26 = v35; } else { if (v35.weaponCategory == 'specialLoad' && param_player.preAttackWeapon.weaponName == 'space') { v27 = v35.maxKills; v26 = v35; } } } param_TA.attackWeapon = v26; param_TA.preAttackPayload = param_TA.attackWeapon; param_TA.preAttackCarrier = param_player.preAttackWeapon; param_TA.__set__action('preAttack'); for (v20 in param_TA.targetPlayer.cityArr) { var v25 = param_TA.targetPlayer.cityArr[v20]; if (v25.population <= v27 && v25.population > 0) { param_TA.targetCity = v25; v36 = true; v36 = true; } } if (!v36) { param_TA.targetCity = this.select_random_city(param_TA.targetPlayer); } } else { var v81 = param_player.weaponStock.__get__allowPre(); var v80 = param_player.weaponStock.__get__allowDir(); if (v80 && v81) { var v79 = this.tools.randRange(1, 2); } else { if (!v80 && v81) { var v79 = 1; } else { if (v80 && !v81) { var v79 = 2; } } } if (v79 == 1) { param_TA.__set__action('preAttack'); v9.__set__action('reset'); param_TA.preAttackCarrier = param_player.weaponStock.randomAvailableCarrier; } if (v79 == 2) { param_TA.__set__action('attack'); param_TA.targetCity = this.select_random_city(param_TA.targetPlayer); v9.__set__action('reset'); var v69 = []; for (v20 in v13) { v35 = v13[v20]; if (v35.weaponType == 'soldier') { v69.push(v35); } } param_TA.attackWeapon = v69[this.tools.randRange(0, 3)]; } } } } var v52 = param_player.weaponStock.__get__availableSpies_obj(); var v8 = new Object(); v8._level = 0; v8._amount = 0; v8._plr = undefined; var v16; var v74 = 0; var v78 = false; if (param_player.weaponStock.__get__spyAvailable()) { for (v20 in this.activePlayerArr) { v74 = 0; var v17 = this.activePlayerArr[v20]; v16 = v17.weaponStock.inStock_perLevel_obj; v5 = 1; while (v5 < 5) { if (v16['_level' + v5] > v8._amount && v5 > v8._level && v17 != param_player && v16['_level' + v5] >= this.AI_spy_required_stock_obj['_level' + v5] && v52['_level' + v5] > 0 && param_player.spy_readiness / 25 >= v5) { v8._amount = v16['_level' + v5]; v8._level = v5; v8._plr = v17; } ++v5; } } if (this.human.money > this.tools.randRange(this.difficulty_level_specific_vars.spy_alert_money[this.difficulty_level], 240)) { v8._level = param_player.weaponStock.get_highest_spy_level(); v8._plr = this.human; v78 = true; } } if (!param_TA.attackWeapon && !param_TA.preAttackCarrier && v8._plr) { v78 = true; } else { if (param_TA.attackWeapon && !param_TA.preAttackCarrier && v8._plr) { var v84 = this.tools.randRange(0, 6); if (v84 == 3) { v78 = true; } } } var v62; if (v78) { if (param_player.turnAction_1.__get__action() == 'attack' || param_player.turnAction_1.__get__action() == 'set_attack') { v62 = param_player.turnAction_1; } else { if (param_player.turnAction_2.__get__action() == 'attack' || param_player.turnAction_2.__get__action() == 'set_attack') { v62 = param_player.turnAction_2; } else { v62 = param_TA; } } v62.__set__action('attack'); v62.attackWeapon = param_player.weaponStock.select_spy_by_level(v8._level); v62.targetCity = this.select_random_city(v8._plr); v62.spyBuilding = this.spyBuildingArr[this.tools.randRange(1, this.spyBuildingArr.length - 1)]; v62.targetPlayer = v8._plr; param_TA = v62; } if (!param_TA.attackWeapon && !param_TA.preAttackCarrier) { return false; } if (param_TA.preAttackCarrier && param_player.preAttackStatus == 'ready' && !param_TA.preAttackPayload && !param_TA.ship_attack_arr) { return false; } return true; break; case 'preCounter': param_player.preCounterEnemy.sortOn('_strength', Array.DESCENDING | Array.NUMERIC); var v20 = 0; while (v20 < param_player.preCounterEnemy.length) { if (param_player.preCounterEnemy[v20].player.preAttackWeapon) { var v56 = param_player.preCounterEnemy[v20].player; var v55 = param_player.preCounterEnemy[v20].turnAction; var v34 = param_player.weaponStock.getWeaponByName(param_player.preCounterEnemy[v20].player.preAttackWeapon.counteredBy); if (v34.__get__inStock() > 0) { param_TA.attackWeapon = v34; return true; } } ++v20; } return false; break; case 'propaganda': var v48 = 0; var v87 = 0; var v24 = 0; var v89 = 0; for (var v20 in this.activePlayerArr) { var v11 = this.activePlayerArr[v20]; if (!param_player.ceaseFireArr[v11.playerNum]._status && v11 != param_player) { v24 = 100 - v11.__get__religion(); v24 += (v11.largest_city()).population; v24 -= param_player.regardArr[v11.playerNum]; if (v24 > v48) { v48 = v24; param_TA.targetPlayer = v11; param_TA.targetCity = v11.largest_city(); } } } if (!param_TA.targetPlayer || !param_TA.targetCity) { return false; } else { return true; } break; case 'diplomacy': var v44; var v6; var v15; var v66; var v77 = false; var v45; var v76 = false; var v75 = ''; for (var v20 in this.activePlayerArr) { v6 = this.activePlayerArr[v20]; if (v6 != param_player && !param_player.ceaseFireArr[v6.playerNum]._status) { if (!v15) { v15 = v6.population; v44 = v6; } else { if (v15 > v6.__get__population()) { v44 = v6; v15 = v6.population; } } } } if (v44.money > param_player.money) { v45 = v44; v76 = true; } v15 = undefined; var v38 = 0; var v71; for (v20 in this.activePlayerArr) { v6 = this.activePlayerArr[v20]; if (v6 != param_player && !param_player.ceaseFireArr[v6.playerNum]._status && !param_player.diplomacy_offeredLastTurn[v6.playerNum]) { v38 = this.tools.randRange(1, 5); if (!v15 || v38 > v15) { v15 = v38; v71 = v6; } } } if (v71.__get__population() > param_player.__get__population()) { v66 = v71; v77 = true; } if (!param_player.ceaseFireArr[0]._status && !param_player.diplomacy_offeredLastTurn[0]) { if (this.human.money > 50 && param_player.regardArr[0] < 50) { v45 = this.human; v76 = true; } if (param_player.money > 50 && param_player.regardArr[0] > 50) { v66 = this.human; v77 = true; } } if (v77 && v76) { if (this.tools.randRange(0, 1) == 1) { v75 = 'offer'; } else { v75 = 'demand'; } } else { if (v77) { v75 = 'offer'; } else { if (v76) { v75 = 'demand'; } } } if (v75 == 'offer') { v20 = 0; while (v20 < this.diplomacy_options_arr.length) { if (this.diplomacy_options_arr[v20][0] == 'offer' && this.diplomacy_options_arr[v20][2] < param_player.turnMoney) { param_TA.diplomacyLeader = v66.playerNum; param_TA.diplomacyOption = Number(v20); } ++v20; } } else { v20 = 0; while (v20 < this.diplomacy_options_arr.length) { if (this.diplomacy_options_arr[v20][0] == 'demand' && this.diplomacy_options_arr[v20][2] < v45.money) { param_TA.diplomacyLeader = v45.playerNum; param_TA.diplomacyOption = Number(v20); } ++v20; } } if (param_TA.diplomacyLeader || param_TA.diplomacyLeader == 0) { return true; } else { return false; } break; case 'religion': return true; break; case 'resources': if (param_player.money < 150) { return true; } else { return false; } break; case 'produce': var v10 = new Array(); var v31 = 0; var v28 = 0; var v20 = 0; while (v20 < 8) { v31 = 0; for (var v5 in param_player.weaponStock.weaponArr) { var v4 = param_player.weaponStock.weaponArr[v5]; if (v4.desire > v4.__get__inStock() && v20 == v4.desireGroup && param_player.weaponStock.is_activeCategory(v4.desireGroup)) { v31 += v4.desire - v4.__get__inStock(); } } v10.push({'_cat': v20, '_dif': v31, '_perc': 0}); ++v20; } v10.sortOn('_dif', Array.DESCENDING | Array.NUMERIC); var v60 = this.tools.randRange(1, 4); if (param_player.special_person) { v60 = 2; } if (param_player.suicide_person) { v60 = 1; } var v43 = 0; if (param_player.weaponStock.antiAir.inStock < 1 || param_player.weaponStock.antiRocket.inStock < 1) { v43 = this.tools.randRange(20, 35); v28 = v43; } var v39 = Math.round(this.tools.randRange(80, 100) / 10) * 10; var v14 = 0; v20 = 0; while (v20 < v60) { if (param_player.weaponStock.is_activeCategory(v10[v20]._cat)) { if (param_player.weaponStock.active_dCat_count() < 4) { v14 = Math.round(this.tools.randRange(40, 60) / 10) * 10; } else { v14 = Math.round(this.tools.randRange(0, 60) / 10) * 10; } if (param_player.special_person) { v14 = 50; } if (v28 + v14 > v39) { v14 = v39 - v28; v28 = v39; } else { v28 += v14; } v10[v20]._perc = v14; } ++v20; } v10.sortOn('_cat'); var v65 = 0; v20 = 0; while (v20 < 9) { if (param_TA.productionInvestmentArr[v20][0] == 'defense') { param_TA.productionInvestmentArr[v20][1] = v43; param_TA.productionInvestmentArr[v20][3] = Math.floor((param_player.turnMoney / 100) * v43); } else { v5 = 0; while (v5 < 9) { if (param_TA.productionInvestmentArr[v5][2] == v10[v20]._cat) { param_TA.productionInvestmentArr[v5][1] = v10[v20]._perc; param_TA.productionInvestmentArr[v5][3] = Math.floor((param_player.turnMoney / 100) * v10[v20]._perc); } ++v5; } } v65 += param_TA.productionInvestmentArr[v20][3]; ++v20; } param_player.turnMoney -= v65; param_TA.__set__action('production'); return true; break; case 'research': var v23 = []; var v63 = new Array(); var v41 = 0; if (param_TA.num == 2) { v41 = param_player.turnMoney; } else { v41 = Math.round((param_player.turnMoney / 100) * this.tools.randRange(20, 80)); } if (param_player.special_person) { v41 = param_player.turnMoney; } for (var v20 in param_player.techTree.techArr) { var v18 = param_player.techTree.techArr[v20]; if (!v18.__get__invented() && param_player.money > v18.cost && (v18.requiredTech.__get__invented() || v18.techLevel == 1)) { if (v18.desireGroup != 7) { v23.push(v18); } else { if (param_player.techTree.__get__allow_special()) { v23.push(v18); } } } } v23.sortOn('desire', Array.DESCENDING | Array.NUMERIC); v20 = 0; while (v20 < v23.length) { v18 = v23[v20]; if (v41 > v18.cost && (v23[v20].desire > 0 || param_player.special_person)) { v63.push({'techID': v18.techID}); v41 -= v18.cost; param_player.turnMoney -= v18.cost; } ++v20; } param_TA.researchArr = v63; if (!param_TA.researchArr[0]) { return false; } else { return true; } } }; v2.populationPercentage = function (_plr) { var v2 = 0; for (var v3 in this.activePlayerArr) { v2 += this.activePlayerArr[v3].population; } return Math.round((_plr.__get__population() / v2) * 100); }; v2.killPlayer = function (param_plr) { for (var v5 in param_plr.cityArr) { param_plr.cityArr[v5].population = 0; param_plr.cityArr[v5].removeBioload(); param_plr.cityArr[v5].image.gotoAndStop('empty'); } var v3 = 0; while (v3 < this.activePlayerArr.length) { if (this.activePlayerArr[v3].playerNum == param_plr.playerNum) { this.activePlayerArr.splice(v3, 1); } ++v3; } for (var v4 in this.playerArr) { if (!this.playerArr[v4].alive && this.playerArr[v4].lastAttackedBy_num == param_plr.playerNum) { this.playerArr[v4].lastattackedby_num = param_plr.lastAttackedBy_num; } } param_plr.kill(); }; v2.calcBattle = function (plr, plr_TA) { var v1 = plr_TA.targetPlayer; if (v1.counterWeapon.weaponName == plr_TA.preAttackCarrier.counteredBy) { v1.weaponStock.reduceWeaponByname(v1.counterWeapon.weaponName); } else { plr_TA.targetCity.population -= plr_TA.attackWeapon.maxKills; if (plr.playedBy == 'AI' && plr.regardArr[v1.playerNum] > 0) { plr.regardArr[v1.playerNum] -= 8; } if (v1.playedBy == 'AI' && v1.regardArr[plr.playerNum] > 0) { v1.regardArr[plr.playerNum] -= 8; } } plr.weaponStock.reduceWeaponByName(plr_TA.attackWeapon.weaponName, 1); }; v2.AI_consider_diplomacyArr = function (_plr, _arr) { var v5 = this.diplomacy_options_arr[_arr._option]; var v9 = v5[1]; var v8 = v5[2]; var v7 = this.playerArr[_arr._leader]; var v3 = 2; var v6 = 0; if (v5[0] == 'offer') { if (_plr.regardArr[_arr._leader] > 50) { ++v3; } else { ++v6; } v3 += _arr._option * 4; if (_plr.__get__strength() < v7.__get__strength()) { ++v3; } else { ++v6; } if (v7.__get__population() > _plr.__get__population()) { ++v3; } if (_plr.money < 30) { ++v3; } } else { if (v5[0] == 'demand') { if (_plr.regardArr[_arr._leader] > 50) { ++v3; } else { ++v6; } v6 += Math.round(_arr._option / 2); if (_plr.__get__strength() < v7.__get__strength()) { ++v3; } else { ++v6; } if (_plr.__get__strength() < v7.__get__strength() / 2) { v3 += 2; } else { ++v6; } if (v7.__get__population() > _plr.__get__population()) { ++v3; } else { ++v6; } } } if (v3 > v6) { if (v5[0] == 'demand') { if (_plr.turnMoney >= v5[2]) { _plr.diplomacyAcceptedArr.push(_arr); _plr.turnMoney -= v5[2]; } else { _plr.diplomacyRejectedArr.push(_arr); } } else { if (v5[0] == 'offer') { _plr.diplomacyAcceptedArr.push(_arr); } } } else { _plr.diplomacyRejectedArr.push(_arr); } }; v2.doTurn = function () { for (var v5 in this.activePlayerArr) { if (this.activePlayerArr[v5] != this.human) { var v3 = this.activePlayerArr[v5]; v3.turnMoney = v3.money; if (v3.diplomacyPendingArr[0]) { for (var v4 in v3.diplomacyPendingArr) { this.AI_consider_diplomacyArr(v3, v3.diplomacyPendingArr[v4]); v3.diplomacyPendingArr[v4] = undefined; } v3.diplomacyPendingArr = []; v3.diplomacyPendingArr = new Array(); } this.calcPoints(v3); } } v5 = 0; while (v5 < this.activePlayerArr.length) { v3 = this.activePlayerArr[v5]; if (v3 != this.human) { var v2 = 0; for (v4 in v3.actionArr) { if (this.getTarget(v3, v3.turnAction_1)) { ++v2; break; } else { v3.turnAction_1.__set__action(v3.actionArr[v2].id); v3.turnAction_2.__set__action(v3.actionArr[v2 + 1].id); ++v2; } } for (v4 in v3.actionArr) { if (this.getTarget(v3, v3.turnAction_2)) { ++v2; break; } else { v3.turnAction_2.__set__action(v3.actionArr[v2].id); ++v2; } } } ++v5; } for (v5 in this.playerArr) { v3 = this.playerArr[v5]; } ++this.turn; }; ASSetPropFlags(_global.Model.prototype, null, 1); } #endinitclip } movieClip 5275 __Packages.WD_trace { #initclip if (!_global.WD_trace) { var v1 = function () { this.lc = new LocalConnection(); }; _global.WD_trace = v1; var v2 = v1.prototype; v2.trace = function (_str) { this.lc.send('WD2', 'trace', _str); }; v2.specific_trace = function (_str, _str2) { var v4 = ''; var v9 = ''; var v3; var v8; switch (_str) { case 'aiGameVars': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += 'player ' + v3.playerNum + ': Money: ' + v3.money + ' <br/> '; v4 += 'player ' + v3.playerNum + ': religion: ' + v3.__get__religion() + ' <br/> '; } this.lc.send('WD2', 'specific_trace', 'aiGameVars', v4); break; case 'lastAction': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += 'player ' + v3.playerNum + ': Action 1 - ' + v3.turnAction_1.__get__action() + ' turn: ' + _global.model.turn + ' <br/> '; v4 += 'player ' + v3.playerNum + ': Action 2 - ' + v3.turnAction_2.__get__action() + ' turn: ' + _global.model.turn + ' <br/> '; v9 += ' <u> --Player: ' + v3.playerNum + ' turn: ' + _global.model.turn + ', action 1: </u><br/>' + v3.turnAction_1.__get__actionNames(); v9 += ' <u> --Player: ' + v3.playerNum + ' turn: ' + _global.model.turn + ', action 2: </u><br/>' + v3.turnAction_2.__get__actionNames(); } this.lc.send('WD2', 'specific_trace', 'lastActionDetails', v9); break; case 'stock': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += ' --- player: ' + v3.playerNum + ' <br/> '; for (var v5 in v3.weaponStock.weaponArr) { v8 = v3.weaponStock.weaponArr[v5]; if (v8.active) { v4 += v8.weaponName + ' : ' + v8.__get__inStock() + ' <br/> '; } } v4 += 'Anti Air: ' + v3.weaponStock.antiAir.inStock + ' <br /> '; v4 += 'Anti Roc: ' + v3.weaponStock.antiRocket.inStock + ' <br />'; } this.lc.send('WD2', 'specific_trace', 'stock', v4); break; case 'proTech': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += ' --- player: ' + v3.playerNum + ' <br/> '; var v5 = 0; while (v5 < v3.shortMSG_arr.length) { var v7 = v3.shortMSG_arr[v5]; if (v7._msg != '' && v7._msg) { v4 += v7._msg + '<br />'; } ++v5; } } this.lc.send('WD2', 'specific_trace', 'proTech', v4); break; case 'bio': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += ' --- player: ' + v3.playerNum + ' <br/> '; for (var v5 in v3.bioloadedActionsArr) { v4 += v3.bioloadedActionsArr[v5] + ' <br />'; } } this.lc.send('WD2', 'specific_trace', 'bio', v4); break; case 'ceaseFire': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += ' --- player: ' + v3.playerNum + ' <br/> '; var v5 = 0; while (v5 < v3.ceaseFireArr.length) { if (v3.ceaseFireArr[v5]._status) { v4 += 'cease fire with: ' + v5 + ' for: ' + v3.ceaseFireArr[v5]._turnsLeft + ' turns'; } ++v5; } } break; case 'regard': for (var v10 in _global.model.playerArr) { v3 = _global.model.playerArr[v10]; v4 += ' Player: ' + v3.playerNum + ' <br/>'; var v6 = 0; while (v6 < v3.regardArr.length) { v4 += ' -- towards: ' + v6 + ' : ' + v3.regardArr[v6] + '<br/>'; ++v6; } } break; case 'crashTest': this.lc.send('WD2', 'specific_trace', 'ceaseFire', _str2); } }; ASSetPropFlags(_global.WD_trace.prototype, null, 1); } #endinitclip } movieClip 5276 __Packages.Presenter_gameMenu { #initclip if (!_global.Presenter_gameMenu) { var v1 = function () {}; _global.Presenter_gameMenu = v1; var v2 = v1.prototype; v2.init_main_interface = function () { var v7 = new Array(0, 1, 2, 3, 4); _global.model.playerArr = new Array(); _global.model.activePlayerArr = new Array(); _global.model.human = new Player('human', 0, [0, 0]); var v8 = _global.model.human; v8.religion_code = this.model.building_num_to_religion_code(this.model.selected_building); v8.playerColor = this.model.color_name_by_id(this.model.player_color - 1); v8.playerColorTint1 = _global.model.wd_colors['color_' + this.model.color_code_by_id(this.model.player_color - 1)]; v8.hexColorTint = this.model.color_hex_by_id(this.model.player_color - 1); v8.hexColorTint_str = this.model.color_hexStr_by_id(this.model.player_color - 1); v8.buildingSet_id = this.model.get_religion_buildingSet_by_code(v8.religion_code); v8.alive = true; v8.playerNum = 0; v8.shortMSG_arr.push({'_type': 'welcome', '_msg': 'Welcome commander. Please select 2 action from the left menu.'}); _global.model.difficulty_level = this.model.difficulty; _global.model.playerArr.push(v8); _global.model.activePlayerArr.push(v8); this.remove_value_from_array(v7, this.model.player_color - 1); var v10 = false; var v9 = false; var v4 = 0; while (v4 < this.model.selected_leader_arr.length) { _global.model['comp' + (v4 + 1)] = new Player('AI', v4 + 1, [0, 0]); var v3 = _global.model['comp' + (v4 + 1)]; var v6 = this.model.get_leader_by_ID(this.model.selected_leader_arr[v4]); v3.religion_code = v6._religion; v3.buildingSet_id = this.model.get_religion_buildingSet_by_code(v6._religion); var v5 = v7[_global.model.tools.randRange(0, v7.length - 1)]; v3.playerColor = this.model.color_name_by_id(v5); this.remove_value_from_array(v7, v5); v3.playerColorTint1 = _global.model.wd_colors['color_' + this.model.color_code_by_id(v5)]; v3.hexColorTint = this.model.color_hex_by_id(v5); v3.hexColorTint_str = this.model.color_hexStr_by_id(v5); v3.faceFrame = v6._frame; v3.alive = true; v3.playerNum = v4 + 1; _global.model.playerArr.push(v3); _global.model.activePlayerArr.push(v3); if (_global.model.tools.randRange(1, 3) == 2 && !v10) { v3.special_person = true; v10 = true; } else { if (_global.model.tools.randRange(1, 3) == 2 && !v9) { v3.suicide_person = true; v9 = true; } } ++v4; } _global.presenter.set_player_vars(); _global.presenter.spawn_cities(); _global.presenter.updateMiniMap(); _global.presenter.updateView(); _global.model.decisionPoints.set_points_to_difficulty(_global.model.difficulty_level); _global.view.updateView(); _global.view.setMapFrames(); _global.view.resetActionBuildings(); _global.view.updateCities(); _global.presenter_interface.update_top_plrColor(); _global.presenter_interface.update_color_dots(); _global.presenter_interface.reset_leader_stat_bars(); _global.view_interface.actionTube1.associatedTA = _global.model.human.turnAction_1; _global.view_interface.actionTube2.associatedTA = _global.model.human.turnAction_2; this.view.hide_gameMenu(); _global.view_interface.interfaceMC._visible = true; _global.presenter_interface.updateView(); _global.presenter_interface.debug_automate_func(); _global.view.updateCities(); _global.view.changeOver('toInterface'); }; v2.remove_value_from_array = function (arr, a_value) { var v1 = 0; while (v1 < arr.length) { if (arr[v1] == a_value) { arr.splice(v1, 1); } ++v1; } }; v2.set_btn_func = function () { this.view.src_MC.btn1.onPress = function () { _global.presenter_gameMenu.btn_pressed_difficulty(1); }; this.view.src_MC.btn2.onPress = function () { _global.presenter_gameMenu.btn_pressed_difficulty(2); }; this.view.src_MC.btn3.onPress = function () { _global.presenter_gameMenu.btn_pressed_difficulty(3); }; var v6 = 1; while (v6 < 6) { var v7 = this.view.src_MC['colorBtn' + v6]; v7.num = v6; v7.onPress = function () { _global.presenter_gameMenu.btn_pressed_color(this.num); }; ++v6; } var v5 = 1; while (v5 < 6) { v7 = this.view.src_MC['buildingBtn' + v5]; v7.num = v5; v7.onPress = function () { _global.presenter_gameMenu.btn_pressed_building(this.num); }; ++v5; } var v4 = 1; while (v4 < 7) { v7 = this.view.src_MC['BTN_allLeaders_screen' + v4]; v7.num = v4; v7.onPress = function () { _global.presenter_gameMenu.btn_pressed_leader_from_list(this.num); }; v7.onRollOver = function () { _global.presenter_gameMenu.btn_rollOver_leader(this.num); }; v7.onRollOut = function () { _global.view_gameMenu.src_MC.leaderText.text = ''; }; ++v4; } var v3 = 1; while (v3 < 5) { v7 = this.view.src_MC['BTN_selectedLeader_screen' + v3]; v7.num = v3; v7.onPress = function () { _global.presenter_gameMenu.btn_pressed_selected_leader(this.num); }; ++v3; } this.view.src_MC.btn_player_list_left.onPress = function () { _global.presenter_gameMenu.btn_pressed_leader_arrow_left(); }; this.view.src_MC.btn_player_list_right.onPress = function () { _global.presenter_gameMenu.btn_pressed_leader_arrow_right(); }; this.view.src_MC.btn_start.onPress = function () { _global.presenter_gameMenu.btn_pressed_start(); }; if (!_global.model.zs66hj8s) { this.view.src_MC.demo_MC.btn_full.onPress = function () { _global.presenter_interface.btn_pressed_full(); }; } if (_global.model.zs66hj8s) { this.view.src_MC.demo_MC.txtMC_full.txt.text = 'FULL VERSION'; this.view.src_MC.demo_MC.btn_full.onPress = function () { _global.presenter_interface.btn_pressed_full(); }; this.view.src_MC.arcade_town_logo.onPress = function () { getURL('http://www.arcadetown.com', '_blank'); }; this.view.src_MC.agame_logo.onPress = function () { getURL('http://www.agame.com', '_blank'); }; if (_global.model.get_demo_version_name() == 'Totallygame' || _global.model.get_demo_version_name() == 'Affiliates' || _global.model.get_demo_version_name() == 'NewGrounds') { this.view.src_MC.youda_logo.onPress = function () { getURL('http://www.youdagames.com', '_blank'); }; this.view.src_MC.demo_MC.txtMC_more.txt.text = 'MORE GAMES'; this.view.src_MC.demo_MC.btn_more.onPress = function () { getURL('http://www.youdagames.com/shop/', '_blank'); }; } else { this.view.src_MC.demo_MC.scrn_more._visible = false; this.view.src_MC.demo_MC.btn_more._visible = false; } } else { this.view.src_MC.demo_MC._visible = false; } this.view.src_MC.soundBtn.onPress = function () { _global.presenter_interface.btnPressed_option('music', true); _level0.gameMenu.switch39.play(); }; return undefined; }; v2.initialize_gameMenu = function () { this.btn_pressed_difficulty(2); this.btn_pressed_color(_global.model.tools.randRange(1, 5)); if (!_global.model.zs66hj8s) { this.btn_pressed_building(_global.model.tools.randRange(1, 5)); } else { this.btn_pressed_building(2); } this.set_btn_func(); this.set_visble_leaders_list_arr(); this.update_selected_leaders(true); this.update_leader_list(true); this.update_leader_list(); _global.view.setMapFrames(); }; v2.btn_pressed_building = function (a_nr) { if (!_global.model.zs66hj8s || a_nr == 1 || a_nr == 2) { _global.play_sound_by_action('interface_acceptAction_btn'); this.model.selected_building = a_nr; this.view.__set__active_building_btn(a_nr); this.active_start_btn(); return undefined; } _global.play_sound_by_action('interface_select_stock'); return undefined; }; v2.btn_pressed_difficulty = function (a_nr) { _global.play_sound_by_action('interface_actionBtn_on'); this.model.difficulty = a_nr - 1; this.view.__set__active_difficulty_btn(a_nr); this.active_start_btn(); return undefined; }; v2.btn_pressed_color = function (a_nr) { _global.play_sound_by_action('interface_acceptAction_btn'); this.model.player_color = a_nr; this.view.__set__active_color_btn(a_nr); this.active_start_btn(); return undefined; }; v2.btn_pressed_leader_from_list = function (a_nr) { _global.play_sound_by_action('interface_acceptAction_btn'); this.add_leader_to_selection(this.btn_num_to_leader_num(a_nr)); this.active_start_btn(); return undefined; }; v2.btn_pressed_selected_leader = function (a_nr) { _global.play_sound_by_action('interface_select_stock'); this.remove_selected_leader(a_nr - 1); this.active_start_btn(); return undefined; }; v2.btn_pressed_start = function () { _global.play_sound_by_action('interface_open_tube'); if (this.__get__allow_game_start() && !_global.model.game_initiated) { _global.model.game_initiated = true; this.init_main_interface(); } return undefined; }; v2.__get__allow_game_start = function () { if (!_global.model.zs66hj8s && this.model.selected_leader_arr.length > 0 && this.model.selected_building && this.model.difficulty != undefined && this.model.player_color) { return true; } if (_global.model.zs66hj8s && this.model.selected_leader_arr.length > 2 && this.model.selected_building && this.model.difficulty != undefined && this.model.player_color) { return true; } return false; }; v2.active_start_btn = function () { if (this.__get__allow_game_start()) { this.view.src_MC.scrn_start.gotoAndStop(2); } else { this.view.src_MC.scrn_start.gotoAndStop(1); } }; v2.remove_selected_leader = function (a_arr_index) { this.model.selected_leader_arr.splice(a_arr_index, 1); this.update_leader_panel(); }; v2.add_leader_to_selection = function (a_nr) { if (!this.allowed_demo_religion(a_nr) && _global.model.zs66hj8s) { return undefined; } if (!this.is_selected_leader(a_nr) && this.model.selected_leader_arr.length < 4) { this.model.selected_leader_arr.push(a_nr); } this.update_leader_panel(); }; v2.is_selected_leader = function (a_nr) { var v2 = 0; while (v2 < this.model.selected_leader_arr.length) { if (this.model.selected_leader_arr[v2] == a_nr) { return true; } ++v2; } return false; }; v2.btn_num_to_leader_num = function (a_nr) { return this.model.visible_leader_list_arr[a_nr - 1]; }; v2.update_leader_panel = function () { this.set_visble_leaders_list_arr(); this.update_selected_leaders(); this.update_leader_list(); }; v2.set_visble_leaders_list_arr = function () { this.model.visible_leader_list_arr = []; var v2 = 0; while (v2 < 7) { if (this.model.leader_list_start_num + v2 > 18) { this.model.visible_leader_list_arr.push(v2 - (18 - this.model.leader_list_start_num) - 1); } else { this.model.visible_leader_list_arr.push(this.model.leader_list_start_num + v2); } ++v2; } }; v2.update_selected_leaders = function (a_init) { if (a_init) { var v2 = 1; while (v2 < 5) { this.view.src_MC['leaderScrn' + v2].gotoAndStop('leaderLife'); this.view.src_MC['leaderScrn' + v2].aliveMC.gotoAndStop(20); this.view.src_MC['leaderScrn' + v2].deadMC._visible = false; ++v2; } return undefined; } v2 = 1; while (v2 < 5) { this.view.src_MC['leaderScrn' + v2].aliveMC.gotoAndStop(20); this.view.src_MC['leaderScrn' + v2].aliveMC.gotoAndStop((this.model.get_leader_by_ID(this.model.selected_leader_arr[v2 - 1]))._frame); if (this.model.get_leader_by_ID(this.model.selected_leader_arr[v2 - 1])) { this.view.src_MC['btnCancel' + v2].gotoAndStop(2); } else { this.view.src_MC['btnCancel' + v2].gotoAndStop(1); } ++v2; } return undefined; }; v2.update_leader_list = function (a_init) { if (a_init) { var v3 = 1; while (v3 < 7) { this.view.src_MC['allLeaderScreen' + v3].gotoAndStop('leaderLife'); this.view.src_MC['allLeaderScreen' + v3].aliveMC.gotoAndStop(this.model.visible_leader_list_arr[v3 - 1] + 1); this.view.src_MC['allLeaderScreen' + v3].deadMC._visible = false; ++v3; } return undefined; } v3 = 1; while (v3 < 7) { this.view.src_MC['allLeaderScreen' + v3].aliveMC.gotoAndStop(this.model.visible_leader_list_arr[v3 - 1] + 1); if (this.is_selected_leader(this.model.visible_leader_list_arr[v3 - 1])) { this.view.src_MC['allLeaderScreen' + v3].aliveMC._alpha = 20; } else { this.view.src_MC['allLeaderScreen' + v3].aliveMC._alpha = 100; } if (_global.model.zs66hj8s) { if (!this.allowed_demo_religion(this.model.visible_leader_list_arr[v3 - 1])) { this.view.src_MC['allLeaderScreen' + v3].aliveMC._alpha = 50; this.view.src_MC['full_version_leader_mc_' + v3].gotoAndStop(2); } else { this.view.src_MC['full_version_leader_mc_' + v3].gotoAndStop(1); } } ++v3; } return undefined; }; v2.allowed_demo_religion = function (a_num) { var v2 = this.model.get_leader_by_ID(a_num); if (v2._religion == 'chr' || v2._religion == 'bhu') { return true; } return false; }; v2.btn_pressed_leader_arrow_right = function () { var v2 = this.model.leader_list_start_num; if (v2 > 18) { this.model.leader_list_start_num = 0; } else { ++this.model.leader_list_start_num; } this.update_leader_panel(); }; v2.btn_pressed_leader_arrow_left = function () { var v2 = this.model.leader_list_start_num; if (v2 < 1) { this.model.leader_list_start_num = 18; } else { --this.model.leader_list_start_num; } this.update_leader_panel(); }; v2.btn_rollOver_leader = function (a_nr) { this.view.src_MC.leaderText.text = (this.model.get_leader_by_ID(this.btn_num_to_leader_num(a_nr)))._name; }; v2.addProperty('allow_game_start', v2.__get__allow_game_start, function () {}); ASSetPropFlags(_global.Presenter_gameMenu.prototype, null, 1); } #endinitclip } movieClip 5277 __Packages.View_gameMenu { #initclip if (!_global.View_gameMenu) { var v1 = function (a_src_MC) { this.src_MC = a_src_MC; this.src_MC.txtMC1.txt.text = 'EASY'; this.src_MC.txtMC1.txt.setTextFormat(_global.view.textFormats.interface_actionText_1); this.src_MC.txtMC1.txt.embedFonts = true; this.src_MC.txtMC2.txt.text = 'MEDIUM'; this.src_MC.txtMC2.txt.setTextFormat(_global.view.textFormats.interface_actionText_1); this.src_MC.txtMC2.txt.embedFonts = true; this.src_MC.txtMC3.txt.text = 'HARD'; this.src_MC.txtMC3.txt.setTextFormat(_global.view.textFormats.interface_actionText_1); this.src_MC.txtMC3.txt.embedFonts = true; this.src_MC.txtMC_start.txt.text = 'START GAME'; this.src_MC.txtMC_start.txt.setTextFormat(_global.view.textFormats.interface_actionText_1); this.src_MC.txtMC_start.txt.embedFonts = true; }; _global.View_gameMenu = v1; var v2 = v1.prototype; v2.__set__active_difficulty_btn = function (a_nr) { this.src_MC.scrn1.gotoAndStop(1); this.src_MC.scrn2.gotoAndStop(1); this.src_MC.scrn3.gotoAndStop(1); this.src_MC['scrn' + a_nr].gotoAndStop(2); return undefined; return this.__get__active_difficulty_btn(); }; v2.__set__active_player_color_btn = function (a_nr) { var v2 = 1; while (v2 < 6) { this.src_MC['colorIndicator' + v2].gotoAndStop(1); ++v2; } this.src_MC['colorIndicator' + a_nr].gotoAndStop(a_nr); return undefined; return this.__get__active_player_color_btn(); }; v2.__set__active_color_btn = function (a_nr) { var v2 = 1; while (v2 < 6) { this.src_MC['colorIndicator' + v2].gotoAndStop(1); ++v2; } this.src_MC['colorIndicator' + a_nr].gotoAndStop(2); return undefined; return this.__get__active_color_btn(); }; v2.__set__active_building_btn = function (a_nr) { var v3 = 1; while (v3 < 6) { this.src_MC['buildingIndicator' + v3].gotoAndStop(1); ++v3; } this.src_MC['buildingIndicator' + a_nr].gotoAndStop(2); if (_global.model.zs66hj8s) { this.src_MC.buildingIndicator3._alpha = 40; this.src_MC.buildingIndicator4._alpha = 40; this.src_MC.buildingIndicator5._alpha = 40; this.src_MC.full_version_building_mc.gotoAndStop(2); } return undefined; return this.__get__active_building_btn(); }; v2.update_leader_screen = function (a_MC, a_nr) { a_MC.gotoAndStop(a_nr); }; v2.hide_gameMenu = function () { this.src_MC._visible = false; }; v2.addProperty('active_building_btn', function () {}, v2.__set__active_building_btn); v2.addProperty('active_color_btn', function () {}, v2.__set__active_color_btn); v2.addProperty('active_difficulty_btn', function () {}, v2.__set__active_difficulty_btn); v2.addProperty('active_player_color_btn', function () {}, v2.__set__active_player_color_btn); ASSetPropFlags(_global.View_gameMenu.prototype, null, 1); } #endinitclip } movieClip 5278 __Packages.Model_gameMenu { #initclip if (!_global.Model_gameMenu) { var v1 = function () { this.visible_leader_list_arr = new Array(); this.selected_leader_arr = new Array(); }; _global.Model_gameMenu = v1; var v2 = v1.prototype; v2.color_code_by_id = function (a_num) { for (var v3 in this.color_num_to_code_arr) { if (this.color_num_to_code_arr[v3][0] == a_num) { return this.color_num_to_code_arr[v3][2]; } } }; v2.color_hex_by_id = function (a_num) { for (var v3 in this.color_num_to_code_arr) { if (this.color_num_to_code_arr[v3][0] == a_num) { return this.color_num_to_code_arr[v3][3]; } } }; v2.color_hexStr_by_id = function (a_num) { for (var v3 in this.color_num_to_code_arr) { if (this.color_num_to_code_arr[v3][0] == a_num) { return this.color_num_to_code_arr[v3][4]; } } }; v2.color_name_by_id = function (a_num) { for (var v3 in this.color_num_to_code_arr) { if (this.color_num_to_code_arr[v3][0] == a_num) { return this.color_num_to_code_arr[v3][1]; } } }; v2.get_leader_by_ID = function (a_ID) { for (var v3 in this.leader_arr) { if (this.leader_arr[v3].ID == a_ID) { return this.leader_arr[v3]; } } }; v2.building_num_to_religion_code = function (a_nr) { var v1 = 'chr'; switch (a_nr) { return v1; case 1: return 'bhu'; return v1; case 2: return 'chr'; return v1; case 3: return 'com'; return v1; case 4: return 'jew'; return v1; case 5: return 'mus'; return v1; } return v1; }; v2.get_religion_buildingSet_by_code = function (a_nr) { var v1 = 'christian_buildings'; switch (a_nr) { return v1; case 'bhu': return 'budhist_buildings'; return v1; case 'chr': return 'christian_buildings'; return v1; case 'com': return 'communist_buildings'; return v1; case 'jew': return 'jewish_buildings'; return v1; case 'mus': return 'muslim_buildings'; return v1; } return v1; }; v2.leader_list_start_num = 0; v2.color_num_to_code_arr = new Array([0, 'blue', 'blu', 255, '0x0000FF'], [1, 'red', 'red', 16711680, '0xFF0000'], [2, 'orange', 'ora', 16750848, '0xFF9900'], [3, 'yellow', 'yel', 1044480, '0xFF000'], [4, 'green', 'gre', 65280, '0x00FF00']); v2.leader_arr = new Array({'ID': 0, '_name': 'The Bombki', '_religion': 'chr', '_frame': 1, '_selected': false}, {'ID': 1, '_name': 'M. Headinajar', '_religion': 'mus', '_frame': 2, '_selected': false}, {'ID': 2, '_name': 'Col. Gedoffi', '_religion': 'mus', '_frame': 3, '_selected': false}, {'ID': 3, '_name': 'Reh Moose Hunt', '_religion': 'bhu', '_frame': 4, '_selected': false}, {'ID': 4, '_name': 'Asama Bin Loader', '_religion': 'mus', '_frame': 5, '_selected': false}, {'ID': 5, '_name': 'Any Kissonme', '_religion': 'bhu', '_frame': 6, '_selected': false}, {'ID': 6, '_name': 'Psyman Para\'s', '_religion': 'jew', '_frame': 7, '_selected': false}, {'ID': 7, '_name': 'Ehum Oldbert', '_religion': 'jew', '_frame': 8, '_selected': false}, {'ID': 8, '_name': 'Ehum Bareass', '_religion': 'jew', '_frame': 9, '_selected': false}, {'ID': 9, '_name': 'Gladinme Putit', '_religion': 'com', '_frame': 10, '_selected': false}, {'ID': 10, '_name': 'Keen to Chill', '_religion': 'com', '_frame': 11, '_selected': false}, {'ID': 11, '_name': 'Angola Market', '_religion': 'chr', '_frame': 12, '_selected': false}, {'ID': 12, '_name': 'Ballony Stare', '_religion': 'chr', '_frame': 13, '_selected': false}, {'ID': 13, '_name': 'Who in There', '_religion': 'bhu', '_frame': 14, '_selected': false}, {'ID': 14, '_name': 'JP Barksender', '_religion': 'chr', '_frame': 15, '_selected': false}, {'ID': 15, '_name': 'Jack Searock', '_religion': 'chr', '_frame': 16, '_selected': false}, {'ID': 16, '_name': 'GW Blush', '_religion': 'chr', '_frame': 17, '_selected': false}, {'ID': 17, '_name': 'Taxi Isinawater', '_religion': 'bhu', '_frame': 18, '_selected': false}, {'ID': 18, '_name': 'Bossi Isasad', '_religion': 'mus', '_frame': 19, '_selected': false}); ASSetPropFlags(_global.Model_gameMenu.prototype, null, 1); } #endinitclip } frame 3 { var loaded = 0; _root.onEnterFrame = function () { if (loaded == 100) { loaded = undefined; this.onEnterFrame = undefined; play(); } else { loaded = Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100); this.youdapreloader.percentloaded_bar_mc._xscale = loaded; this.youdapreloader.loaded_txt.text = loaded + '%'; stop(); } }; stop(); } movieClip 5064 { } frame 13 { stop(); } frame 13 { stop(); _global.main = new Main(); } movieClip 5067 { } movieClip 5070 { } movieClip 5073 { } movieClip 5076 { } movieClip 5079 { frame 1 { stop(); } } movieClip 5081 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 5087 { frame 1 { stop(); } } movieClip 5091 { frame 1 { stop(); } } movieClip 5095 { frame 1 { stop(); } } movieClip 5099 { frame 1 { stop(); } } movieClip 5103 { frame 1 { stop(); } } movieClip 5110 { frame 1 { stop(); } } movieClip 5115 { frame 1 { stop(); } } movieClip 5120 { frame 1 { stop(); } } movieClip 5125 { frame 1 { stop(); } } movieClip 5130 { frame 1 { stop(); } } movieClip 5132 { } movieClip 5134 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 5135 { frame 1 { stop(); } } movieClip 5148 { } movieClip 5149 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 5154 { frame 1 { this._visible = false; } } movieClip 5155 { } movieClip 5161 { } button 5164 { on (release) { gameURL = 'http://www.miniclip.com/games/' + gamename + '/en/'; trace('Going to game: ' + gameURL); getURL(gameURL, '_blank'); } } movieClip 5166 { frame 1 { System.security.allowDomain('www.miniclip.com'); } instance mcHighscores of movieClip 5154 { onClipEvent (load) { _visible = false; } } frame 2 { if (_url.indexOf('miniclip.com') == -1 && _url.indexOf('miniclip.net') == -1 && _url.indexOf('miniclip.co.uk') == -1 && _url.indexOf('miniclips.com')) { gotoAndStop(_currentframe + 1); } else { var noCache = getTimer() + random(100000); mcTarget.loadMovie('http://www.miniclip.com/swfcontent/highscore.swf?noCache=' + noCache); stop(); } } frame 3 { stop(); } } movieClip 5167 { frame 1 { stop(); } frame 2 { stop(); } instance comHighscores of movieClip 5166 { onClipEvent (construct) { scoreLocation = '_global.model.human.score'; gamename = 'World Domination 2'; saveScore = true; scoreIsTime = false; scoreReversed = false; negativeScoreAllowed = false; } } } movieClip 5170 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } movieClip 5174 { } movieClip 5179 { frame 195 { stop(); _root.introMovie._visible = false; _root.splashScreenMC._visible = true; _global.presenter_interface.init_theme_snd(); } } movieClip 5182 { } movieClip 5183 { frame 1 { stop(); } } movieClip 5184 { } movieClip 5197 { frame 52 { stop(); } } movieClip 5212 { frame 83 { stop(); } } movieClip 5222 { } movieClip 5223 { } movieClip 5229 { } movieClip 5230 { } movieClip 5231 { frame 1 { stop(); } frame 2 { bg.onPress = function () {}; bg.useHandCursor = false; } frame 7 { _global.presenter_interface.full_version_mc_sound_start(); } frame 290 { stop(); _global.presenter_interface.load_full_version_btns(this); } }




http://swfchan.com/10/47142/info.shtml
Created: 2/5 -2019 10:26:12 Last modified: 2/5 -2019 10:26:12 Server time: 14/11 -2024 06:26:29