Ludeon Forums

RimWorld => Bugs => Topic started by: Currently_Fortifying on March 19, 2020, 02:48:18 AM

Title: [1.0][1.1] Damage conversion from sharp to blunt doesn't use DamageWorker_Blunt
Post by: Currently_Fortifying on March 19, 2020, 02:48:18 AM
Just a heads up, all information below is from RimWorlds decompiled source.

To elaborate, when a bullet hits an armored pawn, there's a rng role to determine if the damage deflects harmlessly, is diminished and turned into blunt damage, or the damage is unaffected.

In the event of a diminished role, the damage is halved and converted into blunt, however DamageWorker_Blunt is not called, meaning the shot will deal full blunt damage to internal organs.
For the moderators, blunt damage is supposed to have a rng role to deal less damage to internal organs, and DamageWorker_Blunt is responsible for calculating the reduction in damage.

The relevant issue in the code is in class verse.ArmorUtility.ApplyArmor:
if (value < num3)
         {
            damAmount = (float)GenMath.RoundRandom(damAmount / 2f);
            if (damageDef.armorCategory == DamageArmorCategoryDefOf.Sharp)
            {
               damageDef = DamageDefOf.Blunt;
            }
         }

As can be seen, the damage is directly converted to blunt meaning DamageWorker_Blunt is never used.

This is testable in game by having 1 pawn shoot an armored pawn until you get a blunt shot that penetrates to an interior organ. The damage between the outer skin layer and the internal organ will be the same.

If this is an intended feature please let me know so I can create a mod changing the behavior.
If this will be fixed, but will be patched at a later date, i.e. months from now, please let me know so I can create a mod as a temporary fix.
Title: [1.1.2575] Damage conversion from sharp to blunt doesn't use DamageWorker_Blunt
Post by: Tynan on March 21, 2020, 10:32:41 AM
Well that's an eagle eye code read if I ever saw one.

It's not intended that I know of; just a bug.

It's not a high priority to fix so don't expect anything really soon. I have wanted to do a refactor of melee damage for some time but nothing like that would be released any time soon.

Thanks for checking and writing this up!