Files
tbd-station-14/Content.Server/Chemistry/ReagentEffects/Oxygenate.cs
Nemanja b9fb66f005 Chem guidebook (#17123)
* im good at atomizing. welcome to half-finished chem guides.

* wagh

* e

* save work

* aa

* woweee UI

* finishing the last of it

* don't actually update the engine :(

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
2023-06-04 15:45:02 -05:00

26 lines
874 B
C#

using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.ReagentEffects;
public sealed class Oxygenate : ReagentEffect
{
[DataField("factor")]
public float Factor = 1f;
// JUSTIFICATION: This is internal magic that players never directly interact with.
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> null;
public override void Effect(ReagentEffectArgs args)
{
if (args.EntityManager.TryGetComponent<RespiratorComponent>(args.SolutionEntity, out var resp))
{
var respSys = EntitySystem.Get<RespiratorSystem>();
respSys.UpdateSaturation(resp.Owner, args.Quantity.Float() * Factor, resp);
}
}
}