From 74a898e42d72985ac8dff747055f21ad368bc77f Mon Sep 17 00:00:00 2001 From: BlackDog86 <122568778+BlackDog86@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:02:37 +0000 Subject: [PATCH] Add check for Tick context to eHit_Crit and eHit-Graze --- .../XComGame/Classes/X2Effect_ApplyWeaponDamage.uc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Effect_ApplyWeaponDamage.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Effect_ApplyWeaponDamage.uc index b7211558e..71cb40976 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Effect_ApplyWeaponDamage.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Effect_ApplyWeaponDamage.uc @@ -950,17 +950,21 @@ simulated function int CalculateDamageAmount(const out EffectAppliedData ApplyEf WeaponDamage++; `log("Rolled for PlusOne off AmmoDamage, succeeded. Damage:" @ WeaponDamage, true, 'XCom_HitRolls'); } - - if (ApplyEffectParameters.AbilityResultContext.HitResult == eHit_Crit) + // Start Issue #1396 + /// HL-Docs: ref:Bugfixes; issue:1396 + /// Ensure that Damage-over-time effects applied by abilities that grazed or critted the target do not get their damage adjusted + /// by checking for ApplyOnTick behavior + if (ApplyEffectParameters.AbilityResultContext.HitResult == eHit_Crit && ApplyEffectParameters.EffectRef.ApplyOnTickIndex == INDEX_NONE) { WeaponDamage += CritDamage; `log("CRIT! Adjusted damage:" @ WeaponDamage, true, 'XCom_HitRolls'); - } - else if (ApplyEffectParameters.AbilityResultContext.HitResult == eHit_Graze) + } + else if (ApplyEffectParameters.AbilityResultContext.HitResult == eHit_Graze && ApplyEffectParameters.EffectRef.ApplyOnTickIndex == INDEX_NONE) { WeaponDamage *= GRAZE_DMG_MULT; `log("GRAZE! Adjusted damage:" @ WeaponDamage, true, 'XCom_HitRolls'); } + // End Issue #1396 // Start Issue #1299 /// HL-Docs: ref:Bugfixes; issue:1299