Skip to content

Commit

Permalink
Add an overridable function to X2AbilityToHitCalc_StandardAim to allo…
Browse files Browse the repository at this point in the history
…w additional hit modifiers
  • Loading branch information
Iridar authored Oct 28, 2023
1 parent 7858d92 commit 5c5b943
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,14 @@ protected function int GetHitChance(XComGameState_Ability kAbility, AvailableTar
}
}

// Start Issue #1271
/// HL-Docs: feature:GetAdditionalHitModifiers; issue:1271; tags:tactical
/// This feature adds a method that can be used by subclasses to apply
/// additional hit modifiers without having to override and copy paste
/// the entire `GetHitChance()` function.
GetAdditionalHitModifiers_CH(kAbility, kTarget, m_ShotBreakdown, bDebugLog);
// End Issue #1271

// Final multiplier based on end Success chance
if (bReactionFire && !bGuaranteedHit)
{
Expand Down Expand Up @@ -1026,6 +1034,14 @@ function ECoverType NextTileOverCoverInSameDirection(const out TTile SourceTile,
return BestCover;
}

/// HL-Docs: ref:GetAdditionalHitModifiers
/// Override this method in subclasses to apply additional hit modifiers.
/// Using the existing `AddModifier()` function is recommended, for example:
/// ```unrealscript
/// AddModifier(10, "localized reason", m_ShotBreakdown, eHit_Success, bDebugLog);
/// ```
function GetAdditionalHitModifiers_CH(XComGameState_Ability kAbility, AvailableTarget kTarget, optional out ShotBreakdown m_ShotBreakdown, optional bool bDebugLog = false) {}

DefaultProperties
{
bAllowCrit=true
Expand Down

0 comments on commit 5c5b943

Please sign in to comment.