mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
Uses the following Cherry-Picks: https://github.com/space-wizards/space-station-14/pull/26994 https://github.com/space-wizards/space-station-14/pull/26518 https://github.com/space-wizards/space-station-14/pull/26279 https://github.com/space-wizards/space-station-14/pull/24946 https://github.com/space-wizards/space-station-14/pull/27188 Requires: https://github.com/Simple-Station/Einstein-Engines/pull/535 https://github.com/Simple-Station/Einstein-Engines/pull/534 --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Co-authored-by: Jake Huxell <JakeHuxell@pm.me> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: 0x6273 <0x40@keemail.me> Co-authored-by: DEATHB4DEFEAT <zachcaffee@outlook.com>
86 lines
3.1 KiB
C#
86 lines
3.1 KiB
C#
using Content.Server.Body.Systems;
|
|
using Content.Shared.Body.Prototypes;
|
|
using Content.Shared.FixedPoint;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.Body.Components
|
|
{
|
|
/// <summary>
|
|
/// Handles metabolizing various reagents with given effects.
|
|
/// </summary>
|
|
[RegisterComponent, Access(typeof(MetabolizerSystem))]
|
|
public sealed partial class MetabolizerComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The next time that reagents will be metabolized.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
public TimeSpan NextUpdate;
|
|
|
|
/// <summary>
|
|
/// How often to metabolize reagents.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[DataField]
|
|
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);
|
|
|
|
/// <summary>
|
|
/// From which solution will this metabolizer attempt to metabolize chemicals
|
|
/// </summary>
|
|
[DataField("solution")]
|
|
public string SolutionName = BloodstreamComponent.DefaultChemicalsSolutionName;
|
|
|
|
/// <summary>
|
|
/// Does this component use a solution on it's parent entity (the body) or itself
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Most things will use the parent entity (bloodstream).
|
|
/// </remarks>
|
|
[DataField]
|
|
public bool SolutionOnBody = true;
|
|
|
|
/// <summary>
|
|
/// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e.
|
|
/// </summary>
|
|
[DataField]
|
|
[Access(typeof(MetabolizerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
|
|
public HashSet<ProtoId<MetabolizerTypePrototype>>? MetabolizerTypes = null;
|
|
|
|
/// <summary>
|
|
/// Should this metabolizer remove chemicals that have no metabolisms defined?
|
|
/// As a stop-gap, basically.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool RemoveEmpty = false;
|
|
|
|
/// <summary>
|
|
/// How many reagents can this metabolizer process at once?
|
|
/// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low
|
|
/// quantity, would be muuuuch better than just one poison acting.
|
|
/// </summary>
|
|
[DataField("maxReagents")]
|
|
public int MaxReagentsProcessable = 3;
|
|
|
|
/// <summary>
|
|
/// A list of metabolism groups that this metabolizer will act on, in order of precedence.
|
|
/// </summary>
|
|
[DataField("groups")]
|
|
public List<MetabolismGroupEntry>? MetabolismGroups = default!;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Contains data about how a metabolizer will metabolize a single group.
|
|
/// This allows metabolizers to remove certain groups much faster, or not at all.
|
|
/// </summary>
|
|
[DataDefinition]
|
|
public sealed partial class MetabolismGroupEntry
|
|
{
|
|
[DataField(required: true)]
|
|
public ProtoId<MetabolismGroupPrototype> Id = default!;
|
|
|
|
[DataField("rateModifier")]
|
|
public FixedPoint2 MetabolismRateModifier = 1.0;
|
|
}
|
|
}
|