using Content.Shared.Sound; using JetBrains.Annotations; using Content.Server.Nutrition.EntitySystems; using Content.Shared.FixedPoint; using System.Threading; namespace Content.Server.Nutrition.Components { [RegisterComponent] [Access(typeof(DrinkSystem))] public sealed class DrinkComponent : Component { [DataField("solution")] public string SolutionName { get; set; } = DefaultSolutionName; public const string DefaultSolutionName = "drink"; [ViewVariables] [DataField("useSound")] public SoundSpecifier UseSound = new SoundPathSpecifier("/Audio/Items/drink.ogg"); [ViewVariables] [DataField("isOpen")] internal bool DefaultToOpened; [ViewVariables(VVAccess.ReadWrite)] public FixedPoint2 TransferAmount { get; [UsedImplicitly] private set; } = FixedPoint2.New(5); [ViewVariables(VVAccess.ReadWrite)] public bool Opened; [DataField("openSounds")] public SoundSpecifier OpenSounds = new SoundCollectionSpecifier("canOpenSounds"); [DataField("pressurized")] public bool Pressurized; [DataField("burstSound")] public SoundSpecifier BurstSound = new SoundPathSpecifier("/Audio/Effects/flash_bang.ogg"); /// /// How long it takes to drink this yourself. /// [DataField("delay")] public float Delay = 1; /// /// This is how many seconds it takes to force feed someone this drink. /// [DataField("forceFeedDelay")] public float ForceFeedDelay = 3; /// /// Token for interrupting a do-after action (e.g., force feeding). If not null, implies component is /// currently "in use". /// public CancellationTokenSource? CancelToken; } }