Ejemplo n.º 1
0
        private void OnAtmosAlarm(EntityUid uid, AirAlarmComponent component, AtmosMonitorAlarmEvent args)
        {
            if (component.ActivePlayers.Count != 0)
            {
                SyncAllDevices(uid);
                SendAirData(uid);
            }

            string addr = string.Empty;

            if (EntityManager.TryGetComponent(uid, out DeviceNetworkComponent netConn))
            {
                addr = netConn.Address;
            }


            if (args.HighestNetworkType == AtmosMonitorAlarmType.Danger)
            {
                SetMode(uid, addr, AirAlarmMode.None, true);
                // set mode to off to mimic the vents/scrubbers being turned off
                // update UI
                //
                // no, the mode isn't processed here - it's literally just
                // set to what mimics 'off'
            }
            else if (args.HighestNetworkType == AtmosMonitorAlarmType.Normal)
            {
                // if the mode is still set to off, set it to filtering instead
                // alternatively, set it to the last saved mode
                //
                // no, this still doesn't execute the mode
                SetMode(uid, addr, AirAlarmMode.Filtering, true);
            }
        }
 private void OnAtmosAlarm(EntityUid uid, GasVentPumpComponent component, AtmosMonitorAlarmEvent args)
 {
     if (args.HighestNetworkType == AtmosMonitorAlarmType.Danger)
     {
         component.Enabled = false;
     }
     else if (args.HighestNetworkType == AtmosMonitorAlarmType.Normal)
     {
         component.Enabled = true;
     }
 }
Ejemplo n.º 3
0
        private void OnAtmosAlarm(EntityUid uid, FirelockComponent component, AtmosMonitorAlarmEvent args)
        {
            if (!TryComp <DoorComponent>(uid, out var doorComponent))
            {
                return;
            }

            if (args.HighestNetworkType == AtmosMonitorAlarmType.Normal)
            {
                if (doorComponent.State == DoorState.Closed)
                {
                    _doorSystem.TryOpen(uid);
                }
            }
            else if (args.HighestNetworkType == AtmosMonitorAlarmType.Danger)
            {
                component.EmergencyPressureStop();
            }
        }
Ejemplo n.º 4
0
        private void OnAtmosAlarm(EntityUid uid, FirelockComponent component, AtmosMonitorAlarmEvent args)
        {
            if (component.DoorComponent == null)
            {
                return;
            }

            if (args.HighestNetworkType == AtmosMonitorAlarmType.Normal)
            {
                if (component.DoorComponent.State == SharedDoorComponent.DoorState.Closed)
                {
                    component.DoorComponent.Open();
                }
            }
            else if (args.HighestNetworkType == AtmosMonitorAlarmType.Danger)
            {
                component.EmergencyPressureStop();
            }
        }