mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# 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>  </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.
29 lines
932 B
C#
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);
|
|
}
|
|
}
|