Add voice locks to various hidden syndicate items (#39310)

This commit is contained in:
beck-thompson
2025-08-10 11:10:13 -07:00
committed by GitHub
parent 80299e863a
commit 80375370f8
36 changed files with 366 additions and 97 deletions

View File

@@ -0,0 +1,35 @@
using Content.Shared.Lock;
using Content.Shared.Trigger.Components.Effects;
namespace Content.Shared.Trigger.Systems;
public sealed class LockOnTriggerSystem : EntitySystem
{
[Dependency] private readonly LockSystem _lock = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<LockOnTriggerComponent, TriggerEvent>(OnTrigger);
}
private void OnTrigger(Entity<LockOnTriggerComponent> ent, ref TriggerEvent args)
{
if (args.Key != null && !ent.Comp.KeysIn.Contains(args.Key))
return;
switch (ent.Comp.LockOnTrigger)
{
case LockAction.Lock:
_lock.Lock(ent.Owner, args.User);
break;
case LockAction.Unlock:
_lock.Unlock(ent, args.User);
break;
case LockAction.Toggle:
_lock.ToggleLock(ent, args.User);
break;
}
}
}