-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitLabTriggers.galaxy
6458 lines (5785 loc) · 327 KB
/
UnitLabTriggers.galaxy
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
//==================================================================================================
//
// Generated Map Script
//
// Name: StarBox - Unit Test [Professional]
//
//==================================================================================================
include "TriggerLibs/NativeLib"
//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void InitLibs () {
libNtve_InitLib();
}
//--------------------------------------------------------------------------------------------------
// Global Structures
//--------------------------------------------------------------------------------------------------
struct gs_tools_spawnStartingUnit {
string lv_unitType;
point lv_unitPosition;
fixed lv_unitFacing;
};
//--------------------------------------------------------------------------------------------------
// Global Preset Declarations
//--------------------------------------------------------------------------------------------------
const int ge_RemoveUnitRequestOptions_ResourcesCurrent = 0x00000001;
const int ge_RemoveUnitRequestOptions_Count = 0x00000002;
const int ge_RemoveUnitRequestOptions_CancelMorph = 0x00000004;
const int ge_ResourceTableType_Units = 0;
const int ge_ResourceTableType_Buildings = 1;
const int ge_ResourceTableType_Tech = 2;
const int ge_ResourceTableType_Gathered = 3;
const int ge_MatrixOptions_HideButtonDialog = 0x00000001;
const int ge_MatrixOptions_HideImage = 0x00000002;
const int ge_MatrixOptions_Desaturated = 0x00000004;
const int ge_MatrixOptions_OnlyforP1 = 0x00000008;
const int ge_MatrixOptions_Locked = 0x00000010;
const int ge_MatrixOptions_Toggled = 0x00000020;
const int ge_MatrixOptions_Doesnotacceptmouse = 0x00000040;
const int ge_MatrixOptions_Centered = 0x00000080;
const int ge_MatrixOptions_Unused1 = 0x00000100;
const int ge_MatrixOptions_Unused2 = 0x00000200;
const int ge_MatrixBackground_Normal = 0;
const int ge_MatrixBackground_None = 1;
const int ge_MatrixBackground_LeafFrame = 2;
const int ge_MatrixBackground_Unused = 3;
const int ge_CompleteRemoved_Complete = 0;
const int ge_CompleteRemoved_Removed = 1;
const int ge_Alphanumeric_Zero = 0;
const int ge_Alphanumeric_Alpha = 1;
const int ge_Alphanumeric_Beta = 2;
const int ge_Alphanumeric_Gamma = 3;
const int ge_Alphanumeric_Delta = 4;
const int ge_Alphanumeric_Epsilon = 5;
const int ge_Alphanumeric_Zeta = 6;
const int ge_Alphanumeric_Eta = 7;
const int ge_Alphanumeric_Theta = 8;
const int ge_Alphanumeric_Iota = 9;
const int ge_Alphanumeric_Kappa = 10;
const int ge_Alphanumeric_Lambda = 11;
const int ge_Alphanumeric_Mu = 12;
const int ge_Alphanumeric_Nu = 13;
const int ge_Alphanumeric_Xi = 14;
const int ge_IncrementationType_Increase = 0;
const int ge_IncrementationType_Decrease = 1;
const int ge_IncrementationType_Other = 2;
const int ge_ResourceState_Current = 0;
const int ge_ResourceState_Lost = 1;
const int ge_ResourceState_Total = 2;
const int ge_ResourceState_Gathered = 3;
const int ge_TechType_Resource = 0;
const int ge_TechType_Upgrade = 1;
const int ge_TechType_Other = 2;
//--------------------------------------------------------------------------------------------------
// Global Variables
//--------------------------------------------------------------------------------------------------
bool gv_debug;
string[32] gv_tech_unused;
string[100][5][5] gv_uPGLevelRace;
string[100][5][5] gv_upgIMGLevelRace;
int[100][5][5] gv_upgMNRLLevelRace;
int[100][5][5] gv_upgVSPNLevelRace;
int[100][5][5] gv_upgTIMELevelRace;
string[100][5] gv_rESRace;
string[100][5] gv_resIMGRace;
int[100][5] gv_resMNRLRace;
int[100][5] gv_resVSPNRace;
int[100][5] gv_resTIMERace;
text[100][5] gv_resTIPRace;
string[151] gv_unitBTNFACE;
string[151][11] gv_unitNAME;
string[151][11] gv_unitTYPE;
int[151] gv_unitTIME;
string[151] gv_data_unitCMD;
bool gv_controlDOWN;
unitgroup gv_unitsUnderConstruction;
unitgroup gv_unitsDoingConstruction;
int gv_flagsRemoveUnitRequestOptions;
int[101][16] gv_unitCounterUnitOwner;
bool gv_unitCounter_activated;
int[11][21][17] gv_unitCounter_countSpawnerBtnOwner;
int[11][21] gv_unitCounter_databaseNumberSpawnerBtn;
unit[11] gv_unitCounter_spawner;
string[31] gv_unitCounter_excludedFaces;
bool gv_stageBATTLE;
unitgroup gv_tools_spawnStartingGroup;
gs_tools_spawnStartingUnit[11][81] gv_tools_spawnStartingUnit_Neutral;
int gv_tools_spawnSelected;
int[16][10][10] gv_playerMNRLPlayerTypeState;
int[16][10][10] gv_playerVSPNPlayerTypeState;
fixed[16][10][10] gv_playerSUPP_MADEPlayerTypeState;
fixed[16][10][10] gv_playerSUPP_USEDPlayerTypeState;
int[16][10][10] gv_playerTIMEPlayerTypeState;
int gv_playerCURRENT;
timer gv_timer_battle;
bool[11] gv_storageDialog_empty;
int[101][41] gv_mATRIXState;
int[100][101][41] gv_matrixITEMDialogState;
int[100][101][41] gv_matrixITEMimageDialogState;
point[11][16] gv_spawn_pointAdjusted;
point[11][16] gv_spawn_pointDefault;
region[11] gv_spawn_region;
string[11] gv_spawn_name;
region gv_spawn_regionCurrent;
int gv_spawn_numberCurrent;
unit gv_wrench;
unitgroup gv_unitgroupMASTERS;
unitgroup gv_unitgroupSPAWNERS;
unitgroup gv_unitgroupSpawned;
point[16] gv_playerSPAWN;
unit[16] gv_unit_pointSPAWN;
int gv_pointingSPAWN;
playergroup gv_mASTERS;
bool gv_nUKING;
bool gv_cREEPING;
sound gv_creepSOUND;
playergroup gv_playerGroupAGGRESSOR;
int gv_gameZOOM;
bool gv_creepREMOVE;
bool gv_creepGENERATE;
fixed gv_creepSIZE;
point[17] gv_mousePosition;
int gv_dialogRACE;
revealer gv_locationRevealer;
unit gv_cursorUnit;
bool gv_airCreator;
unit gv_unitVariableInstant;
playergroup gv_aIs;
void InitGlobals () {
int init_i;
int init_j;
int init_k;
for (init_i = 0; init_i <= 150; init_i += 1) {
gv_unitBTNFACE[init_i] = "";
}
for (init_i = 0; init_i <= 150; init_i += 1) {
for (init_j = 0; init_j <= 10; init_j += 1) {
gv_unitNAME[init_i][init_j] = "";
}
}
for (init_i = 0; init_i <= 150; init_i += 1) {
gv_data_unitCMD[init_i] = "";
}
gv_unitsUnderConstruction = UnitGroupEmpty();
gv_unitsDoingConstruction = UnitGroupEmpty();
gv_flagsRemoveUnitRequestOptions = 3;
for (init_i = 0; init_i <= 10; init_i += 1) {
for (init_j = 0; init_j <= 20; init_j += 1) {
gv_unitCounter_databaseNumberSpawnerBtn[init_i][init_j] = -1;
}
}
for (init_i = 0; init_i <= 30; init_i += 1) {
gv_unitCounter_excludedFaces[init_i] = "";
}
gv_tools_spawnStartingGroup = UnitGroupEmpty();
gv_playerCURRENT = 13;
gv_timer_battle = TimerCreate();
for (init_i = 0; init_i <= 100; init_i += 1) {
for (init_j = 0; init_j <= 40; init_j += 1) {
gv_mATRIXState[init_i][init_j] = c_invalidDialogId;
}
}
for (init_i = 0; init_i <= 99; init_i += 1) {
for (init_j = 0; init_j <= 100; init_j += 1) {
for (init_k = 0; init_k <= 40; init_k += 1) {
gv_matrixITEMDialogState[init_i][init_j][init_k] = c_invalidDialogControlId;
}
}
}
for (init_i = 0; init_i <= 99; init_i += 1) {
for (init_j = 0; init_j <= 100; init_j += 1) {
for (init_k = 0; init_k <= 40; init_k += 1) {
gv_matrixITEMimageDialogState[init_i][init_j][init_k] = c_invalidDialogControlId;
}
}
}
for (init_i = 0; init_i <= 10; init_i += 1) {
gv_spawn_name[init_i] = "";
}
gv_unitgroupMASTERS = UnitGroupEmpty();
gv_unitgroupSPAWNERS = UnitGroupEmpty();
gv_unitgroupSpawned = UnitGroupEmpty();
gv_pointingSPAWN = -1;
gv_mASTERS = PlayerGroupEmpty();
gv_playerGroupAGGRESSOR = PlayerGroupEmpty();
gv_gameZOOM = 2;
gv_creepSIZE = 0.1;
gv_aIs = PlayerGroupEmpty();
}
//--------------------------------------------------------------------------------------------------
// Global Function Declarations
//--------------------------------------------------------------------------------------------------
void gf_TechBuildDatabase ();
void gf_UnitsBuildDatabase ();
void gf_PreloadUnits ();
void gf_UICustomizations ();
void gf_PresetSpawnPoints ();
void gf_TechRegisterALLfromAbility (string lp_ability, string lp_unit);
void gf_TechRegisterfromAbility (string lp_ability, int lp_techNumber, string lp_unit);
void gf_TechAddUnused (string lp_tech);
bool gf_TechIsUnused (string lp_tech, bool lp_logic);
int gf_CountofTechforRace (string lp_race, int lp_techType);
void gf_UnitsRegisterALLfromAbility (string lp_ability);
void gf_UnitsRegisterfromAbility (int lp_commandNumber, string lp_ability);
int gf_UnitDatabaseGetDatabaseNumberbyUnitType (string lp_unitType);
int gf_UnitDatabaseGetDatabaseNumberbyButtonFace (string lp_unitFace);
int gf_UnitDatabaseGetFreeDuplicatebyDatabaseNumber (int lp_databaseNumber);
string gf_UnitDatabaseGetUnitNamebyDatabaseNumber (int lp_databaseNumber);
string gf_UnitDatabaseGetUnitTypebyDatabaseNumber (int lp_databaseNumber);
int gf_CountofUnitsinDatabase ();
int gf_UnitTypeGetTimeCost (string lp_unitType);
void gf_SetUnitSpecials (unit lp_unit);
void gf_RemoveUnitSpecials (unit lp_unit);
void gf_RemoveUnitsRequest (unitgroup lp_unitGroup, int lp_options);
void gf_RemoveUnitRequest (unit lp_unit, int lp_options);
void gf_AggressorUnitsAttackOppositeDirection ();
void gf_RemovePlayerUnitsandResetResources (int lp_owner);
int gf_OppositePlayer (int lp_player);
void gf_UnitCreationDialogCreate ();
void gf_UnitCreationDialogTrigger ();
void gf_SelectUnitCreator (int lp_player);
void gf_UnitCounterCreate ();
void gf_UnitCounterExcludeFace (string lp_face);
bool gf_UnitCounterFaceIsExcluded (string lp_face, bool lp_bool);
void gf_UnitCounterUpdate (int lp_number, string lp_unitType, int lp_owner);
void gf_UnitCounterRemoveUnit (int lp_number, unit lp_unit);
void gf_UnitCounterClear (int lp_player);
void gf_UnitCounterRefresh (playergroup lp_players);
void gf_GameCreate ();
void gf_GameTrigger ();
void gf_SwitchMode ();
void gf_StoreUnitGroupinLastOpenedBank (int lp_bankNumber, int lp_owner);
void gf_StoreAllUnits (int lp_bankNumber, int lp_playerNumber);
void gf_RestoreUnitGroupfromLastOpenedBank (int lp_bankNumber, int lp_owner);
void gf_RestoreAllUnitGroups (int lp_bankNumber, int lp_playerNumber);
void gf_ToolsDialogCreate ();
void gf_ToolsDialogTrigger ();
int gf_CountofLocations ();
void gf_AddStartingUnitsforCurrentLocation ();
void gf_RemoveStartingUnitsforCurrentLocation ();
void gf_MirrorUnitwithPosition (unit lp_unittoMirror);
void gf_ChangeLocation (int lp_location);
void gf_RefreshCamera ();
void gf_PauseCreeping ();
void gf_StopNuking ();
void gf_StopCreeping ();
void gf_StopSpawnPointing ();
void gf_SetSpawnPoint ();
void gf_ResetSpawnPoints ();
void gf_SetNuke ();
void gf_SetCreep ();
void gf_ResourceDialogCreate ();
void gf_ResourceDialogAddRemoveTable ();
void gf_ResourceDialogAddUnit (unit lp_unit, int lp_times, int lp_action);
void gf_ResourceDialogAddUnitType (string lp_unit, int lp_times, int lp_action, int lp_player);
void gf_ResourceDialogAddContents (int lp_action, int lp_minerals, int lp_vespene, fixed lp_suppliesUsed, fixed lp_suppliesMade, int lp_time, int lp_player, int lp_type, int lp_state, int lp_times);
void gf_ResourceDialogAddTech (int lp_action, int lp_state, int lp_player, string lp_research);
void gf_ResourceDialogResetPlayer (int lp_player);
void gf_ResourceDialogRemoveLosses ();
void gf_ResourceDialogRefresh ();
void gf_TechMenuCreate ();
void gf_TechMenuTrigger ();
void gf_TechMenuResearch (int lp_player, int lp_number, int lp_race);
void gf_TechMenuUpgrade (int lp_player, int lp_number, int lp_race, int lp_incrementation);
void gf_TechMenuRefresh ();
void gf_TechMenuShowHideTechManager (bool lp_showHide, playergroup lp_players);
void gf_SettingsCreate ();
void gf_SettingsTrigger ();
void gf_SettingsPreset ();
bool gf_SettingsOptionEnabled (int lp_number, int lp_master, int lp_slave);
void gf_SettingsMenuApplyOmni ();
void gf_SettingsMenu3SuppressCollision ();
void gf_SettingsMenu4AdjustNeutral ();
void gf_SettingsMenu4SetAggressors ();
void gf_SettingsMenu7AdjustVision ();
void gf_SettingsMenu6AdjustRequirements (int lp_master);
void gf_SettingsMenu8AdjustAttack (int lp_master);
void gf_TimerCreate ();
void gf_StorageDialogCreate ();
void gf_StorageDialogTrigger ();
void gf_StorageDialogPreload ();
void gf_StorageDialogDeleteSlot (string lp_bankName, int lp_bankNumber, int lp_playerNumber);
void gf_DebugMessage (text lp_message);
void gf_MatrixCreate (int lp_dialog, int lp_dialogState, int lp_buttonWidth, int lp_buttonHeight, int lp_columns, int lp_rows, int lp_x, int lp_y, int lp_anchor, int lp_background, int lp_options);
void gf_MatrixCreateButton (int lp_buttonWidth, int lp_buttonHeight, int lp_column, int lp_row, int lp_dialog, int lp_dialogState, int lp_options, string lp_buttonImage, text lp_title, text lp_tooltip);
void gf_MatrixCreateCheckbox (int lp_buttonWidth, int lp_buttonHeight, int lp_column, int lp_row, int lp_dialog, int lp_dialogState, int lp_options, string lp_buttonImage, text lp_title, text lp_tooltip, bool lp_checked);
void gf_MatrixCreateLabel (int lp_buttonWidth, int lp_buttonHeight, int lp_column, int lp_row, int lp_dialog, int lp_dialogState, color lp_color, text lp_text, string lp_buttonImage);
void gf_MatrixCreatePulldown (int lp_pulldownWidth, int lp_pulldownHeight, int lp_column, int lp_row, int lp_dialog, int lp_dialogState, int lp_options, string lp__1, string lp__2, string lp__3, string lp__4, string lp__5, string lp__6, string lp__7, string lp__8, string lp__9, string lp__10);
void gf_MatrixModifyItem (bool lp_action, int lp_number, int lp_type, int lp_state);
int gf_MatrixGetButtonsforRace (int lp_dialog, int lp_dialogState);
bool gf_PresetFlagsCheck (int lp_preset, int lp_totalFlags, int lp_flag);
soundlink gf_SoundRacialCompleteRemove (int lp_race, int lp_status);
string gf_TechGetName (string lp_upgrade);
string gf_TechGetRace (string lp_upgrade);
string gf_TechGetfromAbility (string lp_ability, int lp_upgradeNumber);
int gf_TechGetCostfromAbility (string lp_ability, int lp_upgradeNumber, int lp_resource);
int gf_IntegertoAlphanumeric (int lp_integer);
string gf_ConvertIntegertoRacestr (int lp_race);
string gf_ConvertIntegertoRace (int lp_integer);
int gf_ConvertRaceToInteger (string lp_race);
string gf_ConvertUnitNamePathtoUnitName (string lp_unitNamePath);
string gf_UnitTypeGetRace (string lp_unit);
text gf_UnitTypeGetTooltip (string lp_unitType);
bool gf_UnitTypeIsGround (string lp_unitType);
int gf_UnitTypeGetTimefromAbility (int lp_commandNumber, string lp_ability);
string gf_UnitTypeGetNamefromAbility (int lp_commandNumber, string lp_ability);
fixed gf_PercentofReal (fixed lp_number, fixed lp_percent);
fixed gf_PercentageCompare (fixed lp_x, fixed lp_y);
string gf_ButtonGetFromAbility (string lp_ability, int lp_buttonNumber);
string gf_ButtonGetIcon (string lp_button);
text gf_ButtonTooltip (string lp_button);
//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_Initialization;
trigger gt_declarevariables;
trigger gt_AnyKeyDOWN;
trigger gt_AnyKeyUP;
trigger gt_AnyMouseButtonDOWN;
trigger gt_AnyMouseButtonUP;
trigger gt_AnyPlayerMovesMouse;
trigger gt_ChatMessage;
trigger gt_Every3000secondsofRealTime;
trigger gt_Every500secondsofGameTime;
trigger gt_Every005secondsofRealTime;
trigger gt_DetectUnitConstruction;
trigger gt_DetectUnitConstructed;
trigger gt_SetTrainedandConstructedUnitPropertiesAntiInsideSpawn;
trigger gt_RemoveForceFields;
trigger gt_DialogItemTriggers;
trigger gt_DialogItemTriggersDEBUG;
trigger gt_UnitCreation;
trigger gt_DeselectUnitCreator;
trigger gt_SwitchtoAir;
trigger gt_SwitchtoGround;
trigger gt_UnitCounterOnCreatorSelection;
trigger gt_UnitCounterOnUnitRemove;
trigger gt_UnitCounterOnUnitCreation;
trigger gt_UnitCounterOnUnitTrain;
trigger gt_ResourceDialogDetectDeath;
trigger gt_ResourceDialogDetectMorphBuildingMANUAL;
trigger gt_ResourceDialogDetectConstructionMorphMerge;
trigger gt_ResourceDialogDetectInterceptors;
trigger gt_ResourceDialogDetectTech;
trigger gt_ResourceDialogDetectUnit;
trigger gt_ResourceDialogDetectResourceChange;
trigger gt_TechMenuTechDetect;
trigger gt_SettingsMenu2NoLimits;
trigger gt_SettingsMenu3NoCollision;
trigger gt_SettingsMenu4Neutral;
trigger gt_SettingsMenu4Aggressor;
trigger gt_SettingsMenu7Vision;
trigger gt_SettingsMenu5InstantBuild;
trigger gt_SettingsMenu5CompleteReserach;
trigger gt_SettingsMenu5CompleteBuild;
trigger gt_SettingsMenu6NoRequirements;
trigger gt_SettingsMenu8DisableAttack;
trigger gt_ChatCommands;
//--------------------------------------------------------------------------------------------------
// Global Presets
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// Global Functions
//--------------------------------------------------------------------------------------------------
void gf_TechBuildDatabase () {
// Automatic Variable Declarations
// Implementation
gf_TechRegisterALLfromAbility("evolutionchamberresearch", "EvolutionChamber");
gf_TechRegisterALLfromAbility("SpireResearch", "Spire");
gf_TechRegisterALLfromAbility("ForgeResearch", "Forge");
gf_TechRegisterALLfromAbility("CyberneticsCoreResearch", "CyberneticsCore");
gf_TechRegisterALLfromAbility("EngineeringBayResearch", "EngineeringBay");
gf_TechRegisterALLfromAbility("ArmoryResearch", "Armory");
gf_TechRegisterALLfromAbility("LairResearch", "Hive");
gf_TechRegisterALLfromAbility("SpawningPoolResearch", "SpawningPool");
gf_TechRegisterALLfromAbility("RoachWarrenResearch", "RoachWarren");
gf_TechRegisterALLfromAbility("BanelingNestResearch", "BanelingNest");
gf_TechRegisterALLfromAbility("HydraliskDenResearch", "HydraliskDen");
gf_TechRegisterALLfromAbility("InfestationPitResearch", "InfestationPit");
gf_TechRegisterALLfromAbility("UltraliskCavernResearch", "UltraliskCavern");
gf_TechRegisterALLfromAbility("BarracksTechLabResearch", "BarracksTechLab");
gf_TechRegisterALLfromAbility("FactoryTechLabResearch", "FactoryTechLab");
gf_TechRegisterALLfromAbility("StarportTechLabResearch", "StarportTechLab");
gf_TechRegisterALLfromAbility("GhostAcademyResearch", "GhostAcademy");
gf_TechRegisterALLfromAbility("FusionCoreResearch", "FusionCore");
gf_TechRegisterALLfromAbility("TwilightCouncilResearch", "TwilightCouncil");
gf_TechRegisterALLfromAbility("RoboticsBayResearch", "RoboticsBay");
gf_TechRegisterALLfromAbility("TemplarArchivesResearch", "TemplarArchive");
gf_TechRegisterALLfromAbility("FleetBeaconResearch", "FleetBeacon");
}
void gf_UnitsBuildDatabase () {
// Automatic Variable Declarations
// Implementation
gf_UnitsRegisterALLfromAbility("ZergUnitCreatorMorph");
gf_UnitsRegisterALLfromAbility("TrainQueen");
gf_UnitsRegisterALLfromAbility("ZergUnitCreatorMorph22");
gf_UnitsRegisterALLfromAbility("ZergUnitCreatorMorph2");
gf_UnitsRegisterALLfromAbility("BarracksTrain");
gf_UnitsRegisterALLfromAbility("CommandCenterTrain");
gf_UnitsRegisterALLfromAbility("FactoryTrain");
gf_UnitsRegisterALLfromAbility("StarportTrain");
gf_UnitsRegisterALLfromAbility("TerranUnitCreatorTrain");
gf_UnitsRegisterALLfromAbility("GatewayTrain");
gf_UnitsRegisterALLfromAbility("NexusTrain");
gf_UnitsRegisterALLfromAbility("NexusTrainMothershipCore");
gf_UnitsRegisterALLfromAbility("RoboticsFacilityTrain");
gf_UnitsRegisterALLfromAbility("StargateTrain");
gf_UnitsRegisterALLfromAbility("ProtossUnitCreatorTrain");
gf_UnitsRegisterALLfromAbility(AbilityCommandGetAbility(AbilityCommand("CarrierHangar", 0)));
}
void gf_PreloadUnits () {
// Automatic Variable Declarations
// Implementation
libNtve_gf_PreloadUnit("Mothership", false);
}
void gf_UICustomizations () {
// Automatic Variable Declarations
// Implementation
libNtve_gf_DisplayScreenImage(1, "UI-Overlap.tga", c_triggerBlendModeNormal, 780, 240, c_anchorBottom, -90, 0);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeArmyButton, false);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeIdleWorkerButton, false);
UISetResourceVisible(PlayerGroupAll(), c_resourceTypeCustom, false);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeResourcePanel, false);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeTeamResourceButton, false);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeSupply, false);
UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeAllianceButton, false);
}
void gf_PresetSpawnPoints () {
// Automatic Variable Declarations
// Implementation
libNtve_gf_CreateUnitsWithDefaultFacing(1, "SpawnPointDummy", 0, 13, gv_spawn_pointDefault[gv_spawn_numberCurrent][13]);
UnitGroupAdd(gv_unitgroupMASTERS, UnitLastCreated());
UnitGroupAdd(gv_unitgroupSpawned, UnitLastCreated());
gv_unit_pointSPAWN[13] = UnitLastCreated();
libNtve_gf_CreateUnitsWithDefaultFacing(1, "SpawnPointDummy", 0, 14, gv_spawn_pointDefault[gv_spawn_numberCurrent][14]);
UnitGroupAdd(gv_unitgroupMASTERS, UnitLastCreated());
UnitGroupAdd(gv_unitgroupSpawned, UnitLastCreated());
gv_unit_pointSPAWN[14] = UnitLastCreated();
}
void gf_TechRegisterALLfromAbility (string lp_ability, string lp_unit) {
// Variable Declarations
int lv__intA;
// Automatic Variable Declarations
const int autoB372542C_ae = 29;
const int autoB372542C_ai = 1;
// Variable Initialization
// Implementation
lv__intA = 0;
for ( ; ( (autoB372542C_ai >= 0 && lv__intA <= autoB372542C_ae) || (autoB372542C_ai < 0 && lv__intA >= autoB372542C_ae) ) ; lv__intA += autoB372542C_ai ) {
gf_TechRegisterfromAbility(lp_ability, lv__intA, lp_unit);
}
}
void gf_TechRegisterfromAbility (string lp_ability, int lp_techNumber, string lp_unit) {
// Variable Declarations
int lv__intA;
string lv__TECH;
string lv__techNAME;
string lv__syncName;
string lv__techBTN;
int lv__techRACE;
string lv__techICON;
string lv__techICON_path;
int lv__techLEVEL;
int lv__techCOUNT;
// Automatic Variable Declarations
int autoE53DD9D0_ae;
const int autoE53DD9D0_ai = 1;
// Variable Initialization
lv__TECH = gf_TechGetfromAbility(lp_ability, lp_techNumber);
lv__techNAME = (gf_TechGetName(lv__TECH));
lv__syncName = "";
lv__techBTN = gf_ButtonGetFromAbility(lp_ability, lp_techNumber);
lv__techRACE = gf_ConvertRaceToInteger(gf_UnitTypeGetRace(lp_unit));
lv__techICON = gf_ButtonGetIcon(lv__techBTN);
lv__techICON_path = CatalogFieldValueGet(c_gameCatalogUpgrade, lv__TECH, "Icon", c_playerAny);
lv__techLEVEL = StringToInt(StringSub(lv__techNAME, StringLength(lv__techNAME), StringLength(lv__techNAME)));
// Implementation
if ((lv__techNAME != "") && (lv__TECH != "") && (lv__TECH != null)) {
if ((StringContains(lv__techNAME, "Level", c_stringAnywhere, c_stringNoCase) == true)) {
if (gf_TechIsUnused(lv__TECH, true)) {
return ;
}
lv__techCOUNT = gf_CountofTechforRace(gf_UnitTypeGetRace(lp_unit), ge_TechType_Upgrade);
gv_uPGLevelRace[lv__techCOUNT][lv__techLEVEL][lv__techRACE] = lv__TECH;
gv_upgIMGLevelRace[lv__techCOUNT][lv__techLEVEL][lv__techRACE] = lv__techICON;
gv_upgIMGLevelRace[lv__techCOUNT][0][lv__techRACE] = ((StringSub(lv__techICON_path, 1, (StringLength(lv__techICON_path) - 5)) + "0.dds"));
gv_upgMNRLLevelRace[lv__techCOUNT][lv__techLEVEL][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeMinerals);
gv_upgVSPNLevelRace[lv__techCOUNT][lv__techLEVEL][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeVespene);
gv_upgTIMELevelRace[lv__techCOUNT][lv__techLEVEL][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeTerrazine);
}
else {
autoE53DD9D0_ae = gf_CountofTechforRace(gf_UnitTypeGetRace(lp_unit), ge_TechType_Resource);
lv__intA = 0;
for ( ; ( (autoE53DD9D0_ai >= 0 && lv__intA <= autoE53DD9D0_ae) || (autoE53DD9D0_ai < 0 && lv__intA >= autoE53DD9D0_ae) ) ; lv__intA += autoE53DD9D0_ai ) {
if ((StringCompare(gf_TechGetName(lv__TECH), gf_TechGetName(gv_rESRace[lv__intA][lv__techRACE]), c_stringNoCase) == 0)) {
return ;
}
}
if (gf_TechIsUnused(lv__TECH, true)) {
return ;
}
lv__techCOUNT = gf_CountofTechforRace(gf_UnitTypeGetRace(lp_unit), ge_TechType_Resource);
gv_rESRace[lv__techCOUNT][lv__techRACE] = lv__TECH;
gv_resTIPRace[lv__techCOUNT][lv__techRACE] = (StringExternal(lv__techNAME) + ((StringExternal("Param/Value/4DF01B81") + gf_ButtonTooltip(lv__techBTN)) + (StringExternal("Param/Value/54AF38F3") + ((StringExternal("Param/Value/7AADD924") + IntToText(gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeMinerals))) + ((StringExternal("Param/Value/1814A240") + IntToText(gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeVespene))) + (StringExternal("Param/Value/F6DEF5EE") + IntToText(gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeTerrazine))))))));
gv_resIMGRace[lv__techCOUNT][lv__techRACE] = lv__techICON;
gv_resMNRLRace[lv__techCOUNT][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeMinerals);
gv_resVSPNRace[lv__techCOUNT][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeVespene);
gv_resTIMERace[lv__techCOUNT][lv__techRACE] = gf_TechGetCostfromAbility(lp_ability, lp_techNumber, c_resourceTypeTerrazine);
}
}
}
void gf_TechAddUnused (string lp_tech) {
// Variable Declarations
int lv__intA;
// Automatic Variable Declarations
const int auto7B032CFF_ae = 30;
const int auto7B032CFF_ai = 1;
// Variable Initialization
// Implementation
lv__intA = 0;
for ( ; ( (auto7B032CFF_ai >= 0 && lv__intA <= auto7B032CFF_ae) || (auto7B032CFF_ai < 0 && lv__intA >= auto7B032CFF_ae) ) ; lv__intA += auto7B032CFF_ai ) {
if ((gv_tech_unused[lv__intA] == null)) {
gv_tech_unused[lv__intA] = lp_tech;
break;
}
}
}
bool gf_TechIsUnused (string lp_tech, bool lp_logic) {
// Variable Declarations
int lv__intA;
// Automatic Variable Declarations
const int autoFE0045A6_ae = 30;
const int autoFE0045A6_ai = 1;
// Variable Initialization
// Implementation
lv__intA = 0;
for ( ; ( (autoFE0045A6_ai >= 0 && lv__intA <= autoFE0045A6_ae) || (autoFE0045A6_ai < 0 && lv__intA >= autoFE0045A6_ae) ) ; lv__intA += autoFE0045A6_ai ) {
if ((lp_tech == gv_tech_unused[lv__intA])) {
if ((lp_logic == true)) {
return true;
}
else {
return false;
}
}
}
if ((lp_logic == true)) {
return false;
}
else {
return true;
}
}
int gf_CountofTechforRace (string lp_race, int lp_techType) {
// Variable Declarations
int lv__integerA;
// Automatic Variable Declarations
int auto19586E9D_val;
const int auto78E32F86_ae = 99;
const int auto78E32F86_ai = 1;
const int auto9C0AFCAD_ae = 99;
const int auto9C0AFCAD_ai = 1;
// Variable Initialization
// Implementation
auto19586E9D_val = lp_techType;
if (auto19586E9D_val == ge_TechType_Upgrade) {
lv__integerA = 0;
for ( ; ( (auto78E32F86_ai >= 0 && lv__integerA <= auto78E32F86_ae) || (auto78E32F86_ai < 0 && lv__integerA >= auto78E32F86_ae) ) ; lv__integerA += auto78E32F86_ai ) {
if ((gv_uPGLevelRace[lv__integerA][3][gf_ConvertRaceToInteger(lp_race)] == null)) {
return (lv__integerA * 1);
}
}
}
else if (auto19586E9D_val == ge_TechType_Resource) {
lv__integerA = 0;
for ( ; ( (auto9C0AFCAD_ai >= 0 && lv__integerA <= auto9C0AFCAD_ae) || (auto9C0AFCAD_ai < 0 && lv__integerA >= auto9C0AFCAD_ae) ) ; lv__integerA += auto9C0AFCAD_ai ) {
if ((gv_rESRace[lv__integerA][gf_ConvertRaceToInteger(lp_race)] == null)) {
return lv__integerA;
}
}
}
else {
}
return lv__integerA;
}
void gf_UnitsRegisterALLfromAbility (string lp_ability) {
// Variable Declarations
int lv__intA;
// Automatic Variable Declarations
const int auto55C297D7_ae = 29;
const int auto55C297D7_ai = 1;
// Variable Initialization
// Implementation
lv__intA = 0;
for ( ; ( (auto55C297D7_ai >= 0 && lv__intA <= auto55C297D7_ae) || (auto55C297D7_ai < 0 && lv__intA >= auto55C297D7_ae) ) ; lv__intA += auto55C297D7_ai ) {
gf_UnitsRegisterfromAbility(lv__intA, lp_ability);
}
}
void gf_UnitsRegisterfromAbility (int lp_commandNumber, string lp_ability) {
// Variable Declarations
string lv__unitNAME;
string lv__unitTYPE;
string lv__unitCMD;
string lv__unitBTN;
int lv__count;
int lv__duplicate;
int lv__database;
// Automatic Variable Declarations
// Variable Initialization
lv__unitNAME = gf_UnitTypeGetNamefromAbility(lp_commandNumber, lp_ability);
lv__unitTYPE = UnitTypeFromString(lv__unitNAME);
lv__unitCMD = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, "AbilSetId", c_playerAny);
lv__unitBTN = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, "InfoArray[" + IntToString(lp_commandNumber) + "].Button.DefaultButtonFace", c_playerAny);
// Implementation
if ((lv__unitNAME != "")) {
lv__database = gf_UnitDatabaseGetDatabaseNumberbyButtonFace(lv__unitBTN);
if ((lv__database == -1)) {
lv__count = gf_CountofUnitsinDatabase();
gv_unitNAME[lv__count][0] = lv__unitNAME;
gv_unitTYPE[lv__count][0] = lv__unitTYPE;
gv_unitTIME[lv__count] = gf_UnitTypeGetTimefromAbility(lp_commandNumber, lp_ability);
gv_unitBTNFACE[lv__count] = lv__unitBTN;
gv_data_unitCMD[lv__count] = lv__unitCMD;
}
else {
lv__duplicate = gf_UnitDatabaseGetFreeDuplicatebyDatabaseNumber(lv__database);
if ((lv__duplicate != -1)) {
gv_unitNAME[lv__database][lv__duplicate] = lv__unitNAME;
gv_unitTYPE[lv__database][lv__duplicate] = lv__unitTYPE;
}
else {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaError, StringExternal("Param/Value/05E8F998"));
}
}
}
}
int gf_UnitDatabaseGetDatabaseNumberbyUnitType (string lp_unitType) {
// Variable Declarations
string lv__unitNAME;
int lv__unit;
int lv__duplicate;
// Automatic Variable Declarations
int autoF2074D91_ae;
const int autoF2074D91_ai = 1;
const int auto401308D6_ae = 9;
const int auto401308D6_ai = 1;
// Variable Initialization
lv__unitNAME = (lp_unitType);
// Implementation
autoF2074D91_ae = (gf_CountofUnitsinDatabase() - 1);
lv__unit = 0;
for ( ; ( (autoF2074D91_ai >= 0 && lv__unit <= autoF2074D91_ae) || (autoF2074D91_ai < 0 && lv__unit >= autoF2074D91_ae) ) ; lv__unit += autoF2074D91_ai ) {
lv__duplicate = 0;
for ( ; ( (auto401308D6_ai >= 0 && lv__duplicate <= auto401308D6_ae) || (auto401308D6_ai < 0 && lv__duplicate >= auto401308D6_ae) ) ; lv__duplicate += auto401308D6_ai ) {
if ((gv_unitNAME[lv__unit][lv__duplicate] == lv__unitNAME)) {
return lv__unit;
}
}
}
return -1;
}
int gf_UnitDatabaseGetDatabaseNumberbyButtonFace (string lp_unitFace) {
// Variable Declarations
string lv__unitNAME;
int lv__unit;
// Automatic Variable Declarations
int auto984CB947_ae;
const int auto984CB947_ai = 1;
// Variable Initialization
lv__unitNAME = (lp_unitFace);
// Implementation
auto984CB947_ae = (gf_CountofUnitsinDatabase() - 1);
lv__unit = 0;
for ( ; ( (auto984CB947_ai >= 0 && lv__unit <= auto984CB947_ae) || (auto984CB947_ai < 0 && lv__unit >= auto984CB947_ae) ) ; lv__unit += auto984CB947_ai ) {
if ((lp_unitFace == gv_unitBTNFACE[lv__unit])) {
return lv__unit;
}
}
return -1;
}
int gf_UnitDatabaseGetFreeDuplicatebyDatabaseNumber (int lp_databaseNumber) {
// Variable Declarations
int lv__duplicate;
// Automatic Variable Declarations
const int auto39380122_ae = 9;
const int auto39380122_ai = 1;
// Variable Initialization
// Implementation
lv__duplicate = 0;
for ( ; ( (auto39380122_ai >= 0 && lv__duplicate <= auto39380122_ae) || (auto39380122_ai < 0 && lv__duplicate >= auto39380122_ae) ) ; lv__duplicate += auto39380122_ai ) {
if ((gv_unitTYPE[lp_databaseNumber][lv__duplicate] == null)) {
return lv__duplicate;
}
}
return -1;
}
string gf_UnitDatabaseGetUnitNamebyDatabaseNumber (int lp_databaseNumber) {
// Automatic Variable Declarations
// Implementation
if ((lp_databaseNumber >= 0) && (lp_databaseNumber <= 150)) {
return gv_unitNAME[lp_databaseNumber][0];
}
else {
return "";
}
}
string gf_UnitDatabaseGetUnitTypebyDatabaseNumber (int lp_databaseNumber) {
// Automatic Variable Declarations
// Implementation
if ((lp_databaseNumber >= 0) && (lp_databaseNumber <= 150)) {
return gv_unitTYPE[lp_databaseNumber][0];
}
else {
return null;
}
}
int gf_CountofUnitsinDatabase () {
// Variable Declarations
int lv__integerA;
// Automatic Variable Declarations
const int autoA1BDA5D2_ae = 150;
const int autoA1BDA5D2_ai = 1;
// Variable Initialization
// Implementation
lv__integerA = 0;
for ( ; ( (autoA1BDA5D2_ai >= 0 && lv__integerA <= autoA1BDA5D2_ae) || (autoA1BDA5D2_ai < 0 && lv__integerA >= autoA1BDA5D2_ae) ) ; lv__integerA += autoA1BDA5D2_ai ) {
if ((gv_unitTYPE[lv__integerA][0] == null)) {
return lv__integerA;
}
}
UIDisplayMessage(PlayerGroupAll(), c_messageAreaError, StringExternal("Param/Value/3603482D"));
return -1;
}
int gf_UnitTypeGetTimeCost (string lp_unitType) {
// Variable Declarations
string lv__unitNAME;
int lv__intA;
// Automatic Variable Declarations
int autoFC49C35A_ae;
const int autoFC49C35A_ai = 1;
// Variable Initialization
lv__unitNAME = (lp_unitType);
// Implementation
autoFC49C35A_ae = (gf_CountofUnitsinDatabase() - 1);
lv__intA = 0;
for ( ; ( (autoFC49C35A_ai >= 0 && lv__intA <= autoFC49C35A_ae) || (autoFC49C35A_ai < 0 && lv__intA >= autoFC49C35A_ae) ) ; lv__intA += autoFC49C35A_ai ) {
if ((gv_unitNAME[lv__intA][0] == lv__unitNAME)) {
return gv_unitTIME[lv__intA];
}
}
return 0;
}
void gf_SetUnitSpecials (unit lp_unit) {
// Automatic Variable Declarations
// Implementation
if ((UnitGroupHasUnit(gv_unitgroupMASTERS, lp_unit) == false)) {
if ((libNtve_gf_UnitInRegion(lp_unit, gv_spawn_regionCurrent) == false)) {
gf_RemoveUnitRequest(lp_unit, ge_RemoveUnitRequestOptions_CancelMorph);
}
else {
if ((UnitGetType(lp_unit) == "Interceptor")) {
UnitSetState(lp_unit, c_unitStateTargetable, true);
UnitSetState(lp_unit, c_unitStateSelectable, true);
}
if ((UnitTypeTestAttribute(UnitGetType(lp_unit), c_unitAttributeSummoned) == false)) {
if ((gv_stageBATTLE == false)) {
UnitGroupAdd(gv_unitgroupSpawned, lp_unit);
if ((gf_SettingsOptionEnabled(1, 1, UnitGetOwner(lp_unit)) == true)) {
UnitSetPropertyFixed(lp_unit, c_unitPropEnergyPercent, 100.0);
}
if ((gf_SettingsOptionEnabled(3, 1, UnitGetOwner(lp_unit)) == true)) {
UnitBehaviorAdd(lp_unit, "SuppressCollision", lp_unit, 1);
}
}
else {
UnitBehaviorRemove(lp_unit, "SuppressCollision", 1);
}
}
}
}
}
void gf_RemoveUnitSpecials (unit lp_unit) {
// Automatic Variable Declarations
// Implementation
if ((UnitGroupHasUnit(gv_unitgroupMASTERS, lp_unit) == false)) {
if ((libNtve_gf_UnitInRegion(lp_unit, gv_spawn_regionCurrent) == false)) {
UnitRemove(lp_unit);
}
else {
if ((UnitTypeTestAttribute(UnitGetType(lp_unit), c_unitAttributeSummoned) == false)) {
UnitBehaviorRemove(lp_unit, "SuppressCollision", 1);
}
}
}
}
void gf_RemoveUnitsRequest (unitgroup lp_unitGroup, int lp_options) {
// Variable Declarations
int lv__stack;
int lv__breathe;
unitgroup lv__group;
// Automatic Variable Declarations
int auto48A0FDC6_ae;
int auto48A0FDC6_ai;
unitgroup autoE8DF1D05_g;
int autoE8DF1D05_u;
unit autoE8DF1D05_var;
// Variable Initialization
lv__breathe = 20;
lv__group = lp_unitGroup;
// Implementation
auto48A0FDC6_ae = UnitGroupCount(lp_unitGroup, c_unitCountAll);
auto48A0FDC6_ai = lv__breathe;
lv__stack = 1;
for ( ; ( (auto48A0FDC6_ai >= 0 && lv__stack <= auto48A0FDC6_ae) || (auto48A0FDC6_ai < 0 && lv__stack >= auto48A0FDC6_ae) ) ; lv__stack += auto48A0FDC6_ai ) {
autoE8DF1D05_g = UnitGroupFilter(null, c_playerAny, lp_unitGroup, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), lv__breathe);
autoE8DF1D05_u = UnitGroupCount(autoE8DF1D05_g, c_unitCountAll);
for (;; autoE8DF1D05_u -= 1) {
autoE8DF1D05_var = UnitGroupUnitFromEnd(autoE8DF1D05_g, autoE8DF1D05_u);
if (autoE8DF1D05_var == null) { break; }
gf_RemoveUnitRequest(autoE8DF1D05_var, lp_options);
}
Wait(0.001, c_timeReal);
}
}
void gf_RemoveUnitRequest (unit lp_unit, int lp_options) {
// Variable Declarations
int lv__owner;
int lv__presets;
// Automatic Variable Declarations
// Variable Initialization
lv__presets = 3;
// Implementation
if ((UnitGroupHasUnit(gv_unitgroupMASTERS, lp_unit) == false) && (UnitGroupHasUnit(gv_unitgroupSPAWNERS, lp_unit) == false)) {
gf_DebugMessage((StringExternal("Param/Value/05B969AA") + (UnitTypeGetName(UnitGetType(lp_unit)) + (StringExternal("Param/Value/9B2E47BC") + IntToText(UnitGetOwner(lp_unit))))));
lv__owner = UnitGetOwner(lp_unit);
UnitSetPosition(lp_unit, PointFromId(6), false);
UnitSetOwner(lp_unit, 0, false);
if (gf_PresetFlagsCheck((lp_options), gv_flagsRemoveUnitRequestOptions, 3)) {
UnitIssueOrder(lp_unit, Order(AbilityCommand("que1", 0)), c_orderQueueReplace);
}
if (gf_PresetFlagsCheck((lp_options), gv_flagsRemoveUnitRequestOptions, 2)) {
gf_UnitCounterUpdate(-1, UnitGetType(lp_unit), lv__owner);
}
if (gf_PresetFlagsCheck((lp_options), gv_flagsRemoveUnitRequestOptions, 1)) {
gf_ResourceDialogAddUnitType(UnitGetType(lp_unit), 1, ge_IncrementationType_Other, lv__owner);
}
if ((UnitGetType(lp_unit) == "Carrier")) {
gf_ResourceDialogAddUnitType("Interceptor", UnitMagazineCount(lp_unit, "CarrierHangar"), ge_IncrementationType_Other, lv__owner);
}
UnitRemove(lp_unit);
}
else {
gf_DebugMessage((StringExternal("Param/Value/CFE2A477") + (UnitTypeGetName(UnitGetType(lp_unit)) + (StringExternal("Param/Value/C50E760A") + IntToText(UnitGetOwner(lp_unit))))));
}
}
void gf_AggressorUnitsAttackOppositeDirection () {
// Variable Declarations
int lv__intA;
// Automatic Variable Declarations
const int auto36F50CBB_ae = 15;
const int auto36F50CBB_ai = 1;
unitgroup auto80C66F30_g;
int auto80C66F30_u;
unit auto80C66F30_var;
// Variable Initialization
// Implementation
lv__intA = 0;
for ( ; ( (auto36F50CBB_ai >= 0 && lv__intA <= auto36F50CBB_ae) || (auto36F50CBB_ai < 0 && lv__intA >= auto36F50CBB_ae) ) ; lv__intA += auto36F50CBB_ai ) {
if ((PlayerGroupHasPlayer(gv_playerGroupAGGRESSOR, lv__intA) == true) && (gv_stageBATTLE == true)) {
auto80C66F30_g = UnitGroup(null, lv__intA, gv_spawn_regionCurrent, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto80C66F30_u = UnitGroupCount(auto80C66F30_g, c_unitCountAll);
for (;; auto80C66F30_u -= 1) {
auto80C66F30_var = UnitGroupUnitFromEnd(auto80C66F30_g, auto80C66F30_u);
if (auto80C66F30_var == null) { break; }
if ((UnitOrder(auto80C66F30_var, 1) == null) && (UnitOrder(auto80C66F30_var, 0) == null)) {
UnitIssueOrder(auto80C66F30_var, OrderTargetingPoint(AbilityCommand("attack", 0), gv_playerSPAWN[gf_OppositePlayer(lv__intA)]), c_orderQueueReplace);
}
}