Files
tbd-station-14/Content.Server/Destructible/Thresholds/Behaviors/GibBehavior.cs
2022-05-13 17:59:03 +10:00

21 lines
558 B
C#

using Content.Shared.Body.Components;
using JetBrains.Annotations;
namespace Content.Server.Destructible.Thresholds.Behaviors
{
[UsedImplicitly]
[DataDefinition]
public sealed class GibBehavior : IThresholdBehavior
{
[DataField("recursive")] private bool _recursive = true;
public void Execute(EntityUid owner, DestructibleSystem system)
{
if (system.EntityManager.TryGetComponent(owner, out SharedBodyComponent? body))
{
body.Gib(_recursive);
}
}
}
}