DMG_NO_ENHANCE

Moderator: GZDoom Developers

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

DMG_NO_ENHANCE

Post by Major Cooke »

Pull Request

Simple: disables PowerDamage's effect from being called in DamageMobj.

Why? Because trying to self negate it via manual overriding results in some wildly inconsistent results.

Here is some code I'm currently using which negates the damage of all PowerDamage enhancements before the main internal DamageMobj function is actually called. However, this winds up nuking the damage to the point where enhancing it back again results in the damage being even lower. There's no real way to disable this behavior without this flag.

Code: Select all

// If the player hurts himself, negate self damage by taking the
// enhanced damage and use that to divide the current damage.
// This gives us the amount to nuke the damage by, that way
// the internal function will kick it back up again.
// Sadly, not the most consistent of results I'm afraid...
if (damage > 0 && (
	(source && source == self) ||
	(inflictor && (inflictor == self || inflictor.target == self))))
{
	int newdamage = GetModifiedDamage(mod, damage, false);
	if (newdamage > damage)
	{
		double mul = double(damage) / double(Max(1.0,newdamage));
		damage = int(floor(damage * mul));
	}
}
If I can get this flag, I can replace the above damage calculation with just flags |= DMG_NO_ENHANCE; and be done with it.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”