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

@@ -42,23 +42,6 @@ namespace Content.Server.Window
[DataField("knockSound")]
private SoundSpecifier _knockSound = new SoundPathSpecifier("/Audio/Effects/glass_knock.ogg");
public void UpdateVisuals(int currentDamage)
{
if (Owner.TryGetComponent(out AppearanceComponent? appearance) &&
Owner.TryGetComponent(out DestructibleComponent? destructible))
{
foreach (var threshold in destructible.Thresholds)
{
if (threshold.Trigger is not DamageTrigger trigger)
{
continue;
}
appearance.SetData(WindowVisuals.Damage, (float) currentDamage / trigger.Damage);
}
}
}
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
{
if (!Owner.TryGetComponent(out DamageableComponent? damageable) ||