Add security barriers (#4458)
* Add sprites * Lock system now raises lock toggle events * Add prototype and barrier system * Toggle lock on click * Barrier blocks bullets (like a real wall) * Barrier now destroyable * Fancy visualzer and lighting. Also unlock by default * Deleted comma * Ignored components? * Update Resources/Prototypes/Entities/Objects/Specific/Security/barrier.yml Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Resources/Prototypes/Entities/Objects/Specific/Security/barrier.yml Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Toggle Lock no longer handled * Made it much easier to move through airlocks Co-authored-by: Swept <sweptwastaken@protonmail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@ namespace Content.Server.Storage.Components
|
||||
public override string Name => "Lock";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("locked")] public bool Locked { get; set; } = true;
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("lockOnClick")] public bool LockOnClick { get; set; } = false;
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("unlockingSound")] public SoundSpecifier UnlockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("lockingSound")] public SoundSpecifier LockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace Content.Server.Lock
|
||||
{
|
||||
DoUnlock(lockComp, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lockComp.LockOnClick)
|
||||
DoLock(lockComp, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid eUI, LockComponent lockComp, ExaminedEvent args)
|
||||
@@ -73,6 +78,8 @@ namespace Content.Server.Lock
|
||||
appearanceComp.SetData(StorageVisuals.Locked, true);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(lockComp.Owner.Uid, new LockToggledEvent(true));
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -95,6 +102,8 @@ namespace Content.Server.Lock
|
||||
appearanceComp.SetData(StorageVisuals.Locked, false);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(lockComp.Owner.Uid, new LockToggledEvent(false));
|
||||
|
||||
// To stop EntityStorageComponent from opening right after the container gets unlocked
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
14
Content.Server/Lock/LockToggledEvent.cs
Normal file
14
Content.Server/Lock/LockToggledEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Lock
|
||||
{
|
||||
public class LockToggledEvent : EntityEventArgs
|
||||
{
|
||||
public readonly bool Locked;
|
||||
|
||||
public LockToggledEvent(bool locked)
|
||||
{
|
||||
Locked = locked;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user