using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.DeltaV.VendingMachines; /// /// A vending machine that sells items for a currency controlled by events. /// Does not need restocking. /// Another component must handle and to work. /// [RegisterComponent, NetworkedComponent, Access(typeof(SharedShopVendorSystem))] [AutoGenerateComponentState, AutoGenerateComponentPause] public sealed partial class ShopVendorComponent : Component { /// /// The inventory prototype to sell. /// [DataField(required: true)] public ProtoId Pack; [DataField, AutoNetworkedField] public bool Broken; [DataField, AutoNetworkedField] public bool Denying; /// /// Item being ejected, or null if it isn't. /// [DataField, AutoNetworkedField] public EntProtoId? Ejecting; /// /// How long to wait before flashing denied again. /// [DataField] public TimeSpan DenyDelay = TimeSpan.FromSeconds(2); /// /// How long to wait before another item can be bought /// [DataField] public TimeSpan EjectDelay = TimeSpan.FromSeconds(1.2); [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextDeny; [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextEject; [DataField] public SoundSpecifier PurchaseSound = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg") { Params = new AudioParams { Volume = -4f, Variation = 0.15f } }; [DataField] public SoundSpecifier DenySound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg") { Params = new AudioParams { Volume = -2f } }; #region Visuals [DataField] public bool LoopDenyAnimation = true; [DataField] public string? OffState; [DataField] public string? ScreenState; [DataField] public string? NormalState; [DataField] public string? DenyState; [DataField] public string? EjectState; [DataField] public string? BrokenState; #endregion }