Skip to content

Commit

Permalink
hemo
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderFan committed Aug 1, 2024
1 parent 6b02666 commit 843f321
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 1 deletion.
31 changes: 31 additions & 0 deletions Content.Server/ADT/Hemophilia/HemophiliaSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Body.Components;
using Content.Shared.Traits;

namespace Content.Server.Hemophilia;

public sealed partial class HemophiliaSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HemophiliaComponent, MapInitEvent>(OnInitHemophilia);
SubscribeLocalEvent<HemophiliaComponent, ComponentShutdown>(OnShutdown);

}

private void OnInitHemophilia(EntityUid uid, HemophiliaComponent component, MapInitEvent args)
{
if (TryComp<BloodstreamComponent>(uid, out var bldcomp))
{
bldcomp.BleedReductionAmount *= component.Modifier;
}
}
private void OnShutdown(EntityUid uid, HemophiliaComponent component, ComponentShutdown args)
{
if (TryComp<BloodstreamComponent>(uid, out var bldcomp))
{
bldcomp.BleedReductionAmount /= component.Modifier;
}
}
}
3 changes: 2 additions & 1 deletion Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Content.Server.Hemophilia;

namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem))]
[RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))]
public sealed partial class BloodstreamComponent : Component
{
public static string DefaultChemicalsSolutionName = "chemicals";
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/ADT/hemophilia/HemophiliaComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Shared.Traits;

[RegisterComponent]
public sealed partial class HemophiliaComponent : Component
{
[DataField]
public float Modifier = 0.3f;


}
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/ADT/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait-hemophilia-name = Hemophilia
trait-hemophilia-desc = Your blood is clotting extremely badly.
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/ADT/traits/disabilities.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait-hemophilia-name = Гемофилия
trait-hemophilia-desc = Ваша кровь сворачивается крайне плохо.
9 changes: 9 additions & 0 deletions Resources/Prototypes/ADT/Traits/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@
cost: 1
components:
- type: DeutschAccent

- type: trait
id: ADTHemophilia
name: trait-hemophilia-name
description: trait-hemophilia-desc
category: Disabilities
components:
- type: Hemophilia
modifier: 0.01

0 comments on commit 843f321

Please sign in to comment.