Add more DNA interactions (#21989)

* Add more DNA interactions

* remove unused import

* update based on feedback

* Add event for chemistrysystem.injector

* move event to shared; transfer dna to implanter

* doafter and interaction event fixes

* add BreakOnHandChange

* doh

* use events instead of updating component directly

* Add DataFields to ForensicScannerComponent fields

* Convert most events to system api call
This commit is contained in:
themias
2023-12-15 04:52:55 -05:00
committed by GitHub
parent 2455980090
commit 9cc4a50692
20 changed files with 291 additions and 26 deletions

View File

@@ -1,7 +1,6 @@
using Content.Server.Body.Components;
using Content.Server.Chemistry.ReactionEffects;
using Content.Server.Fluids.EntitySystems;
using Content.Server.Forensics;
using Content.Server.HealthExaminable;
using Content.Server.Popups;
using Content.Shared.Alert;
@@ -22,6 +21,8 @@ using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Shared.Speech.EntitySystems;
using Robust.Server.Audio;
using Robust.Shared.GameObjects;
using Content.Server.Forensics;
namespace Content.Server.Body.Systems;
@@ -38,6 +39,7 @@ public sealed class BloodstreamSystem : EntitySystem
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly SharedStutteringSystem _stutteringSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
public override void Initialize()
{
@@ -322,11 +324,7 @@ public sealed class BloodstreamSystem : EntitySystem
component.BloodTemporarySolution.AddSolution(temp, _prototypeManager);
if (_puddleSystem.TrySpillAt(uid, component.BloodTemporarySolution, out var puddleUid, false))
{
if (TryComp<DnaComponent>(uid, out var dna))
{
var comp = EnsureComp<ForensicsComponent>(puddleUid);
comp.DNAs.Add(dna.DNA);
}
_forensicsSystem.TransferDna(puddleUid, uid, false);
}
component.BloodTemporarySolution.RemoveAllSolution();
@@ -378,11 +376,7 @@ public sealed class BloodstreamSystem : EntitySystem
if (_puddleSystem.TrySpillAt(uid, tempSol, out var puddleUid))
{
if (TryComp<DnaComponent>(uid, out var dna))
{
var comp = EnsureComp<ForensicsComponent>(puddleUid);
comp.DNAs.Add(dna.DNA);
}
_forensicsSystem.TransferDna(puddleUid, uid, false);
}
}