GibBehavior.cs 903 B

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