Show / Hide Table of Contents

Class DamageableComponent

Component that allows entities to take damage.

Inheritance
System.Object
DamageableComponent
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 Source

Damage

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.

| Improve this Doc View Source

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>
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

RadiationDamageTypeIDs

Declaration
public List<string> RadiationDamageTypeIDs
Field Value
Type Description
List<System.String>
| Improve this Doc View Source

TotalDamage

The sum of all damages in the DamageableComponent.

Declaration
public FixedPoint2 TotalDamage
Field Value
Type Description
FixedPoint2
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