Class DamageVisualsComponent
Inheritance
Namespace: Content.Client.Damage
Assembly: Content.Client.dll
Syntax
public sealed class DamageVisualsComponent : Component
Fields
| Improve this Doc View SourceDamageGroup
A single damage group to target. This should only be defined if overlay is set to false. If this is defined with damageSprites, this will be ignored.
Declaration
public string? DamageGroup
Field Value
Type | Description |
---|---|
System.Nullable<System.String> |
Remarks
This is here because otherwise, you would need several permutations of group sprites depending on what kind of damage combination you would want, on which threshold.
DamageOverlay
This is the overlay sprite used, if _trackAllDamage is enabled. Supports no complex per-group layering, just an actually simple damage overlay. See DamageVisualizerSprite for more information.
Declaration
public DamageVisualizerSprite DamageOverlay
Field Value
Type | Description |
---|---|
DamageVisualizerSprite |
DamageOverlayGroups
The actual sprites for every damage group that the entity should display visually.
This is keyed by a damage group identifier (for example, Brute), and has a value of a DamageVisualizerSprite (see below)
Declaration
public Dictionary<string, DamageVisualizerSprite>? DamageOverlayGroups
Field Value
Type | Description |
---|---|
System.Nullable<Dictionary<System.String, DamageVisualizerSprite>> |
Disabled
Declaration
public bool Disabled
Field Value
Type | Description |
---|---|
System.Boolean |
DisabledLayers
Declaration
public readonly Dictionary<object, bool> DisabledLayers
Field Value
Type | Description |
---|---|
Dictionary<System.Object, System.Boolean> |
Divisor
Set this if you want incoming damage to be divided.
Declaration
public float Divisor
Field Value
Type | Description |
---|---|
System.Single |
Remarks
This is more useful if you have similar damage sprites in between entities, but with different damage thresholds and you want to avoid duplicating these sprites.
LastDamageThreshold
Declaration
public FixedPoint2 LastDamageThreshold
Field Value
Type | Description |
---|---|
FixedPoint2 |
LastThresholdPerGroup
Declaration
public readonly Dictionary<string, FixedPoint2> LastThresholdPerGroup
Field Value
Type | Description |
---|---|
Dictionary<System.String, FixedPoint2> |
LayerMapKeyStates
Declaration
public readonly Dictionary<object, string> LayerMapKeyStates
Field Value
Type | Description |
---|---|
Dictionary<System.Object, System.String> |
Overlay
Sets if you want sprites to overlay the entity when damaged, or if you would rather have each target layer's state replaced by a different state within its RSI.
This cannot be set to false if:
- There are no target layers
- There is no damage group
Declaration
public bool Overlay
Field Value
Type | Description |
---|---|
System.Boolean |
TargetLayerMapKeys
Declaration
public readonly List<Enum> TargetLayerMapKeys
Field Value
Type | Description |
---|---|
List<Enum> |
TargetLayers
Layers to target, by layerMapKey. If a target layer map key is invalid (in essence, undefined), then the target layer is removed from the list for efficiency.
If no layers are valid, then the visualizer is marked as invalid.
If this is not defined, however, the visualizer instead adds an overlay to the sprite.
Declaration
public List<Enum>? TargetLayers
Field Value
Type | Description |
---|---|
System.Nullable<List<Enum>> |
Remarks
Layers can be disabled here by passing the layer's name as a key to SetData, and passing in a bool set to either 'false' to disable it, or 'true' to enable it. Setting the layer as disabled will make it completely invisible.
Thresholds
Damage thresholds between damage state changes.
If there are any negative thresholds, or there is less than one threshold, the visualizer is marked as invalid.
Declaration
public List<FixedPoint2> Thresholds
Field Value
Type | Description |
---|---|
List<FixedPoint2> |
Remarks
A 'zeroth' threshold is automatically added, and this list is automatically sorted for efficiency beforehand. As such, the zeroth threshold is not required - and negative thresholds are automatically caught as invalid. The zeroth threshold automatically sets all layers to invisible, so a sprite isn't required for it.
TopMostLayerKey
Declaration
public string TopMostLayerKey
Field Value
Type | Description |
---|---|
System.String |
TrackAllDamage
Set this to track all damage, instead of specific groups.
Declaration
public bool TrackAllDamage
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
This will only work if you have damageOverlay defined - otherwise, it will not work.
Valid
Declaration
public bool Valid
Field Value
Type | Description |
---|---|
System.Boolean |