using Content.Shared.Botany.Systems;
using Content.Shared.Chemistry.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Botany.Components;
///
/// Component for hydroponics trays plots that hold resources and link to a plant entity.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true, raiseAfterAutoHandleState: true), AutoGenerateComponentPause]
[Access(typeof(PlantTraySystem))]
public sealed partial class PlantTrayComponent : Component
{
///
/// Amount of water available to the plant.
///
[DataField, AutoNetworkedField]
public float WaterLevel = 100f;
[DataField, AutoNetworkedField]
public float MaxWaterLevel = 100f;
///
/// Amount of nutrients available to the plant.
///
[DataField, AutoNetworkedField]
public float NutritionLevel = 100f;
[DataField, AutoNetworkedField]
public float MaxNutritionLevel = 100f;
///
/// Amount of weeds growing in the tray.
///
[DataField, AutoNetworkedField]
public float WeedLevel;
[DataField, AutoNetworkedField]
public float MaxWeedLevel = 10f;
///
/// Amount of pests in the tray
///
[DataField, AutoNetworkedField]
public float PestLevel;
[DataField, AutoNetworkedField]
public float MaxPestLevel = 10f;
///
/// Amount of toxins in the tray.
///
[DataField, AutoNetworkedField]
public float ToxinLevel;
[DataField, AutoNetworkedField]
public float MaxToxinLevel = 100f;
///
/// Chance per tick for weeds to grow around this tray.
///
[DataField, AutoNetworkedField]
public float WeedGrowthChance = 0.01f;
///
/// Amount of weed growth per successful weed tray tick.
///
[DataField, AutoNetworkedField]
public float WeedGrowthAmount = 0.5f;
///
/// Multiplier for weed growth rate.
///
[DataField, AutoNetworkedField]
public float WeedCoefficient = 1f;
///
/// Multiplier for resource consumption (water, nutrients) in the tray.
///
[DataField, AutoNetworkedField]
public float TrayConsumptionMultiplier = 2f;
///
/// Currently planted plant entity (parented to this tray).
///
[ViewVariables, AutoNetworkedField]
public EntityUid? PlantEntity;
///
/// 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;
///
/// Sound played when any reagent is transferred into the tray.
///
[DataField]
public SoundSpecifier? WateringSound;
///
/// Name of the solution container that holds the soil/nutrient solution.
///
[ViewVariables]
public string SoilSolutionName = "soil";
///
/// Reference to the soil solution container.
///
[ViewVariables]
public Entity? SoilSolution = null;
///
/// Game time for the next plant reagent update.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
public TimeSpan NextUpdate = TimeSpan.Zero;
///
/// The basic tick for updating the tray, between which most of the tray logic processing takes place.
///
[DataField, AutoNetworkedField]
public TimeSpan UpdateDelay = TimeSpan.FromSeconds(3);
}