mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-15 03:31:38 +01:00
* merged chemical into bloodstream * changed injectable to bloodstream * separated bleeding and direct blood removal * removed blood gain from protein * reduced blood gain from saline * rejuvenating fills to reference volume * fixed blood regulation * red mead requires stirring to make * reverted accidental line deletion * cleared the skeletons from the closet * additional routing * field rename for xeno * removed mention of chemstream and field rename for asteroid mobs * minor optimizations * Revert "reduced blood gain from saline" This reverts commit de26fd1c0d99f3019fe7dd1451a50230cc90f058. * Revert "removed blood gain from protein" This reverts commit 7a1648caf39fe26406db73c2a5afa389b82c612f. * removed unused component fetch * dead check mini refactor * eventized blood exclusion * quick fix * Pain * Commit of doom * COMMIT * renamed bloodMaxFactor to MaxVolumeFactor * addressed floating point error * returned vomiting chemicals * blood reagent always skips the flush * no need to mention blood reagent * fixed passing blood flush * adadsafasfasfassfasf * whoops * merge fixed injectors * Revert "adadsafasfasfassfasf" This reverts commit 0a5313a68dd6484d36d28d08930c76851b72ae38. * simplify reagent removal * enabled foreign blood transfusion * Revert "COMMIT" This reverts commit 19abd679cd7761ebd47bb242bd644176a3006a42. * simplified reagent removal when modifying blood level * removed misleading coment since the changes * documented MetabolismExclusionEvent * fixed negative negative modification of blood level * fixed hypervolemia not normalizing * constrainted blood modification * returned bloodpack stop on fully healed * forgot to stage this * band aid for diona blood * swapping GetReagent with GetPrototype * optimize blood filtering * multiplicative multi reagent blood level calculation * removed unused stuff * optimized blood calculation a tiny bit * added per reagent blood regulation * optimized (referenceVolume + bloodReagents) into referenceSolution * polished coded to proper function * forgot to stage rootable system change * clean up, unnecessary GetBloodLevel call * rename method name to TryAddToBloodstream instead of Chemicals * placed overfill safety * cleanup and final touches * final touch --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
99 lines
3.6 KiB
C#
99 lines
3.6 KiB
C#
using Content.Shared.Body.Components;
|
|
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, AutoGenerateComponentPause, Access(typeof(MetabolizerSystem))]
|
|
public sealed partial class MetabolizerComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The next time that reagents will be metabolized.
|
|
/// </summary>
|
|
[DataField, AutoPausedField]
|
|
public TimeSpan NextUpdate;
|
|
|
|
/// <summary>
|
|
/// How often to metabolize reagents.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[DataField]
|
|
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);
|
|
|
|
/// <summary>
|
|
/// Multiplier applied to <see cref="UpdateInterval"/> for adjusting based on metabolic rate multiplier.
|
|
/// </summary>
|
|
[DataField]
|
|
public float UpdateIntervalMultiplier = 1f;
|
|
|
|
/// <summary>
|
|
/// Adjusted update interval based off of the multiplier value.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public TimeSpan AdjustedUpdateInterval => UpdateInterval * UpdateIntervalMultiplier;
|
|
|
|
/// <summary>
|
|
/// From which solution will this metabolizer attempt to metabolize chemicals
|
|
/// </summary>
|
|
[DataField("solution")]
|
|
public string SolutionName = BloodstreamComponent.DefaultBloodSolutionName;
|
|
|
|
/// <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;
|
|
|
|
/// <summary>
|
|
/// Should this metabolizer remove chemicals that have no metabolisms defined?
|
|
/// As a stop-gap, basically.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool RemoveEmpty;
|
|
|
|
/// <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;
|
|
}
|
|
|
|
/// <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;
|
|
|
|
[DataField("rateModifier")]
|
|
public FixedPoint2 MetabolismRateModifier = 1.0;
|
|
}
|
|
}
|