Basically A_Explode for a singular target, and returns the damage falloff. Does not take into account any damage factors of any kind.
In order for this to have worked out efficiently without repeating code, I split off the current and old damage calculation code into their own functions, P_Get(Old)RadiusDamage. This meant taking parts like the sight check inside the old code with it, though thankfully not the new one.
And yes, you'll find that even before any of my changes, OLDRADIUSDMG does one extra point -- that's just the difference of 2D vs 3D.
Using the test file included, shoot a rocket near yourself with primary, secondary and/or reload keys. The player prints off how much damage taken and has BUDDHA so don't worry about dying. The rocket also prints off the calculated falloff at the same time (except for reload's).
- Primary - Rocket deals standard radius damage
- Secondary - Rocket deals old radius damage
- Reload - The rocket does both