]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Power stuff (#31314)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 25 Aug 2024 12:18:42 +0000 (22:18 +1000)
committerGitHub <noreply@github.com>
Sun, 25 Aug 2024 12:18:42 +0000 (22:18 +1000)
* Power stuff

- Add shared IsPowered
- Add shared ResolveApc
- Move PowerChangedEvent to shared for now
- Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it.

* big update

* boing

98 files changed:
Content.Client/Administration/UI/BanList/BanListWindow.xaml.cs
Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs
Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.cs
Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs
Content.Client/CrewManifest/CrewManifestUi.xaml.cs
Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs
Content.Client/Lobby/UI/LobbyGui.xaml.cs
Content.Client/MachineLinking/UI/SignalTimerWindow.xaml.cs
Content.Client/Options/UI/OptionsMenu.xaml.cs
Content.Client/Power/EntitySystems/PowerReceiverSystem.cs
Content.Client/Power/Generator/GeneratorWindow.xaml.cs
Content.Client/Radio/Ui/IntercomMenu.xaml.cs
Content.Client/StationRecords/GeneralRecord.xaml.cs
Content.Client/Storage/Components/StorageContainerVisualsComponent.cs
Content.Client/Xenoarchaeology/Ui/AnalysisConsoleMenu.xaml.cs
Content.Server/AlertLevel/AlertLevelDisplaySystem.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Server/Anomaly/AnomalySynchronizerSystem.cs
Content.Server/Anomaly/AnomalySystem.Generator.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs
Content.Server/Atmos/Portable/PortableScrubberSystem.cs
Content.Server/Atmos/Portable/SpaceHeaterSystem.cs
Content.Server/Audio/AmbientSoundSystem.cs
Content.Server/Audio/Jukebox/JukeboxSystem.cs
Content.Server/Bed/BedSystem.cs
Content.Server/Buckle/Systems/AntiRotOnBuckleSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Telepad.cs
Content.Server/Chemistry/EntitySystems/SolutionContainerMixerSystem.cs
Content.Server/Chemistry/EntitySystems/SolutionHeaterSystem.cs
Content.Server/Cloning/CloningConsoleSystem.cs
Content.Server/Construction/ConstructionSystem.Computer.cs
Content.Server/Construction/FlatpackSystem.cs
Content.Server/DeviceLinking/Components/PowerSensorComponent.cs
Content.Server/DeviceNetwork/Systems/DeviceNetworkRequiresPowerSystem.cs
Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs
Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs
Content.Server/Doors/Systems/AirlockSystem.cs
Content.Server/Doors/Systems/DoorSystem.cs
Content.Server/Doors/Systems/FirelockSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/Light/EntitySystems/EmergencyLightSystem.cs
Content.Server/Light/EntitySystems/LitOnPoweredSystem.cs
Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Content.Server/Materials/MaterialReclaimerSystem.cs
Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs
Content.Server/Medical/CryoPodSystem.cs
Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs
Content.Server/Paper/PaperRandomStoryComponent.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs
Content.Server/Physics/Controllers/ConveyorController.cs
Content.Server/Power/Components/ApcPowerReceiverComponent.cs
Content.Server/Power/Components/CableComponent.cs
Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs
Content.Server/Power/EntitySystems/CableMultitoolSystem.cs
Content.Server/Power/EntitySystems/ChargerSystem.cs
Content.Server/Power/EntitySystems/PowerNetSystem.cs
Content.Server/Power/EntitySystems/PowerReceiverSystem.cs
Content.Server/Power/Generation/Teg/TegSystem.cs
Content.Server/Power/Generator/GasPowerReceiverSystem.cs
Content.Server/Power/Generator/GeneratorSignalControlComponent.cs
Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Server/Shuttles/Systems/ThrusterSystem.cs
Content.Server/Singularity/EntitySystems/EmitterSystem.cs
Content.Server/Sound/SpamEmitSoundRequirePowerSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs
Content.Server/Temperature/Systems/EntityHeaterSystem.cs
Content.Server/VendingMachines/VendingMachineSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactCrusherSystem.cs
Content.Shared/Cabinet/ItemCabinetComponent.cs
Content.Shared/Cargo/Components/CashComponent.cs
Content.Shared/Chemistry/Components/Solution.cs
Content.Shared/Clothing/Components/PilotedByClothingComponent.cs
Content.Shared/Clothing/Components/ToggleClothingComponent.cs
Content.Shared/Containers/ContainerFillComponent.cs
Content.Shared/Light/Components/SlimPoweredLightComponent.cs [new file with mode: 0644]
Content.Shared/Light/EntitySystems/SlimPoweredLightSystem.cs [new file with mode: 0644]
Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs
Content.Shared/Objectives/ObjectiveInfo.cs
Content.Shared/Payload/Components/PayloadTriggerComponent.cs
Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs
Content.Shared/Power/PowerChangedEvent.cs [new file with mode: 0644]
Content.Shared/PowerCell/PowerCellDrawComponent.cs
Content.Shared/Tools/Systems/SharedToolSystem.cs
Content.Shared/Weapons/Melee/MeleeSoundSystem.cs

index c95f8f204dd4a0bdad3ed93647f4cdbb7999ca5f..fad55f9627368141d96bfc06369722c5cb262474 100644 (file)
@@ -1,4 +1,5 @@
 using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Client.UserInterface.XAML;
 
index dd8e3e22121e83a96d963b84a17583ab8433e3bf..b4e9a07ef88b7a5968b625315f50f3ec2eb8918d 100644 (file)
@@ -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
 {
index a2faf208d92f7fddbac230d15ff374c5de8da2de..7cb32b43df59f3e5fb274473cddabe6a5cb5101a 100644 (file)
@@ -1,4 +1,5 @@
 using System.Numerics;
+using Content.Client.UserInterface.Controls;
 using Content.Shared.Roles;
 using Robust.Client.AutoGenerated;
 using Robust.Client.Console;
index 273707cb6ea935c7fa5b44b805d6015dd8575523..27ddd51815e3c566b76b055df192a99e160554fa 100644 (file)
@@ -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;
index 269694ebf9ed87a066a6595a263041eec75f78b8..81410dc7e6df5302e91bdc089a5d2b6116615bf1 100644 (file)
@@ -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;
index 4183c908141e3acdaa61f235c4e1d5bf875e3124..f07e54eb65b508701765770f9603d84017ef2655 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Client.CrewManifest.UI;
 using Content.Shared.CrewManifest;
 using Robust.Client.AutoGenerated;
 using Robust.Client.UserInterface.CustomControls;
index 14709f8b1f017f4a9325e4282b17469ab4ffa75a..619cac6839104cbd98a01afaa81ae8e0b82c4f7c 100644 (file)
@@ -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;
index 6471edb6f3792cdade8a20a29084bd3d0b0d5961..81230130a1dc46f09d3be67cfe3b6bc199aa970d 100644 (file)
@@ -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;
 
index 6133abfcb7043b931304cd19de2e66d06ec5d50e..441ca9ea3654014f1d4f7ac9b9c8d5a0662064b6 100644 (file)
@@ -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;
 
index 61037f4e4afc4caf4cdfade67d4858164622d65c..b749d1f234d0e4aeb3fe3fcadd8a323181e87e28 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Client.Options.UI.Tabs;
 using Robust.Client.AutoGenerated;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Client.UserInterface.XAML;
index 61e20f751cafdd1b90b415ca4ebfc96556b5e9e3..ebf6c18c953ad2704085bd3ef4d8c1ce82fe3572 100644 (file)
@@ -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;
+    }
 }
