- Added a DMG_NO_FACTOR flag for P_DamageMobj(). A_KillChildren, A_KillMaster,

and A_KillSiblings now use it.


SVN r2024 (trunk)
This commit is contained in:
Randy Heit 2009-12-13 05:04:12 +00:00
parent b3d2a1f074
commit 28c23edb2f
4 changed files with 20 additions and 14 deletions

View file

@ -1,4 +1,6 @@
December 12, 2009
- Added a DMG_NO_FACTOR flag for P_DamageMobj(). A_KillChildren, A_KillMaster,
and A_KillSiblings now use it.
- Added a damage type parameter to A_KillChildren, A_KillMaster, and
A_KillSiblings.

View file

@ -1000,21 +1000,24 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
return;
}
DmgFactors * df = target->GetClass()->ActorInfo->DamageFactors;
if (df != NULL)
if (!(flags & DMG_NO_FACTOR))
{
fixed_t * pdf = df->CheckKey(mod);
if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None);
if (pdf != NULL)
DmgFactors *df = target->GetClass()->ActorInfo->DamageFactors;
if (df != NULL)
{
damage = FixedMul(damage, *pdf);
if (damage <= 0)
return;
fixed_t *pdf = df->CheckKey(mod);
if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None);
if (pdf != NULL)
{
damage = FixedMul(damage, *pdf);
if (damage <= 0)
return;
}
}
damage = FixedMul(damage, target->DamageFactor);
if (damage < 0)
return;
}
damage = FixedMul(damage, target->DamageFactor);
if (damage < 0)
return;
damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
}

View file

@ -468,6 +468,7 @@ enum EDmgFlags
DMG_INFLICTOR_IS_PUFF = 2,
DMG_THRUSTLESS = 4,
DMG_FORCED = 8,
DMG_NO_FACTOR = 16,
};

View file

@ -1958,7 +1958,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
if (self->master != NULL)
{
P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR);
P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
}
}
@ -1979,7 +1979,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren)
{
if (mo->master == self)
{
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR);
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
}
}
}
@ -2001,7 +2001,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings)
{
if (mo->master == self->master && mo != self)
{
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR);
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
}
}
}