2023-04-18 14:27:05 +00:00
|
|
|
using Content.Server.Chemistry.EntitySystems;
|
|
|
|
|
using Content.Shared.Chemistry.Components;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.Components;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Passively increases a solution's quantity of a reagent.
|
|
|
|
|
/// </summary>
|
2024-02-26 04:36:19 +01:00
|
|
|
[RegisterComponent, AutoGenerateComponentPause]
|
2023-04-18 14:27:05 +00:00
|
|
|
[Access(typeof(SolutionRegenerationSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SolutionRegenerationComponent : Component
|
2023-04-18 14:27:05 +00:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the solution to add to.
|
|
|
|
|
/// </summary>
|
2024-09-18 22:17:13 -04:00
|
|
|
[DataField("solution", required: true)]
|
2023-12-29 04:47:43 -08:00
|
|
|
public string SolutionName = string.Empty;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The solution to add reagents to.
|
|
|
|
|
/// </summary>
|
2024-09-18 22:17:13 -04:00
|
|
|
[DataField]
|
|
|
|
|
public Entity<SolutionComponent>? SolutionRef = null;
|
2023-04-18 14:27:05 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The reagent(s) to be regenerated in the solution.
|
|
|
|
|
/// </summary>
|
2024-09-18 22:17:13 -04:00
|
|
|
[DataField(required: true)]
|
2023-04-18 14:27:05 +00:00
|
|
|
public Solution Generated = default!;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How long it takes to regenerate once.
|
|
|
|
|
/// </summary>
|
2024-09-18 22:17:13 -04:00
|
|
|
[DataField]
|
2023-04-18 14:27:05 +00:00
|
|
|
public TimeSpan Duration = TimeSpan.FromSeconds(1);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The time when the next regeneration will occur.
|
|
|
|
|
/// </summary>
|
2024-09-18 22:17:13 -04:00
|
|
|
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2023-04-18 14:27:05 +00:00
|
|
|
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
|
|
|
|
|
}
|