GibPartBehavior.cs 884 B

12345678910111213141516171819202122232425
  1. // SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
  2. // SPDX-FileCopyrightText: 2024 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
  3. // SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
  4. //
  5. // SPDX-License-Identifier: AGPL-3.0-or-later
  6. using Content.Shared.Body.Part;
  7. using JetBrains.Annotations;
  8. // Leaving this one in the default namespace because I am afraid to test it
  9. // in the Shitmed namespace lmao.
  10. namespace Content.Server.Destructible.Thresholds.Behaviors;
  11. [UsedImplicitly]
  12. [DataDefinition]
  13. public sealed partial class GibPartBehavior : IThresholdBehavior
  14. {
  15. public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
  16. {
  17. if (!system.EntityManager.TryGetComponent(owner, out BodyPartComponent? part))
  18. return;
  19. system.BodySystem.GibPart(owner, part);
  20. }
  21. }