X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 69 forks source link

Damage over time effects applied by an attack that grazed are also halved in damage #1396

Open faanlez opened 1 month ago

faanlez commented 1 month ago

When using Dragon Rounds or other applied on hit effects their damage gets also halved by a dodge for all ticks of the effects because they remember the hit result being eHit_Graze. This can end up with them doing no damage at all.

X2Effect_ApplyWeaponDamage::CalculateDamageAmount()

else if (ApplyEffectParameters.AbilityResultContext.HitResult == eHit_Graze)
{
    WeaponDamage *= GRAZE_DMG_MULT;
    `log("GRAZE! Adjusted damage:" @ WeaponDamage, true, 'XCom_HitRolls');
}
Iridar commented 1 month ago

That's pretty gnarly.

Mitzruti commented 1 month ago

it's also true of crits, but generally not noticeable because DoTs are typically not set up with crit damage.

should be possible to gate it behind a (ApplyEffectParameters.EffectRef.ApplyOnTickIndex == INDEX_NONE) check. (that is, DoT damage will always have a tick index, while directly applied damage effects will not)