using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Light.Components; /// /// Component that represents a light bulb. Can be broken, or burned, which turns them mostly useless. /// TODO: Breaking and burning should probably be moved to another component eventually. /// [RegisterComponent, NetworkedComponent] public sealed partial class LightBulbComponent : Component { /// /// The color of the lightbulb and the light it produces. /// [DataField("color")] [ViewVariables(VVAccess.ReadWrite)] public Color Color = Color.White; /// /// The type of lightbulb. Tube/bulb/etc... /// [DataField("bulb")] [ViewVariables(VVAccess.ReadWrite)] public LightBulbType Type = LightBulbType.Tube; /// /// The initial state of the lightbulb. /// [DataField("startingState")] public LightBulbState State = LightBulbState.Normal; /// /// The temperature the air around the lightbulb is exposed to when the lightbulb burns out. /// [DataField("BurningTemperature")] [ViewVariables(VVAccess.ReadWrite)] public int BurningTemperature = 1400; /// /// Relates to how bright the light produced by the lightbulb is. /// [DataField("lightEnergy")] [ViewVariables(VVAccess.ReadWrite)] public float LightEnergy = 0.8f; /// /// The maximum radius of the point light source this light produces. /// [DataField("lightRadius")] [ViewVariables(VVAccess.ReadWrite)] public float LightRadius = 10; /// /// Relates to the falloff constant of the light produced by the lightbulb. /// [DataField("lightSoftness")] [ViewVariables(VVAccess.ReadWrite)] public float LightSoftness = 1; /// /// The amount of power used by the lightbulb when it's active. /// [DataField("PowerUse")] [ViewVariables(VVAccess.ReadWrite)] public int PowerUse = 60; /// /// The sound produced when the lightbulb breaks. /// [DataField("breakSound")] [ViewVariables(VVAccess.ReadWrite)] public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak", AudioParams.Default.WithVolume(-6f)); #region Appearance /// /// The sprite state used when the lightbulb is intact. /// [DataField("normalSpriteState")] [ViewVariables(VVAccess.ReadWrite)] public string NormalSpriteState = "normal"; /// /// The sprite state used when the lightbulb is broken. /// [DataField("brokenSpriteState")] [ViewVariables(VVAccess.ReadWrite)] public string BrokenSpriteState = "broken"; /// /// The sprite state used when the lightbulb is burned. /// [DataField("burnedSpriteState")] [ViewVariables(VVAccess.ReadWrite)] public string BurnedSpriteState = "burned"; #endregion Appearance } [Serializable, NetSerializable] public enum LightBulbState : byte { Normal, Broken, Burned, } [Serializable, NetSerializable] public enum LightBulbVisuals : byte { State, Color } [Serializable, NetSerializable] public enum LightBulbType : byte { Bulb, Tube, } [Serializable, NetSerializable] public enum LightBulbVisualLayers : byte { Base, }