Change Biometrics after using Dna Scrambler Implant (#22098)

This commit is contained in:
Tomás Alves
2023-12-04 23:18:49 +00:00
committed by GitHub
parent f99b29fbb1
commit 9d9cfbdd88
2 changed files with 12 additions and 2 deletions

View 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;

View 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);
}