using Content.Server.Body.Systems; using Content.Shared.Body.Prototypes; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Body.Components { /// /// Handles metabolizing various reagents with given effects. /// [RegisterComponent, Access(typeof(MetabolizerSystem))] public sealed partial class MetabolizerComponent : Component { /// /// The next time that reagents will be metabolized. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextUpdate; /// /// How often to metabolize reagents. /// /// [DataField] public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1); /// /// From which solution will this metabolizer attempt to metabolize chemicals /// [DataField("solution")] public string SolutionName = BloodstreamComponent.DefaultChemicalsSolutionName; /// /// Does this component use a solution on it's parent entity (the body) or itself /// /// /// Most things will use the parent entity (bloodstream). /// [DataField] public bool SolutionOnBody = true; /// /// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e. /// [DataField] [Access(typeof(MetabolizerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends public HashSet>? MetabolizerTypes = null; /// /// Should this metabolizer remove chemicals that have no metabolisms defined? /// As a stop-gap, basically. /// [DataField] public bool RemoveEmpty = false; /// /// How many reagents can this metabolizer process at once? /// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low /// quantity, would be muuuuch better than just one poison acting. /// [DataField("maxReagents")] public int MaxReagentsProcessable = 3; /// /// A list of metabolism groups that this metabolizer will act on, in order of precedence. /// [DataField("groups")] public List? MetabolismGroups = default!; } /// /// Contains data about how a metabolizer will metabolize a single group. /// This allows metabolizers to remove certain groups much faster, or not at all. /// [DataDefinition] public sealed partial class MetabolismGroupEntry { [DataField(required: true)] public ProtoId Id = default!; [DataField("rateModifier")] public FixedPoint2 MetabolismRateModifier = 1.0; } }