Added Hemophilia Trait (#38224)
Co-authored-by: ScarKy0 <scarky0@onet.eu> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
16
Content.Shared/Traits/Assorted/HemophiliaComponent.cs
Normal file
16
Content.Shared/Traits/Assorted/HemophiliaComponent.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
16
Content.Shared/Traits/Assorted/HemophiliaSystem.cs
Normal file
16
Content.Shared/Traits/Assorted/HemophiliaSystem.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Content.Shared.Body.Events;
|
||||
|
||||
namespace Content.Shared.Traits.Assorted;
|
||||
|
||||
public sealed class HemophiliaSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<HemophiliaComponent, BleedModifierEvent>(OnBleedModifier);
|
||||
}
|
||||
|
||||
private void OnBleedModifier(Entity<HemophiliaComponent> ent, ref BleedModifierEvent args)
|
||||
{
|
||||
args.BleedReductionAmount *= ent.Comp.HemophiliaBleedReductionMultiplier;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user