DMG_TEST for DamageMobj

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Accensus
Posts: 2377
Joined: Thu Feb 11, 2016 9:59 am

DMG_TEST for DamageMobj

Post by Accensus »

Following the train of thought here, the idea behind DMG_TEST (or DMG_NODAMAGE, whatever works) is to call Super.DamageMobj to get the final damage without doing any real health reduction. This way I can operate on the value after it's been modified by factors and whatnot, and use it in calculations separately from the damage argument, which is the raw value and often times useless to work with in my case. I can't assign the return of Super.DamageMobj to a variable and work with that because by that point it's already too late and the damage has already been dealt.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48326
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DMG_TEST for DamageMobj

Post by Graf Zahl »

This would require quite a bit of refactoring because DamageMobj is doing lots of stuff aside from calculating the damage - and it's not really doing things in an intuitive order.
Accensus
Posts: 2377
Joined: Thu Feb 11, 2016 9:59 am

Re: DMG_TEST for DamageMobj

Post by Accensus »

I was afraid of that. Hopefully it's feasible down the line and not completely out of the question because refactoring DamageMobj seems like a good idea. A lot of calculations regarding damage are located in there so selectively modifying behaviour mod-side is a pain in the ass. Probably one of the most crammed parts of the engine from what I can see. That and AActor::Tick(). 500 LOC functions seem kinda smelly.

Return to “Feature Suggestions [GZDoom]”