- Added inventory-based damage modification to APoisonCloud::DoSpecialDamage() and P_PoisonDamage().

SVN r3718 (trunk)
This commit is contained in:
Randy Heit 2012-06-30 01:06:30 +00:00
parent e1641da881
commit 1346f136f2
2 changed files with 16 additions and 9 deletions

View file

@ -343,6 +343,11 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage, FName damagetype)
{ {
damage = (int)((float)damage * level.teamdamage); damage = (int)((float)damage * level.teamdamage);
} }
// Handle passive damage modifiers (e.g. PowerProtection)
if (victim->Inventory != NULL)
{
victim->Inventory->ModifyDamage(damage, damagetype, damage, true);
}
// Modify with damage factors // Modify with damage factors
damage = FixedMul(damage, victim->DamageFactor); damage = FixedMul(damage, victim->DamageFactor);
if (damage > 0) if (damage > 0)

View file

@ -1566,9 +1566,12 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
// Take half damage in trainer mode // Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor)); damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
} }
// Modify with damage factors // Handle passive damage modifiers (e.g. PowerProtection)
if (damage > 0) if (target->Inventory != NULL)
{ {
target->Inventory->ModifyDamage(damage, player->poisontype, damage, true);
}
// Modify with damage factors
damage = FixedMul(damage, target->DamageFactor); damage = FixedMul(damage, target->DamageFactor);
if (damage > 0) if (damage > 0)
{ {
@ -1578,7 +1581,6 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
{ // Damage was reduced to 0, so don't bother further. { // Damage was reduced to 0, so don't bother further.
return; return;
} }
}
if (damage >= player->health if (damage >= player->health
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch) && (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
&& !player->morphTics) && !player->morphTics)