index e975e5d466e181619f58eb517a10308c2c509110..161482e09052f7d3aa7ea3e482c6e16b983eb8ab 100644 (file)
@@ -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;
 
index 20d2e4a3e54e98119909e5622a896ebd95110b54..f66b3db000e5a6a8b3c7c751b62fb781f340a2bb 100644 (file)
@@ -1,3 +1,4 @@
+using System.Threading.Channels;
 using Content.Client.UserInterface.Controls;
 using Content.Shared.Radio.Components;
 using Robust.Client.AutoGenerated;
index 6a2622fba9e5cc7576f122d9e09716253a7dccca..e84c2dc09828f73f8a165b37d0b4097dda3d8ce7 100644 (file)
@@ -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;
 
index 9f07867da855da97125e180c3b828276b3f58f97..9ef6c65e890718ab5cd3536f6bd14e1dc45b2b53 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Client.Chemistry.Visualizers;
+using Content.Shared.Chemistry.Components;
 
 namespace Content.Client.Storage.Components;
 
index 2890bb3dbf7fc58fd518fec2917ce0df5340ad68..2723db1efbf00c0432d115e8a4cd9623d13903c7 100644 (file)
@@ -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;
index 4f2108748b885083ad373bc935cd1dce6df12376..3dd216c5dce12d27defbd64cede467a508ca1ede 100644 (file)
@@ -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;
 
