Emp more effects (#14550)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Emp;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Radio;
|
||||
@@ -21,6 +22,8 @@ public sealed class HeadsetSystem : SharedHeadsetSystem
|
||||
SubscribeLocalEvent<HeadsetComponent, EncryptionChannelsChangedEvent>(OnKeysChanged);
|
||||
|
||||
SubscribeLocalEvent<WearingHeadsetComponent, EntitySpokeEvent>(OnSpeak);
|
||||
|
||||
SubscribeLocalEvent<HeadsetComponent, EmpPulseEvent>(OnEmpPulse);
|
||||
}
|
||||
|
||||
private void OnKeysChanged(EntityUid uid, HeadsetComponent component, EncryptionChannelsChangedEvent args)
|
||||
@@ -98,4 +101,13 @@ public sealed class HeadsetSystem : SharedHeadsetSystem
|
||||
if (TryComp(Transform(uid).ParentUid, out ActorComponent? actor))
|
||||
_netMan.ServerSendMessage(args.ChatMsg, actor.PlayerSession.ConnectedClient);
|
||||
}
|
||||
|
||||
private void OnEmpPulse(EntityUid uid, HeadsetComponent component, ref EmpPulseEvent args)
|
||||
{
|
||||
if (component.Enabled)
|
||||
{
|
||||
args.Affected = true;
|
||||
args.Disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ public sealed class RadioSystem : EntitySystem
|
||||
|
||||
var sendAttemptEv = new RadioSendAttemptEvent(channel, radioSource);
|
||||
RaiseLocalEvent(ref sendAttemptEv);
|
||||
RaiseLocalEvent(radioSource, ref sendAttemptEv);
|
||||
var canSend = !sendAttemptEv.Cancelled;
|
||||
|
||||
var sourceMapId = Transform(radioSource).MapID;
|
||||
@@ -105,6 +106,7 @@ public sealed class RadioSystem : EntitySystem
|
||||
// check if message can be sent to specific receiver
|
||||
var attemptEv = new RadioReceiveAttemptEvent(channel, radioSource, receiver);
|
||||
RaiseLocalEvent(ref attemptEv);
|
||||
RaiseLocalEvent(receiver, ref attemptEv);
|
||||
if (attemptEv.Cancelled)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user