Files
tbd-station-14/Content.Server/Destructible/Thresholds/Behaviors/GibBehavior.cs

21 lines
615 B
C#

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