OpenBehavior.cs 544 B

1234567891011121314151617
  1. using Content.Shared.Nutrition.EntitySystems;
  2. namespace Content.Server.Destructible.Thresholds.Behaviors;
  3. /// <summary>
  4. /// Causes the drink/food to open when the destruction threshold is reached.
  5. /// If it is already open nothing happens.
  6. /// </summary>
  7. [DataDefinition]
  8. public sealed partial class OpenBehavior : IThresholdBehavior
  9. {
  10. public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
  11. {
  12. var openable = system.EntityManager.System<OpenableSystem>();
  13. openable.TryOpen(uid);
  14. }
  15. }