# Conflicts: # Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml # Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabHeader.xaml # Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabHeader.xaml.cs # Content.Server/Administration/Systems/AdminSystem.cs # Content.Server/Connection/ConnectionManager.cs # Content.Server/Entry/EntryPoint.cs # Content.Server/Ghost/Roles/GhostRoleSystem.cs # Content.Server/IoC/ServerContentIoC.cs # Resources/Locale/en-US/_strings/administration/antag.ftl # Resources/Locale/en-US/_strings/advertisements/vending/pride.ftl # Resources/Locale/en-US/_strings/mind/role-types.ftl # Resources/Prototypes/Entities/Markers/Spawners/ghost_roles.yml # Resources/Prototypes/Entities/Mobs/Player/dragon.yml # Resources/Prototypes/Entities/Mobs/Player/silicon.yml # Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/reinforcement_teleporter.yml # Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml # Resources/Textures/Interface/Misc/job_icons.rsi/meta.json
54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using Content.Server._Sunrise.SolutionRegenerationSwitcher;
|
|
using Content.Server.Chemistry.EntitySystems;
|
|
using Content.Shared.Chemistry.Components;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.Chemistry.Components;
|
|
|
|
/// <summary>
|
|
/// Passively increases a solution's quantity of a reagent.
|
|
/// </summary>
|
|
[RegisterComponent, AutoGenerateComponentPause]
|
|
[Access(typeof(SolutionRegenerationSystem), typeof(SolutionRegenerationSwitcherSystem))] // Sunrise-Edit
|
|
public sealed partial class SolutionRegenerationComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The name of the solution to add to.
|
|
/// </summary>
|
|
[DataField("solution", required: true)]
|
|
public string SolutionName = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The solution to add reagents to.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public Entity<SolutionComponent>? SolutionRef = null;
|
|
|
|
/// <summary>
|
|
/// The reagent(s) to be regenerated in the solution.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public Solution Generated = default!;
|
|
|
|
/// <summary>
|
|
/// How long it takes to regenerate once.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan Duration = TimeSpan.FromSeconds(1);
|
|
|
|
/// <summary>
|
|
/// The time when the next regeneration will occur.
|
|
/// </summary>
|
|
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
[AutoPausedField]
|
|
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
|
|
|
|
// Sunrise-start
|
|
public void ChangeGenerated(ReagentQuantity reagent)
|
|
{
|
|
Generated.RemoveAllSolution();
|
|
Generated.AddReagent(reagent);
|
|
}
|
|
// Sunrise-end
|
|
}
|