-
Notifications
You must be signed in to change notification settings - Fork 1
/
DOMDocument.xml
2909 lines (2650 loc) · 133 KB
/
DOMDocument.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<DOMDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" width="750" frameRate="31" currentTimeline="1" xflVersion="2.1" creatorInfo="Adobe Flash Professional CS5.5" platform="Windows" versionInfo="Saved by Adobe Flash Windows 11.5 build 349" majorVersion="11" minorVersion="5" buildNumber="349" gridSnapTo="true" objectsSnapTo="false" viewAngle3D="70.7391536835427" nextSceneIdentifier="2" playOptionsPlayLoop="false" playOptionsPlayPages="false" playOptionsPlayFrameActions="false">
<timelines>
<DOMTimeline name="Scene 1">
<layers>
<DOMLayer name="Mod Specific" color="#9933CC" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="Forwarders" color="#4FFF4F" parentLayerIndex="0" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function dialogue() {
return _level1.dialogue.apply(_root._level1, arguments);
}
function limit() {
return _level1.limit.apply(_root._level1, arguments);
}
function distance() {
return _level1.distance.apply(_root._level1, arguments);
}
function min() {
return _level1.min.apply(_root._level1, arguments);
}
function max() {
return _level1.max.apply(_root._level1, arguments);
}
function sgn() {
return _level1.sgn.apply(_root._level1, arguments);
}
function kvEvent() {
return _level1.kvEvent.apply(_root._level1, arguments);
}
function Building() {
_level1.Building.apply(this,arguments);
}
function Unit() {
_level1.Unit.apply(this,arguments);
}
function UnitHAL() {
_level1.UnitHAL.apply(this,arguments);
}
function UnitNav() {
_level1.UnitNav.apply(this,arguments);
}
function UnitStats() {
_level1.UnitStats.apply(this,arguments);
}
function Indicator() {
_level1.Indicator.apply(this,arguments);
}
function LevelStats() {
_level1.LevelStats.apply(this,arguments);
}
function Level() {
_level1.Level.apply(this,arguments);
}
function Log(msg:String):Void {
_level0.Log.apply(this, arguments);
}
function log(msg:String):Void {
_level0.Log.apply(this, arguments);
}
]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Cheat Object" color="#4FFF4F" parentLayerIndex="0" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[//cheat object
function cheatObj(id:String, code:String, linked:Array) {
this.id = id;
this.code = code;
this.isEnabled = false;
if (linked !== undefined && linked !== null) {
this.linked = linked;
for (i in this.linked) {
if (this.linked[i].substr(0, 5) != "cheat") {
this.linked[i] = "cheat" + this.linked[i];
}
}
} else {
this.linked = null;
}
}
// fullscreen fatwallet 299792458 quickbuild awesome n00b newbie clearskies moneypenny 1337
//cheatFullscreen cheatCashup cheatBuildspeed cheatFirepower cheatShields cheatShroud
function registerCheat(id:String, code:String, linked:Array) {
var invalidCodes = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "fullscreen", "fatwallet", "299792458", "quickbuild", "awesome", "n00b", "newbie", "clearskies", "moneypenny", "1337", "credits", "beeblebrox");
var invalidIds = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "cheatFullscreen", "cheatCashup", "cheatBuildspeed", "cheatFirepower", "cheatShields", "cheatShroud");//all following 9 may get removed from list
var aborted = false;
if (id.substr(0, 5) != "cheat") {
id = "cheat" + id;
}
if ((id == null) || (id == undefined)) {
aborted = true;
}
if ((code == null) || (code == undefined)) {
aborted = true;
}
for (i in invalidCodes) {
if (invalidCodes[i] == code) {
aborted = true;
break;
}
}
for (i in invalidIds) {
if (invalidIds[i] == id) {
aborted = true;
break;
}
}
for (i in _level1.panel.codes) {
if (_level1.panel.codes[i] == code) {
aborted = true;
break;
}
}
//this check may get removed
/*for (i in _level1.panel.customCheats) {
if (_level1.panel.customCheats[i].id == id) {
aborted = true;
break;
}
}*/
for (i in _level1.panel.customCheats) {
if (_level1.panel.customCheats[i].code == code) {
aborted = true;
break;
}
}
//this cheat can now be registered
if (!aborted) {
_level1.panel.customCheats.push(new cheatObj(id, code, linked));
}
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Disabled Function" color="#FF0000" parentLayerIndex="0" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function DisabledFunction() {
_root.Log("This function was disabled by the CAC Redux Team for a good reason. More information on disabled functions can be found at <a href='http://example.com/'>PLACEHOLDER</a>.");
return undefined;
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Weapon" color="#4FFF4F" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="WeaponHook" color="#9933CC" parentLayerIndex="4" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function WeaponHook(parent, shooter, type, x, y, tx, ty, target) {
// backtrack
this.posX -= this.dx;
this.posY -= this.dy;
// if rocket type, check for collision
if (this.type == "rocket") {
this.collision();
}
// revert backtrack
this.posX += this.dx;
this.posY += this.dy;
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Arena" color="#4F80FF" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="doSnowHook" color="#FF4FFF" parentLayerIndex="6" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function doSnowHook() {
_level0.Log("Snow!");
this.terrainMCx2.filters = this.terrainMC.filters;
this.terrainMCy2.filters = this.terrainMC.filters;
this.terrainMCx2y2.filters = this.terrainMC.filters;
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="ArenaHook" color="#FF4F4F" parentLayerIndex="6" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function ArenaHook(parent) {
// Don't even need to hook layoutTiles, it's called just before this code runs.
this.tiles[this.cols + 1] = new Array();
for (var y = 0; y <= this.rows + 1; y++) {
this.tiles[this.cols + 1][y] = true;
}
// Add more terrain MovieClips to allow for larger maps.
this.terrainMCx2 = this.MC.attachMovie("terrain", "terrainx2", -11);
this.terrainMCx2._x = 2880;
this.terrainMCx2._y = 0;
this.terrainMCx2._width = 2880;
this.terrainMCx2._height = 2880;
this.terrainMCy2 = this.MC.attachMovie("terrain", "terrainy2", -12);
this.terrainMCy2._x = 0;
this.terrainMCy2._y = 2880;
this.terrainMCy2._width = 2880;
this.terrainMCy2._height = 2880;
this.terrainMCx2y2 = this.MC.attachMovie("terrain", "terrainx2y2", -13);
this.terrainMCx2y2._x = 2880;
this.terrainMCx2y2._y = 2880;
this.terrainMCx2y2._width = 2880;
this.terrainMCx2y2._height = 2880;
//if (this.doSnow.isHooked()) {
// _level0.Log("doSnow() already hooked, skipping...");
//} else {
var hookSnow:Object = _level0.addPostHook(this.doSnow, doSnowHook);
this.doSnow = hookSnow.override;
//}
var tempTodaysDate:Date = new Date();
if (_level1.panel.checkCheat("cheatSnow") || (tempTodaysDate.getMonth() == 11 && (tempTodaysDate.getDate() == 24 || tempTodaysDate.getDate() == 25))) {
// Ho ho ho!
this.doSnow();
}
delete tempTodaysDate;
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Construction" color="#4FFF4F" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="ConstructionHook" color="#9933CC" parentLayerIndex="9" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript offsets="36,476">
<script><![CDATA[function ConstructionHook(parent) {
/*
var hook5:Object = _level0.addPreHook(this.construct,
function(item) {
if (!item)
return;
_level0.Log("construct called for type: " + item.type + " inProgress: " + item.inProgress + " progress: " + item.progress + " disabled: " + item.disabled);
}
);
this.construct = hook5.override;
var hook6:Object = _level0.addPostHook(this.doMouse,
function(x, y) {
_level0.Log("doMouse called x: " + x + " y: " + y);
}
);
this.doMouse = hook6.override;
*/
this.construct = function(item) {
if (!item) {
return;
}
if (!item.inProgress) {
item.MC.progress._visible = true;
item.MC.progress.gotoAndStop(100);
return;
}
// Force check for maximum built units.
item.checkMax(item.total);
// If item is now disabled as a result of hitting max units, then abort construction.
if (item.disabled) {
// Properly cancel the construction first.
this.cancel(item, false);
// Now abort.
return;
}
var speed = this.speed;
if (this.parent.powerLow) {
speed *= .5;
}
speed = Math.ceil(speed);
var diff = item.progress + speed - item.constructionTime;
if (diff > 0) {
speed -= diff;
}
var spend = Math.ceil((speed / item.constructionTime) * item.cost);
if (this.parent.cash < spend) {
this.sufficientFunds = false;
return;
}
this.parent.cash -= spend;
item.progress += speed;
item.progress = min(item.progress, item.constructionTime);
var perc = Math.ceil(100 * item.progress / item.constructionTime);
item.MC.progress._visible = true;
item.MC.progress.gotoAndStop(perc);
if (item.progress == item.constructionTime) {
item.inProgress = false;
if (item.isUnit) {
if (!item.superweapon) {
this.parent.units.push(new Unit(this.parent, item.type, null, null, .125 * random(8), this.parent.parent.team));
this.cancel(item);
this.parent.parent.sfx.play("INT_constructioncomplete_unit");
} else {
this.parent.parent.sfx.play("INT_constructioncomplete_building");
}
} else {
this.parent.parent.sfx.play("INT_constructioncomplete_building");
}
}
};
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="BuildingSite" color="#FF800A" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="BuildingSiteHook" color="#FF4FFF" parentLayerIndex="11" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function BuildingSiteHook(parent, type) {
/*
//TODO: Investigate why exactly this causes further bugs whereas replacing the function completely works fine.
var breakGroundHook:Object = _level0.addPreHook(this.breakGround,
function() {
// HACK: Force recalculate if this is on a valid tile.
this.handle();
}
);
this.breakGround = breakGroundHook.override;
*/
this.breakGround = function() {
// HACK: Force recalculate if this is on a valid tile.
this.handle();
if (!this.valid) {
this.parent.parent.parent.sfx.play("INT_invalid");
return;
}
this.parent.parent.outcomeFutures++;// a hack because breakground is called on Control which is called after setFutures - it will resolve itself fairly next frame
this.parent.parent.buildings.push(new Building(this.parent.parent, this.type, this.parent.parent.control.tilePos.x, this.parent.parent.control.tilePos.y, this.parent.parent.parent.team));
//this.parent.parent.cash -= this.stats.cost;
this.destroy(true);
this.parent.parent.parent.sfx.play("INT_breakground");
return true;
};
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Unit" color="#4FFF4F" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="UnitHook" color="#9933CC" parentLayerIndex="13" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function UnitHook(parent, type, x, y, angle, team, damage, target, obj, respawn) {
//ETX wuz here
this.doCheckGroundedPassengers = function() {
for (i in this.stats.contents) {
if (!this.stats.contents[i].stats.flying) {
return true;
}
}
return false;
};
this.doDeploy = function() {
if (!this.stats.carrier) {
return;
}
if (this.stats.flying && (this.nav.landerPerc != 100)) {
return;
}
//and here
var shouldPickup = this.doCheckGroundedPassengers();
if (shouldPickup) {
this.nav.checkCollect();
}
while (this.stats.contents.length) {
this.stats.contents.shift().doEmbark(this);
}
this.nav.voyage(this.nav.currentX,this.nav.currentY + 1);
this.hilite = true;
this.deploy = false;
this.nav.landerPerc = 75;
this.nav.still = 0;
this.nav.hesitate = 0;
this.ordered = true;
};
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="UnitNav" color="#4FFF4F" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="UnitNavHook" color="#9933CC" parentLayerIndex="15" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function UnitNavHook(parent) {
if (!parent.stats.home && !parent.tilePos.x && !parent.tilePos.y) {
var warn:String = "Warning: Could not spawn unit " + parent.type + " at {x: " + parent.tilePos.x + ", y: " + parent.tilePos.y + "}";
parent.tilePos = {x:1, y:1};
parent.tilePos = parent.parent.arena.closestAvailable(parent.tilePos);
parent.x = parent.tilePos.x;
parent.y = parent.tilePos.y;
warn += "\nAssigned next available tile position {x: " + parent.tilePos.x + ", y: " + parent.tilePos.y + "} to avoid crash!";
_level0.Log(warn);
}
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="LevelStats" color="#FF4FFF" locked="true" autoNamed="false" visible="false" layerType="folder"/>
<DOMLayer name="outcomeOverride" color="#4FFF4F" parentLayerIndex="17" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function outcomeOverride() {
if (!this.active) {
return;
}
if ((this.level == 1) || (this.level == 11) || (this.level == 26)) {
if (this.cash >= 1) {
this.win();
}
}
if (this.level == 6) {
if (!this.findBuilding("BC_evil")) {
this.win();
}
}
if (this.level == 9) {
// Fix lose condition: previously if your engineer or
// dropship died, you wouldn't be able to win or lose.
if (!this.findBuilding("BG_evil").friend) {
if (!this.findUnit("UB_good") || !this.findUnit("UH_good")) {
this.lose();
}
}
if (this.findBuilding("BG_evil").friend) {
this.win();
}
if (!this.findBuilding("BG_evil")) {
this.lose();
}
}
if ((this.level == 10) || (this.level == 20)) {
if (!(this.count % 5000) && this.friendlyTarget.active && this.findBuilding("BH_" + this.parent.oppo) && !this.findBuilding("BH_" + this.parent.oppo).friend) {
this.parent.sfx.play("music_ingame_" + this.jukebox + "_stop");
do {
var newjuke = random(4) + 1;
} while (newjuke == this.jukebox);
this.jukebox = newjuke;
this.parent.sfx.play("music_ingame_" + this.jukebox + "_start");
this.launchSuperweapon(this.friendlyTarget.posX,this.friendlyTarget.posY);
}
}
if (this.level == 15) {
var isBuggy = this.findUnit("UE_evil");
if (!isBuggy) {
this.lose();
}
}
if (this.level == 19) {
// Fix lose condition: previously if you didn't own the breeding pit (not captured, been sold or destroyed)
// and you only owned one saboteur, and you used it to capture the satellite uplink, you would lose.
if (this.findBuilding("BH_good").friend) {
this.win();
} else {
if (!this.findBuilding("BC_evil").friend && !this.findUnit("UB_evil")) {
this.lose();
}
if (!this.findBuilding("BH_good")) {
this.lose();
}
}
}
if (this.level == 22) {
var isPitch = this.findBuilding("BI_good");
if ((this.indicators.length == 2) && isPitch) {
this.indicator = false;
this.training = true;
for (var i in this.units) {
this.units[i].target = false;
this.units[i].nav.hesitate = 1000;
this.units[i].weaponCharge = 1000;
}
this.units.push(new Unit(this, "UB_good", 9, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_good", 9, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_good", 9, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_good", 9, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_good", 9, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_evil", 12, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_evil", 12, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_evil", 12, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_evil", 12, 13, 0, this.parent.team, null, isPitch));
this.units.push(new Unit(this, "UB_evil", 12, 13, 0, this.parent.team, null, isPitch));
} else if ((this.indicators.length == 0) && !this.indicator) {
this.camera.focus = isPitch;
this.win();
}
}
if (this.level == 23) {
// Fix lose condition: previously if you lost all buildings,
// you'd be unable to win (can't build anywhere) and
// unable to lose (AI won't attack your units).
if (!this.findBuilding("BB_good").friend && !this.findBuilding("BD_good")) {
this.lose();
}
if (!this.powerLow && (this.construction.shortcuts["BH_good"].total >= 4)) {
this.camera.focus = this.arena.tileHandles["_8_7"];
this.win();
}
}
if (this.level == 24) {
var isBuggy = this.findUnit("UE_good");
if ((isBuggy.tilePos.x == 12) && (isBuggy.tilePos.y == 2)) {
this.win();
}
if (!isBuggy) {
this.lose();
}
}
if (this.level == 27) {
if (!this.findUnit("UD_good")) {
this.win();
}
if (!this.findUnit("UD_evil")) {
this.lose();
}
}
if (this.level == 29) {
var sleigh = this.findBuilding("BJ_evil");
var santa = this.findUnit("UM_evil");
var isPresent = this.findUnit("UO_evil");
if (!sleigh) {
this.lose();
}
if (!santa) {
this.lose();
}
if (!this.findUnit("UN_evil")) {
this.lose();
}
if (!isPresent) {
if (this.indicators.length == 2) {
this.indicator = false;
this.training = true;
for (var i in this.units) {
if (this.units[i].friend) {
this.units[i].nav.returnHome();
}
}
this.training = true;
this.camera.focus = sleigh;
} else if ((this.indicators.length == 0) && !this.indicator && (santa.nav.path.length < 4)) {
this.win();
}
}
}
if (this.level == 31) {
var isDriller = this.findBuilding("BL_good");
if (isDriller) {
this.win();
}
}
if (this.level == 32) {
if (this.specialBuilding.health == this.specialBuilding.stats.maxHealth) {
this.win();
}
if (!this.specialBuilding.active) {
this.lose();
}
}
if (this.level > 1) {
if (!this.outcomeThreats) {
this.win();
}
}
if (this.outcomeFutures == 1) {
var cashSunk = 0;// to fix bug where you have the funds, but it is committed to a constructing item
if (this.construction.constructingBuilding) {
cashSunk += this.construction.constructingBuilding.cost * (this.construction.constructingBuilding.progress / this.construction.constructingBuilding.constructionTime);
}
if (this.construction.constructingUnit) {
cashSunk += this.construction.constructingUnit.cost * (this.construction.constructingUnit.progress / this.construction.constructingUnit.constructionTime);
}
if (this.construction.buildingSite) {
cashSunk += this.construction.buildingSite.stats.cost;
}
if (this.findBuilding("BA_" + this.parent.team).friend && !this.findUnit("UD_" + this.parent.team).friend && ((this.cash + cashSunk) < this.construction.shortcuts["UD_" + this.parent.team].cost)) {
this.outcomeFutures--;
}
if (this.findBuilding("BK_" + this.parent.team).friend && ((this.cash + cashSunk) < this.construction.shortcuts["UP_" + this.parent.team].cost)) {
this.outcomeFutures--;
}
}
if (!this.outcomeFutures) {
this.lose();
}
}]]></script>
</Actionscript>
<elements/>
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="LevelStatsHook" color="#9933CC" parentLayerIndex="17" locked="true" autoNamed="false" visible="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[function LevelStatsHook(parent) {
//var isConflict:Boolean = false;
//var isSpecialLevel: Boolean = false;
//var isLastSpecialLevel: Boolean = false;
//var isBonusLevel: Boolean = false;
this.setup = function()
{
var temp, a, b, c, d;
this.isConflict=false;
this.isSpecialLevel=false;
this.isLastSpecialLevel=false;
this.isBonusLevel=false;
if (this.level == 1) // simple mining training
{
this.buildings.push(new Building(this, "BA_good", 2, 7));
this.units.push(temp = new Unit(this, "UD_good", null, null, .5));
this.indicators.push(new Indicator(this, temp, null, dialogue("int_level1_ind1"), "selected"));
this.indicators.push(new Indicator(this, temp, this.arena.tileHandles["_4_7"], dialogue("int_level1_ind2"), "voyage"));
this.indicators.push(new Indicator(this, temp, this.arena.tileHandles["_6_6"], dialogue("int_level1_ind3"), "voyage"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level1_ind4"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level1_ind5"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level1_ind6"), "message", 120));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level1_ind7"), "message"));
this.cash = 0;
this.training = true;
this.jukebox = 1;
}
if (this.level == 2) // simple seek and destroy
{
this.buildings.push(new Building(this, "BA_good", 1, 11));
this.buildings.push(new Building(this, "BB_good", 3, 11));
// Fixed a mountain tile becoming traversable by moving the miner off of it (from position 10, 5 to 11, 6).
this.units.push(new Unit(this, "UD_good", 11, 6, .5));
this.units.push(temp = new Unit(this, "UA_good", 3, 9, .25));
this.units.push(a = new Unit(this, "UA_good", 4, 9, .5));
this.units.push(b = new Unit(this, "UA_good", 4, 9, .125));
this.units.push(c = new Unit(this, "UA_good", 3, 9, .375));
this.units.push(new Unit(this, "UA_evil", 15, 1, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 13, 15, .75, null, null, "roam", 20));
this.units.push(new Unit(this, "UA_evil", 15, 3, .75, null, null, "still"));
this.indicators.push(new Indicator(this, new Array(temp,a,b,c), null, dialogue("int_level2_ind1"), "selected"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level2_ind2"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level2_ind3"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level2_ind4"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level2_ind5"), "message"));
this.cash = 2000;
this.training = true;
this.jukebox = 2;
}
if (this.level == 3) // simple build and repair
{
this.buildings.push(new Building(this, "BA_good", 3, 13));
this.units.push(temp = new Unit(this, "UD_good", 8, 11, .5, null, .25));
this.units.push(new Unit(this, "UE_evil", 16, 15, .75, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 17, 16, .75, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 18, 17, .75, null, null, "still"));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UA_evil", 15, 15, .75, null, null, "roam", 10));
this.indicators.push(new Indicator(this, temp, null, dialogue("int_level3_ind1"), "selected"));
this.indicators.push(new Indicator(this, temp, this.arena.tileHandles["_4_14"], dialogue("int_level3_ind2"), "voyage"));
this.indicators.push(new Indicator(this, "BB_good", null, dialogue("int_level3_ind3"), "construction"));
this.indicators.push(new Indicator(this, "BC_good", null, dialogue("int_level3_ind4"), "construction"));
this.indicators.push(new Indicator(this, "UB_good", null, dialogue("int_level3_ind5"), "construction"));
this.indicators.push(new Indicator(this, "find:UB_good", null, dialogue("int_level3_ind6"), "selected"));
this.indicators.push(new Indicator(this, "find:UB_good", temp, dialogue("int_level3_ind7"), "voyage"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level3_ind8"), "message"));
this.cash = 4000;
this.training = true;
this.jukebox = 3;
}
if (this.level == 4) // evade and build (radar)
{
this.buildings.push(new Building(this, "BA_good", 2, 4));
this.buildings.push(new Building(this, "BB_good", 1, 4));
this.buildings.push(new Building(this, "BF_good", 4, 4));
this.buildings.push(new Building(this, "BD_good", 8, 5));
this.units.push(new Unit(this, "UD_good", 10, 4, .5));
this.units.push(temp = new Unit(this, "UE_good", 27, 12, .25));
this.units.push(a = new Unit(this, "UI_evil", 28, 12, .75));
this.units.push(new Unit(this, "UE_evil", 30, 12, .75, null, .75, "still"));
this.units.push(new Unit(this, "UA_evil", 27, 7, .5, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 23, 14, .25, null, null, "still"));
this.units.push(new Unit(this, "UA_evil", 23, 15, .25, null, null, "still", 600));
this.units.push(new Unit(this, "UA_evil", 23, 15, .25, null, null, "still", 600));
this.units.push(new Unit(this, "UA_evil", 23, 15, .25, null, null, "still", 1000));
this.units.push(new Unit(this, "UA_evil", 23, 15, .25, null, null, "still", 2000));
this.units.push(new Unit(this, "UA_evil", 23, 15, .25, null, null, "still", 2000));
this.units.push(new Unit(this, "UE_evil", 23, 6, .75, null, .75, "still"));
this.units.push(new Unit(this, "UE_evil", 24, 6, .75, null, .75, "still"));
this.units.push(new Unit(this, "UA_evil", 25, 1, .25, null, null, "still", 600));
this.units.push(new Unit(this, "UA_evil", 25, 1, .25, null, null, "still", 600));
this.units.push(new Unit(this, "UA_evil", 25, 1, .25, null, null, "still", 1000));
this.units.push(new Unit(this, "UA_evil", 25, 1, .25, null, null, "still", 2000));
this.units.push(new Unit(this, "UA_evil", 25, 1, .25, null, null, "still", 2000));
this.units.push(new Unit(this, "UE_evil", 30, 1, .25, null, null, "still", 2500));
this.units.push(new Unit(this, "UE_evil", 30, 2, .25, null, null, "still", 2600));
this.indicators.push(new Indicator(this, temp, null, dialogue("int_level4_ind1"), "selected"));
this.indicators.push(new Indicator(this, temp, a, dialogue("int_level4_ind2"), "voyage"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level4_ind3"), "message", 60));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level4_ind4"), "message", 200));
this.arena.shroud.reveal(6,1,4);
this.arena.shroud.reveal(3,8,4);
this.arena.shroud.reveal(3,12,4);
this.arena.shroud.reveal(10,8,3);
this.arena.shroud.reveal(15,10,3);
this.arena.shroud.reveal(20,8,3);
this.arena.shroud.reveal(25,10,3);
this.arena.shroud.reveal(28,14,2);
this.camera.focus = temp;
this.cash = 2000;
this.training = true;
this.jukebox = 4;
}
if (this.level == 5) // UF's attack in swarms
{
this.buildings.push(new Building(this, "BA_"+this.parent.team, 2, 4));
this.units.push(new Unit(this, "UD_good", null, null, .5, null));
this.units.push(new Unit(this, "UE_good", 4, 3, .5));
this.units.push(new Unit(this, "UA_good", 4, 5, .25));
this.units.push(new Unit(this, "UA_good", 4, 5, .5));
this.units.push(new Unit(this, "UA_good", 4, 5, .75));
this.units.push(new Unit(this, "UF_evil", 15, 5, .75, null, null, "roam", 10));
this.units.push(new Unit(this, "UF_evil", 15, 4, .5, null, null, "still", 1000));
this.units.push(new Unit(this, "UF_evil", 19, 9, .75, null, null, "still", 2000));
this.units.push(new Unit(this, "UA_evil", 18, 19, .75, null, null, "roam", 2));
this.units.push(new Unit(this, "UA_evil", 18, 20, .75, null, null, "roam", 2));
this.units.push(new Unit(this, "UF_evil", 19, 19, .75, null, null, "still"));
this.arena.shroud.reveal(5,10,4);
this.arena.shroud.reveal(19,19,4);
this.cash = 8000;
this.jukebox = 1;
}
if (this.level == 6) // jetpacks ahoy
{
this.buildings.push(a = new Building(this, "BA_good", 4, 15));
this.buildings.push(new Building(this, "BB_good", 1, 15));
this.buildings.push(new Building(this, "BG_good", 1, 13));
this.units.push(new Unit(this, "UD_good", null, null, .5, null));
this.units.push(new Unit(this, "UC_good", 6, 14, .5, null));
this.units.push(new Unit(this, "UC_good", 6, 15, .5, null));
this.units.push(new Unit(this, "UC_good", 6, 16, .5, null));
this.units.push(new Unit(this, "UC_good", 6, 15, .5, null));
this.units.push(new Unit(this, "UC_good", 6, 16, .5, null));
this.buildings.push(temp = new Building(this, "BC_evil", 15, 5));
this.buildings.push(new Building(this, "BD_evil", 11, 7));
this.buildings.push(new Building(this, "BD_evil", 14, 12));
this.buildings.push(new Building(this, "BB_evil", 15, 2));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 30, true));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 35, true));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 40, true));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level6_ind1"), "message", 80));
this.indicators.push(new Indicator(this, a, null, null, "focus"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level6_ind2"), "message", 80));
this.arena.shroud.reveal(16,5,4);
this.camera.focus = temp;
this.cash = 4000;
this.cashOppo = 20000;
this.jukebox = 2;
}
if (this.level == 7) // major tank wars
{
this.buildings.push(new Building(this, "BA_good", 5, 27));
this.units.push(new Unit(this, "UD_good", 13, 26, .5, null));
this.units.push(new Unit(this, "UF_good", 6, 24, .0625, null));
this.units.push(new Unit(this, "UF_good", 7, 24, .125, null));
this.units.push(new Unit(this, "UF_good", 7, 25, .1875, null));
this.units.push(new Unit(this, "UA_good", 4, 24));
this.units.push(new Unit(this, "UA_good", 4, 24));
this.units.push(new Unit(this, "UA_good", 7, 27));
this.units.push(new Unit(this, "UA_good", 7, 27));
this.buildings.push(new Building(this, "BD_evil", 15, 8));
this.buildings.push(new Building(this, "BD_evil", 18, 14));
this.buildings.push(new Building(this, "BE_evil", 19, 4));
this.buildings.push(new Building(this, "BB_evil", 21, 3));
this.buildings.push(new Building(this, "BC_evil", 19, 7));
this.buildings.push(new Building(this, "BB_evil", 21, 7));
this.units.push(new Unit(this, "UA_evil", 19, 6, null, null, null, "roam", 6, true));
this.units.push(new Unit(this, "UA_evil", 19, 6, null, null, null, "roam", 6, true));
this.units.push(new Unit(this, "UA_evil", 19, 6, null, null, null, "roam", 6, true));
this.units.push(new Unit(this, "UA_evil", 19, 6, null, null, null, "roam", 6, true));
this.units.push(new Unit(this, "UA_evil", 19, 6, null, null, null, "roam", 6, true));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 1000, true));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 1000, true));
this.units.push(new Unit(this, "UC_evil", null, null, null, null, null, "still", 1000, true));
this.units.push(new Unit(this, "UE_evil", 5, 3, .5, null, null, "still", null, true));
this.units.push(new Unit(this, "UE_evil", 21, 24, .75, null, null, "still", null, true));
this.units.push(new Unit(this, "UF_evil", 17, 11, .625, null, null, "still", null, true));
this.units.push(new Unit(this, "UI_evil", 4, 7));
this.units.push(new Unit(this, "UI_evil", 11, 9));
this.units.push(new Unit(this, "UI_evil", 21, 17));
this.cash = 4000;
this.cashOppo = 20000;
this.jukebox = 3;
}
if (this.level == 8) // crashed ship
{
this.buildings.push(new Building(this, "BA_good", 2, 25, "evil", .25));
this.buildings.push(new Building(this, "BC_good", 13, 14, "evil", .25));
this.units.push(temp = new Unit(this, "UA_good", 13, 6, .5, null));
this.units.push(new Unit(this, "UA_good", 12, 5, .5, null));
this.units.push(new Unit(this, "UA_good", 14, 5, .5, null));
this.units.push(new Unit(this, "UB_good", 13, 4, .5, null));
this.units.push(new Unit(this, "UB_good", 13, 4, .5, null));
this.units.push(new Unit(this, "UH_good", 14, 29, .625));
this.units.push(new Unit(this, "UI_good", 10, 7, .5, null, null, null, "UE_good"));
this.units.push(new Unit(this, "UI_good", 8, 3, .5, null, null, null, "UF_good"));
this.units.push(new Unit(this, "UI_good", 8, 29, .25, null, null, null, "UC_good"));
this.buildings.push(new Building(this, "BD_evil", 4, 7));
this.buildings.push(new Building(this, "BD_evil", 6, 15));
this.buildings.push(new Building(this, "BD_evil", 8, 24));
this.buildings.push(new Building(this, "BB_evil", 4, 25, "evil"));
this.buildings.push(new Building(this, "BB_evil", 4, 23, "evil"));
this.units.push(new Unit(this, "UA_evil", 12, 15, null, null, null, "roam", 4));
this.units.push(new Unit(this, "UA_evil", 12, 15, null, null, null, "roam", 4));
this.units.push(new Unit(this, "UF_evil", 2, 17, .125, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 3, 15, .125, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 10, 26, 0, null, null, "still"));
this.units.push(new Unit(this, "UE_evil", 2, 11, .375, null, null, "still"));
this.units.push(new Unit(this, "UA_evil", 3, 25, null, null, null, "roam", 6));
this.units.push(new Unit(this, "UA_evil", 3, 25, null, null, null, "roam", 6));
this.units.push(new Unit(this, "UI_evil", 15, 15));
this.units.push(new Unit(this, "UI_evil", 14, 16));
this.units.push(new Unit(this, "UI_evil", 6, 27));
this.units.push(new Unit(this, "UI_evil", 1, 17));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level8_ind1"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level8_ind2"), "message", 80));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level8_ind3"), "message", 80));
this.camera.focus = temp;
this.cash = 0;
this.jukebox = 4;
}
if (this.level == 9) // tech centre grab
{
this.buildings.push(new Building(this, "BG_good", 10, 26));
this.buildings.push(new Building(this, "BB_good", 11, 26));
this.units.push(a = new Unit(this, "UB_good", 9, 26, .5, null));
this.units.push(new Unit(this, "UH_good", 7, 26, .625, null));
this.units.push(new Unit(this, "UI_good", 3, 2, .5, null, null, null, "UF_good"));
this.units.push(new Unit(this, "UI_good", 4, 16, .5, null, null, null, "UC_good"));
this.units.push(new Unit(this, "UI_good", 12, 17, .5, null, null, null, "UC_good"));
this.units.push(new Unit(this, "UI_good", 14, 27, .5, null, null, null, "UC_good"));
this.units.push(new Unit(this, "UI_good", 14, 12, .5, null, null, null, "UC_good"));
this.units.push(new Unit(this, "UI_good", 7, 16, .5, null, null, null, "UC_good"));
this.buildings.push(temp = new Building(this, "BG_evil", 8, 4));
this.buildings.push(new Building(this, "BD_evil", 7, 3));
this.buildings.push(new Building(this, "BD_evil", 7, 5));
this.buildings.push(new Building(this, "BD_evil", 9, 3));
this.buildings.push(new Building(this, "BD_evil", 9, 5));
this.buildings.push(new Building(this, "BB_evil", 13, 5));
this.buildings.push(new Building(this, "BB_evil", 13, 2));
this.buildings.push(new Building(this, "BB_evil", 15, 5));
this.buildings.push(new Building(this, "BB_evil", 15, 2));
this.buildings.push(new Building(this, "BB_evil", 14, 3));
this.buildings.push(new Building(this, "BB_evil", 1, 2));
this.buildings.push(new Building(this, "BB_evil", 1, 5));
this.indicators.push(new Indicator(this, a, null, null, "focus"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level9_ind1"), "message", 80));
this.indicators.push(new Indicator(this, a, null, dialogue("int_level9_ind2"), "selected"));
this.indicators.push(new Indicator(this, a, this.units[1], dialogue("int_level9_ind3"), "voyage"));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level9_ind4"), "message", 160));
this.indicators.push(new Indicator(this, null, null, dialogue("int_level9_ind5"), "message"));
this.arena.shroud.reveal(8,6,3);
this.camera.focus = temp;
this.cash = 0;
this.jukebox = 1;
}
if (this.level == 10) // good conflict
{
this.isConflict=true;
this.buildings.push(new Building(this, "BB_good", 25, 23));
this.buildings.push(new Building(this, "BD_good", 8, 23));
this.buildings.push(b = new Building(this, "BD_good", 26, 23));
this.buildings.push(c = new Building(this, "BA_good", 5, 20));
this.units.push(new Unit(this, "UF_good", 5, 22, .375));
this.units.push(new Unit(this, "UE_good", 6, 22, .625));
this.units.push(new Unit(this, "UC_good", 4, 20, .375));
this.units.push(new Unit(this, "UC_good", 7, 20, .625));
this.units.push(new Unit(this, "UD_good", 13, 26, .5));
this.units.push(new Unit(this, "UI_good", 27, 3, .5, null, null, null, "UB_good"));
this.units.push(new Unit(this, "UI_good", 21, 21, .5, null, null, null, "UD_good"));
this.units.push(new Unit(this, "UI_good", 10, 10, .5, null, null, null, "UF_good"));
this.buildings.push(a = new Building(this, "BA_evil", 25, 12));
this.buildings.push(new Building(this, "BD_evil", 30, 14));
this.buildings.push(new Building(this, "BD_evil", 21, 12));
this.buildings.push(new Building(this, "BD_evil", 22, 12));
this.buildings.push(new Building(this, "BD_evil", 24, 15));
this.buildings.push(new Building(this, "BD_evil", 25, 15));
this.buildings.push(new Building(this, "BD_evil", 5, 7));
this.buildings.push(new Building(this, "BB_evil", 6, 7));
this.buildings.push(new Building(this, "BD_evil", 7, 7));
this.buildings.push(new Building(this, "BD_evil", 23, 2));
this.buildings.push(new Building(this, "BC_evil", 25, 2));
this.buildings.push(new Building(this, "BG_evil", 28, 2));
this.buildings.push(new Building(this, "BH_evil", 29, 2));
this.buildings.push(new Building(this, "BE_evil", 25, 7));
this.buildings.push(new Building(this, "BF_evil", 28, 5));
this.buildings.push(new Building(this, "BB_evil", 23, 7));
this.buildings.push(new Building(this, "BB_evil", 23, 9));
this.buildings.push(new Building(this, "BB_evil", 28, 13));
this.buildings.push(new Building(this, "BB_evil", 28, 11));
this.buildings.push(new Building(this, "BB_evil", 29, 11));
this.buildings.push(new Building(this, "BB_evil", 28, 9));