diff --git a/Content.Server/_SSS/SuspicionGameRule/Components/SuspicionRuleComponent.cs b/Content.Server/_SSS/SuspicionGameRule/Components/SuspicionRuleComponent.cs index 503866019f..4cf80242a1 100644 --- a/Content.Server/_SSS/SuspicionGameRule/Components/SuspicionRuleComponent.cs +++ b/Content.Server/_SSS/SuspicionGameRule/Components/SuspicionRuleComponent.cs @@ -74,12 +74,15 @@ public sealed partial class SuspicionRuleComponent : Component public string DetectiveImplant = "SusDetectiveUplinkImplant"; - [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] - public string TraitorRadio = "Syndicate"; + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] + public string TraitorRadio = "EncryptionKeySyndie"; [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string TraitorFaction = "Syndicate"; + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] + public string DetectiveRadio = "EncryptionKeySecurity"; + /// /// How much TC to give to traitors/detectives for their performance /// diff --git a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs index 0deb75f3b5..22c06c5fc8 100644 --- a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs +++ b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs @@ -100,7 +100,8 @@ private void StartRound(EntityUid uid, SuspicionRuleComponent component, GameRul // Hijacking the nuke op systems to show fellow traitors. Don't have to reinvent the wheel. EnsureComp(ownedEntity.Value); EnsureComp(ownedEntity.Value); - EnsureComp(ownedEntity.Value).Channels.Add(component.TraitorRadio); + + AddKeyToRadio(ownedEntity.Value, component.TraitorRadio); _npcFactionSystem.AddFaction(ownedEntity.Value, component.TraitorFaction); @@ -126,6 +127,8 @@ private void StartRound(EntityUid uid, SuspicionRuleComponent component, GameRul EnsureComp(ownedEntity.Value).StatusIcon = "SecurityIconDischarged"; + AddKeyToRadio(ownedEntity.Value, component.DetectiveRadio); + _subdermalImplant.AddImplants(ownedEntity.Value, new List {component.DetectiveImplant}); _antagSelectionSystem.SendBriefing( diff --git a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Utility.cs b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Utility.cs index fd41eee393..eeb4452ad7 100644 --- a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Utility.cs +++ b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Utility.cs @@ -4,6 +4,9 @@ using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Roles; +using Robust.Server.Containers; +using Robust.Shared.Map; +using Robust.Shared.Physics.Components; namespace Content.Server._SSS.SuspicionGameRule; @@ -65,4 +68,20 @@ private void SendAnnouncement(string message, Color? colorOverride = null) return result; } + + public void AddKeyToRadio(EntityUid entity, string keyProto) + { + if (!_inventory.TryGetSlotEntity(entity, "ears", out var headset)) + return; + + if (!_containerSystem.TryGetContainer(headset.Value, "key_slots", out var container)) + return; + + var key = Spawn(keyProto, MapCoordinates.Nullspace); + var transform = Comp(key); + var meta = Comp(key); + var physics = Comp(key); + + _containerSystem.Insert((key, transform, meta, physics), container, null, true); + } } diff --git a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.cs b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.cs index 39e920e9df..1fdaa5fd73 100644 --- a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.cs +++ b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.cs @@ -20,9 +20,11 @@ using Content.Shared.Damage; using Content.Shared.Examine; using Content.Shared.GameTicking.Components; +using Content.Shared.Inventory; using Content.Shared.Mobs; using Content.Shared.Mobs.Systems; using Content.Shared.NPC.Systems; +using Robust.Server.Containers; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Audio; @@ -53,6 +55,8 @@ public sealed partial class SuspicionRuleSystem : GameRuleSystem