From 348b3bdc690e5042b4fa54301ae22221550fe307 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:17:33 +0300 Subject: [PATCH] Merge pull request #391 * Update BorgSystem.cs * Remove-AA * Update borg.yml * Update BorgSystem.cs --- Content.Server/Silicons/Borgs/BorgSystem.cs | 25 ++++++++++++++++++- .../Prototypes/Roles/Jobs/Science/borg.yml | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Content.Server/Silicons/Borgs/BorgSystem.cs b/Content.Server/Silicons/Borgs/BorgSystem.cs index 611dfa6ea2a..060c98e4798 100644 --- a/Content.Server/Silicons/Borgs/BorgSystem.cs +++ b/Content.Server/Silicons/Borgs/BorgSystem.cs @@ -1,9 +1,11 @@ -using Content.Server.Actions; +using Content.Server.Actions; using Content.Server.Administration.Logs; using Content.Server.Administration.Managers; using Content.Server.Hands.Systems; using Content.Server.PowerCell; using Content.Server.UserInterface; +using Content.Shared.Access; +using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.Alert; using Content.Shared.Database; @@ -22,7 +24,9 @@ using Robust.Server.GameObjects; using Robust.Shared.Containers; using Robust.Shared.Players; +using Robust.Shared.Prototypes; using Robust.Shared.Random; +using System.Linq; namespace Content.Server.Silicons.Borgs; @@ -44,6 +48,8 @@ public sealed partial class BorgSystem : SharedBorgSystem [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [ValidatePrototypeId] public const string BorgJobId = "Borg"; @@ -281,7 +287,24 @@ public void BorgActivate(EntityUid uid, BorgChassisComponent component) { Popup.PopupEntity(Loc.GetString("borg-mind-added", ("name", Identity.Name(uid, EntityManager))), uid); _powerCell.SetPowerCellDrawEnabled(uid, true); + + if (TryComp(uid, out var oldAccess)) + { + var access = oldAccess.Tags.ToList(); + + access.Clear(); + access.Add($"Captain"); + access.Add($"Cargo"); + access.Add($"Salvage"); + access.Add($"Medical"); + access.Add($"Service"); + access.Add($"Research"); + access.Add($"Engineering"); + + _access.TrySetTags(uid, access); + } _access.SetAccessEnabled(uid, true); + _appearance.SetData(uid, BorgVisuals.HasPlayer, true); Dirty(uid, component); } diff --git a/Resources/Prototypes/Roles/Jobs/Science/borg.yml b/Resources/Prototypes/Roles/Jobs/Science/borg.yml index deb4392e985..c6c1953a42c 100644 --- a/Resources/Prototypes/Roles/Jobs/Science/borg.yml +++ b/Resources/Prototypes/Roles/Jobs/Science/borg.yml @@ -10,3 +10,4 @@ icon: JobIconBorg supervisors: job-supervisors-rd jobEntity: PlayerBorgGeneric +