04bcc6b9b1
- Armor values aren't reduced from the damage taken, but instead multiply the damage (e.g. an item reduces damage by 10% instead of 10 hp). Now armor doesn't make characters invulnerable to small amounts of damage. - Armoring isn't defined as a single "armor value", but instead there are "damage modifiers" which can be added to items and limbs. The modifiers can only affect specific types of damage and have separate multipliers for the damage amount and bleeding amount. - Having a fire proof item on a limb doesn't make that limb invulnerable to burn damage. Item's that protect against fire now have a damage modifier for the Burn damage type.
67 lines
1.3 KiB
C#
67 lines
1.3 KiB
C#
using Microsoft.Xna.Framework;
|
|
using System.Xml.Linq;
|
|
|
|
namespace Barotrauma
|
|
{
|
|
class DamageModifier
|
|
{
|
|
[Serialize(DamageType.None, false)]
|
|
public DamageType DamageType
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
[Serialize(1.0f, false)]
|
|
public float DamageMultiplier
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
[Serialize(1.0f, false)]
|
|
public float BleedingMultiplier
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
[Serialize("0.0,360", false)]
|
|
public Vector2 ArmorSector
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
[Serialize(true, false)]
|
|
public bool IsArmor
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
[Serialize(true, false)]
|
|
public bool DeflectProjectiles
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
|
|
#if CLIENT
|
|
[Serialize(DamageSoundType.None, false)]
|
|
public DamageSoundType DamageSoundType
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
#endif
|
|
|
|
public DamageModifier(XElement element)
|
|
{
|
|
SerializableProperty.DeserializeProperties(this, element);
|
|
ArmorSector = new Vector2(MathHelper.ToRadians(ArmorSector.X), MathHelper.ToRadians(ArmorSector.Y));
|
|
}
|
|
}
|
|
}
|