index bac2648307cce3af9cc0b8af720643467b95f074..bc3b57bd5a3e5301dc7dec47396aa33f9476405b 100644 (file)
@@ -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;
index 9f18a412925556e4f8c06bc99f08eb051f0b75d7..d4a3a0d5faa9a87568b1d96e50fe968d383b894c 100644 (file)
@@ -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;
 
index 056a985cbe2040d98245b8ebb33ba1a45ad42756..6eb84b944184ee455d6ffe28876559bb50afd076 100644 (file)
@@ -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;
index 561cad8d7eed464f0f08b89c2eb4ecbf63a47e10..b0bf3895092860a505bb148c4fcf2a217488364a 100644 (file)
@@ -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;
 
index f7758f11f17d0c7859dcd5b73b8fdb50e21b4494..b359a13bd121ec90a3d6b77ab480de12f4980d51 100644 (file)
@@ -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;
index 7212865baaf0bd973204e501421fff09af8d6b0f..eebac18501a86ed321fe8371ae7dc80e69e95f3c 100644 (file)
@@ -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;
index 1b3b11068c52692cb3d2459ef7f638bc8622600d..81a3968e6ff04aff352bed5c65494f06c00bdc43 100644 (file)
@@ -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;
index c1a5256fdd5bb51f0e649db1c3e3e318f19ab167..2c9a3587559a82e25eb8aed579211e740a631f42 100644 (file)
@@ -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;
 
