diff --git a/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs b/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs new file mode 100644 index 00000000000..eb84218b8e0 --- /dev/null +++ b/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs @@ -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(OnInitHemophilia); + SubscribeLocalEvent(OnShutdown); + + } + + private void OnInitHemophilia(EntityUid uid, HemophiliaComponent component, MapInitEvent args) + { + if (TryComp(uid, out var bldcomp)) + { + bldcomp.BleedReductionAmount *= component.Modifier; + } + } + private void OnShutdown(EntityUid uid, HemophiliaComponent component, ComponentShutdown args) + { + if (TryComp(uid, out var bldcomp)) + { + bldcomp.BleedReductionAmount /= component.Modifier; + } + } +} diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index a6d2afab219..4bbb6bfee86 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -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"; diff --git a/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs b/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs new file mode 100644 index 00000000000..2a82c95013d --- /dev/null +++ b/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared.Traits; + +[RegisterComponent] +public sealed partial class HemophiliaComponent : Component +{ + [DataField] + public float Modifier = 0.3f; + + +} diff --git a/Resources/Locale/en-US/ADT/traits/traits.ftl b/Resources/Locale/en-US/ADT/traits/traits.ftl new file mode 100644 index 00000000000..92289cb406e --- /dev/null +++ b/Resources/Locale/en-US/ADT/traits/traits.ftl @@ -0,0 +1,2 @@ +trait-hemophilia-name = Hemophilia +trait-hemophilia-desc = Your blood is clotting extremely badly. diff --git a/Resources/Locale/ru-RU/ADT/traits/disabilities.ftl b/Resources/Locale/ru-RU/ADT/traits/disabilities.ftl new file mode 100644 index 00000000000..9fbced1d643 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/traits/disabilities.ftl @@ -0,0 +1,2 @@ +trait-hemophilia-name = Гемофилия +trait-hemophilia-desc = Ваша кровь сворачивается крайне плохо. diff --git a/Resources/Prototypes/ADT/Traits/speech.yml b/Resources/Prototypes/ADT/Traits/speech.yml index 28d63e224f3..5aea2761fee 100644 --- a/Resources/Prototypes/ADT/Traits/speech.yml +++ b/Resources/Prototypes/ADT/Traits/speech.yml @@ -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