]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change Biometrics after using Dna Scrambler Implant (#22098)
authorTomás Alves <tomasalves35@gmail.com>
Mon, 4 Dec 2023 23:18:49 +0000 (23:18 +0000)
committerGitHub <noreply@github.com>
Mon, 4 Dec 2023 23:18:49 +0000 (18:18 -0500)
Content.Server/Forensics/Systems/ForensicsSystem.cs
Content.Server/Implants/SubdermalImplantSystem.cs

index c67af9d816056052d11e8b0096f1278ad8bf23d2..d4281c8b8d5c483b14fd9bbab251ecb92a1bf024 100644 (file)
@@ -30,14 +30,14 @@ namespace Content.Server.Forensics
             component.DNA = GenerateDNA();
         }
 
-        private string GenerateFingerprint()
+        public string GenerateFingerprint()
         {
             var fingerprint = new byte[16];
             _random.NextBytes(fingerprint);
             return Convert.ToHexString(fingerprint);
         }
 
-        private string GenerateDNA()
+        public string GenerateDNA()
         {
             var letters = new[] { "A", "C", "G", "T" };
             var DNA = string.Empty;
index 038e0fdcdfa1a45002b20dd9c919c3b76c302cad..0b1e9d46b1050af5ec94d901044fb72e9c211fb6 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Server.Cuffs;
+using Content.Server.Forensics;
 using Content.Server.Humanoid;
 using Content.Server.Store.Components;
 using Content.Server.Store.Systems;
@@ -19,6 +20,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
     [Dependency] private readonly MetaDataSystem _metaData = default!;
     [Dependency] private readonly StoreSystem _store = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
+    [Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
 
     public override void Initialize()
     {
@@ -80,6 +82,14 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
             var newProfile = HumanoidCharacterProfile.RandomWithSpecies(humanoid.Species);
             _humanoidAppearance.LoadProfile(ent, newProfile, humanoid);
             _metaData.SetEntityName(ent, newProfile.Name);
+            if (TryComp<DnaComponent>(ent, out var dna))
+            {
+                dna.DNA = _forensicsSystem.GenerateDNA();
+            }
+            if (TryComp<FingerprintComponent>(ent, out var fingerprint))
+            {
+                fingerprint.Fingerprint = _forensicsSystem.GenerateFingerprint();
+            }
             _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup"), ent, ent);
         }