mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
Added support for standard DamageFactor property on Armor, PowerProtection and PowerDamage items.
This commit is contained in:
parent
39a9a48ad6
commit
e781cb4043
2 changed files with 6 additions and 3 deletions
|
@ -201,7 +201,8 @@ class BasicArmor : Armor
|
||||||
// Once the armor has absorbed its part of the damage, then apply its damage factor, if any, to the player
|
// Once the armor has absorbed its part of the damage, then apply its damage factor, if any, to the player
|
||||||
if ((damage > 0) && (ArmorType != 'None')) // BasicArmor is not going to have any damage factor, so skip it.
|
if ((damage > 0) && (ArmorType != 'None')) // BasicArmor is not going to have any damage factor, so skip it.
|
||||||
{
|
{
|
||||||
newdamage = ApplyDamageFactors(ArmorType, damageType, damage, damage);
|
damage = int(damage * DamageFactor);
|
||||||
|
newdamage = (damage < 1) ? 0 : ApplyDamageFactors(ArmorType, damageType, damage, damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1659,7 +1659,8 @@ class PowerDamage : Powerup
|
||||||
{
|
{
|
||||||
if (!passive && damage > 0)
|
if (!passive && damage > 0)
|
||||||
{
|
{
|
||||||
newdamage = max(1, ApplyDamageFactors(GetClass(), damageType, damage, damage * 4));
|
damage = int(damage * DamageFactor);
|
||||||
|
newdamage = (damage < 1) ? 0 : max(1, ApplyDamageFactors(GetClass(), damageType, damage, damage * 4));
|
||||||
if (Owner != null && newdamage > damage) Owner.A_StartSound(ActiveSound, CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_NONE);
|
if (Owner != null && newdamage > damage) Owner.A_StartSound(ActiveSound, CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1753,7 +1754,8 @@ class PowerProtection : Powerup
|
||||||
{
|
{
|
||||||
if (passive && damage > 0)
|
if (passive && damage > 0)
|
||||||
{
|
{
|
||||||
newdamage = max(0, ApplyDamageFactors(GetClass(), damageType, damage, damage / 4));
|
damage = int(damage * DamageFactor);
|
||||||
|
newdamage = (damage < 1) ? 0 : max(0, ApplyDamageFactors(GetClass(), damageType, damage, damage / 4));
|
||||||
if (Owner != null && newdamage < damage) Owner.A_StartSound(ActiveSound, CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_NONE);
|
if (Owner != null && newdamage < damage) Owner.A_StartSound(ActiveSound, CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue