From dafc4952ad35f3b15472f1085608027c589872a8 Mon Sep 17 00:00:00 2001 From: AnderFan Date: Fri, 21 Jun 2024 19:31:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B3=D0=B5=D0=BC=D0=BE=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ADT/Hemophilia/HemophiliaSystem.cs | 31 +++++++++++++++++++ .../Body/Components/BloodstreamComponent.cs | 3 +- .../ADT/hemophilia/HemophiliaComponent.cs | 10 ++++++ Resources/Locale/en-US/ADT/traits/traits.ftl | 2 ++ .../Locale/ru-RU/ADT/traits/disabilities.ftl | 3 ++ Resources/Prototypes/ADT/Traits/neutral.yml | 10 +++++- 6 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 Content.Server/ADT/Hemophilia/HemophiliaSystem.cs create mode 100644 Content.Shared/ADT/hemophilia/HemophiliaComponent.cs create mode 100644 Resources/Locale/en-US/ADT/traits/traits.ftl 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 7041df44481..cde6afeef10 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -6,10 +6,11 @@ using Content.Shared.FixedPoint; using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Content.Server.Hemophilia; namespace Content.Server.Body.Components { - [RegisterComponent, Access(typeof(BloodstreamSystem), (typeof(ChemistrySystem)))] + [RegisterComponent, Access(typeof(BloodstreamSystem), (typeof(ChemistrySystem)), (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 index 956737e9440..457f40894ef 100644 --- a/Resources/Locale/ru-RU/ADT/traits/disabilities.ftl +++ b/Resources/Locale/ru-RU/ADT/traits/disabilities.ftl @@ -4,3 +4,6 @@ trait-monochromacy-description = Ваши глаза получили необр trait-nearsighted-name = Близорукость trait-nearsighted-description = Вам требуются очки, чтобы нормально видеть. trait-nearsighted-examined = [color=lightblue]{CAPITALIZE(POSS-ADJ($target))} глаза довольно расфокусированы. Не похоже, что {SUBJECT($target)} может видеть вещи настолько хорошо.[/color] + +trait-hemophilia-name = Гемофилия +trait-hemophilia-desc = Ваша кровь сворачивается крайне плохо. diff --git a/Resources/Prototypes/ADT/Traits/neutral.yml b/Resources/Prototypes/ADT/Traits/neutral.yml index 79fa48c9573..fc0ff0e508e 100644 --- a/Resources/Prototypes/ADT/Traits/neutral.yml +++ b/Resources/Prototypes/ADT/Traits/neutral.yml @@ -3,4 +3,12 @@ name: trait-moth-accent-name description: trait-moth-accent-desc components: - - type: MothAccent \ No newline at end of file + - type: MothAccent + +- type: trait + id: ADTHemophilia + name: trait-hemophilia-name + description: trait-hemophilia-desc + components: + - type: Hemophilia + modifier: 0.01