Better DNA forensics & ReagentData (#26699)

* Added the ability for blood to track DNA using ReagentData; Forensic Scanner now accounts for solution DNA, non-DNA holders have "Unknown DNA"

* Removes touch DNA for puddles, adds DNA to vomit

* DNA now leaves traces in containers and those marked without don't show DNA on scan (except for puddles), gibbed parts have DNA

* Fix stupid metamorphic glass bug grrr

* Removed SpillableComponent since DnaSubstanceTraceComponent is used instead

* Removes data field from maps, adds DNA tracking for some missed items

* Give default value, fix missing values.

* Fixes recipe bug

* Review changes

* Make the Data list into a nullable type

* Revert map changes

* Move gibbed unknown DNA to forensicssystem
This commit is contained in:
SlamBamActionman
2024-08-09 01:27:27 +02:00
committed by GitHub
parent c43fcdfa06
commit 07174d0aaf
45 changed files with 307 additions and 66 deletions

View File

@@ -3,16 +3,19 @@ using System.Text;
using Content.Server.Popups;
using Content.Shared.UserInterface;
using Content.Shared.DoAfter;
using Content.Shared.Fluids.Components;
using Content.Shared.Forensics;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Paper;
using Content.Shared.Verbs;
using Content.Shared.Tag;
using Robust.Shared.Audio.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Server.Chemistry.Containers.EntitySystems;
// todo: remove this stinky LINQy
namespace Content.Server.Forensics
@@ -27,6 +30,9 @@ namespace Content.Server.Forensics
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly TagSystem _tag = default!;
public override void Initialize()
{
@@ -46,7 +52,8 @@ namespace Content.Server.Forensics
var state = new ForensicScannerBoundUserInterfaceState(
component.Fingerprints,
component.Fibers,
component.DNAs,
component.TouchDNAs,
component.SolutionDNAs,
component.Residues,
component.LastScannedName,
component.PrintCooldown,
@@ -69,18 +76,25 @@ namespace Content.Server.Forensics
{
scanner.Fingerprints = new();
scanner.Fibers = new();
scanner.DNAs = new();
scanner.TouchDNAs = new();
scanner.Residues = new();
}
else
{
scanner.Fingerprints = forensics.Fingerprints.ToList();
scanner.Fibers = forensics.Fibers.ToList();
scanner.DNAs = forensics.DNAs.ToList();
scanner.TouchDNAs = forensics.DNAs.ToList();
scanner.Residues = forensics.Residues.ToList();
}
if (_tag.HasTag(args.Args.Target.Value, "DNASolutionScannable"))
{
scanner.SolutionDNAs = _forensicsSystem.GetSolutionsDNA(args.Args.Target.Value);
} else
{
scanner.SolutionDNAs = new();
}
scanner.LastScannedName = MetaData(args.Args.Target.Value).EntityName;
}
@@ -206,10 +220,17 @@ namespace Content.Server.Forensics
}
text.AppendLine();
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas"));
foreach (var dna in component.DNAs)
foreach (var dna in component.TouchDNAs)
{
text.AppendLine(dna);
}
foreach (var dna in component.SolutionDNAs)
{
Log.Debug(dna);
if (component.TouchDNAs.Contains(dna))
continue;
text.AppendLine(dna);
}
text.AppendLine();
text.AppendLine(Loc.GetString("forensic-scanner-interface-residues"));
foreach (var residue in component.Residues)
@@ -232,7 +253,8 @@ namespace Content.Server.Forensics
{
component.Fingerprints = new();
component.Fibers = new();
component.DNAs = new();
component.TouchDNAs = new();
component.SolutionDNAs = new();
component.LastScannedName = string.Empty;
UpdateUserInterface(uid, component);