Skip to content

Commit

Permalink
Add Temple of Unification race swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 29, 2024
1 parent bd0a9ef commit 5c49cdf
Show file tree
Hide file tree
Showing 8 changed files with 5,482 additions and 5,290 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void gf_LockBullyUpgrades (int lp_index);
//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_FactionSwapInit;
trigger gt_onDifficultyCasual;
trigger gt_onDifficultyNormal;
trigger gt_onDifficultyHard;
Expand Down Expand Up @@ -860,6 +861,44 @@ bool auto_gf_LockBullyUpgrades_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, true);
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");
}

//--------------------------------------------------------------------------------------------------
// Trigger: onDifficultyCasual
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -946,7 +985,7 @@ bool gt_onDifficultyHard_Func (bool testConds, bool runActions) {
return true;
}

auto8FA5AB69_g = UnitGroupFromId(2);
auto8FA5AB69_g = UnitGroupFromId(3);
auto8FA5AB69_u = UnitGroupCount(auto8FA5AB69_g, c_unitCountAll);
for (;; auto8FA5AB69_u -= 1) {
lv_currentUnit = UnitGroupUnitFromEnd(auto8FA5AB69_g, auto8FA5AB69_u);
Expand Down Expand Up @@ -1037,6 +1076,11 @@ bool gt_Initialization_Func (bool testConds, bool runActions) {
TriggerExecute(gt_Init04MusicSound, true, false);
TriggerExecute(gt_Init05Environment, true, false);
TriggerExecute(gt_Init06Difficulties, true, false);
UnitSetPropertyFixed(UnitFromId(1690119034), c_unitPropEnergyPercent, 100.0);
UnitSetPropertyFixed(UnitFromId(1349492688), c_unitPropEnergyPercent, 100.0);
UnitSetPropertyFixed(UnitFromId(1074008513), c_unitPropEnergyPercent, 100.0);
UnitSetPropertyFixed(UnitFromId(1530677958), c_unitPropEnergyPercent, 100.0);
TriggerExecute(gt_FactionSwapInit, true, true);
TriggerExecute(gt_IntroQ, true, true);
TriggerExecute(gt_StartGameQ, true, false);
return true;
Expand Down Expand Up @@ -3556,7 +3600,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 @@ -3784,7 +3828,7 @@ bool gt_IntroCleanup_Func (bool testConds, bool runActions) {
TriggerStop(gt_IntroCapture2);
GameTimeOfDayPause(false);
PlayerSetState(gv_pLAYER_01_USER, c_playerStateXPGain, true);
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false)) {
if ((libABFE498B_gv_aP_Triggers_skipCutscenes == false) && (libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Neut")) {
UnitSetPropertyFixed(UnitFromId(190), c_unitPropResources, gv_introMinerals[1]);
UnitSetPropertyFixed(UnitFromId(185), c_unitPropResources, gv_introMinerals[2]);
UnitSetPropertyFixed(UnitFromId(186), c_unitPropResources, gv_introMinerals[3]);
Expand Down Expand Up @@ -4174,6 +4218,7 @@ void gt_VictoryCleanup_Init () {
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
gt_FactionSwapInit_Init();
gt_onDifficultyCasual_Init();
gt_onDifficultyNormal_Init();
gt_onDifficultyHard_Init();
Expand Down
Loading

0 comments on commit 5c49cdf

Please sign in to comment.