GibBehavior.cs 615 B

1234567891011121314151617181920
  1. using Content.Shared.Body.Components;
  2. using JetBrains.Annotations;
  3. namespace Content.Server.Destructible.Thresholds.Behaviors
  4. {
  5. [UsedImplicitly]
  6. [DataDefinition]
  7. public sealed partial class GibBehavior : IThresholdBehavior
  8. {
  9. [DataField("recursive")] private bool _recursive = true;
  10. public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
  11. {
  12. if (system.EntityManager.TryGetComponent(owner, out BodyComponent? body))
  13. {
  14. system.BodySystem.GibBody(owner, _recursive, body);
  15. }
  16. }
  17. }
  18. }