Files
tbd-station-14/Content.Shared/Animals/UdderComponent.cs
2025-01-11 21:22:29 +01:00

58 lines
1.7 KiB
C#

using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Animals;
/// <summary>
/// Gives the ability to produce a solution;
/// produces endlessly if the owner does not have a HungerComponent.
/// </summary>
[RegisterComponent, AutoGenerateComponentState, AutoGenerateComponentPause, NetworkedComponent]
public sealed partial class UdderComponent : Component
{
/// <summary>
/// The reagent to produce.
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<ReagentPrototype> ReagentId = new();
/// <summary>
/// The name of <see cref="Solution"/>.
/// </summary>
[DataField]
public string SolutionName = "udder";
/// <summary>
/// The solution to add reagent to.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public Entity<SolutionComponent>? Solution = null;
/// <summary>
/// The amount of reagent to be generated on update.
/// </summary>
[DataField, AutoNetworkedField]
public FixedPoint2 QuantityPerUpdate = 25;
/// <summary>
/// The amount of nutrient consumed on update.
/// </summary>
[DataField, AutoNetworkedField]
public float HungerUsage = 10f;
/// <summary>
/// How long to wait before producing.
/// </summary>
[DataField, AutoNetworkedField]
public TimeSpan GrowthDelay = TimeSpan.FromMinutes(1);
/// <summary>
/// When to next try to produce.
/// </summary>
[DataField, AutoPausedField, Access(typeof(UdderSystem))]
public TimeSpan NextGrowth = TimeSpan.Zero;
}