* Changed comments to be more clear and uniform. EggLayer uses NextGrowth instead of frame accumulation. Egglayer uses much less energy to make eggs, and lay time is randomized for player and AI chicken. * UdderComponent ReagentId can be changed now UdderSystem and WoolySystem use SharedSolutionContainerSystem now * Entities with udders can be examined to see a rough hunger level udders and wooly stop reagent generation/extra nutrient usage once the solution container is full * Moved stuff to Shared AutoPausedField now * Cleanup moving stuff to Shared * Oops. Make UdderSystem sealed instead of abstract. * Switch PopupEntity for PopupClient * Didn't mean to delete Access * new() instead of default! prototype revert egglayer balance change NextGrowth += timespan in egglayer * forgot [Datafield] for NextGrowth * forgot NetworkedComponent again... * Renaming Shared Animal to Shared Animals to match Server Hopefully also resolve merge conflicts. * Fix incorrect filename * Update with requested changes Put UdderSystem dependencies in alphabetical order. Initialise NextGrowth for Udder and Wooly components on MapInitEvent. Clean-up EggLayerSystem a little. Re-write OnExamine function for UdderSystem, improving clarity. Add full stops to end of udder examine locales. And more :) * Add some additional descriptions for cow hunger levels. * Add Udder and Wooly quantity to AutoNetworkedField * Account for less than starving threshold. --------- Co-authored-by: sirionaut <sirionaut@gmail.com> Co-authored-by: Sirionaut <148076704+Sirionaut@users.noreply.github.com> Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
58 lines
1.7 KiB
C#
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>
|
|
[DataField, 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;
|
|
}
|