using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Light.Components; /// /// Makes the color of lights on an entity fluctuate. Will update point-light color and modulate some or all of the /// sprite layers. Will also modulate the color of any unshaded layers that this entity contributes to a wearer or holder. /// /// /// Networked ~~solely for admemes~~ for completely legitimate reasons, like hacked energy swords. /// [NetworkedComponent, RegisterComponent, Access(typeof(SharedRgbLightControllerSystem))] public sealed partial class RgbLightControllerComponent : Component { [DataField("cycleRate")] public float CycleRate { get; set; } = 0.1f; /// /// What layers of the sprite to modulate? If null, will affect only unshaded layers. /// [DataField("layers")] public List? Layers; /// /// Original light color from befor the rgb was aded. Used to revert colors when removed. /// public Color OriginalLightColor; /// /// Original colors of the sprite layersfrom before the rgb was added. Used to revert colors when removed. /// public Dictionary? OriginalLayerColors; /// /// User that is holding or wearing this entity /// public EntityUid? Holder; /// /// List of unshaded layers on the holder/wearer that are being modulated. /// public List? HolderLayers; } [Serializable, NetSerializable] public sealed class RgbLightControllerState : ComponentState { public readonly float CycleRate; public List? Layers; public RgbLightControllerState(float cycleRate, List? layers) { CycleRate = cycleRate; Layers = layers; } }