Show / Hide Table of Contents

Class DamageableSystem

Inheritance
System.Object
DamageableSystem
Namespace: Content.Shared.Damage
Assembly: Content.Shared.dll
Syntax
public sealed class DamageableSystem : EntitySystem

Methods

| Improve this Doc View Source

DamageChanged(EntityUid, DamageableComponent, DamageSpecifier, Boolean, Nullable<EntityUid>)

If the damage in a DamageableComponent was changed, this function should be called.

Declaration
public void DamageChanged(EntityUid uid, DamageableComponent component, DamageSpecifier damageDelta = null, bool interruptsDoAfters = true, EntityUid? origin = null)
Parameters
Type Name Description
EntityUid uid
DamageableComponent component
DamageSpecifier damageDelta
System.Boolean interruptsDoAfters
System.Nullable<EntityUid> origin
Remarks

This updates cached damage information, flags the component as dirty, and raises a damage changed event. The damage changed event is used by other systems, such as damage thresholds.

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

SetAllDamage(EntityUid, DamageableComponent, FixedPoint2)

Sets all damage types supported by a DamageableComponent to the specified value.

Declaration
public void SetAllDamage(EntityUid uid, DamageableComponent component, FixedPoint2 newValue)
Parameters
Type Name Description
EntityUid uid
DamageableComponent component
FixedPoint2 newValue
| Improve this Doc View Source

SetDamage(EntityUid, DamageableComponent, DamageSpecifier)

Directly sets the damage specifier of a damageable component.

Declaration
public void SetDamage(EntityUid uid, DamageableComponent damageable, DamageSpecifier damage)
Parameters
Type Name Description
EntityUid uid
DamageableComponent damageable
DamageSpecifier damage
Remarks

Useful for some unfriendly folk. Also ensures that cached values are updated and that a damage changed event is raised.

| Improve this Doc View Source

SetDamageModifierSetId(EntityUid, String, DamageableComponent)

Declaration
public void SetDamageModifierSetId(EntityUid uid, string damageModifierSetId, DamageableComponent comp = null)
Parameters
Type Name Description
EntityUid uid
System.String damageModifierSetId
DamageableComponent comp
| Improve this Doc View Source

TryChangeDamage(Nullable<EntityUid>, DamageSpecifier, Boolean, Boolean, DamageableComponent, Nullable<EntityUid>)

Applies damage specified via a DamageSpecifier.

Declaration
public DamageSpecifier TryChangeDamage(EntityUid? uid, DamageSpecifier damage, bool ignoreResistances = false, bool interruptsDoAfters = true, DamageableComponent damageable = null, EntityUid? origin = null)
Parameters
Type Name Description
System.Nullable<EntityUid> uid
DamageSpecifier damage
System.Boolean ignoreResistances
System.Boolean interruptsDoAfters
DamageableComponent damageable
System.Nullable<EntityUid> origin
Returns
Type Description
DamageSpecifier

Returns a DamageSpecifier with information about the actual damage changes. This will be null if the user had no applicable components that can take damage.

Remarks

DamageSpecifier is effectively just a dictionary of damage types and damage values. This function just applies the container's resistances (unless otherwise specified) and then changes the stored damage data. Division of group damage into types is managed by DamageSpecifier.

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