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

@@ -147,7 +147,7 @@ namespace Content.Shared.Chemistry.Components
/// </summary>
/// <param name="prototype">The prototype ID of the reagent to add.</param>
/// <param name="quantity">The quantity in milli-units.</param>
public Solution(string prototype, FixedPoint2 quantity, ReagentData? data = null) : this()
public Solution(string prototype, FixedPoint2 quantity, List<ReagentData>? data = null) : this()
{
AddReagent(new ReagentId(prototype, data), quantity);
}
@@ -243,7 +243,7 @@ namespace Content.Shared.Chemistry.Components
return false;
}
public bool ContainsReagent(string reagentId, ReagentData? data)
public bool ContainsReagent(string reagentId, List<ReagentData>? data)
=> ContainsReagent(new(reagentId, data));
public bool TryGetReagent(ReagentId id, out ReagentQuantity quantity)
@@ -404,7 +404,7 @@ namespace Content.Shared.Chemistry.Components
/// </summary>
/// <param name="proto">The prototype of the reagent to add.</param>
/// <param name="quantity">The quantity in milli-units.</param>
public void AddReagent(ReagentPrototype proto, FixedPoint2 quantity, float temperature, IPrototypeManager? protoMan, ReagentData? data = null)
public void AddReagent(ReagentPrototype proto, FixedPoint2 quantity, float temperature, IPrototypeManager? protoMan, List<ReagentData>? data = null)
{
if (_heatCapacityDirty)
UpdateHeatCapacity(protoMan);
@@ -489,7 +489,7 @@ namespace Content.Shared.Chemistry.Components
{
var (reagent, curQuantity) = Contents[i];
if(reagent != toRemove.Reagent)
if(reagent.Prototype != toRemove.Reagent.Prototype)
continue;
var newQuantity = curQuantity - toRemove.Quantity;
@@ -523,7 +523,7 @@ namespace Content.Shared.Chemistry.Components
/// <param name="prototype">The prototype of the reagent to be removed.</param>
/// <param name="quantity">The amount of reagent to remove.</param>
/// <returns>How much reagent was actually removed. Zero if the reagent is not present on the solution.</returns>
public FixedPoint2 RemoveReagent(string prototype, FixedPoint2 quantity, ReagentData? data = null)
public FixedPoint2 RemoveReagent(string prototype, FixedPoint2 quantity, List<ReagentData>? data = null)
{
return RemoveReagent(new ReagentQuantity(prototype, quantity, data));
}