]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Warfarin and Hemorrhinol, Hemophilia turned into a StatusEffect (#41685)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Fri, 5 Dec 2025 00:42:03 +0000 (01:42 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Dec 2025 00:42:03 +0000 (00:42 +0000)
* init

* yeah

* move folders

* comments

* i hate cloning sometimes

* review

* review squred

* fix stuff

13 files changed:
Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs
Content.Shared/Traits/Assorted/HemophiliaComponent.cs [deleted file]
Content.Shared/Traits/Assorted/HemophiliaStatusEffectComponent.cs [new file with mode: 0644]
Content.Shared/Traits/Assorted/HemophiliaSystem.cs
Resources/Locale/en-US/reagents/meta/medicine.ftl
Resources/Locale/en-US/reagents/meta/physical-desc.ftl
Resources/Locale/en-US/reagents/meta/toxins.ftl
Resources/Prototypes/Entities/Mobs/Player/clone.yml
Resources/Prototypes/Entities/StatusEffects/body.yml
Resources/Prototypes/Reagents/medicine.yml
Resources/Prototypes/Reagents/toxins.yml
Resources/Prototypes/Recipes/Reactions/medicine.yml
Resources/Prototypes/Traits/disabilities.yml

index 9b16aadff0f282ee07ee8587597a79f101f1f7f7..30c5d9f67e6ffbf0c9899ffd4372eed5bab1a059 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Body.Events;
 using Content.Shared.Damage.Events;
 using Content.Shared.Mobs.Events;
 using Content.Shared.Movement.Events;
@@ -31,6 +32,8 @@ public sealed partial class StatusEffectsSystem
         SubscribeLocalEvent<StatusEffectContainerComponent, BeforeAlertSeverityCheckEvent>(RelayStatusEffectEvent);
 
         SubscribeLocalEvent<StatusEffectContainerComponent, AccentGetEvent>(RelayStatusEffectEvent);
+
+        SubscribeLocalEvent<StatusEffectContainerComponent, BleedModifierEvent>(RefRelayStatusEffectEvent);
     }
 
     private void RefRelayStatusEffectEvent<T>(EntityUid uid, StatusEffectContainerComponent component, ref T args) where T : struct
diff --git a/Content.Shared/Traits/Assorted/HemophiliaComponent.cs b/Content.Shared/Traits/Assorted/HemophiliaComponent.cs
deleted file mode 100644 (file)
index 208883f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using Robust.Shared.GameStates;
-
-namespace Content.Shared.Traits.Assorted;
-
-/// <summary>
-/// This component is used for the Hemophilia Trait, it reduces the passive bleed stack reduction amount so entities with it bleed for longer.
-/// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
-public sealed partial class HemophiliaComponent : Component
-{
-    /// <summary>
-    /// What multiplier should be applied to the BleedReduction when an entity bleeds?
-    /// </summary>
-    [DataField, AutoNetworkedField]
-    public float HemophiliaBleedReductionMultiplier = 0.33f;
-}
diff --git a/Content.Shared/Traits/Assorted/HemophiliaStatusEffectComponent.cs b/Content.Shared/Traits/Assorted/HemophiliaStatusEffectComponent.cs
new file mode 100644 (file)
index 0000000..3216052
--- /dev/null
@@ -0,0 +1,22 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Traits.Assorted;
+
+/// <summary>
+/// This component is used for the Hemophilia Trait, it reduces the passive bleed stack reduction amount so entities with it bleed for longer.
+/// </summary>
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+public sealed partial class HemophiliaStatusEffectComponent : Component
+{
+    /// <summary>
+    /// Multiplier to use for the amount of bloodloss reduction during a bleed tick.
+    /// </summary>
+    [DataField, AutoNetworkedField]
+    public float BleedReductionMultiplier = 0.33f;
+
+    /// <summary>
+    /// Multiplier to use for the amount of blood lost during a bleed tick.
+    /// </summary>
+    [DataField, AutoNetworkedField]
+    public float BleedAmountMultiplier = 1f;
+}
index 53f660957548466aa10e38fd52b5e6a43b2bfdef..4544007ac7ea7aab9e81d634b375e098e55c2c71 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Shared.Body.Events;
+using Content.Shared.StatusEffectNew;
 
 namespace Content.Shared.Traits.Assorted;
 
