forked from space-syndicate/space-station-14
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
# traits
|
||||
- BlackAndWhiteOverlay
|
||||
- Clumsy
|
||||
- Hemophilia
|
||||
- ImpairedMobility
|
||||
# - LegsParalyzed (you get healed)
|
||||
- LightweightDrunk
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1487,3 +1487,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
|
||||
|
||||
@@ -751,3 +751,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
|
||||
|
||||
@@ -662,3 +662,27 @@
|
||||
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
|
||||
|
||||
@@ -93,8 +93,10 @@
|
||||
name: trait-hemophilia-name
|
||||
description: trait-hemophilia-desc
|
||||
category: Disabilities
|
||||
components:
|
||||
- type: Hemophilia
|
||||
specials:
|
||||
- !type:ApplyStatusEffectSpecial
|
||||
statusEffects:
|
||||
- StatusEffectHemophiliaTrait
|
||||
|
||||
- type: trait
|
||||
id: ImpairedMobility
|
||||
|
||||
Reference in New Issue
Block a user