UdderComponent.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Content.Shared.Chemistry.Components;
  2. using Content.Shared.Chemistry.Reagent;
  3. using Content.Shared.FixedPoint;
  4. using Robust.Shared.GameStates;
  5. using Robust.Shared.Prototypes;
  6. namespace Content.Shared.Animals;
  7. /// <summary>
  8. /// Gives the ability to produce a solution;
  9. /// produces endlessly if the owner does not have a HungerComponent.
  10. /// </summary>
  11. [RegisterComponent, AutoGenerateComponentState, AutoGenerateComponentPause, NetworkedComponent]
  12. public sealed partial class UdderComponent : Component
  13. {
  14. /// <summary>
  15. /// The reagent to produce.
  16. /// </summary>
  17. [DataField, AutoNetworkedField]
  18. public ProtoId<ReagentPrototype> ReagentId = new();
  19. /// <summary>
  20. /// The name of <see cref="Solution"/>.
  21. /// </summary>
  22. [DataField]
  23. public string SolutionName = "udder";
  24. /// <summary>
  25. /// The solution to add reagent to.
  26. /// </summary>
  27. [ViewVariables(VVAccess.ReadOnly)]
  28. public Entity<SolutionComponent>? Solution = null;
  29. /// <summary>
  30. /// The amount of reagent to be generated on update.
  31. /// </summary>
  32. [DataField, AutoNetworkedField]
  33. public FixedPoint2 QuantityPerUpdate = 25;
  34. /// <summary>
  35. /// The amount of nutrient consumed on update.
  36. /// </summary>
  37. [DataField, AutoNetworkedField]
  38. public float HungerUsage = 10f;
  39. /// <summary>
  40. /// How long to wait before producing.
  41. /// </summary>
  42. [DataField, AutoNetworkedField]
  43. public TimeSpan GrowthDelay = TimeSpan.FromMinutes(1);
  44. /// <summary>
  45. /// When to next try to produce.
  46. /// </summary>
  47. [DataField, AutoPausedField, Access(typeof(UdderSystem))]
  48. public TimeSpan NextGrowth = TimeSpan.Zero;
  49. }