@@ -6,11 +7,14 @@ public sealed class HemophiliaSystem : EntitySystem
 {
     public override void Initialize()
     {
-        SubscribeLocalEvent<HemophiliaComponent, BleedModifierEvent>(OnBleedModifier);
+        SubscribeLocalEvent<HemophiliaStatusEffectComponent, StatusEffectRelayedEvent<BleedModifierEvent>>(OnBleedModifier);
     }
 
-    private void OnBleedModifier(Entity<HemophiliaComponent> ent, ref BleedModifierEvent args)
+    private void OnBleedModifier(Entity<HemophiliaStatusEffectComponent> ent, ref StatusEffectRelayedEvent<BleedModifierEvent> args)
     {
-        args.BleedReductionAmount *= ent.Comp.HemophiliaBleedReductionMultiplier;
+        var ev = args.Args;
+        ev.BleedReductionAmount *= ent.Comp.BleedReductionMultiplier;
+        ev.BleedAmount *= ent.Comp.BleedAmountMultiplier;
+        args.Args = ev;
     }
 }
index 1d2dac1bf52e9ef7b14c00c1184068c4167e7144..f1eb6e82a5c8ffef0b3c1e7b8af8ee730cb8f7b8 100644 (file)
@@ -147,3 +147,6 @@ reagent-desc-potassium-iodide = Will reduce the damaging effects of radiation by
 
 reagent-name-haloperidol = haloperidol
 reagent-desc-haloperidol = Removes most stimulating and hallucinogenic drugs. Reduces druggy effects and jitteriness. Causes drowsiness.
+
+reagent-name-warfarin = warfarin
+reagent-desc-warfarin = Commonly used as an anticoagulant medication. Causes blood to have difficulty forming clots. Can cause internal bleeding when overdosed.
index 6e0ebf53bf3978a54b8b3b5978e4228b4b78e715..b9e6249fa0ad015b624f8a1307ce17a512b01355 100644 (file)
@@ -97,3 +97,4 @@ reagent-physical-desc-slimy = slimy
 reagent-physical-desc-neural = neural
 reagent-physical-desc-unidentifiable = unidentifiable
 reagent-physical-desc-non-newtonian = non-newtonian
+reagent-physical-desc-thin = thin
index 46de20a592d10e17eefb62ab9c556f0d45288dfc..89271516a8083a1bd2a4d0766abf26c0929f2b26 100644 (file)
@@ -84,3 +84,6 @@ reagent-desc-mechanotoxin = A neurotoxin used as venom by some species of spider
 
 reagent-name-toxintrash = reprocessed material
 reagent-desc-toxintrash = An awful-smelling slurry efficiently refined from discarded matter. It represents a perfect, zero-waste conversion of salvage into Vox sustenance, though it is a violent poison to others.
+
+reagent-name-hemorrhinol = hemorrhinol
+reagent-desc-hemorrhinol = A toxin that causes severe damage to blood vessels, causing rapid bleeding.
index e9e4f04f102f087b127fec217735b3039abe5f3a..419bf233256dce0d89bbee7341accd5ea0f927a4 100644 (file)
@@ -16,7 +16,6 @@
   # traits
   - BlackAndWhiteOverlay
   - Clumsy
-  - Hemophilia
   - ImpairedMobility
   # - LegsParalyzed (you get healed)
   - LightweightDrunk
index 6b6f704a2c9048d8ba8289b600feddfcfff5c0e5..739c9c3b2243f1d08830f8e52804d99e627186da 100644 (file)
@@ -9,13 +9,19 @@
       - Bloodstream
 
 - type: entity
-  parent: [ BloodstreamStatusEffectBase ]
+  parent: BloodstreamStatusEffectBase
+  id: BloodstreamStatusEffectDebuff
+  abstract: true
+  components:
+  - type: RejuvenateRemovedStatusEffect
+
+- type: entity
+  parent: BloodstreamStatusEffectDebuff
   id: StatusEffectBloodloss
   name: bloodloss
   components:
   - type: StutteringAccent
   - type: DrunkStatusEffect
-  - type: RejuvenateRemovedStatusEffect
 
 - type: entity
   parent: MobStatusEffectBase
   - type: PainNumbnessStatusEffect
 
 - type: entity
