Skip to content

Commit

Permalink
Add Sky Shield Race Swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 24, 2024
1 parent 3651bee commit 6b78458
Show file tree
Hide file tree
Showing 8 changed files with 2,714 additions and 2,548 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ void gf_SpawnUnitsforIntro (string lp_unitType, int lp_count, point lp_location)
//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_FactionSwapInit;
trigger gt_onDifficultyCasual;
trigger gt_onDifficultyNormal;
trigger gt_onDifficultyHard;
Expand Down Expand Up @@ -1613,6 +1614,45 @@ bool auto_gf_SpawnUnitsforIntro_TriggerFunc (bool testConds, bool runActions) {
return true;
}

//--------------------------------------------------------------------------------------------------
// Trigger: Faction Swap Init
//--------------------------------------------------------------------------------------------------
bool gt_FactionSwapInit_Func (bool testConds, bool runActions) {
// Automatic Variable Declarations
// 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);
}
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);
}

}
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 @@ -2111,6 +2151,8 @@ bool gt_Initialization_Func (bool testConds, bool runActions) {
unit lv_unit;

// Automatic Variable Declarations
unitgroup autoD4A42770_g;
int autoD4A42770_u;
unitgroup autoB23963B4_g;
int autoB23963B4_u;

Expand All @@ -2126,16 +2168,24 @@ bool gt_Initialization_Func (bool testConds, bool runActions) {
TriggerExecute(gt_Init05Environment, true, false);
TriggerExecute(gt_Init06Difficulties, true, false);
TriggerExecute(gt_IntroQ, true, true);
if ((libABFE498B_gv_aP_Triggers_Option_takeOverAIAllies == false)) {
if ((libABFE498B_gv_aP_Triggers_Option_takeOverAIAllies == true)) {
autoB23963B4_g = UnitGroupFromId(1);
autoB23963B4_u = UnitGroupCount(autoB23963B4_g, c_unitCountAll);
for (;; autoB23963B4_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(autoB23963B4_g, autoB23963B4_u);
if (lv_unit == null) { break; }
libNtve_gf_ShowHideUnit(lv_unit, true);
}
}
else {
autoD4A42770_g = UnitGroupFromId(1);
autoD4A42770_u = UnitGroupCount(autoD4A42770_g, c_unitCountAll);
for (;; autoD4A42770_u -= 1) {
lv_unit = UnitGroupUnitFromEnd(autoD4A42770_g, autoD4A42770_u);
if (lv_unit == null) { break; }
UnitRemove(lv_unit);
}
}

TriggerExecute(gt_StartGameQ, true, false);
return true;
}
Expand Down Expand Up @@ -5398,7 +5448,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 @@ -6004,7 +6054,7 @@ bool gt_MidOrbitalStrikeQ_Func (bool testConds, bool runActions) {

TriggerEnable(TriggerGetCurrent(), false);
TriggerQueueEnter();
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false)) {
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false) && (libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Neut")) {
TriggerExecute(gt_MidOrbitalStrikeSetup, true, true);
TriggerExecute(gt_MidOrbitalStrikeCinematic, true, true);
TriggerExecute(gt_MidOrbitalStrikeCinematicEnd, true, true);
Expand Down Expand Up @@ -6599,6 +6649,7 @@ void gt_VictoryMusic_Init () {
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
gt_FactionSwapInit_Init();
gt_onDifficultyCasual_Init();
gt_onDifficultyNormal_Init();
gt_onDifficultyHard_Init();
Expand Down
Loading

0 comments on commit 6b78458

Please sign in to comment.