using Content.Shared.Body.Components;
using Content.Shared.Body.Systems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects.Body;
///
/// Removes a given amount of chemicals from the bloodstream modified by scale.
/// Optionally ignores a given chemical.
///
///
public sealed partial class CleanBloodstreamEntityEffectSystem : EntityEffectSystem
{
[Dependency] private readonly SharedBloodstreamSystem _bloodstream = default!;
protected override void Effect(Entity entity, ref EntityEffectEvent args)
{
var scale = args.Scale * args.Effect.CleanseRate;
_bloodstream.FlushChemicals((entity, entity), args.Effect.Excluded, scale);
}
}
///
public sealed partial class CleanBloodstream : EntityEffectBase
{
///
/// Amount of reagent we're cleaning out of our bloodstream.
///
[DataField]
public FixedPoint2 CleanseRate = 3.0f;
///
/// An optional chemical to ignore when doing removal.
///
[DataField]
public ProtoId? Excluded;
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-clean-bloodstream", ("chance", Probability));
}