using Content.Shared.Chemistry.Components; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Audio; namespace Content.Server.Botany.Components; [RegisterComponent] public sealed partial class PlantHolderComponent : Component { /// /// Game time for the next plant reagent update. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextUpdate = TimeSpan.Zero; /// /// Time between plant reagent consumption updates. /// [DataField] public TimeSpan UpdateDelay = TimeSpan.FromSeconds(3); [DataField] public int LastProduce; [DataField] public int MissingGas; /// /// Time between plant growth updates. /// [DataField] public TimeSpan CycleDelay = TimeSpan.FromSeconds(15f); /// /// Game time when the plant last did a growth update. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan LastCycle = TimeSpan.Zero; /// /// Sound played when any reagent is transferred into the plant holder. /// [DataField] public SoundSpecifier? WateringSound; [DataField] public bool UpdateSpriteAfterUpdate; /// /// Set to true if the plant holder displays plant warnings (e.g. water low) in the sprite and /// examine text. Used to differentiate hydroponic trays from simple soil plots. /// [DataField] public bool DrawWarnings = false; [DataField] public float WaterLevel = 100f; [DataField] public float NutritionLevel = 100f; [DataField] public float PestLevel; [DataField] public float WeedLevel; [DataField] public float Toxins; [DataField] public int Age; [DataField] public int SkipAging; [DataField] public bool Dead; [DataField] public bool Harvest; /// /// Set to true if this plant has been clipped by seed clippers. Used to prevent a single plant /// from repeatedly being clipped. /// [DataField] public bool Sampled; /// /// Multiplier for the number of entities produced at harvest. /// [DataField] public int YieldMod = 1; [DataField] public float MutationMod = 1f; [DataField] public float MutationLevel; [DataField] public float Health; [DataField] public float WeedCoefficient = 1f; [DataField] public SeedData? Seed; /// /// True if the plant is losing health due to too high/low temperature. /// [DataField] public bool ImproperHeat; /// /// True if the plant is losing health due to too high/low pressure. /// [DataField] public bool ImproperPressure; /// /// Not currently used. /// [DataField] public bool ImproperLight; /// /// Set to true to force a plant update (visuals, component, etc.) regardless of the current /// update cycle time. Typically used when some interaction affects this plant. /// [DataField] public bool ForceUpdate; [DataField] public string SoilSolutionName = "soil"; [ViewVariables] public Entity? SoilSolution = null; }