mech nitrogen filtering 2 (#19868)

* target oxygen logic

* filter out nitrogen when low on oxygen

* vvrw and datafield for everything

* :trollface:

* bruh does work

* tagless chicken

* move into atmos, make it not depend on mech

* update mech prototype

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-11-06 03:15:13 +00:00
committed by GitHub
parent db1eba15e3
commit f0f54b5872
9 changed files with 225 additions and 143 deletions

View File

@@ -47,8 +47,6 @@ public sealed partial class MechSystem : SharedMechSystem
_sawmill = Logger.GetSawmill("mech");
InitializeFiltering();
SubscribeLocalEvent<MechComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<MechComponent, EntInsertedIntoContainerMessage>(OnInsertBattery);
SubscribeLocalEvent<MechComponent, MapInitEvent>(OnMapInit);
@@ -69,6 +67,8 @@ public sealed partial class MechSystem : SharedMechSystem
SubscribeLocalEvent<MechPilotComponent, ExhaleLocationEvent>(OnExhale);
SubscribeLocalEvent<MechPilotComponent, AtmosExposedGetAirEvent>(OnExpose);
SubscribeLocalEvent<MechAirComponent, GetFilterAirEvent>(OnGetFilterAir);
#region Equipment UI message relays
SubscribeLocalEvent<MechComponent, MechGrabberEjectMessage>(ReceiveEquipmentUiMesssages);
SubscribeLocalEvent<MechComponent, MechSoundboardPlayMessage>(ReceiveEquipmentUiMesssages);
@@ -423,5 +423,17 @@ public sealed partial class MechSystem : SharedMechSystem
args.Handled = true;
}
private void OnGetFilterAir(EntityUid uid, MechAirComponent comp, ref GetFilterAirEvent args)
{
if (args.Air != null)
return;
// only airtight mechs get internal air
if (!TryComp<MechComponent>(uid, out var mech) || !mech.Airtight)
return;
args.Air = comp.Air;
}
#endregion
}