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, AutoGenerateComponentState]
public sealed partial class LightBulbComponent : Component
{
///
/// The color of the lightbulb and the light it produces.
///
[DataField, AutoNetworkedField]
public Color Color = Color.White;
///
/// The type of lightbulb. Tube/bulb/etc...
///
[DataField("bulb")]
public LightBulbType Type = LightBulbType.Tube;
///
/// The initial state of the lightbulb.
///
[DataField("startingState"), AutoNetworkedField]
public LightBulbState State = LightBulbState.Normal;
///
/// The temperature the air around the lightbulb is exposed to when the lightbulb burns out.
///
[DataField("BurningTemperature")]
public int BurningTemperature = 1400;
///
/// Relates to how bright the light produced by the lightbulb is.
///
[DataField]
public float LightEnergy = 0.8f;
///
/// The maximum radius of the point light source this light produces.
///
[DataField]
public float LightRadius = 10;
///
/// Relates to the falloff constant of the light produced by the lightbulb.
///
[DataField]
public float LightSoftness = 1;
///
/// The amount of power used by the lightbulb when it's active.
///
[DataField("PowerUse")]
public int PowerUse = 60;
///
/// The sound produced when the lightbulb breaks.
///
[DataField]
public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak", AudioParams.Default.WithVolume(-6f));
#region Appearance
///
/// The sprite state used when the lightbulb is intact.
///
[DataField]
public string NormalSpriteState = "normal";
///
/// The sprite state used when the lightbulb is broken.
///
[DataField]
public string BrokenSpriteState = "broken";
///
/// The sprite state used when the lightbulb is burned.
///
[DataField]
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,
}