diff --git a/Content.Server/Forensics/Components/FiberComponent.cs b/Content.Server/Forensics/Components/FiberComponent.cs index 2086c958702..d2fc3a4bd90 100644 --- a/Content.Server/Forensics/Components/FiberComponent.cs +++ b/Content.Server/Forensics/Components/FiberComponent.cs @@ -12,5 +12,8 @@ public sealed partial class FiberComponent : Component [DataField] public string? FiberColor; + + [DataField] + public string? Fiberprint; // DeltaV, unique glove fibers } } diff --git a/Content.Server/Forensics/Systems/ForensicsSystem.cs b/Content.Server/Forensics/Systems/ForensicsSystem.cs index cd4e2edaeca..c653fbb0627 100644 --- a/Content.Server/Forensics/Systems/ForensicsSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicsSystem.cs @@ -26,6 +26,7 @@ public sealed class ForensicsSystem : EntitySystem public override void Initialize() { SubscribeLocalEvent(OnInteract); + SubscribeLocalEvent(OnFiberInit); // DeltaV #1455 - unique glove fibers SubscribeLocalEvent(OnFingerprintInit); SubscribeLocalEvent(OnDNAInit); @@ -44,6 +45,13 @@ private void OnInteract(EntityUid uid, FingerprintComponent component, ContactIn ApplyEvidence(uid, args.Other); } + // DeltaV #1455 - unique glove fibers + private void OnFiberInit(EntityUid uid, FiberComponent component, MapInitEvent args) + { + component.Fiberprint = GenerateFingerprint(length: 7); + } + // End of DeltaV code + private void OnFingerprintInit(EntityUid uid, FingerprintComponent component, MapInitEvent args) { component.Fingerprint = GenerateFingerprint(); @@ -203,9 +211,9 @@ private void OnCleanForensicsDoAfter(EntityUid uid, ForensicsComponent component targetComp.Residues.Add(string.IsNullOrEmpty(residue.ResidueColor) ? Loc.GetString("forensic-residue", ("adjective", residue.ResidueAdjective)) : Loc.GetString("forensic-residue-colored", ("color", residue.ResidueColor), ("adjective", residue.ResidueAdjective))); } - public string GenerateFingerprint() + public string GenerateFingerprint(int length = 16) // DeltaV #1455 - allow changing the length of the fingerprint hash { - var fingerprint = new byte[16]; + var fingerprint = new byte[length]; // DeltaV #1455 - allow changing the length of the fingerprint hash _random.NextBytes(fingerprint); return Convert.ToHexString(fingerprint); } @@ -231,8 +239,15 @@ private void ApplyEvidence(EntityUid user, EntityUid target) var component = EnsureComp(target); if (_inventory.TryGetSlotEntity(user, "gloves", out var gloves)) { + // DeltaV #1455 - unique glove fibers if (TryComp(gloves, out var fiber) && !string.IsNullOrEmpty(fiber.FiberMaterial)) - component.Fibers.Add(string.IsNullOrEmpty(fiber.FiberColor) ? Loc.GetString("forensic-fibers", ("material", fiber.FiberMaterial)) : Loc.GetString("forensic-fibers-colored", ("color", fiber.FiberColor), ("material", fiber.FiberMaterial))); + { + var fiberLocale = string.IsNullOrEmpty(fiber.FiberColor) + ? Loc.GetString("forensic-fibers", ("material", fiber.FiberMaterial)) + : Loc.GetString("forensic-fibers-colored", ("color", fiber.FiberColor), ("material", fiber.FiberMaterial)); + component.Fibers.Add(fiberLocale + " ; " + fiber.Fiberprint); + } + // End of DeltaV code if (HasComp(gloves)) return; diff --git a/Resources/Locale/en-US/_NF/forensics/fibers.ftl b/Resources/Locale/en-US/_NF/forensics/fibers.ftl new file mode 100644 index 00000000000..75402758ae8 --- /dev/null +++ b/Resources/Locale/en-US/_NF/forensics/fibers.ftl @@ -0,0 +1 @@ +fibers-cream = cream diff --git a/Resources/Prototypes/Entities/Clothing/Hands/base_clothinghands.yml b/Resources/Prototypes/Entities/Clothing/Hands/base_clothinghands.yml index 5053c27598f..02cf0ab6f67 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/base_clothinghands.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/base_clothinghands.yml @@ -43,4 +43,4 @@ components: - type: Fiber fiberMaterial: fibers-synthetic -# - type: FingerprintMask # Frontier + - type: FingerprintMask diff --git a/Resources/Prototypes/Entities/Clothing/Hands/colored.yml b/Resources/Prototypes/Entities/Clothing/Hands/colored.yml index 0b5b2e3fe79..8b7300670d3 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/colored.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/colored.yml @@ -300,7 +300,7 @@ name: insulated gloves description: These gloves will protect the wearer from electric shocks. components: -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: Sprite sprite: Clothing/Hands/Gloves/Color/yellow.rsi - type: Clothing diff --git a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml index 946301a2b01..01aa66ed421 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml @@ -24,7 +24,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-red -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: Tag tags: - Kangaroo @@ -44,7 +44,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-blue -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsGlovesBoxingRed @@ -60,7 +60,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-green -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsGlovesBoxingRed @@ -76,7 +76,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-yellow -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsGlovesBoxingBlue @@ -109,7 +109,7 @@ - type: Fiber fiberMaterial: fibers-durathread fiberColor: fibers-regal-blue -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsBase @@ -128,7 +128,7 @@ modifiers: coefficients: Slash: 0.95 -# - type: FingerprintMask # Frontier + - type: FingerprintMask #### Medical - type: entity @@ -143,7 +143,7 @@ sprite: Clothing/Hands/Gloves/latex.rsi - type: Fiber fiberMaterial: fibers-latex -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsButcherable @@ -157,7 +157,7 @@ sprite: Clothing/Hands/Gloves/nitrile.rsi - type: Fiber fiberMaterial: fibers-nitrile -# - type: FingerprintMask # Frontier + - type: FingerprintMask #### - type: entity parent: ClothingHandsButcherable @@ -174,7 +174,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-brown -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsBase @@ -188,7 +188,7 @@ sprite: Clothing/Hands/Gloves/powerglove.rsi - type: Fiber fiberMaterial: fibers-nanomachines -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsButcherable @@ -203,7 +203,7 @@ - type: Fiber fiberMaterial: fibers-leather fiberColor: fibers-black -# - type: FingerprintMask # Frontier + - type: FingerprintMask - type: entity parent: ClothingHandsBase @@ -426,4 +426,4 @@ - type: Fiber fiberMaterial: fibers-rubber fiberColor: fibers-yellow -# - type: FingerprintMask # Frontier + - type: FingerprintMask diff --git a/Resources/Prototypes/_NF/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/_NF/Entities/Clothing/Hands/gloves.yml index 43a00cff64a..b5b11ccfbe7 100644 --- a/Resources/Prototypes/_NF/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/_NF/Entities/Clothing/Hands/gloves.yml @@ -8,6 +8,8 @@ sprite: _NF/Clothing/Hands/Gloves/arcadia.rsi - type: Clothing sprite: _NF/Clothing/Hands/Gloves/arcadia.rsi + - type: Fiber + fiberColor: fibers-white - type: entity parent: ClothingHandsGlovesLeather @@ -19,6 +21,8 @@ sprite: _NF/Clothing/Hands/Gloves/pilot.rsi - type: Clothing sprite: _NF/Clothing/Hands/Gloves/pilot.rsi + - type: Fiber + fiberColor: fibers-brown - type: entity parent: ClothingHandsGlovesCombat @@ -30,9 +34,11 @@ sprite: _NF/Clothing/Hands/Gloves/nfsd_brown.rsi - type: Clothing sprite: _NF/Clothing/Hands/Gloves/nfsd_brown.rsi + - type: Fiber + fiberColor: fibers-brown - type: entity - parent: ClothingHandsGlovesCombat + parent: ClothingHandsGlovesCombatNfsdBrown id: ClothingHandsGlovesCombatNfsdCream name: nfsd combat gloves description: Insulated gloves for a deputy sheriff. @@ -41,6 +47,8 @@ sprite: _NF/Clothing/Hands/Gloves/nfsd_cream.rsi - type: Clothing sprite: _NF/Clothing/Hands/Gloves/nfsd_cream.rsi + - type: Fiber + fiberColor: fibers-cream - type: entity parent: ClothingHandsGlovesHop