Files
wwdpublic/Content.Server/Traits/HemophiliaSystem.cs
Angelo Fallaria 54e59822b6 New Trait: Hemophilia (#690)
# Description

**Hemophilia** is a +1 point negative Physical trait that makes you more
susceptible to bleeding. You bleed twice as long, and you take 10% more
Blunt damage.

## Media

<details><summary>Expand</summary>


![image](https://github.com/user-attachments/assets/ceb0e91e-73c8-4986-a566-40fb9cd0d32b)

</details>

---

# Changelog

🆑 Skubman
- add: Add the Hemophilia trait, a new negative trait for 1 point that
makes you bleed twice as long and makes you take 10% more Blunt damage.
2024-08-07 19:39:52 -04:00

29 lines
932 B
C#

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<HemophiliaComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<HemophiliaComponent, DamageModifyEvent>(OnDamageModify);
}
private void OnStartup(EntityUid uid, HemophiliaComponent component, ComponentStartup args)
{
if (!TryComp<BloodstreamComponent>(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);
}
}