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))] public sealed partial class FatExtractorComponent : Component { /// /// Whether or not the extractor is currently extracting fat from someone /// [DataField("processing")] public bool Processing = true; /// /// How much nutrition is extracted per second. /// [DataField("nutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)] public int NutritionPerSecond = 10; /// /// The base rate of extraction /// [DataField("baseNutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)] public int BaseNutritionPerSecond = 10; #region Machine Upgrade /// /// Which machine part affects the nutrition rate /// [DataField("machinePartNutritionRate", customTypeSerializer: typeof(PrototypeIdSerializer))] public string MachinePartNutritionRate = "Manipulator"; /// /// The increase in rate per each rating above 1. /// [DataField("partRatingRateMultiplier")] public float PartRatingRateMultiplier = 10; #endregion /// /// An accumulator which tracks extracted nutrition to determine /// when to spawn a meat. /// [DataField("nutrientAccumulator"), ViewVariables(VVAccess.ReadWrite)] public int NutrientAccumulator; /// /// How high has to be to spawn meat /// [DataField("nutrientPerMeat"), ViewVariables(VVAccess.ReadWrite)] public int NutrientPerMeat = 60; /// /// Meat spawned by the extractor. /// [DataField("meatPrototype", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] public string MeatPrototype = "FoodMeat"; /// /// When the next update will occur /// [DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan NextUpdate; /// /// How long each update takes /// [DataField("updateTime"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan UpdateTime = TimeSpan.FromSeconds(1); /// /// The sound played when extracting /// [DataField("processSound")] public SoundSpecifier? ProcessSound; public EntityUid? Stream; /// /// A minium hunger threshold for extracting nutrition. /// Ignored when emagged. /// [DataField("minHungerThreshold")] public HungerThreshold MinHungerThreshold = HungerThreshold.Okay; }