using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
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
{
using System.Numerics;
+using Content.Client.UserInterface.Controls;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
-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;
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;
+using Content.Client.CrewManifest.UI;
using Content.Shared.CrewManifest;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using System.Numerics;
using Content.Client.UserInterface.Controls;
+using Prometheus;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
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;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;
using Content.Client.TextScreen;
+using Robust.Client.UserInterface.Controls;
namespace Content.Client.MachineLinking.UI;
+using Content.Client.Options.UI.Tabs;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
+using System.Diagnostics.CodeAnalysis;
using Content.Client.Power.Components;
using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems;
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;
+ }
}
using Content.Shared.Power.Generator;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Network;
namespace Content.Client.Power.Generator;
+using System.Threading.Channels;
using Content.Client.UserInterface.Controls;
using Content.Shared.Radio.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Enums;
namespace Content.Client.StationRecords;
using Content.Client.Chemistry.Visualizers;
+using Content.Shared.Chemistry.Components;
namespace Content.Client.Storage.Components;
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;
using Content.Server.Power.Components;
using Content.Server.Station.Systems;
using Content.Shared.AlertLevel;
+using Content.Shared.Power;
namespace Content.Server.AlertLevel;
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;
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;
using Robust.Shared.Physics.Components;
using Robust.Shared.Map;
using System.Numerics;
+using Content.Shared.Power;
using Robust.Server.GameObjects;
namespace Content.Server.Anomaly;
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;
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;
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;
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;
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;
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;
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;
using Content.Server.NodeContainer.EntitySystems;
using Content.Shared.Atmos;
using Content.Shared.Database;
+using Content.Shared.Power;
namespace Content.Server.Atmos.Portable
{
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;
using Content.Server.Power.EntitySystems;
using Content.Shared.Audio;
using Content.Shared.Mobs;
+using Content.Shared.Power;
namespace Content.Server.Audio;
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;
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;
using Content.Server.Power.Components;
using Content.Shared.Atmos.Rotting;
using Content.Shared.Buckle.Components;
+using Content.Shared.Power;
namespace Content.Server.Buckle.Systems;
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;
using Content.Server.Power.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
+using Content.Shared.Power;
namespace Content.Server.Chemistry.EntitySystems;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Placeable;
+using Content.Shared.Power;
namespace Content.Server.Chemistry.EntitySystems;
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;
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;
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;
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;
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;
using Content.Server.Medical.CrewMonitoring;
using Content.Server.Power.Components;
using Content.Server.Station.Systems;
+using Content.Shared.Power;
namespace Content.Server.DeviceNetwork.Systems;
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;
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;
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;
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;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Shared.NameModifier.Components;
+using Content.Shared.Power;
namespace Content.Server.Fax;
using System.Linq;
using Content.Server.Jittering;
using Content.Shared.Jittering;
+using Content.Shared.Power;
namespace Content.Server.Kitchen.EntitySystems
{
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;
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;
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
{
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
{
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;
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;
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;
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;
+using Content.Shared.Paper;
using Content.Shared.StoryGen;
using Robust.Shared.Prototypes;
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;
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;
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);
}
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;
[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
using Content.Server.Power.Components;
+using Content.Shared.Power;
using Content.Shared.Power.Components;
using Content.Shared.Power.EntitySystems;
using Content.Shared.UserInterface;
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;
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));
// 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,
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;
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;
+using System.Diagnostics.CodeAnalysis;
using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers;
using Content.Server.Power.Components;
{
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;
+ }
}
}
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;
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;
using Content.Shared.DeviceLinking;
+using Content.Shared.Power.Generator;
using Robust.Shared.Prototypes;
namespace Content.Server.Power.Generator;
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;
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;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Shared.Localizations;
+using Content.Shared.Power;
namespace Content.Server.Shuttles.Systems;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
+using Content.Shared.Containers.ItemSlots;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
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
using Robust.Shared.Utility;
using System.Collections;
using System.Linq;
+using Content.Shared.Chemistry.Components.SolutionManager;
namespace Content.Shared.Chemistry.Components
{
+using Content.Shared.Clothing.EntitySystems;
using Robust.Shared.GameStates;
namespace Content.Shared.Clothing.Components;
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;
using Content.Shared.Storage;
+using Content.Shared.Storage.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown.Mapping;
--- /dev/null
+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;
+}
--- /dev/null
+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);
+ }
+}
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!;
+using Content.Shared.Objectives.Components;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
+using Content.Shared.Explosion.Components;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
+using System.Diagnostics.CodeAnalysis;
using Content.Shared.Examine;
using Content.Shared.Power.Components;
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",
--- /dev/null
+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
+using Content.Shared.Item.ItemToggle.Components;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
[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();
using Content.Shared.Weapons.Melee.Components;
+using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;