-
Notifications
You must be signed in to change notification settings - Fork 592
Expand file tree
/
Copy pathWashingMachineSystem.cs
More file actions
52 lines (45 loc) · 1.95 KB
/
Copy pathWashingMachineSystem.cs
File metadata and controls
52 lines (45 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Content.Shared._Funkystation.WashingMachine;
using Content.Shared._Funkystation.Stains.Components;
using Content.Shared._Funkystation.Stains.Systems;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Destructible;
using Content.Shared.Storage.Components;
using Content.Server.Forensics;
using Content.Shared.Clothing.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using System.Linq;
using Content.Shared.Chemistry;
using Content.Shared.Damage.Systems;
namespace Content.Server._Funkystation.WashingMachine;
public sealed partial class WashingMachineSystem : SharedWashingMachineSystem
{
[Dependency] private SharedSolutionContainerSystem _solution = null!;
[Dependency] private ForensicsSystem _forensics = null!;
protected override void UpdateForensics(Entity<WashingMachineComponent> ent, HashSet<EntityUid> items)
{
if (!TryComp<ForensicsComponent>(ent.Owner, out var forensics))
return;
foreach (var item in items)
{
// Pull DNA out of the item's stain solution before the shared FinishWash washes it out.
if (TryComp<StainableComponent>(item, out var stain)
&& _solution.TryGetSolution(item, stain.SolutionName, out var sol))
{
forensics.DNAs.UnionWith(_forensics.GetSolutionsDNA(sol.Value.Comp.Solution));
}
if (!TryComp<FiberComponent>(item, out var fiber))
continue;
var fiberText = fiber.FiberColor == null
? Loc.GetString("forensic-fibers", ("material", fiber.FiberMaterial))
: Loc.GetString("forensic-fibers-colored",
("color", fiber.FiberColor),
("material", fiber.FiberMaterial));
forensics.Fibers.Add(fiberText);
}
}
}