Adds generic damage visualizer to the game (#4893)

This commit is contained in:
Flipp Syder
2021-10-29 01:04:24 -07:00
committed by GitHub
parent 87701b50c6
commit 91b4ce6f24
67 changed files with 1021 additions and 117 deletions

View File

@@ -83,6 +83,9 @@ namespace Content.Shared.Damage
component.DamagePerGroup = component.Damage.GetDamagePerGroup();
component.TotalDamage = component.Damage.Total;
component.Dirty();
if (EntityManager.TryGetComponent<SharedAppearanceComponent>(component.Owner.Uid, out var appearance) && damageDelta != null)
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList());
RaiseLocalEvent(component.Owner.Uid, new DamageChangedEvent(component, damageDelta), false);
}