| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using Content.Server.Animals.Systems;
- using Content.Shared.Storage;
- using Robust.Shared.Audio;
- using Robust.Shared.Prototypes;
- namespace Content.Server.Animals.Components;
- /// <summary>
- /// 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.
- /// </summary>
- [RegisterComponent, Access(typeof(EggLayerSystem)), AutoGenerateComponentPause]
- public sealed partial class EggLayerComponent : Component
- {
- /// <summary>
- /// The item that gets laid/spawned, retrieved from animal prototype.
- /// </summary>
- [DataField(required: true)]
- public List<EntitySpawnEntry> EggSpawn = new();
- /// <summary>
- /// Player action.
- /// </summary>
- [DataField]
- public EntProtoId EggLayAction = "ActionAnimalLayEgg";
- [DataField]
- public SoundSpecifier EggLaySound = new SoundPathSpecifier("/Audio/Effects/pop.ogg");
- /// <summary>
- /// Minimum cooldown used for the automatic egg laying.
- /// </summary>
- [DataField]
- public float EggLayCooldownMin = 60f;
- /// <summary>
- /// Maximum cooldown used for the automatic egg laying.
- /// </summary>
- [DataField]
- public float EggLayCooldownMax = 120f;
- /// <summary>
- /// The amount of nutrient consumed on update.
- /// </summary>
- [DataField]
- public float HungerUsage = 60f;
- [DataField] public EntityUid? Action;
- /// <summary>
- /// When to next try to produce.
- /// </summary>
- [DataField, AutoPausedField]
- public TimeSpan NextGrowth = TimeSpan.Zero;
- }
|