diff --git a/Content.Client/Administration/UI/BanList/BanListWindow.xaml.cs b/Content.Client/Administration/UI/BanList/BanListWindow.xaml.cs index c95f8f204d..fad55f9627 100644 --- a/Content.Client/Administration/UI/BanList/BanListWindow.xaml.cs +++ b/Content.Client/Administration/UI/BanList/BanListWindow.xaml.cs @@ -1,4 +1,5 @@ using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs index dd8e3e2212..b4e9a07ef8 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs @@ -11,9 +11,8 @@ using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Network; -using Robust.Shared.Utility; -using Robust.Shared.Timing; using Robust.Shared.Configuration; +using Robust.Shared.Utility; namespace Content.Client.Administration.UI.Bwoink { diff --git a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs index a2faf208d9..7cb32b43df 100644 --- a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs +++ b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Client.UserInterface.Controls; using Content.Shared.Roles; using Robust.Client.AutoGenerated; using Robust.Client.Console; diff --git a/Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.cs b/Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.cs index 273707cb6e..27ddd51815 100644 --- a/Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.cs +++ b/Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.cs @@ -1,4 +1,5 @@ -using Content.Shared.CrewManifest; +using Content.Client.CrewManifest.UI; +using Content.Shared.CrewManifest; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; diff --git a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs index 269694ebf9..81410dc7e6 100644 --- a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs +++ b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs @@ -1,5 +1,6 @@ using System.Linq; using Content.Client.Materials; +using Content.Client.Materials.UI; using Content.Client.Message; using Content.Client.UserInterface.Controls; using Content.Shared.Construction.Components; diff --git a/Content.Client/CrewManifest/CrewManifestUi.xaml.cs b/Content.Client/CrewManifest/CrewManifestUi.xaml.cs index 4183c90814..f07e54eb65 100644 --- a/Content.Client/CrewManifest/CrewManifestUi.xaml.cs +++ b/Content.Client/CrewManifest/CrewManifestUi.xaml.cs @@ -1,3 +1,4 @@ +using Content.Client.CrewManifest.UI; using Content.Shared.CrewManifest; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.CustomControls; diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs index 14709f8b1f..619cac6839 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs @@ -1,5 +1,6 @@ using System.Numerics; using Content.Client.UserInterface.Controls; +using Prometheus; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml.cs b/Content.Client/Lobby/UI/LobbyGui.xaml.cs index 6471edb6f3..81230130a1 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml.cs +++ b/Content.Client/Lobby/UI/LobbyGui.xaml.cs @@ -2,6 +2,7 @@ using Content.Client.Message; using Content.Client.UserInterface.Systems.EscapeMenu; using Robust.Client.AutoGenerated; using Robust.Client.Console; +using Robust.Client.State; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; diff --git a/Content.Client/MachineLinking/UI/SignalTimerWindow.xaml.cs b/Content.Client/MachineLinking/UI/SignalTimerWindow.xaml.cs index 6133abfcb7..441ca9ea36 100644 --- a/Content.Client/MachineLinking/UI/SignalTimerWindow.xaml.cs +++ b/Content.Client/MachineLinking/UI/SignalTimerWindow.xaml.cs @@ -3,6 +3,7 @@ using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.XAML; using Robust.Shared.Timing; using Content.Client.TextScreen; +using Robust.Client.UserInterface.Controls; namespace Content.Client.MachineLinking.UI; diff --git a/Content.Client/Options/UI/OptionsMenu.xaml.cs b/Content.Client/Options/UI/OptionsMenu.xaml.cs index 61037f4e4a..b749d1f234 100644 --- a/Content.Client/Options/UI/OptionsMenu.xaml.cs +++ b/Content.Client/Options/UI/OptionsMenu.xaml.cs @@ -1,3 +1,4 @@ +using Content.Client.Options.UI.Tabs; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; diff --git a/Content.Client/Power/EntitySystems/PowerReceiverSystem.cs b/Content.Client/Power/EntitySystems/PowerReceiverSystem.cs index 61e20f751c..ebf6c18c95 100644 --- a/Content.Client/Power/EntitySystems/PowerReceiverSystem.cs +++ b/Content.Client/Power/EntitySystems/PowerReceiverSystem.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using Content.Client.Power.Components; using Content.Shared.Power.Components; using Content.Shared.Power.EntitySystems; @@ -27,4 +28,16 @@ public sealed class PowerReceiverSystem : SharedPowerReceiverSystem component.Powered = state.Powered; } + + public override bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component) + { + if (component != null) + return true; + + if (!TryComp(entity, out ApcPowerReceiverComponent? receiver)) + return false; + + component = receiver; + return true; + } } diff --git a/Content.Client/Power/Generator/GeneratorWindow.xaml.cs b/Content.Client/Power/Generator/GeneratorWindow.xaml.cs index e975e5d466..161482e090 100644 --- a/Content.Client/Power/Generator/GeneratorWindow.xaml.cs +++ b/Content.Client/Power/Generator/GeneratorWindow.xaml.cs @@ -3,6 +3,7 @@ using Content.Client.UserInterface.Controls; using Content.Shared.Power.Generator; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Network; namespace Content.Client.Power.Generator; diff --git a/Content.Client/Radio/Ui/IntercomMenu.xaml.cs b/Content.Client/Radio/Ui/IntercomMenu.xaml.cs index 20d2e4a3e5..f66b3db000 100644 --- a/Content.Client/Radio/Ui/IntercomMenu.xaml.cs +++ b/Content.Client/Radio/Ui/IntercomMenu.xaml.cs @@ -1,3 +1,4 @@ +using System.Threading.Channels; using Content.Client.UserInterface.Controls; using Content.Shared.Radio.Components; using Robust.Client.AutoGenerated; diff --git a/Content.Client/StationRecords/GeneralRecord.xaml.cs b/Content.Client/StationRecords/GeneralRecord.xaml.cs index 6a2622fba9..e84c2dc098 100644 --- a/Content.Client/StationRecords/GeneralRecord.xaml.cs +++ b/Content.Client/StationRecords/GeneralRecord.xaml.cs @@ -2,6 +2,7 @@ using Content.Shared.StationRecords; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Enums; namespace Content.Client.StationRecords; diff --git a/Content.Client/Storage/Components/StorageContainerVisualsComponent.cs b/Content.Client/Storage/Components/StorageContainerVisualsComponent.cs index 9f07867da8..9ef6c65e89 100644 --- a/Content.Client/Storage/Components/StorageContainerVisualsComponent.cs +++ b/Content.Client/Storage/Components/StorageContainerVisualsComponent.cs @@ -1,4 +1,5 @@ using Content.Client.Chemistry.Visualizers; +using Content.Shared.Chemistry.Components; namespace Content.Client.Storage.Components; diff --git a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml.cs b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml.cs index 2890bb3dbf..2723db1efb 100644 --- a/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml.cs +++ b/Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml.cs @@ -1,6 +1,7 @@ using Content.Client.Stylesheets; using Content.Client.UserInterface.Controls; using Content.Shared.Xenoarchaeology.Equipment; +using Microsoft.VisualBasic; using Robust.Client.AutoGenerated; using Robust.Client.GameObjects; using Robust.Client.UserInterface.Controls; diff --git a/Content.Server/AlertLevel/AlertLevelDisplaySystem.cs b/Content.Server/AlertLevel/AlertLevelDisplaySystem.cs index 4f2108748b..3dd216c5dc 100644 --- a/Content.Server/AlertLevel/AlertLevelDisplaySystem.cs +++ b/Content.Server/AlertLevel/AlertLevelDisplaySystem.cs @@ -1,6 +1,7 @@ using Content.Server.Power.Components; using Content.Server.Station.Systems; using Content.Shared.AlertLevel; +using Content.Shared.Power; namespace Content.Server.AlertLevel; diff --git a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs index bac2648307..bc3b57bd5a 100644 --- a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs +++ b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Ame.Components; using Content.Shared.Containers.ItemSlots; using Content.Shared.Database; using Content.Shared.Mind.Components; +using Content.Shared.Power; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; diff --git a/Content.Server/Anomaly/AnomalySynchronizerSystem.cs b/Content.Server/Anomaly/AnomalySynchronizerSystem.cs index 9f18a41292..d4a3a0d5fa 100644 --- a/Content.Server/Anomaly/AnomalySynchronizerSystem.cs +++ b/Content.Server/Anomaly/AnomalySynchronizerSystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Anomaly.Components; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Popups; +using Content.Shared.Power; using Robust.Shared.Audio.Systems; using Content.Shared.Verbs; diff --git a/Content.Server/Anomaly/AnomalySystem.Generator.cs b/Content.Server/Anomaly/AnomalySystem.Generator.cs index 056a985cbe..6eb84b9441 100644 --- a/Content.Server/Anomaly/AnomalySystem.Generator.cs +++ b/Content.Server/Anomaly/AnomalySystem.Generator.cs @@ -13,6 +13,7 @@ using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Map; using System.Numerics; +using Content.Shared.Power; using Robust.Server.GameObjects; namespace Content.Server.Anomaly; diff --git a/Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs b/Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs index 561cad8d7e..b0bf389509 100644 --- a/Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs +++ b/Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.UserInterface; using Content.Server.Advertise; using Content.Server.Advertise.Components; using Content.Shared.Arcade; +using Content.Shared.Power; using Robust.Server.GameObjects; using Robust.Shared.Player; diff --git a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs index f7758f11f1..b359a13bd1 100644 --- a/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs +++ b/Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Power.Components; using Content.Shared.UserInterface; using Content.Server.Advertise; using Content.Server.Advertise.Components; +using Content.Shared.Power; using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent; using Robust.Server.GameObjects; using Robust.Shared.Audio; diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs index 7212865baa..eebac18501 100644 --- a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs @@ -18,6 +18,7 @@ using Content.Shared.DeviceLinking; using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork.Systems; using Content.Shared.Interaction; +using Content.Shared.Power; using Content.Shared.Wires; using Robust.Server.GameObjects; using Robust.Shared.Player; diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs index 1b3b11068c..81a3968e6f 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs @@ -7,6 +7,7 @@ using Content.Server.DeviceNetwork.Systems; using Content.Server.Power.Components; using Content.Shared.Atmos.Monitor; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.Tag; using Robust.Server.Audio; using Robust.Server.GameObjects; diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index c1a5256fdd..2c9a358755 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -9,6 +9,7 @@ using Content.Server.Power.EntitySystems; using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.Tag; using Robust.Shared.Prototypes; diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs index 2859c7f19d..dbbbf2d008 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs @@ -18,6 +18,7 @@ using Content.Shared.Atmos.Visuals; using Content.Shared.Audio; using Content.Shared.DeviceNetwork; using Content.Shared.Examine; +using Content.Shared.Power; using Content.Shared.Tools.Systems; using JetBrains.Annotations; using Robust.Server.GameObjects; diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs index b27689ed58..a35cf6c2e3 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs @@ -16,6 +16,7 @@ using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Piping.Unary.Components; using Content.Shared.Audio; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.Tools.Systems; using JetBrains.Annotations; using Robust.Server.GameObjects; diff --git a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs index bc5db2e22c..b1b6ed3678 100644 --- a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs +++ b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs @@ -15,6 +15,7 @@ using Content.Server.Administration.Logs; using Content.Server.NodeContainer.EntitySystems; using Content.Shared.Atmos; using Content.Shared.Database; +using Content.Shared.Power; namespace Content.Server.Atmos.Portable { diff --git a/Content.Server/Atmos/Portable/SpaceHeaterSystem.cs b/Content.Server/Atmos/Portable/SpaceHeaterSystem.cs index cbf63f5404..36ef59e743 100644 --- a/Content.Server/Atmos/Portable/SpaceHeaterSystem.cs +++ b/Content.Server/Atmos/Portable/SpaceHeaterSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Atmos.Piping.Portable.Components; using Content.Shared.Atmos.Visuals; +using Content.Shared.Power; using Content.Shared.UserInterface; using Robust.Server.GameObjects; diff --git a/Content.Server/Audio/AmbientSoundSystem.cs b/Content.Server/Audio/AmbientSoundSystem.cs index e78970d124..1f4abf34f7 100644 --- a/Content.Server/Audio/AmbientSoundSystem.cs +++ b/Content.Server/Audio/AmbientSoundSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Audio; using Content.Shared.Mobs; +using Content.Shared.Power; namespace Content.Server.Audio; diff --git a/Content.Server/Audio/Jukebox/JukeboxSystem.cs b/Content.Server/Audio/Jukebox/JukeboxSystem.cs index cc9235e3d7..3535f6b238 100644 --- a/Content.Server/Audio/Jukebox/JukeboxSystem.cs +++ b/Content.Server/Audio/Jukebox/JukeboxSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Audio.Jukebox; +using Content.Shared.Power; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Components; diff --git a/Content.Server/Bed/BedSystem.cs b/Content.Server/Bed/BedSystem.cs index a6b61da591..2cc8085e72 100644 --- a/Content.Server/Bed/BedSystem.cs +++ b/Content.Server/Bed/BedSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Buckle.Components; using Content.Shared.Damage; using Content.Shared.Emag.Systems; using Content.Shared.Mobs.Systems; +using Content.Shared.Power; using Robust.Shared.Timing; using Robust.Shared.Utility; diff --git a/Content.Server/Buckle/Systems/AntiRotOnBuckleSystem.cs b/Content.Server/Buckle/Systems/AntiRotOnBuckleSystem.cs index 4458b020a1..6f356baf07 100644 --- a/Content.Server/Buckle/Systems/AntiRotOnBuckleSystem.cs +++ b/Content.Server/Buckle/Systems/AntiRotOnBuckleSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Power.Components; using Content.Shared.Atmos.Rotting; using Content.Shared.Buckle.Components; +using Content.Shared.Power; namespace Content.Server.Buckle.Systems; diff --git a/Content.Server/Cargo/Systems/CargoSystem.Telepad.cs b/Content.Server/Cargo/Systems/CargoSystem.Telepad.cs index f83ec1a512..5b69974077 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Telepad.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Telepad.cs @@ -6,6 +6,7 @@ using Content.Server.Station.Components; using Content.Shared.Cargo; using Content.Shared.Cargo.Components; using Content.Shared.DeviceLinking; +using Content.Shared.Power; using Robust.Shared.Audio; using Robust.Shared.Random; using Robust.Shared.Utility; diff --git a/Content.Server/Chemistry/EntitySystems/SolutionContainerMixerSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionContainerMixerSystem.cs index a942d34e7a..45a85010b1 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionContainerMixerSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionContainerMixerSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.Power; namespace Content.Server.Chemistry.EntitySystems; diff --git a/Content.Server/Chemistry/EntitySystems/SolutionHeaterSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionHeaterSystem.cs index 6e6373e10b..cd39d20b75 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionHeaterSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionHeaterSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Power.EntitySystems; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Placeable; +using Content.Shared.Power; namespace Content.Server.Chemistry.EntitySystems; diff --git a/Content.Server/Cloning/CloningConsoleSystem.cs b/Content.Server/Cloning/CloningConsoleSystem.cs index 950a6599a8..050e2b7f06 100644 --- a/Content.Server/Cloning/CloningConsoleSystem.cs +++ b/Content.Server/Cloning/CloningConsoleSystem.cs @@ -15,6 +15,7 @@ using Content.Shared.IdentityManagement; using Content.Shared.Mind; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; +using Content.Shared.Power; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.Player; diff --git a/Content.Server/Construction/ConstructionSystem.Computer.cs b/Content.Server/Construction/ConstructionSystem.Computer.cs index 0685b08f4f..6951d44b4d 100644 --- a/Content.Server/Construction/ConstructionSystem.Computer.cs +++ b/Content.Server/Construction/ConstructionSystem.Computer.cs @@ -1,6 +1,7 @@ using Content.Server.Construction.Components; using Content.Server.Power.Components; using Content.Shared.Computer; +using Content.Shared.Power; using Robust.Shared.Containers; namespace Content.Server.Construction; diff --git a/Content.Server/Construction/FlatpackSystem.cs b/Content.Server/Construction/FlatpackSystem.cs index af2132723c..11303e7f2e 100644 --- a/Content.Server/Construction/FlatpackSystem.cs +++ b/Content.Server/Construction/FlatpackSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Power.EntitySystems; using Content.Shared.Construction; using Content.Shared.Construction.Components; using Content.Shared.Containers.ItemSlots; +using Content.Shared.Power; using Robust.Shared.Prototypes; using Robust.Shared.Timing; diff --git a/Content.Server/DeviceLinking/Components/PowerSensorComponent.cs b/Content.Server/DeviceLinking/Components/PowerSensorComponent.cs index d9599546ae..b67a2fcd95 100644 --- a/Content.Server/DeviceLinking/Components/PowerSensorComponent.cs +++ b/Content.Server/DeviceLinking/Components/PowerSensorComponent.cs @@ -1,5 +1,6 @@ using Content.Server.DeviceLinking.Systems; using Content.Shared.DeviceLinking; +using Content.Shared.Power.Generator; using Content.Shared.Tools; using Robust.Shared.Audio; using Robust.Shared.Prototypes; diff --git a/Content.Server/DeviceNetwork/Systems/DeviceNetworkRequiresPowerSystem.cs b/Content.Server/DeviceNetwork/Systems/DeviceNetworkRequiresPowerSystem.cs index 6e7bd255c5..f47a5df8ac 100644 --- a/Content.Server/DeviceNetwork/Systems/DeviceNetworkRequiresPowerSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/DeviceNetworkRequiresPowerSystem.cs @@ -1,6 +1,7 @@ using Content.Server.DeviceNetwork.Components; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; +using Content.Shared.Power.EntitySystems; namespace Content.Server.DeviceNetwork.Systems; diff --git a/Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs b/Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs index cdc083feac..d189afc0a0 100644 --- a/Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs @@ -3,6 +3,7 @@ using Content.Server.DeviceNetwork.Components; using Content.Server.Medical.CrewMonitoring; using Content.Server.Power.Components; using Content.Server.Station.Systems; +using Content.Shared.Power; namespace Content.Server.DeviceNetwork.Systems; diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 7726acfc93..f1d182fc66 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -25,6 +25,7 @@ using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Movement.Events; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Verbs; using Robust.Server.Audio; using Robust.Server.GameObjects; diff --git a/Content.Server/Doors/Systems/AirlockSystem.cs b/Content.Server/Doors/Systems/AirlockSystem.cs index fd5d3a9ceb..e9f1db13ff 100644 --- a/Content.Server/Doors/Systems/AirlockSystem.cs +++ b/Content.Server/Doors/Systems/AirlockSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Wires; using Content.Shared.Doors.Components; using Content.Shared.Doors.Systems; using Content.Shared.Interaction; +using Content.Shared.Power; using Content.Shared.Wires; using Robust.Shared.Player; diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index 5968e445c1..292f8ec8e9 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -1,9 +1,9 @@ using Content.Server.Access; using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; -using Content.Server.Power.Components; using Content.Shared.Doors.Components; using Content.Shared.Doors.Systems; +using Content.Shared.Power; using Robust.Shared.Physics.Components; namespace Content.Server.Doors.Systems; diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index 87e5887c42..6bb1972b6e 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; using Content.Shared.Doors.Components; using Content.Shared.Doors.Systems; +using Content.Shared.Power; using Robust.Server.GameObjects; using Robust.Shared.Map.Components; diff --git a/Content.Server/Fax/FaxSystem.cs b/Content.Server/Fax/FaxSystem.cs index 18852ac755..a43d0171e6 100644 --- a/Content.Server/Fax/FaxSystem.cs +++ b/Content.Server/Fax/FaxSystem.cs @@ -29,6 +29,7 @@ using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Content.Shared.NameModifier.Components; +using Content.Shared.Power; namespace Content.Server.Fax; diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index b4023bbdb9..f7e0c6fde2 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -21,6 +21,7 @@ using Robust.Shared.Timing; using System.Linq; using Content.Server.Jittering; using Content.Shared.Jittering; +using Content.Shared.Power; namespace Content.Server.Kitchen.EntitySystems { diff --git a/Content.Server/Lathe/LatheSystem.cs b/Content.Server/Lathe/LatheSystem.cs index 6d7d4e4533..18f246dcef 100644 --- a/Content.Server/Lathe/LatheSystem.cs +++ b/Content.Server/Lathe/LatheSystem.cs @@ -19,6 +19,7 @@ using Content.Shared.Emag.Components; using Content.Shared.Examine; using Content.Shared.Lathe; using Content.Shared.Materials; +using Content.Shared.Power; using Content.Shared.ReagentSpeed; using Content.Shared.Research.Components; using Content.Shared.Research.Prototypes; diff --git a/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs b/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs index b6810aa33b..6bd5750460 100644 --- a/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs +++ b/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs @@ -7,6 +7,7 @@ using Content.Server.Station.Systems; using Content.Shared.Examine; using Content.Shared.Light; using Content.Shared.Light.Components; +using Content.Shared.Power; using Content.Shared.Station.Components; using Robust.Server.GameObjects; using Color = Robust.Shared.Maths.Color; diff --git a/Content.Server/Light/EntitySystems/LitOnPoweredSystem.cs b/Content.Server/Light/EntitySystems/LitOnPoweredSystem.cs index 752fb8f5fe..3c5f7eaecb 100644 --- a/Content.Server/Light/EntitySystems/LitOnPoweredSystem.cs +++ b/Content.Server/Light/EntitySystems/LitOnPoweredSystem.cs @@ -1,6 +1,8 @@ using Content.Server.Light.Components; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; +using Content.Shared.Power; +using Content.Shared.Power.Components; namespace Content.Server.Light.EntitySystems { diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index 33b7ce0782..6e1363dee2 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -25,6 +25,8 @@ using Robust.Shared.Timing; using Robust.Shared.Audio.Systems; using Content.Shared.Damage.Systems; using Content.Shared.Damage.Components; +using Content.Shared.Power; +using Content.Shared.Power.Components; namespace Content.Server.Light.EntitySystems { diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs index e66c27343c..b02212844b 100644 --- a/Content.Server/Materials/MaterialReclaimerSystem.cs +++ b/Content.Server/Materials/MaterialReclaimerSystem.cs @@ -24,6 +24,7 @@ using Content.Server.Repairable; using Content.Shared.Database; using Content.Shared.Destructible; using Content.Shared.Emag.Components; +using Content.Shared.Power; using Robust.Shared.Prototypes; namespace Content.Server.Materials; diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index c5beed718e..868e6d99f2 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -24,6 +24,7 @@ using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Throwing; using Robust.Server.Player; using Robust.Shared.Audio.Systems; diff --git a/Content.Server/Medical/CryoPodSystem.cs b/Content.Server/Medical/CryoPodSystem.cs index 8d54fc6dd9..2c9f58616a 100644 --- a/Content.Server/Medical/CryoPodSystem.cs +++ b/Content.Server/Medical/CryoPodSystem.cs @@ -29,6 +29,7 @@ using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Medical.Cryogenics; using Content.Shared.MedicalScanner; +using Content.Shared.Power; using Content.Shared.Verbs; using Robust.Server.GameObjects; using Robust.Shared.Containers; diff --git a/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs b/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs index 180e40d1e4..c91a6f795b 100644 --- a/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; +using Content.Shared.Power; using Content.Shared.Storage.Components; using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; diff --git a/Content.Server/Paper/PaperRandomStoryComponent.cs b/Content.Server/Paper/PaperRandomStoryComponent.cs index b8e07f0ee8..7b6624ac85 100644 --- a/Content.Server/Paper/PaperRandomStoryComponent.cs +++ b/Content.Server/Paper/PaperRandomStoryComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Paper; using Content.Shared.StoryGen; using Robust.Shared.Prototypes; diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs index 4d39a5ce30..17943c1c98 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs @@ -6,6 +6,7 @@ using Robust.Shared.Utility; using System.Diagnostics; using Content.Server.Administration.Managers; using Content.Shared.CCVar; +using Content.Shared.Power; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; diff --git a/Content.Server/Physics/Controllers/ConveyorController.cs b/Content.Server/Physics/Controllers/ConveyorController.cs index e2788fa54c..3c0db7f85a 100644 --- a/Content.Server/Physics/Controllers/ConveyorController.cs +++ b/Content.Server/Physics/Controllers/ConveyorController.cs @@ -7,6 +7,7 @@ using Content.Shared.Destructible; using Content.Shared.Maps; using Content.Shared.Physics; using Content.Shared.Physics.Controllers; +using Content.Shared.Power; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; diff --git a/Content.Server/Power/Components/ApcPowerReceiverComponent.cs b/Content.Server/Power/Components/ApcPowerReceiverComponent.cs index 9a68e2aabb..ebb3c6b42f 100644 --- a/Content.Server/Power/Components/ApcPowerReceiverComponent.cs +++ b/Content.Server/Power/Components/ApcPowerReceiverComponent.cs @@ -59,11 +59,4 @@ namespace Content.Server.Power.Components public float PowerReceived => NetworkLoad.ReceivingPower; } - - /// - /// Raised whenever an ApcPowerReceiver becomes powered / unpowered. - /// Does nothing on the client. - /// - [ByRefEvent] - public readonly record struct PowerChangedEvent(bool Powered, float ReceivingPower); } diff --git a/Content.Server/Power/Components/CableComponent.cs b/Content.Server/Power/Components/CableComponent.cs index a2a02a60f6..7398bc0616 100644 --- a/Content.Server/Power/Components/CableComponent.cs +++ b/Content.Server/Power/Components/CableComponent.cs @@ -4,6 +4,7 @@ using Content.Shared.Tools; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using System.Diagnostics.Tracing; +using Content.Shared.Tools.Systems; namespace Content.Server.Power.Components; @@ -14,11 +15,11 @@ namespace Content.Server.Power.Components; [Access(typeof(CableSystem))] public sealed partial class CableComponent : Component { - [DataField("cableDroppedOnCutPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string CableDroppedOnCutPrototype = "CableHVStack1"; + [DataField] + public EntProtoId CableDroppedOnCutPrototype = "CableHVStack1"; - [DataField("cuttingQuality", customTypeSerializer:typeof(PrototypeIdSerializer))] - public string CuttingQuality = "Cutting"; + [DataField] + public ProtoId CuttingQuality = SharedToolSystem.CutQuality; /// /// Checked by to determine if there is diff --git a/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs b/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs index 11f35634b2..9fd824a3c4 100644 --- a/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs +++ b/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Power.Components; +using Content.Shared.Power; using Content.Shared.Power.Components; using Content.Shared.Power.EntitySystems; using Content.Shared.UserInterface; diff --git a/Content.Server/Power/EntitySystems/CableMultitoolSystem.cs b/Content.Server/Power/EntitySystems/CableMultitoolSystem.cs index 15b967bb1d..4a63be894e 100644 --- a/Content.Server/Power/EntitySystems/CableMultitoolSystem.cs +++ b/Content.Server/Power/EntitySystems/CableMultitoolSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Power.NodeGroups; using Content.Server.Tools; using Content.Shared.Examine; using Content.Shared.Interaction; +using Content.Shared.Tools.Systems; using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Shared.Utility; @@ -27,7 +28,7 @@ namespace Content.Server.Power.EntitySystems private void OnAfterInteractUsing(EntityUid uid, CableComponent component, AfterInteractUsingEvent args) { - if (args.Handled || args.Target == null || !args.CanReach || !_toolSystem.HasQuality(args.Used, "Pulsing")) + if (args.Handled || args.Target == null || !args.CanReach || !_toolSystem.HasQuality(args.Used, SharedToolSystem.PulseQuality)) return; var markup = FormattedMessage.FromMarkup(GenerateCableMarkup(uid)); @@ -45,7 +46,7 @@ namespace Content.Server.Power.EntitySystems // Pulsing is hardcoded here because I don't think it needs to be more complex than that right now. // Update if I'm wrong. - var enabled = held != null && _toolSystem.HasQuality(held.Value, "Pulsing"); + var enabled = held != null && _toolSystem.HasQuality(held.Value, SharedToolSystem.PulseQuality); var verb = new ExamineVerb { Disabled = !enabled, diff --git a/Content.Server/Power/EntitySystems/ChargerSystem.cs b/Content.Server/Power/EntitySystems/ChargerSystem.cs index 4e2543d2a7..df7bd2a54f 100644 --- a/Content.Server/Power/EntitySystems/ChargerSystem.cs +++ b/Content.Server/Power/EntitySystems/ChargerSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Emp; using JetBrains.Annotations; using Robust.Shared.Containers; using System.Diagnostics.CodeAnalysis; +using Content.Shared.Power.Components; using Content.Shared.Storage.Components; using Robust.Server.Containers; using Content.Shared.Whitelist; diff --git a/Content.Server/Power/EntitySystems/PowerNetSystem.cs b/Content.Server/Power/EntitySystems/PowerNetSystem.cs index a7098649ce..9ce4814139 100644 --- a/Content.Server/Power/EntitySystems/PowerNetSystem.cs +++ b/Content.Server/Power/EntitySystems/PowerNetSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Power.NodeGroups; using Content.Server.Power.Pow3r; using Content.Shared.CCVar; using Content.Shared.Power; +using Content.Shared.Power.Components; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Configuration; diff --git a/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs b/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs index 9b15bdfd28..38d7376e54 100644 --- a/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs +++ b/Content.Server/Power/EntitySystems/PowerReceiverSystem.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using Content.Server.Administration.Logs; using Content.Server.Administration.Managers; using Content.Server.Power.Components; @@ -197,5 +198,17 @@ namespace Content.Server.Power.EntitySystems { comp.Load = load; } + + public override bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component) + { + if (component != null) + return true; + + if (!TryComp(entity, out ApcPowerReceiverComponent? receiver)) + return false; + + component = receiver; + return true; + } } } diff --git a/Content.Server/Power/Generation/Teg/TegSystem.cs b/Content.Server/Power/Generation/Teg/TegSystem.cs index 02412ca5fb..edf0693954 100644 --- a/Content.Server/Power/Generation/Teg/TegSystem.cs +++ b/Content.Server/Power/Generation/Teg/TegSystem.cs @@ -10,6 +10,8 @@ using Content.Server.Power.Components; using Content.Shared.Atmos; using Content.Shared.DeviceNetwork; using Content.Shared.Examine; +using Content.Shared.Power; +using Content.Shared.Power.Components; using Content.Shared.Power.Generation.Teg; using Content.Shared.Rounding; using Robust.Server.GameObjects; diff --git a/Content.Server/Power/Generator/GasPowerReceiverSystem.cs b/Content.Server/Power/Generator/GasPowerReceiverSystem.cs index 5f79906c99..5a1bd31a15 100644 --- a/Content.Server/Power/Generator/GasPowerReceiverSystem.cs +++ b/Content.Server/Power/Generator/GasPowerReceiverSystem.cs @@ -5,6 +5,8 @@ using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.Nodes; using Content.Server.Power.Components; using Content.Shared.Atmos; +using Content.Shared.Power; +using Content.Shared.Power.Components; namespace Content.Server.Power.Generator; diff --git a/Content.Server/Power/Generator/GeneratorSignalControlComponent.cs b/Content.Server/Power/Generator/GeneratorSignalControlComponent.cs index f16a09eae3..19ae0bd687 100644 --- a/Content.Server/Power/Generator/GeneratorSignalControlComponent.cs +++ b/Content.Server/Power/Generator/GeneratorSignalControlComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.DeviceLinking; +using Content.Shared.Power.Generator; using Robust.Shared.Prototypes; namespace Content.Server.Power.Generator; diff --git a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs index 1258e0b8c7..c977fbc048 100644 --- a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs @@ -9,6 +9,7 @@ using Content.Server.Speech; using Content.Server.Speech.Components; using Content.Shared.Examine; using Content.Shared.Interaction; +using Content.Shared.Power; using Content.Shared.Radio; using Content.Shared.Radio.Components; using Robust.Shared.Prototypes; diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index 00a913aad8..81a2b29beb 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -12,6 +12,7 @@ using Content.Shared.Shuttles.Events; using Content.Shared.Shuttles.Systems; using Content.Shared.Tag; using Content.Shared.Movement.Systems; +using Content.Shared.Power; using Content.Shared.Shuttles.UI.MapObjects; using Content.Shared.Timing; using Robust.Server.GameObjects; diff --git a/Content.Server/Shuttles/Systems/ThrusterSystem.cs b/Content.Server/Shuttles/Systems/ThrusterSystem.cs index fd14963081..af780df44a 100644 --- a/Content.Server/Shuttles/Systems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/Systems/ThrusterSystem.cs @@ -19,6 +19,7 @@ using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; using Robust.Shared.Utility; using Content.Shared.Localizations; +using Content.Shared.Power; namespace Content.Server.Shuttles.Systems; diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs index a9763b64d9..1ada60e1d6 100644 --- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs @@ -11,6 +11,7 @@ using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Lock; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Projectiles; using Content.Shared.Singularity.Components; using Content.Shared.Singularity.EntitySystems; diff --git a/Content.Server/Sound/SpamEmitSoundRequirePowerSystem.cs b/Content.Server/Sound/SpamEmitSoundRequirePowerSystem.cs index 9cc85060c6..d2c2a8a1ca 100644 --- a/Content.Server/Sound/SpamEmitSoundRequirePowerSystem.cs +++ b/Content.Server/Sound/SpamEmitSoundRequirePowerSystem.cs @@ -1,5 +1,7 @@ using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; +using Content.Shared.Power; +using Content.Shared.Power.Components; using Content.Shared.Sound; using Content.Shared.Sound.Components; diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs index f61c57a4a6..5e50740ae6 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs @@ -3,6 +3,7 @@ using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Systems; using Content.Server.Power.Components; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.UserInterface; using Content.Shared.SurveillanceCamera; using Robust.Server.GameObjects; diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs index d0c2cd78d3..315273a0cc 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs @@ -4,6 +4,7 @@ using Content.Server.DeviceNetwork.Systems; using Content.Server.Power.Components; using Content.Shared.ActionBlocker; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.SurveillanceCamera; using Content.Shared.Verbs; using Robust.Server.GameObjects; diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs index 8dd253269d..9d1dd00590 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Emp; using Content.Server.Power.Components; using Content.Shared.ActionBlocker; using Content.Shared.DeviceNetwork; +using Content.Shared.Power; using Content.Shared.SurveillanceCamera; using Content.Shared.Verbs; using Robust.Server.GameObjects; diff --git a/Content.Server/Temperature/Systems/EntityHeaterSystem.cs b/Content.Server/Temperature/Systems/EntityHeaterSystem.cs index ffc796cbb2..c4b5b72a9c 100644 --- a/Content.Server/Temperature/Systems/EntityHeaterSystem.cs +++ b/Content.Server/Temperature/Systems/EntityHeaterSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Temperature.Components; using Content.Shared.Examine; using Content.Shared.Placeable; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Temperature; using Content.Shared.Verbs; using Robust.Server.Audio; diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index 2866b14a83..a265ce2d43 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -16,6 +16,7 @@ using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; using Content.Shared.Emp; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Throwing; using Content.Shared.UserInterface; using Content.Shared.VendingMachines; diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index 92dcbb504f..92a0322ecb 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.GameTicking; using Content.Shared.Hands.Components; using Content.Shared.Interaction; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Tools.Components; using Content.Shared.Wires; using Robust.Server.GameObjects; diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs index 8fc2f26fa6..3681e3d402 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs @@ -11,6 +11,7 @@ using Content.Shared.DeviceLinking.Events; using Content.Shared.Paper; using Content.Shared.Placeable; using Content.Shared.Popups; +using Content.Shared.Power; using Content.Shared.Research.Components; using Content.Shared.Xenoarchaeology.Equipment; using Content.Shared.Xenoarchaeology.XenoArtifacts; diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs index f65ba46f7a..f841ea910e 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs @@ -7,6 +7,7 @@ using Content.Server.Storage.Components; using Content.Server.Xenoarchaeology.XenoArtifacts; using Content.Shared.Body.Components; using Content.Shared.Damage; +using Content.Shared.Power; using Content.Shared.Verbs; using Content.Shared.Whitelist; using Content.Shared.Xenoarchaeology.Equipment; diff --git a/Content.Shared/Cabinet/ItemCabinetComponent.cs b/Content.Shared/Cabinet/ItemCabinetComponent.cs index b1d7e4a263..f83f6a96ad 100644 --- a/Content.Shared/Cabinet/ItemCabinetComponent.cs +++ b/Content.Shared/Cabinet/ItemCabinetComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Containers.ItemSlots; using Robust.Shared.GameStates; using Robust.Shared.Serialization; diff --git a/Content.Shared/Cargo/Components/CashComponent.cs b/Content.Shared/Cargo/Components/CashComponent.cs index 10a47ff803..89af094e04 100644 --- a/Content.Shared/Cargo/Components/CashComponent.cs +++ b/Content.Shared/Cargo/Components/CashComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; namespace Content.Shared.Cargo.Components; /// -/// Can be inserted into a to increase the station's bank account. +/// Can be inserted into a to increase the station's bank account. /// [RegisterComponent, NetworkedComponent] public sealed partial class CashComponent : Component diff --git a/Content.Shared/Chemistry/Components/Solution.cs b/Content.Shared/Chemistry/Components/Solution.cs index 35ab28f34a..fc25781005 100644 --- a/Content.Shared/Chemistry/Components/Solution.cs +++ b/Content.Shared/Chemistry/Components/Solution.cs @@ -6,6 +6,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Utility; using System.Collections; using System.Linq; +using Content.Shared.Chemistry.Components.SolutionManager; namespace Content.Shared.Chemistry.Components { diff --git a/Content.Shared/Clothing/Components/PilotedByClothingComponent.cs b/Content.Shared/Clothing/Components/PilotedByClothingComponent.cs index cd4d0d6203..a5303ac121 100644 --- a/Content.Shared/Clothing/Components/PilotedByClothingComponent.cs +++ b/Content.Shared/Clothing/Components/PilotedByClothingComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Clothing.EntitySystems; using Robust.Shared.GameStates; namespace Content.Shared.Clothing.Components; diff --git a/Content.Shared/Clothing/Components/ToggleClothingComponent.cs b/Content.Shared/Clothing/Components/ToggleClothingComponent.cs index c77aa03475..04bc3ed4e8 100644 --- a/Content.Shared/Clothing/Components/ToggleClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ToggleClothingComponent.cs @@ -1,5 +1,7 @@ using Content.Shared.Actions; using Content.Shared.Clothing.EntitySystems; +using Content.Shared.Item.ItemToggle.Components; +using Content.Shared.Toggleable; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; diff --git a/Content.Shared/Containers/ContainerFillComponent.cs b/Content.Shared/Containers/ContainerFillComponent.cs index 8c63cbc66a..7ce5fa8850 100644 --- a/Content.Shared/Containers/ContainerFillComponent.cs +++ b/Content.Shared/Containers/ContainerFillComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Storage; +using Content.Shared.Storage.Components; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager; using Robust.Shared.Serialization.Markdown.Mapping; diff --git a/Content.Shared/Light/Components/SlimPoweredLightComponent.cs b/Content.Shared/Light/Components/SlimPoweredLightComponent.cs new file mode 100644 index 0000000000..bf6ae0e525 --- /dev/null +++ b/Content.Shared/Light/Components/SlimPoweredLightComponent.cs @@ -0,0 +1,17 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Light.Components; + +// All content light code is terrible and everything is baked-in. Power code got predicted before light code did. +/// +/// Handles turning a pointlight on / off based on power. Nothing else +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class SlimPoweredLightComponent : Component +{ + /// + /// Used to make this as being lit. If unpowered then the light will still be off. + /// + [DataField, AutoNetworkedField] + public bool Enabled = true; +} diff --git a/Content.Shared/Light/EntitySystems/SlimPoweredLightSystem.cs b/Content.Shared/Light/EntitySystems/SlimPoweredLightSystem.cs new file mode 100644 index 0000000000..6d984ed19a --- /dev/null +++ b/Content.Shared/Light/EntitySystems/SlimPoweredLightSystem.cs @@ -0,0 +1,67 @@ +using Content.Shared.Light.Components; +using Content.Shared.Power; +using Content.Shared.Power.Components; +using Content.Shared.Power.EntitySystems; + +namespace Content.Shared.Light.EntitySystems; + +public sealed class SlimPoweredLightSystem : EntitySystem +{ + [Dependency] private readonly SharedPowerReceiverSystem _receiver = default!; + [Dependency] private readonly SharedPointLightSystem _lights = default!; + + private bool _setting; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnLightAttempt); + SubscribeLocalEvent(OnLightPowerChanged); + } + + private void OnLightAttempt(Entity ent, ref AttemptPointLightToggleEvent args) + { + // Early-out to avoid having to trycomp stuff if we're the caller setting it + if (_setting) + return; + + if (args.Enabled && !_receiver.IsPowered(ent.Owner)) + args.Cancelled = true; + } + + private void OnLightPowerChanged(Entity ent, ref PowerChangedEvent args) + { + // Early out if we don't need to trycomp. + if (args.Powered) + { + if (!ent.Comp.Enabled) + return; + } + else + { + if (!ent.Comp.Enabled) + return; + } + + if (!_lights.TryGetLight(ent.Owner, out var light)) + return; + + var enabled = ent.Comp.Enabled && args.Powered; + _setting = true; + _lights.SetEnabled(ent.Owner, enabled, light); + _setting = false; + } + + public void SetEnabled(Entity entity, bool enabled) + { + if (!Resolve(entity.Owner, ref entity.Comp, false)) + return; + + if (entity.Comp.Enabled == enabled) + return; + + entity.Comp.Enabled = enabled; + Dirty(entity); + _lights.SetEnabled(entity.Owner, enabled); + } +} diff --git a/Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs b/Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs index 42e55bea55..8754de5058 100644 --- a/Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs +++ b/Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs @@ -13,6 +13,8 @@ namespace Content.Shared.Light.EntitySystems; public sealed class UnpoweredFlashlightSystem : EntitySystem { + // TODO: Split some of this to ItemTogglePointLight + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; diff --git a/Content.Shared/Objectives/ObjectiveInfo.cs b/Content.Shared/Objectives/ObjectiveInfo.cs index 689fe17e6c..0b7e7a15f6 100644 --- a/Content.Shared/Objectives/ObjectiveInfo.cs +++ b/Content.Shared/Objectives/ObjectiveInfo.cs @@ -1,3 +1,4 @@ +using Content.Shared.Objectives.Components; using Robust.Shared.Serialization; using Robust.Shared.Utility; diff --git a/Content.Shared/Payload/Components/PayloadTriggerComponent.cs b/Content.Shared/Payload/Components/PayloadTriggerComponent.cs index 6d3df41ac9..b064e91198 100644 --- a/Content.Shared/Payload/Components/PayloadTriggerComponent.cs +++ b/Content.Shared/Payload/Components/PayloadTriggerComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Explosion.Components; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; diff --git a/Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs b/Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs index 37ac751889..2bc2af7831 100644 --- a/Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs +++ b/Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using Content.Shared.Examine; using Content.Shared.Power.Components; @@ -5,6 +6,16 @@ namespace Content.Shared.Power.EntitySystems; public abstract class SharedPowerReceiverSystem : EntitySystem { + public abstract bool ResolveApc(EntityUid entity, [NotNullWhen(true)] ref SharedApcPowerReceiverComponent? component); + + public bool IsPowered(Entity entity) + { + if (!ResolveApc(entity.Owner, ref entity.Comp)) + return true; + + return entity.Comp.Powered; + } + protected string GetExamineText(bool powered) { return Loc.GetString("power-receiver-component-on-examine-main", diff --git a/Content.Shared/Power/PowerChangedEvent.cs b/Content.Shared/Power/PowerChangedEvent.cs new file mode 100644 index 0000000000..578a34142a --- /dev/null +++ b/Content.Shared/Power/PowerChangedEvent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared.Power; + +/// +/// Raised whenever an ApcPowerReceiver becomes powered / unpowered. +/// Does nothing on the client. +/// +[ByRefEvent] +public readonly record struct PowerChangedEvent(bool Powered, float ReceivingPower); \ No newline at end of file diff --git a/Content.Shared/PowerCell/PowerCellDrawComponent.cs b/Content.Shared/PowerCell/PowerCellDrawComponent.cs index 9c2f72661d..7af44420a7 100644 --- a/Content.Shared/PowerCell/PowerCellDrawComponent.cs +++ b/Content.Shared/PowerCell/PowerCellDrawComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.cs b/Content.Shared/Tools/Systems/SharedToolSystem.cs index 201eb19a88..86b91dcda4 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.cs @@ -33,6 +33,9 @@ public abstract partial class SharedToolSystem : EntitySystem [Dependency] private readonly TurfSystem _turfs = default!; [Dependency] protected readonly SharedSolutionContainerSystem SolutionContainer = default!; + public const string CutQuality = "Cutting"; + public const string PulseQuality = "Pulsing"; + public override void Initialize() { InitializeMultipleTool(); diff --git a/Content.Shared/Weapons/Melee/MeleeSoundSystem.cs b/Content.Shared/Weapons/Melee/MeleeSoundSystem.cs index 5bf7480202..3add18365a 100644 --- a/Content.Shared/Weapons/Melee/MeleeSoundSystem.cs +++ b/Content.Shared/Weapons/Melee/MeleeSoundSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Weapons.Melee.Components; +using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems;