EasyPry airlocks for arrivals. Now also prying refactor I guess (#19394)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
nikthechampiongr
2023-09-28 11:34:21 +00:00
committed by GitHub
parent cbeba20ebb
commit 5ff79120e6
24 changed files with 463 additions and 170 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Shared.Interaction;
using Content.Shared.Tools.Components;
using Robust.Shared.GameStates;
using Content.Shared.Prying.Components;
namespace Content.Shared.Tools;
@@ -27,7 +28,7 @@ public abstract partial class SharedToolSystem : EntitySystem
private void OnMultipleToolStartup(EntityUid uid, MultipleToolComponent multiple, ComponentStartup args)
{
// Only set the multiple tool if we have a tool component.
if(EntityManager.TryGetComponent(uid, out ToolComponent? tool))
if (EntityManager.TryGetComponent(uid, out ToolComponent? tool))
SetMultipleTool(uid, multiple, tool);
}
@@ -52,7 +53,7 @@ public abstract partial class SharedToolSystem : EntitySystem
if (multiple.Entries.Length == 0)
return false;
multiple.CurrentEntry = (uint) ((multiple.CurrentEntry + 1) % multiple.Entries.Length);
multiple.CurrentEntry = (uint)((multiple.CurrentEntry + 1) % multiple.Entries.Length);
SetMultipleTool(uid, multiple, playSound: true, user: user);
return true;
@@ -79,6 +80,19 @@ public abstract partial class SharedToolSystem : EntitySystem
tool.UseSound = current.Sound;
tool.Qualities = current.Behavior;
// TODO: Replace this with a better solution later
if (TryComp<PryingComponent>(uid, out var pcomp))
{
if (current.Behavior.Contains("Prying"))
{
pcomp.Enabled = true;
}
else
{
pcomp.Enabled = false;
}
}
if (playSound && current.ChangeSound != null)
_audioSystem.PlayPredicted(current.ChangeSound, uid, user);