using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Tools;
-using Content.Shared.UserInterface;
using Content.Shared.Administration.Logs;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
+using Content.Shared.DeviceNetwork.Components;
using Content.Shared.DeviceNetwork.Events;
using Content.Shared.Emag.Systems;
using Content.Shared.Fax;
-using Content.Shared.Fax.Systems;
using Content.Shared.Fax.Components;
+using Content.Shared.Fax.Systems;
using Content.Shared.Interaction;
using Content.Shared.Labels.Components;
using Content.Shared.Labels.EntitySystems;
using Content.Shared.Mobs.Components;
+using Content.Shared.NameModifier.Components;
using Content.Shared.Paper;
+using Content.Shared.Power;
+using Content.Shared.Tools;
+using Content.Shared.UserInterface;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
-using Content.Shared.NameModifier.Components;
-using Content.Shared.Power;
-using Content.Shared.DeviceNetwork.Components;
+using Robust.Shared.Prototypes;
namespace Content.Server.Fax;
[Dependency] private readonly FaxecuteSystem _faxecute = default!;
[Dependency] private readonly EmagSystem _emag = default!;
+ private static readonly ProtoId<ToolQualityPrototype> ScrewingQuality = "Screwing";
+
private const string PaperSlotId = "Paper";
public override void Initialize()
{
if (args.Handled ||
!TryComp<ActorComponent>(args.User, out var actor) ||
- !_toolSystem.HasQuality(args.Used, "Screwing")) // Screwing because Pulsing already used by device linking
+ !_toolSystem.HasQuality(args.Used, ScrewingQuality)) // Screwing because Pulsing already used by device linking
return;
_quickDialog.OpenDialog(actor.PlayerSession,
using System.Linq;
using Content.Server.Atmos.EntitySystems;
+using Content.Server.Body.Systems;
using Content.Server.Mech.Components;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Mech.EntitySystems;
using Content.Shared.Movement.Events;
using Content.Shared.Popups;
+using Content.Shared.Tools;
using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
using Content.Shared.Verbs;
+using Content.Shared.Whitelist;
using Content.Shared.Wires;
-using Content.Server.Body.Systems;
-using Content.Shared.Tools.Systems;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
-using Content.Shared.Whitelist;
+using Robust.Shared.Prototypes;
namespace Content.Server.Mech.Systems;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
+ private static readonly ProtoId<ToolQualityPrototype> PryingQuality = "Prying";
+
/// <inheritdoc/>
public override void Initialize()
{
return;
}
- if (_toolSystem.HasQuality(args.Used, "Prying") && component.BatterySlot.ContainedEntity != null)
+ if (_toolSystem.HasQuality(args.Used, PryingQuality) && component.BatterySlot.ContainedEntity != null)
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay,
new RemoveBatteryEvent(), uid, target: uid, used: args.Target)
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.NodeContainer.Nodes;
using Content.Server.Temperature.Components;
-using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Atmos;
-using Content.Shared.UserInterface;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
+using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Climbing.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.Medical.Cryogenics;
using Content.Shared.MedicalScanner;
using Content.Shared.Power;
+using Content.Shared.Tools;
+using Content.Shared.Tools.Systems;
+using Content.Shared.UserInterface;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
+using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
-using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
namespace Content.Server.Medical;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
+ private static readonly ProtoId<ToolQualityPrototype> PryingQuality = "Prying";
+
public override void Initialize()
{
base.Initialize();
if (args.Handled || !entity.Comp.Locked || entity.Comp.BodyContainer.ContainedEntity == null)
return;
- args.Handled = _toolSystem.UseTool(args.Used, args.User, entity.Owner, entity.Comp.PryDelay, "Prying", new CryoPodPryFinished());
+ args.Handled = _toolSystem.UseTool(args.Used, args.User, entity.Owner, entity.Comp.PryDelay, PryingQuality, new CryoPodPryFinished());
}
private void OnExamined(Entity<CryoPodComponent> entity, ref ExaminedEvent args)
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Power;
+using Content.Shared.Tools;
using Content.Shared.Tools.Components;
using Content.Shared.Wires;
using Robust.Server.GameObjects;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ConstructionSystem _construction = default!;
+ private static readonly ProtoId<ToolQualityPrototype> CuttingQuality = "Cutting";
+ private static readonly ProtoId<ToolQualityPrototype> PulsingQuality = "Pulsing";
+
// This is where all the wire layouts are stored.
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts = new();
if (!IsPanelOpen(uid))
return;
- if (Tool.HasQuality(args.Used, "Cutting", tool) ||
- Tool.HasQuality(args.Used, "Pulsing", tool))
+ if (Tool.HasQuality(args.Used, CuttingQuality, tool) ||
+ Tool.HasQuality(args.Used, PulsingQuality, tool))
{
if (TryComp(args.User, out ActorComponent? actor))
{
switch (action)
{
case WiresAction.Cut:
- if (!Tool.HasQuality(toolEntity, "Cutting", tool))
+ if (!Tool.HasQuality(toolEntity, CuttingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user);
return;
break;
case WiresAction.Mend:
- if (!Tool.HasQuality(toolEntity, "Cutting", tool))
+ if (!Tool.HasQuality(toolEntity, CuttingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user);
return;
break;
case WiresAction.Pulse:
- if (!Tool.HasQuality(toolEntity, "Pulsing", tool))
+ if (!Tool.HasQuality(toolEntity, PulsingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), user);
return;
switch (action)
{
case WiresAction.Cut:
- if (!Tool.HasQuality(toolEntity, "Cutting", tool))
+ if (!Tool.HasQuality(toolEntity, CuttingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user);
break;
UpdateUserInterface(used);
break;
case WiresAction.Mend:
- if (!Tool.HasQuality(toolEntity, "Cutting", tool))
+ if (!Tool.HasQuality(toolEntity, CuttingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user);
break;
UpdateUserInterface(used);
break;
case WiresAction.Pulse:
- if (!Tool.HasQuality(toolEntity, "Pulsing", tool))
+ if (!Tool.HasQuality(toolEntity, PulsingQuality, tool))
{
_popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), user);
break;
EntityUid user,
EntityUid? target,
float doAfterDelay,
- IEnumerable<string> toolQualitiesNeeded,
+ [ForbidLiteral] IEnumerable<string> toolQualitiesNeeded,
DoAfterEvent doAfterEv,
float fuel = 0,
ToolComponent? toolComponent = null)
EntityUid user,
EntityUid? target,
TimeSpan delay,
- IEnumerable<string> toolQualitiesNeeded,
+ [ForbidLiteral] IEnumerable<string> toolQualitiesNeeded,
DoAfterEvent doAfterEv,
out DoAfterId? id,
float fuel = 0,
EntityUid user,
EntityUid? target,
float doAfterDelay,
- string toolQualityNeeded,
+ [ForbidLiteral] string toolQualityNeeded,
DoAfterEvent doAfterEv,
float fuel = 0,
ToolComponent? toolComponent = null)
/// <summary>
/// Whether a tool entity has the specified quality or not.
/// </summary>
- public bool HasQuality(EntityUid uid, string quality, ToolComponent? tool = null)
+ public bool HasQuality(EntityUid uid, [ForbidLiteral] string quality, ToolComponent? tool = null)
{
return Resolve(uid, ref tool, false) && tool.Qualities.Contains(quality);
}
/// Whether a tool entity has all specified qualities or not.
/// </summary>
[PublicAPI]
- public bool HasAllQualities(EntityUid uid, IEnumerable<string> qualities, ToolComponent? tool = null)
+ public bool HasAllQualities(EntityUid uid, [ForbidLiteral] IEnumerable<string> qualities, ToolComponent? tool = null)
{
return Resolve(uid, ref tool, false) && tool.Qualities.ContainsAll(qualities);
}