Skip to content

Commit

Permalink
give ipcs and borgs fibers (#2992)
Browse files Browse the repository at this point in the history
* support Fiber on user

:trollface:

* ipcs get fiberprint in records

* give ipc and borgs metal fibers

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Feb 17, 2025
1 parent ae243de commit f918379
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 6 deletions.
27 changes: 22 additions & 5 deletions Content.Server/Forensics/Systems/ForensicsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public sealed class ForensicsSystem : EntitySystem
public override void Initialize()
{
SubscribeLocalEvent<FingerprintComponent, ContactInteractionEvent>(OnInteract);
SubscribeLocalEvent<FiberComponent, ContactInteractionEvent>(OnFiberInteract); // DeltaV
SubscribeLocalEvent<FiberComponent, MapInitEvent>(OnFiberInit); // DeltaV #1455 - unique glove fibers
SubscribeLocalEvent<FingerprintComponent, MapInitEvent>(OnFingerprintInit);
SubscribeLocalEvent<DnaComponent, MapInitEvent>(OnDNAInit);
Expand Down Expand Up @@ -64,12 +65,19 @@ 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)
// Begin DeltaV Additions
// ipcs and borgs leave metal fibers
private void OnFiberInteract(Entity<FiberComponent> ent, ref ContactInteractionEvent args)
{
component.Fiberprint = GenerateFingerprint(length: 7);
ApplyEvidence(ent, args.Other);
}
// End of DeltaV code

// #1455 - unique glove fibers
private void OnFiberInit(Entity<FiberComponent> ent, ref MapInitEvent args)
{
ent.Comp.Fiberprint = GenerateFingerprint(length: 7);
}
// End DeltaV Additions

private void OnFingerprintInit(EntityUid uid, FingerprintComponent component, MapInitEvent args)
{
Expand Down Expand Up @@ -294,10 +302,19 @@ private void ApplyEvidence(EntityUid user, EntityUid target)
return;

var component = EnsureComp<ForensicsComponent>(target);
// Begin DeltaV Additions - IPCs and borgs leave fibers
if (TryComp<FiberComponent>(user, out var fiber) && CanAccessFingerprint(user, out _))
{
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 DeltaV Additions
if (_inventory.TryGetSlotEntity(user, "gloves", out var gloves))
{
// DeltaV #1455 - unique glove fibers
if (TryComp<FiberComponent>(gloves, out var fiber) && !string.IsNullOrEmpty(fiber.FiberMaterial))
if (TryComp<FiberComponent>(gloves, out fiber) && !string.IsNullOrEmpty(fiber.FiberMaterial))
{
var fiberLocale = string.IsNullOrEmpty(fiber.FiberColor)
? Loc.GetString("forensic-fibers", ("material", fiber.FiberMaterial))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCh
TryComp<FingerprintComponent>(player, out var fingerprintComponent);
TryComp<DnaComponent>(player, out var dnaComponent);

CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
var prints = fingerprintComponent?.Fingerprint ?? CompOrNull<FiberComponent>(player)?.Fiberprint; // DeltaV - IPCs use fibers
CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, prints, dnaComponent?.DNA, profile, records); // DeltaV - use prints var
}


Expand Down
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/_DV/forensics/fibers.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# IPC
fibers-steel = steel
# Borg, coloured with the chassis colour for non-generic borgs
fibers-plasteel = plasteel
fibers-degraded-plasteel = degraded plasteel
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
allowSelfRepair: false
- type: BorgChassis
- type: SurgerySelfDirty # DeltaV: borgs get dirty from doing surgery
- type: Fiber # DeltaV - borgs leave metal fibers
fiberMaterial: fibers-plasteel
- type: LockingWhitelist
blacklist:
components:
Expand Down Expand Up @@ -338,6 +340,8 @@
Unsexed: UnisexSiliconSyndicate
- type: PointLight
color: "#dd200b"
- type: Fiber # DeltaV - syndiborgs have black plasteel fibers
fiberColor: fibers-black

- type: entity
id: BaseBorgChassisDerelict
Expand All @@ -358,3 +362,5 @@
- type: IonStormTarget
chance: 1
- type: ShowJobIcons
- type: Fiber # DeltaV - derelict borgs have degraded plasteel fibers
fiberMaterial: fibers-degraded-plasteel
3 changes: 3 additions & 0 deletions Resources/Prototypes/_DV/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
0: Alive
80: Critical # -20 to Crit Threshold
200: Dead
- type: Fiber # red plasteel fibers
fiberMaterial: fibers-plasteel
fiberColor: fibers-red

radioChannels:
- Science
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,5 @@
- type: Targeting
- type: SurgeryTarget
- type: LayingDown
- type: Fiber # DeltaV - IPCs leave fibers instead of prints
fiberMaterial: fibers-steel
16 changes: 16 additions & 0 deletions Resources/Prototypes/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
- BorgModuleCable

lawset: Engineer # DeltaV: Custom lawset
addComponents: # DeltaV - orange plasteel fibers
- type: Fiber
fiberMaterial: fibers-plasteel
fiberColor: fibers-orange

radioChannels:
- Engineering
Expand Down Expand Up @@ -86,6 +90,11 @@
- BorgModuleMining
- BorgModuleAppraisal

addComponents: # DeltaV - brown plasteel fibers
- type: Fiber
fiberMaterial: fibers-plasteel
fiberColor: fibers-brown

radioChannels:
- Supply
- Science
Expand Down Expand Up @@ -122,6 +131,10 @@
- BorgModuleCleaning

lawset: Janitor # DeltaV: Custom lawset
addComponents: # DeltaV - purple plasteel fibers
- type: Fiber
fiberMaterial: fibers-plasteel
fiberColor: fibers-purple

radioChannels:
- Science
Expand Down Expand Up @@ -176,6 +189,9 @@
actions:
- ActionFabricateLollipop
- ActionFabricateGumball
- type: Fiber # DeltaV - white plasteel fibers
fiberMaterial: fibers-plasteel
fiberColor: fibers-white
- type: SurgeryTarget # Shitmed
- type: Sanitized # Shitmed

Expand Down

0 comments on commit f918379

Please sign in to comment.