1
0

PlantHolderComponent.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using Content.Shared.Chemistry.Components;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. using Robust.Shared.Audio;
  4. namespace Content.Server.Botany.Components;
  5. [RegisterComponent]
  6. public sealed partial class PlantHolderComponent : Component
  7. {
  8. /// <summary>
  9. /// Game time for the next plant reagent update.
  10. /// </summary>
  11. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  12. public TimeSpan NextUpdate = TimeSpan.Zero;
  13. /// <summary>
  14. /// Time between plant reagent consumption updates.
  15. /// </summary>
  16. [DataField]
  17. public TimeSpan UpdateDelay = TimeSpan.FromSeconds(3);
  18. [DataField]
  19. public int LastProduce;
  20. [DataField]
  21. public int MissingGas;
  22. /// <summary>
  23. /// Time between plant growth updates.
  24. /// </summary>
  25. [DataField]
  26. public TimeSpan CycleDelay = TimeSpan.FromSeconds(15f);
  27. /// <summary>
  28. /// Game time when the plant last did a growth update.
  29. /// </summary>
  30. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  31. public TimeSpan LastCycle = TimeSpan.Zero;
  32. /// <summary>
  33. /// Sound played when any reagent is transferred into the plant holder.
  34. /// </summary>
  35. [DataField]
  36. public SoundSpecifier? WateringSound;
  37. [DataField]
  38. public bool UpdateSpriteAfterUpdate;
  39. /// <summary>
  40. /// Set to true if the plant holder displays plant warnings (e.g. water low) in the sprite and
  41. /// examine text. Used to differentiate hydroponic trays from simple soil plots.
  42. /// </summary>
  43. [DataField]
  44. public bool DrawWarnings = false;
  45. [DataField]
  46. public float WaterLevel = 100f;
  47. [DataField]
  48. public float NutritionLevel = 100f;
  49. [DataField]
  50. public float PestLevel;
  51. [DataField]
  52. public float WeedLevel;
  53. [DataField]
  54. public float Toxins;
  55. [DataField]
  56. public int Age;
  57. [DataField]
  58. public int SkipAging;
  59. [DataField]
  60. public bool Dead;
  61. [DataField]
  62. public bool Harvest;
  63. /// <summary>
  64. /// Set to true if this plant has been clipped by seed clippers. Used to prevent a single plant
  65. /// from repeatedly being clipped.
  66. /// </summary>
  67. [DataField]
  68. public bool Sampled;
  69. /// <summary>
  70. /// Multiplier for the number of entities produced at harvest.
  71. /// </summary>
  72. [DataField]
  73. public int YieldMod = 1;
  74. [DataField]
  75. public float MutationMod = 1f;
  76. [DataField]
  77. public float MutationLevel;
  78. [DataField]
  79. public float Health;
  80. [DataField]
  81. public float WeedCoefficient = 1f;
  82. [DataField]
  83. public SeedData? Seed;
  84. /// <summary>
  85. /// True if the plant is losing health due to too high/low temperature.
  86. /// </summary>
  87. [DataField]
  88. public bool ImproperHeat;
  89. /// <summary>
  90. /// True if the plant is losing health due to too high/low pressure.
  91. /// </summary>
  92. [DataField]
  93. public bool ImproperPressure;
  94. /// <summary>
  95. /// Not currently used.
  96. /// </summary>
  97. [DataField]
  98. public bool ImproperLight;
  99. /// <summary>
  100. /// Set to true to force a plant update (visuals, component, etc.) regardless of the current
  101. /// update cycle time. Typically used when some interaction affects this plant.
  102. /// </summary>
  103. [DataField]
  104. public bool ForceUpdate;
  105. [DataField]
  106. public string SoilSolutionName = "soil";
  107. [ViewVariables]
  108. public Entity<SolutionComponent>? SoilSolution = null;
  109. }