using Content.Shared.Random; using Robust.Shared.Audio; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Audio; /// /// Attaches a rules prototype to sound files to play ambience. /// [Prototype("ambientMusic")] public sealed class AmbientMusicPrototype : IPrototype { [IdDataField] public string ID { get; } = string.Empty; /// /// Traditionally you'd prioritise most rules to least as priority but in our case we'll just be explicit. /// [ViewVariables(VVAccess.ReadWrite), DataField("priority")] public int Priority = 0; /// /// Can we interrupt this ambience for a better prototype if possible? /// [ViewVariables(VVAccess.ReadWrite), DataField("interruptable")] public bool Interruptable = false; /// /// Do we fade-in. Useful for songs. /// [ViewVariables(VVAccess.ReadWrite), DataField("fadeIn")] public bool FadeIn; [ViewVariables(VVAccess.ReadWrite), DataField("sound", required: true)] public SoundSpecifier Sound = default!; [ViewVariables(VVAccess.ReadWrite), DataField("rules", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))] public string Rules = string.Empty; }