Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Content.Server/_HL/Traits/Physical/SyntheticHeartComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server._HL.Traits.Physical;

[RegisterComponent]
public sealed partial class SyntheticHeartComponent : Component
{

}
47 changes: 47 additions & 0 deletions Content.Server/_HL/Traits/Physical/SyntheticHeartSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Content.Shared.Body.Systems;
using Content.Shared._Shitmed.Body.Organ;
using Content.Shared.Body.Components;
using Content.Shared.Body.Organ;
using Robust.Shared.Containers;

namespace Content.Server._HL.Traits.Physical;

public sealed class SyntheticHeartSystem : EntitySystem
{
[Dependency] private readonly SharedBodySystem _body = null!;
[Dependency] private readonly SharedContainerSystem _containers = null!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SyntheticHeartComponent, ComponentStartup>(OnStartup);
}

private void OnStartup(EntityUid uid, SyntheticHeartComponent comp, ComponentStartup args)
{
if (!TryComp<BodyComponent>(uid, out var body))
return;

if (_body.TryGetBodyOrganEntityComps<HeartComponent>((uid, body), out var livers))
{
var old = livers[0].Owner;
if (_containers.TryGetContainingContainer((old, null, null), out var cont))
{
var part = cont.Owner;
_body.RemoveOrgan(old);
QueueDel(old);

var spawn = Spawn("OrganSynthHeart", Transform(part).Coordinates);
if (TryComp(spawn, out OrganComponent? organ))
{
_body.InsertOrgan(part, spawn, "heart", null, organ);
}
else
{
QueueDel(spawn);
}
}
}
}
}
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_HL/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ hl-trait-kinky-erotic-moods-desc = Every half hour or so you receive a private r
hl-trait-romantic-moods-name = Romantic Moods
hl-trait-romantic-moods-desc = Every half hour or so you receive a private reminder of two randomly drawn romantic inclinations — tenderness, dates, closeness. Preferences rotate every one to two and a half hours.

trait-syntheticheart-name = Synthetic Heart
trait-syntheticheart-desc = You have a high-tech biomechanical heart based on the same technology found in Synths. Their nanites work on you, and chemicals will continue to process even when the rest of your body won't - but they have significantly reduced effect on you.
trait-hardskin-name = Hard Skin
trait-hardskin-desc = Your skin is too hard for needles to pierce.
injector-component-deny-hardskin = {CAPITALIZE(THE($target))}'s skin is too hard for the needle to pierce.
Expand Down
17 changes: 17 additions & 0 deletions Resources/Prototypes/_HL/Traits/Physical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,23 @@
removeBodyPart: Arm
partSymmetry: Right

- type: trait
id: SyntheticHeart
name: trait-syntheticheart-name
description: trait-syntheticheart-desc
category: Physical
cost: 16
speciesBlacklist: # HardLight
- IPC
- Synth
mutuallyExclusiveTraits:
- PlateletFactories
- NaturalRegen
- UnnaturalRegen
components:
- type: SyntheticHeart
- type: HLSynth

- type: trait
id: HardSkin
name: trait-hardskin-name
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/_Mono/Traits/physical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
- NaturalRegen
- ShadekinRegeneration
- ExtremeShadekinRegeneration
- SyntheticHeart # HL
speciesBlacklist:
- IPC
- Avali
Expand Down
Loading