using Content.Server.Nutrition.EntitySystems; using Content.Shared.Construction.Prototypes; using Content.Shared.Nutrition.Components; using Robust.Shared.Audio; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.Nutrition.Components; /// /// This is used for a machine that extracts hunger from entities and creates meat. Yum! /// [RegisterComponent, Access(typeof(FatExtractorSystem)), AutoGenerateComponentPause] public sealed partial class FatExtractorComponent : Component { /// /// Whether or not the extractor is currently extracting fat from someone /// [DataField] public bool Processing = true; /// /// How much nutrition is extracted per second. /// [ViewVariables(VVAccess.ReadWrite)] public int NutritionPerSecond = 10; /// /// The base rate of extraction /// [DataField] public int BaseNutritionPerSecond = 10; #region Machine Upgrade /// /// Which machine part affects the nutrition rate /// [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string MachinePartNutritionRate = "Manipulator"; /// /// The increase in rate per each rating above 1. /// [DataField] public float PartRatingRateMultiplier = 10; #endregion /// /// An accumulator which tracks extracted nutrition to determine /// when to spawn a meat. /// [DataField] public int NutrientAccumulator; /// /// How high has to be to spawn meat /// [DataField] public int NutrientPerMeat = 60; /// /// Meat spawned by the extractor. /// [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string MeatPrototype = "FoodMeat"; /// /// When the next update will occur /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [AutoPausedField] public TimeSpan NextUpdate; /// /// How long each update takes /// [DataField] public TimeSpan UpdateTime = TimeSpan.FromSeconds(1); /// /// The sound played when extracting /// [DataField] public SoundSpecifier? ProcessSound; public EntityUid? Stream; /// /// A minium hunger threshold for extracting nutrition. /// Ignored when emagged. /// [DataField] public HungerThreshold MinHungerThreshold = HungerThreshold.Okay; }