using Content.Server.Animals.Systems;
using Content.Shared.Storage;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.Animals.Components;
///
/// This component handles animals which lay eggs (or some other item) on a timer, using up hunger to do so.
/// It also grants an action to players who are controlling these entities, allowing them to do it manually.
///
[RegisterComponent, Access(typeof(EggLayerSystem)), AutoGenerateComponentPause]
public sealed partial class EggLayerComponent : Component
{
///
/// The item that gets laid/spawned, retrieved from animal prototype.
///
[DataField(required: true)]
public List EggSpawn = new();
///
/// Player action.
///
[DataField]
public EntProtoId EggLayAction = "ActionAnimalLayEgg";
[DataField]
public SoundSpecifier EggLaySound = new SoundPathSpecifier("/Audio/Effects/pop.ogg");
///
/// Minimum cooldown used for the automatic egg laying.
///
[DataField]
public float EggLayCooldownMin = 60f;
///
/// Maximum cooldown used for the automatic egg laying.
///
[DataField]
public float EggLayCooldownMax = 120f;
///
/// The amount of nutrient consumed on update.
///
[DataField]
public float HungerUsage = 60f;
[DataField] public EntityUid? Action;
///
/// When to next try to produce.
///
[DataField, AutoPausedField]
public TimeSpan NextGrowth = TimeSpan.Zero;
}