GetRadiusDamage()

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

GetRadiusDamage()

Post by Major Cooke »

Pull Request

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
Attachments
test.pk3
Primary: Rocket does regular radius damage
Second: Rocket does old radius damage
Reload: Rocket does both.
(2.04 KiB) Downloaded 33 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GetRadiusDamage()

Post by Graf Zahl »

Will have to be reviewed by at least one person before merging.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: GetRadiusDamage()

Post by Major Cooke »

Understood. It does cut up P_RadiusAttack where all the damage is being calculated and distance too.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GetRadiusDamage()

Post by _mental_ »

I made minor changes to make comparison (and tracking of modification) easier. From my side it's ready to be pushed as a single commit.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: GetRadiusDamage()

Post by Major Cooke »

Hmm, can you push them to a branch? I think Graf might be waiting to see what they are first.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GetRadiusDamage()

Post by _mental_ »

It’s here.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”