Skip to content

Commit

Permalink
Add Forbidden Weapon Race Swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 28, 2024
1 parent 5cce715 commit fa1fd14
Show file tree
Hide file tree
Showing 14 changed files with 5,638 additions and 4,598 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Components>
<Optimized/>
<DataComponent Type="gada">GameData</DataComponent>
<DataComponent Type="text" Locale="enUS">GameText</DataComponent>
<DataComponent Type="info">DocumentInfo</DataComponent>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ void gf_RawSolaritePickupQ (unit lp_cHOSEN_UNIT);
//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_FactionSwapInit;
trigger gt_onDifficultyCasual;
trigger gt_onDifficultyNormal;
trigger gt_onDifficultyHard;
Expand Down Expand Up @@ -442,20 +443,38 @@ bool auto_gf_RescueSentryUnits_TriggerFunc (bool testConds, bool runActions) {
point lp_tARGET = auto_gf_RescueSentryUnits_lp_tARGET;
bool lp_cHOSEN_TRANSMISSION = auto_gf_RescueSentryUnits_lp_cHOSEN_TRANSMISSION;

// Variable Declarations
string lv_unitType;

// Automatic Variable Declarations
string autoA063F3FF_val;
unitgroup auto9D2DD649_g;
int auto9D2DD649_u;
unit auto9D2DD649_var;
unitgroup autoAEE0432B_g;
int autoAEE0432B_u;
unit autoAEE0432B_var;

// Variable Initialization

// Implementation
if ((lp_cHOSEN_TRANSMISSION == true)) {
TriggerExecute(gt_TrackSentryStasisQ, true, false);
}

auto9D2DD649_g = UnitGroup("AP_SentryAiur", 0, lp_cHOSEN_REGION, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoA063F3FF_val = libABFE498B_gv_aP_Triggers_Option_overridePlayerRace;
if (autoA063F3FF_val == "Neut") {
lv_unitType = "AP_SentryAiur";
}
else if (autoA063F3FF_val == "Terr") {
lv_unitType = "AP_MercMedic";
}
else if (autoA063F3FF_val == "Zerg") {
lv_unitType = "AP_InfestedMedic";
}
else {
}
auto9D2DD649_g = UnitGroup(lv_unitType, 0, lp_cHOSEN_REGION, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto9D2DD649_u = UnitGroupCount(auto9D2DD649_g, c_unitCountAll);
for (;; auto9D2DD649_u -= 1) {
auto9D2DD649_var = UnitGroupUnitFromEnd(auto9D2DD649_g, auto9D2DD649_u);
Expand All @@ -468,7 +487,7 @@ bool auto_gf_RescueSentryUnits_TriggerFunc (bool testConds, bool runActions) {
}

Wait(3.0, c_timeAI);
autoAEE0432B_g = UnitGroup("AP_SentryAiur", 0, lp_cHOSEN_REGION, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoAEE0432B_g = UnitGroup(lv_unitType, 0, lp_cHOSEN_REGION, UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoAEE0432B_u = UnitGroupCount(autoAEE0432B_g, c_unitCountAll);
for (;; autoAEE0432B_u -= 1) {
autoAEE0432B_var = UnitGroupUnitFromEnd(autoAEE0432B_g, autoAEE0432B_u);
Expand Down Expand Up @@ -771,6 +790,131 @@ void gf_RawSolaritePickupQ (unit lp_cHOSEN_UNIT) {
TriggerQueueExit();
}

//--------------------------------------------------------------------------------------------------
// Trigger: Faction Swap Init
//--------------------------------------------------------------------------------------------------
bool gt_FactionSwapInit_Func (bool testConds, bool runActions) {
// Variable Declarations
unit lv_unit;

// Automatic Variable Declarations
unitgroup autoAEA83B52_g;
int autoAEA83B52_u;
unitgroup auto6B1E3CF4_g;
int auto6B1E3CF4_u;
unitgroup auto54F6E4CA_g;
int auto54F6E4CA_u;
unitgroup auto38F70F7E_g;
int auto38F70F7E_u;
unitgroup auto0E620730_g;
int auto0E620730_u;
unitgroup autoFEA089F7_g;
int autoFEA089F7_u;
unitgroup auto1CFDDE0C_g;
int auto1CFDDE0C_u;
unitgroup autoAD76A4AC_g;
int autoAD76A4AC_u;

// Variable Initialization

// Actions
if (!runActions) {
return true;
}

if ((libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Neut")) {
lib15EF4C78_gf_RemoveUnusedStartingUnits(UnitGroupFromId(5), "Prot", false);
}
else {
libABFE498B_gv_aP_Triggers_skipCutscenes = true;
lib15EF4C78_gf_RemoveUnusedStartingUnits(UnitGroupFromId(5), libABFE498B_gv_aP_Triggers_Option_overridePlayerRace, false);
if ((libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Terr")) {
PlayerSetRace(gv_pLAYER_01_USER, "Terr");
lib5BD4895D_gf_AP_Core_MapConfig_setPlayerFaction(gv_pLAYER_01_USER, lib5BD4895D_gv_aP_Core_Faction_RAYNORS_RAIDERS);
auto0E620730_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(4), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto0E620730_u = UnitGroupCount(auto0E620730_g, c_unitCountAll);
for (;; auto0E620730_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(auto0E620730_g, auto0E620730_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_MercMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
autoFEA089F7_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(26), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoFEA089F7_u = UnitGroupCount(autoFEA089F7_g, c_unitCountAll);
for (;; autoFEA089F7_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(autoFEA089F7_g, autoFEA089F7_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_MercMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
auto1CFDDE0C_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(28), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto1CFDDE0C_u = UnitGroupCount(auto1CFDDE0C_g, c_unitCountAll);
for (;; auto1CFDDE0C_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(auto1CFDDE0C_g, auto1CFDDE0C_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_MercMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
autoAD76A4AC_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(32), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoAD76A4AC_u = UnitGroupCount(autoAD76A4AC_g, c_unitCountAll);
for (;; autoAD76A4AC_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(autoAD76A4AC_g, autoAD76A4AC_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_MercMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
}
else {
if ((libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Zerg")) {
PlayerSetRace(gv_pLAYER_01_USER, "Zerg");
lib5BD4895D_gf_AP_Core_MapConfig_setPlayerFaction(gv_pLAYER_01_USER, lib5BD4895D_gv_aP_Core_Faction_KERRIGAN_SWARM);
autoAEA83B52_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(4), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoAEA83B52_u = UnitGroupCount(autoAEA83B52_g, c_unitCountAll);
for (;; autoAEA83B52_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(autoAEA83B52_g, autoAEA83B52_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_InfestedMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
auto6B1E3CF4_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(26), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto6B1E3CF4_u = UnitGroupCount(auto6B1E3CF4_g, c_unitCountAll);
for (;; auto6B1E3CF4_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(auto6B1E3CF4_g, auto6B1E3CF4_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_InfestedMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
auto54F6E4CA_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(28), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto54F6E4CA_u = UnitGroupCount(auto54F6E4CA_g, c_unitCountAll);
for (;; auto54F6E4CA_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(auto54F6E4CA_g, auto54F6E4CA_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_InfestedMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
auto38F70F7E_g = UnitGroup("AP_SentryAiur", c_playerAny, RegionFromId(32), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto38F70F7E_u = UnitGroupCount(auto38F70F7E_g, c_unitCountAll);
for (;; auto38F70F7E_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(auto38F70F7E_g, auto38F70F7E_u);
if (lv_unit == null) { break; }
libNtve_gf_ReplaceUnit(lv_unit, "AP_InfestedMedic", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
UnitBehaviorAddPlayer(libNtve_gf_LastReplacedUnit(), "PurifierStasisLongTerm", gv_pLAYER_01_USER, 1);
}
}

}
libLbty_gf_OrderWorkerstoGatherNearbyResources(RegionEntireMap(), gv_pLAYER_01_USER);
lib15EF4C78_gf_AP_Player_UtilTownHallAutoRally(gv_pLAYER_01_USER);
}
return true;
}

//--------------------------------------------------------------------------------------------------
void gt_FactionSwapInit_Init () {
gt_FactionSwapInit = TriggerCreate("gt_FactionSwapInit_Func");
TriggerAddEventGeneric(gt_FactionSwapInit, lib5BD4895D_gv_aP_Core_LOAD_FINISHED_EVENT);
}

//--------------------------------------------------------------------------------------------------
// Trigger: onDifficultyCasual
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -5082,7 +5226,7 @@ bool gt_IntroQ_Func (bool testConds, bool runActions) {
TriggerEnable(TriggerGetCurrent(), false);
TriggerQueueEnter();
TriggerExecute(gt_IntroSetup, true, true);
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false)) {
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false) && (libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Neut")) {
TriggerExecute(gt_IntroCinematic, true, true);
TriggerExecute(gt_IntroCinematicEnd, true, true);
}
Expand Down Expand Up @@ -5736,6 +5880,7 @@ void gt_VictoryVaultAnimations_Init () {
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
gt_FactionSwapInit_Init();
gt_onDifficultyCasual_Init();
gt_onDifficultyNormal_Init();
gt_onDifficultyHard_Init();
Expand Down
Loading

0 comments on commit fa1fd14

Please sign in to comment.