using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.Prototypes; using Robust.Shared.Prototypes; namespace Content.Shared.EntityEffects.Effects.Body; // TODO: Arguably oxygen saturation should also be added here... /// /// Attempts to find a on the target, and update its value of the specified /// . /// public sealed partial class SatiateEntityEffectsSystem : EntityEffectSystem { [Dependency] private SatiationSystem _satiation = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) { _satiation.ModifyValue(entity, args.Effect.SatiationType, args.Effect.Factor * args.Scale); } } /// public sealed partial class Satiate : EntityEffectBase { public const float AverageSatiation = 3f; // Magic number. Not sure how it was calculated since I didn't make it. /// /// How much the specified is modified by this effect. /// [DataField] public float Factor = 1.5f; /// /// The type of satiation to modify. /// [DataField(required: true)] public ProtoId SatiationType; public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { return Loc.GetString( "entity-effect-guidebook-satiate", ("chance", Probability), ("relative", Factor / AverageSatiation), ("type", prototype.Index(SatiationType).Name) ); } }