using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Eye.Blinding.Components; /// /// Allows mobs to toggle their eyes between being closed and being not closed. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] public sealed partial class EyeClosingComponent : Component { /// /// Default eyes opening sound. /// private static readonly ProtoId DefaultEyeOpen = new("EyeOpen"); /// /// Default eyes closing sound. /// private static readonly ProtoId DefaultEyeClose = new("EyeClose"); /// /// The prototype to grant to enable eye-toggling action. /// [DataField("eyeToggleAction", customTypeSerializer: typeof(PrototypeIdSerializer))] public string EyeToggleAction = "ActionToggleEyes"; /// /// The actual eye toggling action entity itself. /// [DataField] public EntityUid? EyeToggleActionEntity; /// /// Sound to play when opening eyes. /// [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public SoundSpecifier EyeOpenSound = new SoundCollectionSpecifier(DefaultEyeOpen); /// /// Sound to play when closing eyes. /// [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public SoundSpecifier EyeCloseSound = new SoundCollectionSpecifier(DefaultEyeClose); /// /// Toggles whether the eyes are open or closed. This is really just exactly what it says on the tin. Honest. /// [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public bool EyesClosed; [ViewVariables(VVAccess.ReadOnly), DataField] public bool PreviousEyelidPosition; [ViewVariables(VVAccess.ReadOnly), DataField] public bool NaturallyCreated; }