-
Notifications
You must be signed in to change notification settings - Fork 71
Add ModifyMaxSquadSize DLC hook #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
robojumper
wants to merge
4
commits into
X2CommunityCore:master
Choose a base branch
from
robojumper:953-squad-size
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
/// 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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".