by Major Cooke » Mon Jan 27, 2020 6:25 pm
Source is what you want. And you would do a check to make sure passive is false first.
Here's the relevant code from DamageMobj internally.
Code: Select all
if (damage > 0 && source != NULL)
{
damage = int(damage * source->DamageMultiply);
// Handle active damage modifiers (e.g. PowerDamage)
if (damage > 0 && !(flags & DMG_NO_ENHANCE))
{
damage = source->GetModifiedDamage(mod, damage, false, inflictor, target, flags);
}
}
// Handle passive damage modifiers (e.g. PowerProtection), provided they are not afflicted with protection penetrating powers.
if (damage > 0 && !(flags & DMG_NO_PROTECT))
{
damage = target->GetModifiedDamage(mod, damage, true, inflictor, source, flags);
}
Pairing those parameters up to ModifyDamage, you can see that source becomes the actor that's being damaged. There's no point in it being the owner in this case because it'd be redundant when you have the "owner" variable already at your disposal.
So check the source, make sure it isn't null, and then check to see if it has the boss flag. But again, make sure the
passive boolean is false.
Source is what you want. And you would do a check to make sure passive is false first.
Here's the relevant code from DamageMobj internally.
[code]if (damage > 0 && source != NULL)
{
damage = int(damage * source->DamageMultiply);
// Handle active damage modifiers (e.g. PowerDamage)
if (damage > 0 && !(flags & DMG_NO_ENHANCE))
{
damage = source->GetModifiedDamage(mod, damage, false, inflictor, target, flags);
}
}
// Handle passive damage modifiers (e.g. PowerProtection), provided they are not afflicted with protection penetrating powers.
if (damage > 0 && !(flags & DMG_NO_PROTECT))
{
damage = target->GetModifiedDamage(mod, damage, true, inflictor, source, flags);
}[/code]
Pairing those parameters up to ModifyDamage, you can see that source becomes the actor that's being damaged. There's no point in it being the owner in this case because it'd be redundant when you have the "owner" variable already at your disposal.
So check the source, make sure it isn't null, and then check to see if it has the boss flag. But again, make sure the [u]passive boolean[/u] is false.