Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,51 @@ static function UnitPawnPostInitAnimTree(XComGameState_Unit UnitState, XComUnitP
}
/// End Issue #455

// Start Issue #953
/// HL-Docs: feature:ModifyMaxSquadSize; issue:953; tags:
/// The DLC hook `ModifyMaxSquadSize` is called from `X2StrategyGameRulesetDataStructures:GetMaxSoldiersAllowedOnMission`. It gives
/// mods a chance to modify the components that make up the maximum squad size:
///
/// * `MissionDefLimit`: `MaxBaseSize` was imposed by the mission definition
/// * `MaxBaseSize`: Base max squad size
/// * `SquadSizeUpgradeMod`: Modifier from GTS squad size purchases. `0` if `MissionDefLimit == true`
/// * `SituationMod`: Modifiers from SITREPs and the intel purchase (network tower mission)
/// * `SitRepMax`: Maximum squad size imposed by SITREPs. Will be `MaxInt` if no SITREP limits squad size
///
/// Example usage:
///
/// ```unrealscript
/// static function ModifyMaxSquadSize(XComGameState_MissionSite MissionSite, bool MissionDefLimit, out int MaxBaseSize, out int SquadSizeUpgradeMod, out int SituationMod, out int SitRepMax)
/// {
/// local XComGameState_HeadquartersXCom XComHQ;
///
/// if (MissionDefLimit) return; // Mission definition imposes a maximum -- probably for a good reason
///
/// XComHQ = `XCOMHQ;
/// if (`XCOMHISTORY.GetCurrentHistoryIndex() > -1 && XComHQ != none) // cargo-culted from original code
/// {
/// if (XComHQ.SoldierUnlockTemplates.Find('SquadSizeIIIUnlock') != INDEX_NONE) { SquadSizeUpgradeMod += 1; }
/// if (XComHQ.SoldierUnlockTemplates.Find('SquadSizeIVUnlock') != INDEX_NONE) { SquadSizeUpgradeMod += 1; }
/// }
///
/// if (MissionSite != none && MissionSite.GeneratedMission.Mission.MissionName == 'AssaultFortressLeadup')
/// {
/// // Leviathan gets four more soldiers because reasons
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I had no trouble following these docs and I find the provided explanations perfectly sufficient, but perhaps they should be a bit lighter on the joke-ish wordings like "cargo cult" and "because reasons".

/// SituationMod += 4;
/// }
/// }
/// ```
///
/// The final max squad size will be calculated with the expression `Min(Max(1, MaxBaseSize + SquadSizeUpgradeMod + SituationMod), SitRepMax)`.
///
/// This hook is best combined with `GetValidFloorSpawnLocations` or `SPAWN_EXTRA_TILE` (TODO: Docs for these) in order to support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we'd want to ship a "TODO", but I assume this is here just because it's a Draft PR? It is marked as "ready for review", so I'm getting some mixed signals here.

/// large enough spawn points.
static function ModifyMaxSquadSize(XComGameState_MissionSite MissionSite, bool MissionDefLimit, out int MaxBaseSize, out int SquadSizeUpgradeMod, out int SituationMod, out int SitRepMax)
{
return;
}
// End Issue #953

/// Start Issue #511
/// <summary>
/// Allowes mod to define dlc run order dependencies
Expand Down
Loading