Warfarin and Hemorrhinol, Hemophilia turned into a StatusEffect (#41685)

* init

* yeah

* move folders

* comments

* i hate cloning sometimes

* review

* review squred

* fix stuff
This commit is contained in:
ScarKy0 2025-12-05 01:42:03 +01:00 committed by BarryNorfolk
parent 5d496b92d9
commit 376d1cdafc
12 changed files with 151 additions and 32 deletions

View 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

View File

@ -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;
}

View File

@ -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;
}

View 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;
}
}

View File

@ -156,3 +156,6 @@ reagent-desc-haloperidol = Removes most stimulating and hallucinogenic drugs. Re
reagent-name-stelloxadone = stelloxadone
reagent-desc-stelloxadone = A cryogenics chemical. Used to aggressively dissolve toxins from the body. Works regardless of the patient being alive or dead.
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.

View 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.

View File

@ -16,7 +16,6 @@
# traits
- BlackAndWhiteOverlay
- Clumsy
- Hemophilia
- ImpairedMobility
# - LegsParalyzed (you get healed)
- LightweightDrunk

View 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
@ -29,5 +35,30 @@
- 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

View File

@ -1558,3 +1558,27 @@
- !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

View File

@ -776,3 +776,22 @@
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

View File

@ -691,7 +691,7 @@
amount: 1
products:
Traumoxadone: 3
- type: reaction
id: Stelloxadone
impact: Medium
@ -706,3 +706,27 @@
Stelloxadone: 5
Water: 3
Fiber: 2
- 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

View File

@ -93,18 +93,21 @@
# - PainNumbnessTraitStatusEffect
#
#- type: trait
# id: Hemophilia
# name: trait-hemophilia-name
# description: trait-hemophilia-desc
# category: Disabilities
# specials:
# - !type:ApplyStatusEffectSpecial
# statusEffects:
# - StatusEffectHemophiliaTrait
#
#- type: trait
# id: ImpairedMobility
# name: trait-impaired-mobility-name
# description: trait-impaired-mobility-desc
# traitGear: OffsetCane
# category: Disabilities
# components:
# - type: ImpairedMobility
# - type: ImpairedMobility
#
#- type: trait
# id: Hemophilia
# name: trait-hemophilia-name
# description: trait-hemophilia-desc
# category: Disabilities
# components:
# - type: Hemophilia