Skip to content

Commit

Permalink
Added a boolean value to CHHelpers which can be set by other mods in …
Browse files Browse the repository at this point in the history
…XComGame.ini to disable the additional 50% healing the game automatically gives to soldiers at the end of a mission when beta strike is active. Updated code in XCGS_Unit to use the new bool variable. If the variable is false, or doesn't exist , the base game behaviour will be retained.
  • Loading branch information
BlackDog86 committed Jul 12, 2023
1 parent d35f137 commit cd0fba8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions X2WOTCCommunityHighlander/Config/XComGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,7 @@ bEnableVersionDisplay=true
; destroying smoke trails (and similar) prematurely.
; Values below 5 (seconds) will be ignored.
;ProjectileParticleSystemExpirationDefaultOverride=60

;;; HL-Docs: ref:BetaStrikeEndTacticalHeal;
;;; With Beta Strike enabled, soldiers are normally immediately healed for 50% of their missing HP after a mission. Uncomment this to disable this behavior.
;bDisableBetaStrikePostMissionHealing=true
3 changes: 3 additions & 0 deletions X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ var config name PlaceEvacZoneAbilityName;
// Variable for Issue #854
var config float CameraRotationAngle;

// Variable for Issue #917
var config bool bDisableBetaStrikePostMissionHealing;

// Start Issue #669
//
/// HL-Docs: feature:GrenadesRequiringUnitsOnTargetedTiles; issue:669; tags:tactical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2647,13 +2647,16 @@ function EndTacticalHealthMod()
local float HealthPercent, NewHealth, SWHeal;
local int RoundedNewHealth, HealthLost, NewMissingHP;

HealthLost = HighestHP - LowestHP;

if (LowestHP > 0 && `SecondWaveEnabled('BetaStrike')) // Immediately Heal 1/2 Damage
HealthLost = HighestHP - LowestHP;
/// HL-Docs: feature:BetaStrikeEndTacticalHeal; Issue:917;
if (LowestHP > 0 && `SecondWaveEnabled('BetaStrike')) // Immediately Heal 1/2 Damage
{
SWHeal = FFloor( HealthLost / 2 );
LowestHP += SWHeal;
HealthLost -= SWHeal;
if (!class'CHHelpers'.default.bDisableBetaStrikePostMissionHealing)
{
SWHeal = FFloor( HealthLost / 2 );
LowestHP += SWHeal;
HealthLost -= SWHeal;
}
}

// If Dead or never injured, return
Expand Down

0 comments on commit cd0fba8

Please sign in to comment.