From 843f32185391275f53d69bfa40d5653401a280cd Mon Sep 17 00:00:00 2001 From: AnderFan Date: Thu, 1 Aug 2024 16:07:31 +0300 Subject: [PATCH 1/4] hemo --- .../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 | 2 ++ Resources/Prototypes/ADT/Traits/speech.yml | 9 ++++++ 6 files changed, 56 insertions(+), 1 deletion(-) 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 create mode 100644 Resources/Locale/ru-RU/ADT/traits/disabilities.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 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 From 2795539488aa0b7702d54105075cf12f3e6e9abe Mon Sep 17 00:00:00 2001 From: AnderFan Date: Thu, 1 Aug 2024 18:34:34 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=A1=D1=8D=D1=80,=20=D0=B4=D0=B0,=20?= =?UTF-8?q?=D1=81=D1=8D=D1=80!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Body/Components/BloodstreamComponent.cs | 2 +- .../en-US/ADT/traits/{traits.ftl => disabilities.ftl} | 0 Resources/Prototypes/ADT/Traits/disabilities.yml | 8 ++++++++ Resources/Prototypes/ADT/Traits/speech.yml | 8 -------- 4 files changed, 9 insertions(+), 9 deletions(-) rename Resources/Locale/en-US/ADT/traits/{traits.ftl => disabilities.ftl} (100%) create mode 100644 Resources/Prototypes/ADT/Traits/disabilities.yml diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 4bbb6bfee86..1c62539ec42 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -13,7 +13,7 @@ namespace Content.Server.Body.Components { - [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))] + [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))] // ADThemophilia public sealed partial class BloodstreamComponent : Component { public static string DefaultChemicalsSolutionName = "chemicals"; diff --git a/Resources/Locale/en-US/ADT/traits/traits.ftl b/Resources/Locale/en-US/ADT/traits/disabilities.ftl similarity index 100% rename from Resources/Locale/en-US/ADT/traits/traits.ftl rename to Resources/Locale/en-US/ADT/traits/disabilities.ftl diff --git a/Resources/Prototypes/ADT/Traits/disabilities.yml b/Resources/Prototypes/ADT/Traits/disabilities.yml new file mode 100644 index 00000000000..17cd0d5aa33 --- /dev/null +++ b/Resources/Prototypes/ADT/Traits/disabilities.yml @@ -0,0 +1,8 @@ +- type: trait + id: ADTHemophilia + name: trait-hemophilia-name + description: trait-hemophilia-desc + category: Disabilities + components: + - type: Hemophilia + modifier: 0.01 diff --git a/Resources/Prototypes/ADT/Traits/speech.yml b/Resources/Prototypes/ADT/Traits/speech.yml index 5aea2761fee..ec03739e0d4 100644 --- a/Resources/Prototypes/ADT/Traits/speech.yml +++ b/Resources/Prototypes/ADT/Traits/speech.yml @@ -16,11 +16,3 @@ components: - type: DeutschAccent -- type: trait - id: ADTHemophilia - name: trait-hemophilia-name - description: trait-hemophilia-desc - category: Disabilities - components: - - type: Hemophilia - modifier: 0.01 From ddf6ac230c256ca4b278c337f30bbed096b6ef19 Mon Sep 17 00:00:00 2001 From: AnderFan Date: Fri, 2 Aug 2024 12:48:24 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9E=D0=99,=20=D0=B7=D0=B0=D0=B1=D1=8B?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=BB=D1=83=D0=B4=D1=81=D1=82=D1=80=D0=B8=D0=BC?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BA=D0=BE=D0=BC=D0=B5=D0=BD=D0=B8=D1=82=D0=B8?= =?UTF-8?q?=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Body/Components/BloodstreamComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 1c62539ec42..b9b3c16e864 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -13,7 +13,7 @@ namespace Content.Server.Body.Components { - [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))] // ADThemophilia + [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), (typeof(HemophiliaSystem)))] // ADT Hemophilia public sealed partial class BloodstreamComponent : Component { public static string DefaultChemicalsSolutionName = "chemicals"; From 33437584f531c15347a1648832bbbb42c7e33a8c Mon Sep 17 00:00:00 2001 From: Darki255 Date: Mon, 5 Aug 2024 14:58:39 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=BF=D0=BE=D0=BC=D0=BE=D0=B3=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=20=D0=B0=D0=BD=D0=B4=D0=B5=D1=80=D1=83=20=D1=81=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/ADT/Hemophilia/HemophiliaSystem.cs | 4 ++-- Content.Server/Body/Components/BloodstreamComponent.cs | 2 +- Content.Shared/ADT/hemophilia/HemophiliaComponent.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs b/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs index eb84218b8e0..9092cc66a14 100644 --- a/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs +++ b/Content.Server/ADT/Hemophilia/HemophiliaSystem.cs @@ -1,7 +1,7 @@ using Content.Server.Body.Components; -using Content.Shared.Traits; +using Content.Shared.ADT.Traits; -namespace Content.Server.Hemophilia; +namespace Content.Server.ADT.Hemophilia; public sealed partial class HemophiliaSystem : EntitySystem { diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index b9b3c16e864..2eb356dc0e9 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -9,7 +9,7 @@ using Robust.Shared.Audio; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; -using Content.Server.Hemophilia; +using Content.Server.ADT.Hemophilia; namespace Content.Server.Body.Components { diff --git a/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs b/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs index 2a82c95013d..30ed792e1b1 100644 --- a/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs +++ b/Content.Shared/ADT/hemophilia/HemophiliaComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared.Traits; +namespace Content.Shared.ADT.Traits; [RegisterComponent] public sealed partial class HemophiliaComponent : Component