Files
crystall-punk-14/Content.Server/Destructible/Thresholds/Behaviors/GibBehavior.cs
2021-06-09 22:19:39 +02:00

23 lines
600 B
C#

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