예제 #1
0
 private void OnBeforeDoorOpened(EntityUid uid, FirelockComponent component, BeforeDoorOpenedEvent args)
 {
     if (component.IsHoldingFire() || component.IsHoldingPressure())
     {
         args.Cancel();
     }
 }
예제 #2
0
 private void OnDoorGetPryTimeModifier(EntityUid uid, FirelockComponent component, DoorGetPryTimeModifierEvent args)
 {
     if (component.IsHoldingFire() || component.IsHoldingPressure())
     {
         args.PryTimeModifier *= component.LockedPryTimeModifier;
     }
 }
예제 #3
0
 private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)
 {
     // Make firelocks autoclose, but only if the last alarm type it
     // remembers was a danger. This is to prevent people from
     // flooding hallways with endless bad air/fire.
     if (!EntityManager.TryGetComponent(uid, out AtmosAlarmableComponent? alarmable))
     {
         args.Cancel();
         return;
     }
     if (alarmable.HighestNetworkState != AtmosMonitorAlarmType.Danger)
     {
         args.Cancel();
     }
 }
예제 #4
0
        private void OnBeforeDoorPry(EntityUid uid, FirelockComponent component, BeforeDoorPryEvent args)
        {
            if (!TryComp <DoorComponent>(uid, out var door) || door.State != DoorState.Closed)
            {
                return;
            }

            if (component.IsHoldingPressure())
            {
                component.Owner.PopupMessage(args.User, Loc.GetString("firelock-component-is-holding-pressure-message"));
            }
            else if (component.IsHoldingFire())
            {
                component.Owner.PopupMessage(args.User, Loc.GetString("firelock-component-is-holding-fire-message"));
            }
        }
예제 #5
0
        private void OnBeforeDoorPry(EntityUid uid, FirelockComponent component, BeforeDoorPryEvent args)
        {
            if (component.DoorComponent == null || component.DoorComponent.State != SharedDoorComponent.DoorState.Closed)
            {
                return;
            }

            if (component.IsHoldingPressure())
            {
                component.Owner.PopupMessage(args.Args.User, Loc.GetString("firelock-component-is-holding-pressure-message"));
            }
            else if (component.IsHoldingFire())
            {
                component.Owner.PopupMessage(args.Args.User, Loc.GetString("firelock-component-is-holding-fire-message"));
            }
        }
예제 #6
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();
            }
        }
예제 #7
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();
            }
        }
예제 #8
0
 private void OnBeforeDoorDenied(EntityUid uid, FirelockComponent component, BeforeDoorDeniedEvent args)
 {
     args.Cancel();
 }
예제 #9
0
 private void OnDoorClickShouldActivate(EntityUid uid, FirelockComponent component, DoorClickShouldActivateEvent args)
 {
     // We're a firelock, you can't click to open it
     args.Handled = true;
 }
예제 #10
0
 private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)
 {
     // Firelocks can't autoclose, they must be manually closed
     args.Cancel();
 }