index 2859c7f19d0c09ab09d2add5c0f43b980f9bbe29..dbbbf2d00830e2687aabc91b1126ddbfae48fb7e 100644 (file)
@@ -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;
index b27689ed586ed5af358ce7eeaf2103510dceb159..a35cf6c2e30592f7c12460a0515464906e5fae93 100644 (file)
@@ -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;
index bc5db2e22cbf0afbdf835cf76483508851a2130a..b1b6ed3678993a187ef76f4854f0f2fd3b35a4a2 100644 (file)
@@ -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
 {
index cbf63f54043164b713bf110538a6ed317210801a..36ef59e743bce8f3c9ea0ec4da33c5ab7e409c62 100644 (file)
@@ -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;
 
index e78970d1243df3b5215c13855e7d3dc56545100b..1f4abf34f77f4cd411775793f7b0ea590758a595 100644 (file)
@@ -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;
 
index cc9235e3d7a41ad65e5309390995c23f7be8b815..3535f6b238258bcdb7c237a28e870878ef1b70a9 100644 (file)
@@ -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;
index a6b61da591f34907928131da9e23ee8fc0b4ff1d..2cc8085e725cd9cf5a648b92ca864ca8abf6e715 100644 (file)
@@ -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;
 
index 4458b020a11bca372a21b5b84aecfce9342ba98e..6f356baf0735d724597556dd03a4aa7cdac8191b 100644 (file)
@@ -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;
 
index f83ec1a5123b6e875d673b527445e6d3cee52e21..5b6997407763b870bea13e7582e3543c160fa210 100644 (file)
@@ -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;
index a942d34e7a82dd9605a42bea67f8a19f1fb96344..45a85010b1942f24f109b6ec167994d6e7265d43 100644 (file)
@@ -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;
 
index 6e6373e10bf7570c434c5612dbfab7fc332807c6..cd39d20b753e330f98cd72e01516a0f0a7d0df99 100644 (file)
@@ -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;
 
index 950a6599a890bbecf0d6c8740bcc38c0f4613419..050e2b7f0647fbff29fa71c339995270561fb4da 100644 (file)
@@ -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;
index 0685b08f4ff879063f037af897b6326534f698eb..6951d44b4d55e8fd8a92fd698f0fbf91c740dbaa 100644 (file)
@@ -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;
index af2132723cd1364bb6680bbce949c0112e893bdc..11303e7f2eeef9b65b0720aa280de665619ae606 100644 (file)
@@ -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;
 
index d9599546aea07473728117a132ff57a6d30201a5..b67a2fcd9507c102247703174198a90b4bb4e3cd 100644 (file)
@@ -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;
index 6e7bd255c5dc4c43e2810679b17b6237a99d23d2..f47a5df8ac401dcb73a5c5acc1320cf563dc35c6 100644 (file)
@@ -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;
 
index cdc083feacd1271f4b3f85ae918bac39b17d2a39..d189afc0a029bfbb3477dbf4f73f18735da50c99 100644 (file)
@@ -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;
 
index 7726acfc93ae19f74ca81d2e5d96e708844068f3..f1d182fc6689491e3128b3c47aded13d5fa48352 100644 (file)
@@ -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;
index fd5d3a9ceba3c654a1cb22484aebf6cbf0c1ce3f..e9f1db13ffb9d1d129161d1a7aef958334bb5195 100644 (file)
@@ -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;
 
index 5968e445c19a8df747bd089fe6523f89aefe2c84..292f8ec8e97c12fc7caf92ccbd433c377886178a 100644 (file)
@@ -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;
index 87e5887c422c5e39cf89ca68d6e1634857ba47a7..6bb1972b6eca72683b78161668d2b0e3a19924f6 100644 (file)
@@ -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;
 
index 18852ac75551d2d4abaeb79312589c46c252642c..a43d0171e604159d2d29be6bef33460262c6bed8 100644 (file)
@@ -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;
 
index b4023bbdb9ffddafec31b22e3f4a6cc958befe0a..f7e0c6fde22a9a7856cf5eab8eb4621d09f0ac7d 100644 (file)
@@ -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
 {
index 6d7d4e453315d99367a9c59e7be1708d083a12f2..18f246dcef491213adbe53c1cd55306b7cb16386 100644 (file)
@@ -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;
index b6810aa33be6041d0c945d5ff0b6b199aef73036..6bd5750460a5cc36970267481f5e432cbfdc86a6 100644 (file)
@@ -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;
index 752fb8f5fe6a33391f13c8b873739c0518f34185..3c5f7eaecb2d102d49cfe7f6fbc502128eebe5d6 100644 (file)
@@ -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
 {
index 33b7ce0782f4a4d2b01b16380820ec6fd7e7e4e6..6e1363dee2a2e4b35b51126ce8d71ebcc40bfe3f 100644 (file)
@@ -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
 {
index e66c27343c858394c4e147aa95e3ff0cb4b015a8..b02212844b0cdbbb34d96fd017baf83be1b1a575 100644 (file)
@@ -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;
index c5beed718ed7797341ab1893238d4472611ee522..868e6d99f251a0a80f0dca254aa46bb6978ebc5d 100644 (file)
@@ -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;
index 8d54fc6dd951d0a36eae3fc1c9f81cd92669a14e..2c9f58616a2f8213b8e059246e57b99d132f96cd 100644 (file)
@@ -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;
index 180e40d1e42625a785c0ef4bce78dac4876a0d53..c91a6f795b2c03559230c961e0384ffffaa8f0fb 100644 (file)
@@ -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;
index b8e07f0ee819d6b6fbe55405e9ed19662a7500a7..7b6624ac85dd8cee4c8a07d251b740ae3e072833 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Paper;
 using Content.Shared.StoryGen;
 using Robust.Shared.Prototypes;
 
index 4d39a5ce305c01b7ebe8e4410099aa210ed29562..17943c1c9878805c992ffff207e38bbf375e1b97 100644 (file)
@@ -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;
index e2788fa54cfb0fcd2afce3963c86a5c8ba26ba8e..3c0db7f85a3cdf17d750a35f86fc708dbf4f14e7 100644 (file)
@@ -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;
index 9a68e2aabb894b5e77d24e93362f91ffad257656..ebb3c6b42f306d18649d5e62322eff6d8eb96c85 100644 (file)
@@ -59,11 +59,4 @@ namespace Content.Server.Power.Components
 
         public float PowerReceived => NetworkLoad.ReceivingPower;
     }
-
-    /// <summary>
-    /// Raised whenever an ApcPowerReceiver becomes powered / unpowered.
-    /// Does nothing on the client.
-    /// </summary>
-    [ByRefEvent]
-    public readonly record struct PowerChangedEvent(bool Powered, float ReceivingPower);
 }
index a2a02a60f681b5db2f9e71945d2f1bf727a90c62..7398bc0616e13224e3cc29ce3bed94979bc6183b 100644 (file)
@@ -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<EntityPrototype>))]
-    public string CableDroppedOnCutPrototype = "CableHVStack1";
+    [DataField]
+    public EntProtoId CableDroppedOnCutPrototype = "CableHVStack1";
 
-    [DataField("cuttingQuality", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
-    public string CuttingQuality = "Cutting";
+    [DataField]
+    public ProtoId<ToolQualityPrototype> CuttingQuality = SharedToolSystem.CutQuality;
 
     /// <summary>
     ///     Checked by <see cref="CablePlacerComponent"/> to determine if there is
index 11f35634b20beefc74ed4cc6ec61224693ad5b79..9fd824a3c49559e7cbc80dcae4b5aa32afa9b042 100644 (file)
@@ -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;
index 15b967bb1d5cbb0c873c14a64aa661317de7c2a1..4a63be894ef2bd54983200ce2fb52abbaefde691 100644 (file)
@@ -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,
index 4e2543d2a70dddfba536639f5a40e80145eb6c20..df7bd2a54f7da84ab45059d540233ccbb34d2ff0 100644 (file)
@@ -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;
index a7098649ceffb19f38c626d709576c775ea8045d..9ce4814139629674e1396b85254377cd03a7fd00 100644 (file)
@@ -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;
index 9b15bdfd287a05528ee7bd452c2fb422a936b401..38d7376e5470e850688778fe10b9cf2204c6ad90 100644 (file)
@@ -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;
+        }
     }
 }
index 02412ca5fb54b5f59484537c3706147ef44a8c50..edf0693954c5d8e2827c24294f7fefe75797b4e8 100644 (file)
@@ -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;
index 5f79906c9951a284e12cb5ce4c72829904566bf9..5a1bd31a15c36350c854a9ecccd011ff70688ca7 100644 (file)
@@ -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;
 
index f16a09eae373ef820eac408ba8631a1e43268ee8..19ae0bd6876668cfdff7ed15fe4cb4c91432c8e9 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Shared.DeviceLinking;
+using Content.Shared.Power.Generator;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.Power.Generator;
index 1258e0b8c7ebce50233202fc5b71a69ee3991db9..c977fbc0489af6189a57543822e60b5bf08fca94 100644 (file)
@@ -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;
index 00a913aad867c67e6466464b8543dc6d79270241..81a2b29beb49744db475f1fe5acc76c7441ca93c 100644 (file)
@@ -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;
index fd149630814c16f711503ed3ce673ff6364e3d3f..af780df44af5f6d8c137b3b09f4e9948577c7249 100644 (file)
@@ -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;
 
index a9763b64d90bac4b96161218b7671c2fb66237e8..1ada60e1d64506a232053c11f389efdfad75e106 100644 (file)
@@ -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;
index 9cc85060c6e6c91984ee8e3375d8d75e88e615f7..d2c2a8a1ca7adbed2053a9e17dd84ac5b4e8161a 100644 (file)
@@ -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;
 
index f61c57a4a6bb06fb7efaeca3805fc2db24634667..5e50740ae698c77c2778b30817023842bca6de86 100644 (file)
@@ -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;
index d0c2cd78d320b9ad3888cd4c7dda15efa5d47363..315273a0cc4734c116417acd66f43c92dfd6d9dd 100644 (file)
@@ -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;
index 8dd253269d06cb75b09e84029a082a1a5ac3ebf5..9d1dd00590a991709bc39c3aa2210f24cf4f3c81 100644 (file)
@@ -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;
index ffc796cbb22130cb96de89cd878e1e345cf72b49..c4b5b72a9cb759ea5b5d30e6517c86e63a67bfd6 100644 (file)
@@ -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;
index 2866b14a835193a6d1281909013cfb59b98b8c56..a265ce2d431bf144b16f6c6f89f985fc4dd9a5e3 100644 (file)
@@ -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;
index 92dcbb504f87cd5d3efcfae971e8eb18bf3b1ffd..92a0322ecb833f827036b8bff70cdf8ef32e98f7 100644 (file)
@@ -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;
index 8fc2f26fa635a24247e7f1135e2258f35ba23a44..3681e3d402aff4d10882b4ad7de3ed0b77ab6fa5 100644 (file)
@@ -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;
index f65ba46f7a5df34f42852502917c4b44dfe3ada0..f841ea910e7759bcef4416c5558640f4679fd4c5 100644 (file)
@@ -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;
index b1d7e4a263fb3d1416870687d2f725abcebb2f86..f83f6a96ada83e3bfd8628264963a30112b010ac 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Containers.ItemSlots;
 using Robust.Shared.GameStates;
 using Robust.Shared.Serialization;
 
index 10a47ff803abfe3e3d5bcf70c85f0577036973da..89af094e04a7dad3b6b6f12051c1147e64fad7e3 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 namespace Content.Shared.Cargo.Components;
 
 /// <summary>
-/// Can be inserted into a <see cref="Content.Server.Cargo.Components.CargoOrderConsoleComponent"/> to increase the station's bank account.
+/// Can be inserted into a <see cref="CargoOrderConsoleComponent"/> to increase the station's bank account.
 /// </summary>
 [RegisterComponent, NetworkedComponent]
 public sealed partial class CashComponent : Component
index 35ab28f34a1731f56797972cf6c80e65dd9b25fa..fc25781005f8c6c5aa2921b72828e96c6ca82bbf 100644 (file)
@@ -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
 {
index cd4d0d6203053840110bffec1b2c97fe1ab4cf46..a5303ac12122e69d5194eeac71d897c06965aad7 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Clothing.EntitySystems;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Clothing.Components;
index c77aa03475ffb794ece245168d2fc3b56618e66c..04bc3ed4e83d0e9b4d297f85bda0dcc8b657efae 100644 (file)
@@ -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;
 
index 8c63cbc66afee915f0a7ceff98ba1553e03be3ed..7ce5fa88502b63803b54d91734e0123142510ba0 100644 (file)
@@ -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 (file)
index 0000000..bf6ae0e
--- /dev/null
@@ -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.
+/// <summary>
+/// Handles turning a pointlight on / off based on power. Nothing else
+/// </summary>
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+public sealed partial class SlimPoweredLightComponent : Component
+{
+    /// <summary>
+    /// Used to make this as being lit. If unpowered then the light will still be off.
+    /// </summary>
+    [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 (file)
index 0000000..6d984ed
--- /dev/null
@@ -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<SlimPoweredLightComponent, AttemptPointLightToggleEvent>(OnLightAttempt);
+        SubscribeLocalEvent<SlimPoweredLightComponent, PowerChangedEvent>(OnLightPowerChanged);
+    }
+
+    private void OnLightAttempt(Entity<SlimPoweredLightComponent> 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<SlimPoweredLightComponent> 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<SlimPoweredLightComponent?> 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);
+    }
+}
index 42e55bea55dd12824916b945602a93a899ca4ebe..8754de50583ed35382a155d02209c96511d573b1 100644 (file)
@@ -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!;
index 689fe17e6c8f647bedaed814996d60a6dd9a63ad..0b7e7a15f6ef480e395e6fbd79e5a612c583b458 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Objectives.Components;
 using Robust.Shared.Serialization;
 using Robust.Shared.Utility;
 
index 6d3df41ac9712c9637c8c885ba5f8aee577742d1..b064e91198c01e8274114338daaa6138b66b8eb9 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Explosion.Components;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
 
index 37ac751889687638184b9ac0b81606153a501837..2bc2af78314352e21d988577fb91209d25b9fbad 100644 (file)
@@ -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<SharedApcPowerReceiverComponent?> 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 (file)
index 0000000..578a341
--- /dev/null
@@ -0,0 +1,8 @@
+namespace Content.Shared.Power;
+
+/// <summary>
+/// Raised whenever an ApcPowerReceiver becomes powered / unpowered.
+/// Does nothing on the client.
+/// </summary>
+[ByRefEvent]
+public readonly record struct PowerChangedEvent(bool Powered, float ReceivingPower);
\ No newline at end of file
index 9c2f72661de74b7b1dec4486817df226920e438d..7af44420a7122e6c7d46480b8877ba3bfee39f6d 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Item.ItemToggle.Components;
 using Robust.Shared.GameStates;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
index 201eb19a88ba051072c4d63a97f7047536ad2b73..86b91dcda4677864ae846717027030a5d253c3c4 100644 (file)
@@ -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();
index 5bf74802026d56248eaac74bbf26273a41df9dc5..3add18365afd14dd0700f096f62d2f5bbf1412fe 100644 (file)
@@ -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;