2024-04-01 06:27:39 +00:00
|
|
|
using Content.Shared.Nutrition.EntitySystems;
|
2023-10-07 01:35:32 +01:00
|
|
|
|
|
|
|
|
namespace Content.Server.Destructible.Thresholds.Behaviors;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Causes the drink/food to open when the destruction threshold is reached.
|
|
|
|
|
/// If it is already open nothing happens.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataDefinition]
|
|
|
|
|
public sealed partial class OpenBehavior : IThresholdBehavior
|
|
|
|
|
{
|
|
|
|
|
public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
|
|
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
var openable = system.EntityManager.System<OpenableSystem>();
|
2023-10-07 01:35:32 +01:00
|
|
|
openable.TryOpen(uid);
|
|
|
|
|
}
|
|
|
|
|
}
|