mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using Content.Shared.Body.Components;
|
|
using Content.Shared.Body.Systems;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityEffects.Effects.Body;
|
|
|
|
/// <summary>
|
|
/// Modifies bleed by a given amount multiplied by scale. This can increase or decrease bleed.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
|
|
public sealed partial class ModifyBleedEntityEffectSystem : EntityEffectSystem<BloodstreamComponent, ModifyBleed>
|
|
{
|
|
[Dependency] private SharedBloodstreamSystem _bloodstream = default!;
|
|
|
|
protected override void Effect(Entity<BloodstreamComponent> entity, ref EntityEffectEvent<ModifyBleed> args)
|
|
{
|
|
_bloodstream.TryModifyBleedAmount(entity.AsNullable(), args.Effect.Amount * args.Scale);
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc cref="EntityEffect"/>
|
|
public sealed partial class ModifyBleed : EntityEffectBase<ModifyBleed>
|
|
{
|
|
/// <summary>
|
|
/// Amount of bleed we're applying or removing if negative.
|
|
/// </summary>
|
|
[DataField]
|
|
public float Amount = -1.0f;
|
|
|
|
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
|
=> Loc.GetString("entity-effect-guidebook-modify-bleed-amount", ("chance", Probability), ("deltasign", MathF.Sign(Amount)));
|
|
}
|