Skip to content

Commit

Permalink
Add Purification Race Swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Nov 30, 2024
1 parent b031bd6 commit 6fccfaa
Show file tree
Hide file tree
Showing 14 changed files with 12,447 additions and 13,538 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 @@ -12,6 +12,7 @@ include "TriggerLibs/VoidLib"
include "TriggerLibs/VoidCampaignLib"
include "TriggerLibs/VoidCampaignMissionLib"
include "TriggerLibs/VoidCampaignUILib"
include "Lib15EF4C78"
include "Lib30B9E51A"
include "Lib5BD4895D"
include "LibABFE498B"
Expand All @@ -28,6 +29,7 @@ void InitLibs () {
libVoiC_InitLib();
libVCMI_InitLib();
libVCUI_InitLib();
lib15EF4C78_InitLib();
lib30B9E51A_InitLib();
lib5BD4895D_InitLib();
libABFE498B_InitLib();
Expand Down Expand Up @@ -201,6 +203,7 @@ void gf_WarpInPurifiersCinematic (int lp_stasisChamberIndex);
//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_FactionSwapInit;
trigger gt_onDifficultyCasual;
trigger gt_onDifficultyNormal;
trigger gt_onDifficultyHard;
Expand Down Expand Up @@ -1352,6 +1355,45 @@ bool auto_gf_WarpInPurifiersCinematic_TriggerFunc (bool testConds, bool runActio
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(4), "Prot", false);
}
else {
libABFE498B_gv_aP_Triggers_skipCutscenes = true;
lib15EF4C78_gf_RemoveUnusedStartingUnits(UnitGroupFromId(4), 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");
TriggerAddEventGeneric(gt_FactionSwapInit, lib5BD4895D_gv_aP_Core_LOAD_FINISHED_EVENT);
}

//--------------------------------------------------------------------------------------------------
// Trigger: onDifficultyCasual
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1462,24 +1504,8 @@ bool gt_onDifficultyBrutal_Func (bool testConds, bool runActions) {
unit lv_currentUnit;

// Automatic Variable Declarations
unitgroup auto895C3FB3_g;
int auto895C3FB3_u;

// Variable Initialization

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

auto895C3FB3_g = UnitGroupFromId(4);
auto895C3FB3_u = UnitGroupCount(auto895C3FB3_g, c_unitCountAll);
for (;; auto895C3FB3_u -= 1) {
lv_currentUnit = UnitGroupUnitFromEnd(auto895C3FB3_g, auto895C3FB3_u);
if (lv_currentUnit == null) { break; }
AIToggleBulliesInRegion(UnitGetOwner(lv_currentUnit), RegionCircle(UnitGetPosition(lv_currentUnit), 0.5), false);
UnitRemove(lv_currentUnit);
}
return true;
}

Expand Down Expand Up @@ -2235,7 +2261,7 @@ bool gt_TransmissionPurifierCoreMatrixQ_Func (bool testConds, bool runActions) {
for (;; auto24921BCC_u -= 1) {
auto24921BCC_var = UnitGroupUnitFromEnd(auto24921BCC_g, auto24921BCC_u);
if (auto24921BCC_var == null) { break; }
if ((PowerLevel(gv_pLAYER_01_USER, UnitGetPosition(auto24921BCC_var), "PowerSource") == 0) && (libLotv_gf_DifficultyValueInt2(1, 1, 0, 0) == 1)) {
if ((PowerLevel(gv_pLAYER_01_USER, UnitGetPosition(auto24921BCC_var), "PowerSource") == 0) && (libLotv_gf_DifficultyValueInt2(1, 1, 0, 0) == 1) && (libABFE498B_gv_aP_Triggers_Option_overridePlayerRace == "Neut")) {
libVCMI_gf_AttachReticleEffectAndTextTagOnUnit(libVCMI_ge_CampaginReticleType_ProtossMainObjective, libVCMI_ge_CampaginReticleSize_Medium, StringToText(""), auto24921BCC_var, "Ref_Center");
libHots_gf_StoreActorForUnit(auto24921BCC_var, 1, libNtve_gf_ActorLastCreated());
UnitGroupAdd(gv_unpoweredDefenses, auto24921BCC_var);
Expand Down Expand Up @@ -6270,7 +6296,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 @@ -7750,6 +7776,7 @@ void gt_VictoryZealotsandZerg_Init () {
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
gt_FactionSwapInit_Init();
gt_onDifficultyCasual_Init();
gt_onDifficultyNormal_Init();
gt_onDifficultyHard_Init();
Expand Down
Loading

0 comments on commit 6fccfaa

Please sign in to comment.