2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Body.Components;
|
2021-01-10 20:12:34 +01:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Destructible.Thresholds.Behaviors
|
2021-01-10 20:12:34 +01:00
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataDefinition]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class GibBehavior : IThresholdBehavior
|
2021-01-10 20:12:34 +01:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("recursive")] private bool _recursive = true;
|
2021-01-10 20:12:34 +01:00
|
|
|
|
2023-02-10 17:45:38 -06:00
|
|
|
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
|
2021-01-10 20:12:34 +01:00
|
|
|
{
|
2022-10-23 00:46:28 +02:00
|
|
|
if (system.EntityManager.TryGetComponent(owner, out BodyComponent? body))
|
2021-01-10 20:12:34 +01:00
|
|
|
{
|
2022-10-23 00:46:28 +02:00
|
|
|
system.BodySystem.GibBody(owner, _recursive, body);
|
2021-01-10 20:12:34 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|