Files
crystall-punk-14/Content.Server/Chemistry/TileReactions/ExtinguishTileReaction.cs
SlamBamActionman 07174d0aaf 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
2024-08-09 09:27:27 +10:00

44 lines
1.5 KiB
C#

using Content.Server.Atmos.EntitySystems;
using Content.Shared.Atmos;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using JetBrains.Annotations;
using Robust.Shared.Map;
namespace Content.Server.Chemistry.TileReactions
{
[UsedImplicitly]
[DataDefinition]
public sealed partial class ExtinguishTileReaction : ITileReaction
{
[DataField("coolingTemperature")] private float _coolingTemperature = 2f;
public FixedPoint2 TileReact(TileRef tile,
ReagentPrototype reagent,
FixedPoint2 reactVolume,
IEntityManager entityManager,
List<ReagentData>? data)
{
if (reactVolume <= FixedPoint2.Zero || tile.Tile.IsEmpty)
return FixedPoint2.Zero;
var atmosphereSystem = entityManager.System<AtmosphereSystem>();
var environment = atmosphereSystem.GetTileMixture(tile.GridUid, null, tile.GridIndices, true);
if (environment == null || !atmosphereSystem.IsHotspotActive(tile.GridUid, tile.GridIndices))
return FixedPoint2.Zero;
environment.Temperature =
MathF.Max(MathF.Min(environment.Temperature - (_coolingTemperature * 1000f),
environment.Temperature / _coolingTemperature), Atmospherics.TCMB);
atmosphereSystem.ReactTile(tile.GridUid, tile.GridIndices);
atmosphereSystem.HotspotExtinguish(tile.GridUid, tile.GridIndices);
return FixedPoint2.Zero;
}
}
}