-  parent: PainNumbnessTraitStatusEffect
+  parent: BloodstreamStatusEffectBase
+  id: StatusEffectHemophiliaTrait
+  components:
+  - type: HemophiliaStatusEffect
+
+- type: entity
+  parent: BloodstreamStatusEffectDebuff
+  id: StatusEffectAnticoagulant # Decreases the amount of blood coagulation when bleeding.
+  name: thin blood
+  components:
+  - type: HemophiliaStatusEffect
+    bleedReductionMultiplier: 0.33
+    bleedAmountMultiplier: 1
+
+- type: entity
+  parent: BloodstreamStatusEffectDebuff
+  id: StatusEffectHemorrhage # Increases the amount of blood lost when bleeding.
+  name: hemorrhage
+  components:
+  - type: HemophiliaStatusEffect
+    bleedReductionMultiplier: 1 # We don't want it to also reduce coagulation, it would stack with Anticoagulant.
+    bleedAmountMultiplier: 1.33
+
+- type: entity
+  parent: [ PainNumbnessTraitStatusEffect, MobStatusEffectDebuff ]
   id: StatusEffectPainNumbness
+  name: pain numbness
index 84b5535802b481bc541becfe0b3b212d69e7da8c..06c261b0a7c41b8fa51567b8741a8ac9c0646c5b 100644 (file)
       - !type:AdjustReagent
         reagent: MindbreakerToxin
         amount: -3.0
+
+- type: reagent
+  id: Warfarin
+  name: reagent-name-warfarin
+  group: Medicine
+  desc: reagent-desc-warfarin
+  physicalDesc: reagent-physical-desc-thin
+  allowedDepartments:
+  - Medical
+  flavor: medicine
+  color: "#d0e21b"
+  metabolisms:
+    Medicine:
+      effects: # One day this could be useful for treating blood clots, if we get those
+      - !type:ModifyStatusEffect
+        effectProto: StatusEffectAnticoagulant
+        time: 30 # 10 bleed ticks, you bleed every 3 seconds by default.
+        type: Update
+      - !type:ModifyBleed
+        conditions:
+        - !type:ReagentCondition
+          reagent: Warfarin
+          min: 15
+        amount: 0.25
index 4a7527032523c381db05a1b92016f334d1de7f1f..79f8e5cc2985d39bb772d9c3cbda403d35cf41da 100644 (file)
         conditions:
         - !type:MetabolizerTypeCondition
           type: [Vox]
+
+- type: reagent
+  id: Hemorrhinol
+  name: reagent-name-hemorrhinol
+  group: Toxins
+  desc: reagent-desc-hemorrhinol
+  physicalDesc: reagent-physical-desc-thin
+  contrabandSeverity: Major
+  flavor: sharp
+  color: "#96424f"
+  metabolisms:
+    Poison:
+      effects:
+      - !type:ModifyStatusEffect
+        effectProto: StatusEffectHemorrhage
+        time: 21 # 7 bleed ticks, you bleed every 3 seconds by default.
+        type: Update
+      - !type:ModifyBleed
+        amount: 0.5
index f710f5c471586498d2d3bebcb0fbee1064940569..1a9db942da56f8f6622bc3dda747c400823faefa 100644 (file)
       amount: 1
   products:
     Haloperidol: 5
+
+- type: reaction
+  id: Warfarin
+  reactants:
+    SulfuricAcid:
+      amount: 1
+    Nitrogen:
+      amount: 1
+    Sodium:
+      amount: 1
+  products:
+    Warfarin: 2
+
+- type: reaction
+  id: Hemorrhinol
+  reactants:
+    Warfarin:
+      amount: 2
+    Razorium:
+      amount: 2
+    Plasma:
+      amount: 1
+  products:
+    Hemorrhinol: 2
index de102b54eeddd6675101caf3f898b9edb4f816a8..299032bf779f71b4806ece9f5b26cf75c29451fe 100644 (file)
   name: trait-hemophilia-name
   description: trait-hemophilia-desc
   category: Disabilities
-  components:
-  - type: Hemophilia
+  specials:
+  - !type:ApplyStatusEffectSpecial
+    statusEffects:
+    - StatusEffectHemophiliaTrait
 
 - type: trait
   id: ImpairedMobility