diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 7a4af3e4cc1..6106ac65b15 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -12,7 +12,7 @@ namespace Content.Server.Body.Components { - [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BloodDeficiencySystem))] + [RegisterComponent, Access(typeof(BloodstreamSystem), typeof(ReactionMixerSystem), typeof(BloodDeficiencySystem), typeof(HemophiliaSystem))] public sealed partial class BloodstreamComponent : Component { public static string DefaultChemicalsSolutionName = "chemicals"; diff --git a/Content.Server/Traits/HemophiliaComponent.cs b/Content.Server/Traits/HemophiliaComponent.cs new file mode 100644 index 00000000000..e8f1f57c6e5 --- /dev/null +++ b/Content.Server/Traits/HemophiliaComponent.cs @@ -0,0 +1,21 @@ +using Content.Shared.Damage; +namespace Content.Server.Traits.Assorted; + +/// +/// This is used for the Hemophilia trait. +/// +[RegisterComponent] +public sealed partial class HemophiliaComponent : Component +{ + // + // What the BleedReductionAmount should be multiplied by. + // + [DataField(required: true)] + public float BleedReductionModifier = 1f; + + /// + /// The damage increase from this trait. + /// + [DataField(required: true)] + public DamageModifierSet DamageModifiers = default!; +} diff --git a/Content.Server/Traits/HemophiliaSystem.cs b/Content.Server/Traits/HemophiliaSystem.cs new file mode 100644 index 00000000000..c70c7de37c0 --- /dev/null +++ b/Content.Server/Traits/HemophiliaSystem.cs @@ -0,0 +1,28 @@ +using Content.Server.Body.Systems; +using Content.Server.Body.Components; +using Content.Shared.Damage; + +namespace Content.Server.Traits.Assorted; + +public sealed class HemophiliaSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnStartup); + SubscribeLocalEvent(OnDamageModify); + } + + private void OnStartup(EntityUid uid, HemophiliaComponent component, ComponentStartup args) + { + if (!TryComp(uid, out var bloodstream)) + return; + + bloodstream.BleedReductionAmount *= component.BleedReductionModifier; + } + + private void OnDamageModify(EntityUid uid, HemophiliaComponent component, DamageModifyEvent args) + { + args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, component.DamageModifiers); + } +} diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index 3439ffcdc97..73e4866bace 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -28,6 +28,11 @@ trait-description-BloodDeficiency = Your body loses more blood than it can replenish. You lose blood over time, and when left untreated you will eventually die from blood loss. +trait-name-Hemophilia = Hemophilia +trait-description-Hemophilia = + Your body's ability to form blood clots is impaired. + You bleed twice as long, and you have easy bruising, taking 10% more Blunt damage. + trait-name-Paracusia = Paracusia trait-description-Paracusia = You hear sounds that aren't really there @@ -106,4 +111,4 @@ trait-description-Spearmaster = trait-name-WeaponsGeneralist = Weapons Generalist trait-description-WeaponsGeneralist = You are a jack of all trades with melee weapons, enabling you to be versatile with your weapon arsenal. - Your melee damage bonus for all Brute damage types (Blunt, Slash, Piercing) becomes 25%. \ No newline at end of file + Your melee damage bonus for all Brute damage types (Blunt, Slash, Piercing) becomes 25%. diff --git a/Resources/Prototypes/Traits/disabilities.yml b/Resources/Prototypes/Traits/disabilities.yml index afdd27f339d..ee3c43cfbda 100644 --- a/Resources/Prototypes/Traits/disabilities.yml +++ b/Resources/Prototypes/Traits/disabilities.yml @@ -108,3 +108,20 @@ components: - type: BloodDeficiency # 0.07 = start taking bloodloss damage at around ~21.4 minutes, bloodLossAmount: 0.07 # then become crit ~10 minutes later + +- type: trait + id: Hemophilia + category: Physical + points: 1 + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + components: + - type: Hemophilia + bleedReductionModifier: 0.5 + damageModifiers: + coefficients: + Blunt: 1.1