- made player_t::crouchoffset and FPlayerStart's coordinates doubles and added a float version of divline_t so that I could complete the conversion of Hexen's game code.
- consolidated the actor based damage factor code which was repeated multiple times in various damage inflicting functions.
This commit is contained in:
parent
c830801da3
commit
4155e84a1c
24 changed files with 133 additions and 121 deletions
|
|
@ -1046,7 +1046,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
if (player && damage > 1)
|
||||
{
|
||||
// Take half damage in trainer mode
|
||||
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
|
||||
damage = int(damage * G_SkillProperty(SKILLP_DamageFactor));
|
||||
}
|
||||
// Special damage types
|
||||
if (inflictor)
|
||||
|
|
@ -1091,11 +1091,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
}
|
||||
if (damage > 0 && !(flags & DMG_NO_FACTOR))
|
||||
{
|
||||
damage = FixedMul(damage, target->DamageFactor);
|
||||
if (damage > 0)
|
||||
{
|
||||
damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, mod, target->GetClass()->DamageFactors);
|
||||
}
|
||||
damage = target->ApplyDamageFactor(mod, damage);
|
||||
}
|
||||
|
||||
if (damage >= 0)
|
||||
|
|
@ -1721,18 +1717,15 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
|||
return;
|
||||
}
|
||||
// Take half damage in trainer mode
|
||||
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
|
||||
damage = int(damage * G_SkillProperty(SKILLP_DamageFactor));
|
||||
// Handle passive damage modifiers (e.g. PowerProtection)
|
||||
if (target->Inventory != NULL)
|
||||
{
|
||||
target->Inventory->ModifyDamage(damage, player->poisontype, damage, true);
|
||||
}
|
||||
// Modify with damage factors
|
||||
damage = FixedMul(damage, target->DamageFactor);
|
||||
if (damage > 0)
|
||||
{
|
||||
damage = DamageTypeDefinition::ApplyMobjDamageFactor(damage, player->poisontype, target->GetClass()->DamageFactors);
|
||||
}
|
||||
damage = target->ApplyDamageFactor(player->poisontype, damage);
|
||||
|
||||
if (damage <= 0)
|
||||
{ // Damage was reduced to 0, so don't bother further.
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue