Power stuff (#31314)

* 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
This commit is contained in:
metalgearsloth
2024-08-25 22:18:42 +10:00
committed by GitHub
parent 3d145875a4
commit a89d4c750b
98 changed files with 236 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;

View File

@@ -11,9 +11,8 @@ using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Utility;
using Robust.Shared.Timing;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Utility;
namespace Content.Client.Administration.UI.Bwoink namespace Content.Client.Administration.UI.Bwoink
{ {

View File

@@ -1,4 +1,5 @@
using System.Numerics; using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Roles; using Content.Shared.Roles;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.Console; using Robust.Client.Console;

View 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.AutoGenerated;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;

View File

@@ -1,5 +1,6 @@
using System.Linq; using System.Linq;
using Content.Client.Materials; using Content.Client.Materials;
using Content.Client.Materials.UI;
using Content.Client.Message; using Content.Client.Message;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared.Construction.Components; using Content.Shared.Construction.Components;

View File

@@ -1,3 +1,4 @@
using Content.Client.CrewManifest.UI;
using Content.Shared.CrewManifest; using Content.Shared.CrewManifest;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;

View File

@@ -1,5 +1,6 @@
using System.Numerics; using System.Numerics;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Prometheus;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;

View File

@@ -2,6 +2,7 @@ using Content.Client.Message;
using Content.Client.UserInterface.Systems.EscapeMenu; using Content.Client.UserInterface.Systems.EscapeMenu;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.Console; using Robust.Client.Console;
using Robust.Client.State;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;

View File

@@ -3,6 +3,7 @@ using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Content.Client.TextScreen; using Content.Client.TextScreen;
using Robust.Client.UserInterface.Controls;
namespace Content.Client.MachineLinking.UI; namespace Content.Client.MachineLinking.UI;

View File

@@ -1,3 +1,4 @@
using Content.Client.Options.UI.Tabs;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Content.Client.Power.Components; using Content.Client.Power.Components;
using Content.Shared.Power.Components; using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems; using Content.Shared.Power.EntitySystems;
@@ -27,4 +28,16 @@ public sealed class PowerReceiverSystem : SharedPowerReceiverSystem
component.Powered = state.Powered; 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;
}
} }

View File

@@ -3,6 +3,7 @@ using Content.Client.UserInterface.Controls;
using Content.Shared.Power.Generator; using Content.Shared.Power.Generator;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Network;
namespace Content.Client.Power.Generator; namespace Content.Client.Power.Generator;

View File

@@ -1,3 +1,4 @@
using System.Threading.Channels;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared.Radio.Components; using Content.Shared.Radio.Components;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;

View File

@@ -2,6 +2,7 @@ using Content.Shared.StationRecords;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Enums;
namespace Content.Client.StationRecords; namespace Content.Client.StationRecords;

View File

@@ -1,4 +1,5 @@
using Content.Client.Chemistry.Visualizers; using Content.Client.Chemistry.Visualizers;
using Content.Shared.Chemistry.Components;
namespace Content.Client.Storage.Components; namespace Content.Client.Storage.Components;

View File

@@ -1,6 +1,7 @@
using Content.Client.Stylesheets; using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared.Xenoarchaeology.Equipment; using Content.Shared.Xenoarchaeology.Equipment;
using Microsoft.VisualBasic;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;

View File

@@ -1,6 +1,7 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.AlertLevel; using Content.Shared.AlertLevel;
using Content.Shared.Power;
namespace Content.Server.AlertLevel; namespace Content.Server.AlertLevel;

View File

@@ -10,6 +10,7 @@ using Content.Shared.Ame.Components;
using Content.Shared.Containers.ItemSlots; using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Power;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;

View File

@@ -7,6 +7,7 @@ using Content.Shared.Anomaly.Components;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Content.Shared.Verbs; using Content.Shared.Verbs;

View File

@@ -13,6 +13,7 @@ using Robust.Shared.Physics;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Map; using Robust.Shared.Map;
using System.Numerics; using System.Numerics;
using Content.Shared.Power;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
namespace Content.Server.Anomaly; namespace Content.Server.Anomaly;

View File

@@ -3,6 +3,7 @@ using Content.Shared.UserInterface;
using Content.Server.Advertise; using Content.Server.Advertise;
using Content.Server.Advertise.Components; using Content.Server.Advertise.Components;
using Content.Shared.Arcade; using Content.Shared.Arcade;
using Content.Shared.Power;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Player; using Robust.Shared.Player;

View File

@@ -2,6 +2,7 @@ using Content.Server.Power.Components;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Content.Server.Advertise; using Content.Server.Advertise;
using Content.Server.Advertise.Components; using Content.Server.Advertise.Components;
using Content.Shared.Power;
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent; using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;

View File

@@ -18,6 +18,7 @@ using Content.Shared.DeviceLinking;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.DeviceNetwork.Systems; using Content.Shared.DeviceNetwork.Systems;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Power;
using Content.Shared.Wires; using Content.Shared.Wires;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Player; using Robust.Shared.Player;

View File

@@ -7,6 +7,7 @@ using Content.Server.DeviceNetwork.Systems;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Server.Audio; using Robust.Server.Audio;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -9,6 +9,7 @@ using Content.Server.Power.EntitySystems;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -18,6 +18,7 @@ using Content.Shared.Atmos.Visuals;
using Content.Shared.Audio; using Content.Shared.Audio;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Power;
using Content.Shared.Tools.Systems; using Content.Shared.Tools.Systems;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -16,6 +16,7 @@ using Content.Shared.Atmos.Monitor;
using Content.Shared.Atmos.Piping.Unary.Components; using Content.Shared.Atmos.Piping.Unary.Components;
using Content.Shared.Audio; using Content.Shared.Audio;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.Tools.Systems; using Content.Shared.Tools.Systems;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -15,6 +15,7 @@ using Content.Server.Administration.Logs;
using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.EntitySystems;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Power;
namespace Content.Server.Atmos.Portable namespace Content.Server.Atmos.Portable
{ {

View File

@@ -6,6 +6,7 @@ using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Atmos.Piping.Portable.Components; using Content.Shared.Atmos.Piping.Portable.Components;
using Content.Shared.Atmos.Visuals; using Content.Shared.Atmos.Visuals;
using Content.Shared.Power;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -2,6 +2,7 @@ using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Audio; using Content.Shared.Audio;
using Content.Shared.Mobs; using Content.Shared.Mobs;
using Content.Shared.Power;
namespace Content.Server.Audio; namespace Content.Server.Audio;

View File

@@ -1,6 +1,7 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Audio.Jukebox; using Content.Shared.Audio.Jukebox;
using Content.Shared.Power;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Components; using Robust.Shared.Audio.Components;

View File

@@ -10,6 +10,7 @@ using Content.Shared.Buckle.Components;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Emag.Systems; using Content.Shared.Emag.Systems;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Power;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

@@ -1,6 +1,7 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.Atmos.Rotting; using Content.Shared.Atmos.Rotting;
using Content.Shared.Buckle.Components; using Content.Shared.Buckle.Components;
using Content.Shared.Power;
namespace Content.Server.Buckle.Systems; namespace Content.Server.Buckle.Systems;

View File

@@ -6,6 +6,7 @@ using Content.Server.Station.Components;
using Content.Shared.Cargo; using Content.Shared.Cargo;
using Content.Shared.Cargo.Components; using Content.Shared.Cargo.Components;
using Content.Shared.DeviceLinking; using Content.Shared.DeviceLinking;
using Content.Shared.Power;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

@@ -2,6 +2,7 @@ using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Power;
namespace Content.Server.Chemistry.EntitySystems; namespace Content.Server.Chemistry.EntitySystems;

View File

@@ -5,6 +5,7 @@ using Content.Server.Power.EntitySystems;
using Content.Shared.Chemistry; using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Placeable; using Content.Shared.Placeable;
using Content.Shared.Power;
namespace Content.Server.Chemistry.EntitySystems; namespace Content.Server.Chemistry.EntitySystems;

View File

@@ -15,6 +15,7 @@ using Content.Shared.IdentityManagement;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Power;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.Player; using Robust.Server.Player;

View File

@@ -1,6 +1,7 @@
using Content.Server.Construction.Components; using Content.Server.Construction.Components;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.Computer; using Content.Shared.Computer;
using Content.Shared.Power;
using Robust.Shared.Containers; using Robust.Shared.Containers;
namespace Content.Server.Construction; namespace Content.Server.Construction;

View File

@@ -4,6 +4,7 @@ using Content.Server.Power.EntitySystems;
using Content.Shared.Construction; using Content.Shared.Construction;
using Content.Shared.Construction.Components; using Content.Shared.Construction.Components;
using Content.Shared.Containers.ItemSlots; using Content.Shared.Containers.ItemSlots;
using Content.Shared.Power;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -1,5 +1,6 @@
using Content.Server.DeviceLinking.Systems; using Content.Server.DeviceLinking.Systems;
using Content.Shared.DeviceLinking; using Content.Shared.DeviceLinking;
using Content.Shared.Power.Generator;
using Content.Shared.Tools; using Content.Shared.Tools;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -1,6 +1,7 @@
using Content.Server.DeviceNetwork.Components; using Content.Server.DeviceNetwork.Components;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Power.EntitySystems;
namespace Content.Server.DeviceNetwork.Systems; namespace Content.Server.DeviceNetwork.Systems;

View File

@@ -3,6 +3,7 @@ using Content.Server.DeviceNetwork.Components;
using Content.Server.Medical.CrewMonitoring; using Content.Server.Medical.CrewMonitoring;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Power;
namespace Content.Server.DeviceNetwork.Systems; namespace Content.Server.DeviceNetwork.Systems;

View File

@@ -25,6 +25,7 @@ using Content.Shared.Interaction;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Movement.Events; using Content.Shared.Movement.Events;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Server.Audio; using Robust.Server.Audio;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -4,6 +4,7 @@ using Content.Server.Wires;
using Content.Shared.Doors.Components; using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems; using Content.Shared.Doors.Systems;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Power;
using Content.Shared.Wires; using Content.Shared.Wires;
using Robust.Shared.Player; using Robust.Shared.Player;

View File

@@ -1,9 +1,9 @@
using Content.Server.Access; using Content.Server.Access;
using Content.Server.Atmos.Components; using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems; using Content.Server.Atmos.EntitySystems;
using Content.Server.Power.Components;
using Content.Shared.Doors.Components; using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems; using Content.Shared.Doors.Systems;
using Content.Shared.Power;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
namespace Content.Server.Doors.Systems; namespace Content.Server.Doors.Systems;

View File

@@ -8,6 +8,7 @@ using Content.Shared.Atmos;
using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor;
using Content.Shared.Doors.Components; using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems; using Content.Shared.Doors.Systems;
using Content.Shared.Power;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;

View File

@@ -29,6 +29,7 @@ using Robust.Shared.Containers;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.NameModifier.Components; using Content.Shared.NameModifier.Components;
using Content.Shared.Power;
namespace Content.Server.Fax; namespace Content.Server.Fax;

View File

@@ -21,6 +21,7 @@ using Robust.Shared.Timing;
using System.Linq; using System.Linq;
using Content.Server.Jittering; using Content.Server.Jittering;
using Content.Shared.Jittering; using Content.Shared.Jittering;
using Content.Shared.Power;
namespace Content.Server.Kitchen.EntitySystems namespace Content.Server.Kitchen.EntitySystems
{ {

View File

@@ -19,6 +19,7 @@ using Content.Shared.Emag.Components;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Lathe; using Content.Shared.Lathe;
using Content.Shared.Materials; using Content.Shared.Materials;
using Content.Shared.Power;
using Content.Shared.ReagentSpeed; using Content.Shared.ReagentSpeed;
using Content.Shared.Research.Components; using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes; using Content.Shared.Research.Prototypes;

View File

@@ -7,6 +7,7 @@ using Content.Server.Station.Systems;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Light; using Content.Shared.Light;
using Content.Shared.Light.Components; using Content.Shared.Light.Components;
using Content.Shared.Power;
using Content.Shared.Station.Components; using Content.Shared.Station.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Color = Robust.Shared.Maths.Color; using Color = Robust.Shared.Maths.Color;

View File

@@ -1,6 +1,8 @@
using Content.Server.Light.Components; using Content.Server.Light.Components;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Power;
using Content.Shared.Power.Components;
namespace Content.Server.Light.EntitySystems namespace Content.Server.Light.EntitySystems
{ {

View File

@@ -25,6 +25,8 @@ using Robust.Shared.Timing;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Content.Shared.Damage.Systems; using Content.Shared.Damage.Systems;
using Content.Shared.Damage.Components; using Content.Shared.Damage.Components;
using Content.Shared.Power;
using Content.Shared.Power.Components;
namespace Content.Server.Light.EntitySystems namespace Content.Server.Light.EntitySystems
{ {

View File

@@ -24,6 +24,7 @@ using Content.Server.Repairable;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Destructible; using Content.Shared.Destructible;
using Content.Shared.Emag.Components; using Content.Shared.Emag.Components;
using Content.Shared.Power;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Server.Materials; namespace Content.Server.Materials;

View File

@@ -24,6 +24,7 @@ using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;

View File

@@ -29,6 +29,7 @@ using Content.Shared.Examine;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Medical.Cryogenics; using Content.Shared.Medical.Cryogenics;
using Content.Shared.MedicalScanner; using Content.Shared.MedicalScanner;
using Content.Shared.Power;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Containers; using Robust.Shared.Containers;

View File

@@ -8,6 +8,7 @@ using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems; using Content.Shared.Emag.Systems;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Power;
using Content.Shared.Storage.Components; using Content.Shared.Storage.Components;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -1,3 +1,4 @@
using Content.Shared.Paper;
using Content.Shared.StoryGen; using Content.Shared.StoryGen;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -6,6 +6,7 @@ using Robust.Shared.Utility;
using System.Diagnostics; using System.Diagnostics;
using Content.Server.Administration.Managers; using Content.Server.Administration.Managers;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Power;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -7,6 +7,7 @@ using Content.Shared.Destructible;
using Content.Shared.Maps; using Content.Shared.Maps;
using Content.Shared.Physics; using Content.Shared.Physics;
using Content.Shared.Physics.Controllers; using Content.Shared.Physics.Controllers;
using Content.Shared.Power;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;

View File

@@ -59,11 +59,4 @@ namespace Content.Server.Power.Components
public float PowerReceived => NetworkLoad.ReceivingPower; 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);
} }

View File

@@ -4,6 +4,7 @@ using Content.Shared.Tools;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using System.Diagnostics.Tracing; using System.Diagnostics.Tracing;
using Content.Shared.Tools.Systems;
namespace Content.Server.Power.Components; namespace Content.Server.Power.Components;
@@ -14,11 +15,11 @@ namespace Content.Server.Power.Components;
[Access(typeof(CableSystem))] [Access(typeof(CableSystem))]
public sealed partial class CableComponent : Component public sealed partial class CableComponent : Component
{ {
[DataField("cableDroppedOnCutPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField]
public string CableDroppedOnCutPrototype = "CableHVStack1"; public EntProtoId CableDroppedOnCutPrototype = "CableHVStack1";
[DataField("cuttingQuality", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))] [DataField]
public string CuttingQuality = "Cutting"; public ProtoId<ToolQualityPrototype> CuttingQuality = SharedToolSystem.CutQuality;
/// <summary> /// <summary>
/// Checked by <see cref="CablePlacerComponent"/> to determine if there is /// Checked by <see cref="CablePlacerComponent"/> to determine if there is

View File

@@ -1,4 +1,5 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.Power;
using Content.Shared.Power.Components; using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems; using Content.Shared.Power.EntitySystems;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;

View File

@@ -4,6 +4,7 @@ using Content.Server.Power.NodeGroups;
using Content.Server.Tools; using Content.Server.Tools;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Tools.Systems;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -27,7 +28,7 @@ namespace Content.Server.Power.EntitySystems
private void OnAfterInteractUsing(EntityUid uid, CableComponent component, AfterInteractUsingEvent args) 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; return;
var markup = FormattedMessage.FromMarkup(GenerateCableMarkup(uid)); 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. // Pulsing is hardcoded here because I don't think it needs to be more complex than that right now.
// Update if I'm wrong. // 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 var verb = new ExamineVerb
{ {
Disabled = !enabled, Disabled = !enabled,

View File

@@ -8,6 +8,7 @@ using Content.Shared.Emp;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Content.Shared.Power.Components;
using Content.Shared.Storage.Components; using Content.Shared.Storage.Components;
using Robust.Server.Containers; using Robust.Server.Containers;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;

View File

@@ -5,6 +5,7 @@ using Content.Server.Power.NodeGroups;
using Content.Server.Power.Pow3r; using Content.Server.Power.Pow3r;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Power; using Content.Shared.Power;
using Content.Shared.Power.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Content.Server.Administration.Logs; using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers; using Content.Server.Administration.Managers;
using Content.Server.Power.Components; using Content.Server.Power.Components;
@@ -197,5 +198,17 @@ namespace Content.Server.Power.EntitySystems
{ {
comp.Load = load; 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;
}
} }
} }

View File

@@ -10,6 +10,8 @@ using Content.Server.Power.Components;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Power;
using Content.Shared.Power.Components;
using Content.Shared.Power.Generation.Teg; using Content.Shared.Power.Generation.Teg;
using Content.Shared.Rounding; using Content.Shared.Rounding;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -5,6 +5,8 @@ using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes; using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Power;
using Content.Shared.Power.Components;
namespace Content.Server.Power.Generator; namespace Content.Server.Power.Generator;

View File

@@ -1,4 +1,5 @@
using Content.Shared.DeviceLinking; using Content.Shared.DeviceLinking;
using Content.Shared.Power.Generator;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Server.Power.Generator; namespace Content.Server.Power.Generator;

View File

@@ -9,6 +9,7 @@ using Content.Server.Speech;
using Content.Server.Speech.Components; using Content.Server.Speech.Components;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Power;
using Content.Shared.Radio; using Content.Shared.Radio;
using Content.Shared.Radio.Components; using Content.Shared.Radio.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -12,6 +12,7 @@ using Content.Shared.Shuttles.Events;
using Content.Shared.Shuttles.Systems; using Content.Shared.Shuttles.Systems;
using Content.Shared.Tag; using Content.Shared.Tag;
using Content.Shared.Movement.Systems; using Content.Shared.Movement.Systems;
using Content.Shared.Power;
using Content.Shared.Shuttles.UI.MapObjects; using Content.Shared.Shuttles.UI.MapObjects;
using Content.Shared.Timing; using Content.Shared.Timing;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -19,6 +19,7 @@ using Robust.Shared.Physics.Systems;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Content.Shared.Localizations; using Content.Shared.Localizations;
using Content.Shared.Power;
namespace Content.Server.Shuttles.Systems; namespace Content.Server.Shuttles.Systems;

View File

@@ -11,6 +11,7 @@ using Content.Shared.Examine;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Lock; using Content.Shared.Lock;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Projectiles; using Content.Shared.Projectiles;
using Content.Shared.Singularity.Components; using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.EntitySystems;

View File

@@ -1,5 +1,7 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Power;
using Content.Shared.Power.Components;
using Content.Shared.Sound; using Content.Shared.Sound;
using Content.Shared.Sound.Components; using Content.Shared.Sound.Components;

View File

@@ -3,6 +3,7 @@ using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Systems; using Content.Server.DeviceNetwork.Systems;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Content.Shared.SurveillanceCamera; using Content.Shared.SurveillanceCamera;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -4,6 +4,7 @@ using Content.Server.DeviceNetwork.Systems;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.ActionBlocker; using Content.Shared.ActionBlocker;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.SurveillanceCamera; using Content.Shared.SurveillanceCamera;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -5,6 +5,7 @@ using Content.Server.Emp;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Shared.ActionBlocker; using Content.Shared.ActionBlocker;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.Power;
using Content.Shared.SurveillanceCamera; using Content.Shared.SurveillanceCamera;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -3,6 +3,7 @@ using Content.Server.Temperature.Components;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Placeable; using Content.Shared.Placeable;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Temperature; using Content.Shared.Temperature;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Server.Audio; using Robust.Server.Audio;

View File

@@ -16,6 +16,7 @@ using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems; using Content.Shared.Emag.Systems;
using Content.Shared.Emp; using Content.Shared.Emp;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Content.Shared.VendingMachines; using Content.Shared.VendingMachines;

View File

@@ -9,6 +9,7 @@ using Content.Shared.GameTicking;
using Content.Shared.Hands.Components; using Content.Shared.Hands.Components;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Tools.Components; using Content.Shared.Tools.Components;
using Content.Shared.Wires; using Content.Shared.Wires;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -11,6 +11,7 @@ using Content.Shared.DeviceLinking.Events;
using Content.Shared.Paper; using Content.Shared.Paper;
using Content.Shared.Placeable; using Content.Shared.Placeable;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Power;
using Content.Shared.Research.Components; using Content.Shared.Research.Components;
using Content.Shared.Xenoarchaeology.Equipment; using Content.Shared.Xenoarchaeology.Equipment;
using Content.Shared.Xenoarchaeology.XenoArtifacts; using Content.Shared.Xenoarchaeology.XenoArtifacts;

View File

@@ -7,6 +7,7 @@ using Content.Server.Storage.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts; using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Shared.Body.Components; using Content.Shared.Body.Components;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Power;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;
using Content.Shared.Xenoarchaeology.Equipment; using Content.Shared.Xenoarchaeology.Equipment;

View File

@@ -1,3 +1,4 @@
using Content.Shared.Containers.ItemSlots;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;

View File

@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
namespace Content.Shared.Cargo.Components; namespace Content.Shared.Cargo.Components;
/// <summary> /// <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> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class CashComponent : Component public sealed partial class CashComponent : Component

View File

@@ -6,6 +6,7 @@ using Robust.Shared.Serialization;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using System.Collections; using System.Collections;
using System.Linq; using System.Linq;
using Content.Shared.Chemistry.Components.SolutionManager;
namespace Content.Shared.Chemistry.Components namespace Content.Shared.Chemistry.Components
{ {

View File

@@ -1,3 +1,4 @@
using Content.Shared.Clothing.EntitySystems;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
namespace Content.Shared.Clothing.Components; namespace Content.Shared.Clothing.Components;

View File

@@ -1,5 +1,7 @@
using Content.Shared.Actions; using Content.Shared.Actions;
using Content.Shared.Clothing.EntitySystems; using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Toggleable;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -1,4 +1,5 @@
using Content.Shared.Storage; using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager; using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown.Mapping; using Robust.Shared.Serialization.Markdown.Mapping;

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -13,6 +13,8 @@ namespace Content.Shared.Light.EntitySystems;
public sealed class UnpoweredFlashlightSystem : EntitySystem public sealed class UnpoweredFlashlightSystem : EntitySystem
{ {
// TODO: Split some of this to ItemTogglePointLight
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;

View File

@@ -1,3 +1,4 @@
using Content.Shared.Objectives.Components;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

@@ -1,3 +1,4 @@
using Content.Shared.Explosion.Components;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Power.Components; using Content.Shared.Power.Components;
@@ -5,6 +6,16 @@ namespace Content.Shared.Power.EntitySystems;
public abstract class SharedPowerReceiverSystem : EntitySystem 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) protected string GetExamineText(bool powered)
{ {
return Loc.GetString("power-receiver-component-on-examine-main", return Loc.GetString("power-receiver-component-on-examine-main",

View File

@@ -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);

View File

@@ -1,3 +1,4 @@
using Content.Shared.Item.ItemToggle.Components;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

View File

@@ -33,6 +33,9 @@ public abstract partial class SharedToolSystem : EntitySystem
[Dependency] private readonly TurfSystem _turfs = default!; [Dependency] private readonly TurfSystem _turfs = default!;
[Dependency] protected readonly SharedSolutionContainerSystem SolutionContainer = default!; [Dependency] protected readonly SharedSolutionContainerSystem SolutionContainer = default!;
public const string CutQuality = "Cutting";
public const string PulseQuality = "Pulsing";
public override void Initialize() public override void Initialize()
{ {
InitializeMultipleTool(); InitializeMultipleTool();

View File

@@ -1,4 +1,5 @@
using Content.Shared.Weapons.Melee.Components; using Content.Shared.Weapons.Melee.Components;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;