2022-02-10 17:53:10 +13:00
|
|
|
|
using Content.Server.Atmos.Components;
|
|
|
|
|
|
using Content.Server.Body.Components;
|
|
|
|
|
|
using Content.Shared.Atmos;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Body.Systems;
|
|
|
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class InternalsSystem : EntitySystem
|
2022-02-10 17:53:10 +13:00
|
|
|
|
{
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<InternalsComponent, InhaleLocationEvent>(OnInhaleLocation);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnInhaleLocation(EntityUid uid, InternalsComponent component, InhaleLocationEvent args)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (component.AreInternalsWorking())
|
|
|
|
|
|
{
|
|
|
|
|
|
var gasTank = Comp<GasTankComponent>(component.GasTankEntity!.Value);
|
|
|
|
|
|
args.Gas = gasTank.RemoveAirVolume(Atmospherics.BreathVolume);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|