Ludeon Forums

Ludeon Forums

  • March 29, 2020, 02:39:35 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [1.0][1.1] Damage conversion from sharp to blunt doesn't use DamageWorker_Blunt  (Read 104 times)

Currently_Fortifying

  • Muffalo
  • *
  • Posts: 10
  • Refugee
    • View Profile

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.
« Last Edit: March 19, 2020, 02:51:46 AM by Currently_Fortifying »
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12429
    • View Profile
    • Tynan's Blog

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!
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog