Files
tbd-station-14/Content.Server/GameObjects/Components/Destructible/Thresholds/Behaviors/GibBehavior.cs
2021-03-16 15:50:20 +01:00

24 lines
683 B
C#

using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Body;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.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);
}
}
}
}