Files
tbd-station-14/Content.Server/Body/Behavior/LiverBehavior.cs
mirrorcult 8aa4f998de Metabolism refactor (#4395)
* metabolism -> respirator, add reageanteffect and reagenteffectcondition, start on metabolizercomp/system

* move LiverBehavior metabolism logic to Metabolizer

* minor tweaks and update all YAML

* how about actually taking conditions into account

* off by one

* removals

* reviews
2021-07-31 13:50:32 +02:00

36 lines
866 B
C#

using System.Linq;
using Content.Server.Body.Circulatory;
using Content.Shared.Body.Networks;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
namespace Content.Server.Body.Behavior
{
/// <summary>
/// Metabolizes reagents in <see cref="SharedBloodstreamComponent"/> after they are digested.
/// </summary>
public class LiverBehavior : MechanismBehavior
{
private float _accumulatedFrameTime;
public override void Update(float frameTime)
{
if (Body == null)
{
return;
}
_accumulatedFrameTime += frameTime;
// Update at most once per second
if (_accumulatedFrameTime < 1)
{
return;
}
_accumulatedFrameTime -= 1;
}
}
}