Class DamageableComponent
Component that allows entities to take damage.
Inheritance
Namespace: Content.Shared.Damage
Assembly: Content.Shared.dll
Syntax
public sealed class DamageableComponent : Component
Remarks
The supported damage types are specified using a DamageContainerPrototypes. DamageContainers may also have resistances to certain damage types, defined via a DamageModifierSetPrototype.
Fields
| Improve this Doc View SourceDamage
All the damage information is stored in this DamageSpecifier.
Declaration
public DamageSpecifier Damage
Field Value
Type | Description |
---|---|
DamageSpecifier |
Remarks
If this data-field is specified, this allows damageable components to be initialized with non-zero damage.
DamageContainerID
This DamageContainerPrototype specifies what damage types are supported by this component. If null, all damage types will be supported.
Declaration
public string? DamageContainerID
Field Value
Type | Description |
---|---|
System.Nullable<System.String> |
DamageModifierSetId
This DamageModifierSetPrototype will be applied to any damage that is dealt to this container, unless the damage explicitly ignores resistances.
Declaration
public string? DamageModifierSetId
Field Value
Type | Description |
---|---|
System.Nullable<System.String> |
Remarks
Though DamageModifierSets can be deserialized directly, we only want to use the prototype version here to reduce duplication.
DamagePerGroup
Damage, indexed by DamageGroupPrototype ID keys.
Declaration
public Dictionary<string, FixedPoint2> DamagePerGroup
Field Value
Type | Description |
---|---|
Dictionary<System.String, FixedPoint2> |
Remarks
Groups which have no members that are supported by this component will not be present in this dictionary.
RadiationDamageTypeIDs
Declaration
public List<string> RadiationDamageTypeIDs
Field Value
Type | Description |
---|---|
List<System.String> |
TotalDamage
The sum of all damages in the DamageableComponent.
Declaration
public FixedPoint2 TotalDamage
Field Value
Type | Description |
---|---|
FixedPoint2 |