AirAlarms fixes (#11062)

* modify airalarm thresholds

* display percentage, not ratio

* reopen doors on normal/warning state

* panic mode on danger state
This commit is contained in:
corentt 2022-09-06 02:54:26 +02:00 committed by GitHub
parent eaa5df4ad3
commit 6301ac5147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 14 deletions

View File

@ -36,7 +36,7 @@ public sealed partial class SensorInfo : BoxContainer
var label = new Label();
label.Text = Loc.GetString("air-alarm-ui-gases", ("gas", $"{gas}"),
("amount", $"{amount:0.####}"),
("percentage", $"{(amount / data.TotalMoles):0.##}"));
("percentage", $"{(100 * amount / data.TotalMoles):0.##}"));
GasContainer.AddChild(label);
_gasLabels.Add(gas, label);
}
@ -87,7 +87,7 @@ public sealed partial class SensorInfo : BoxContainer
label.Text = Loc.GetString("air-alarm-ui-gases", ("gas", $"{gas}"),
("amount", $"{amount:0.####}"),
("percentage", $"{(amount / data.TotalMoles):0.##}"));
("percentage", $"{(100 * amount / data.TotalMoles):0.##}"));
}
_pressureThreshold.UpdateThresholdData(data.PressureThreshold);

View File

@ -298,9 +298,9 @@ public sealed class AirAlarmSystem : EntitySystem
if (args.AlarmType == AtmosAlarmType.Danger)
{
SetMode(uid, addr, AirAlarmMode.None, true, false);
SetMode(uid, addr, AirAlarmMode.Panic, true, false);
}
else if (args.AlarmType == AtmosAlarmType.Normal)
else if (args.AlarmType == AtmosAlarmType.Normal || args.AlarmType == AtmosAlarmType.Warning)
{
SetMode(uid, addr, AirAlarmMode.Filtering, true, false);
}

View File

@ -91,7 +91,7 @@ namespace Content.Server.Doors.Systems
{
if (!TryComp<DoorComponent>(uid, out var doorComponent)) return;
if (args.AlarmType == AtmosAlarmType.Normal)
if (args.AlarmType == AtmosAlarmType.Normal || args.AlarmType == AtmosAlarmType.Warning)
{
if (doorComponent.State == DoorState.Closed)
_doorSystem.TryOpen(uid);

View File

@ -1,8 +1,8 @@
- type: alarmThreshold
id: stationTemperature
upperBound: 1465.75 # T20C * 5
upperBound: 393.15 # T20C + 200
lowerBound: 193.15 # T20C - 100
upperWarnAround: 0.25
upperWarnAround: 0.7
lowerWarnAround: 1.1
- type: alarmThreshold
@ -14,7 +14,7 @@
- type: alarmThreshold
id: stationOxygen
lowerBound: 0.0010
lowerBound: 0.10
lowerWarnAround: 1.5
- type: alarmThreshold
@ -22,6 +22,16 @@
upperBound: 0.0025
upperWarnAround: 0.5
- type: alarmThreshold
id: stationNO
upperBound: 0.0025
upperWarnAround: 0.5
- type: alarmThreshold
id: stationMiasma
upperBound: 0.0025
upperWarnAround: 0.5
- type: alarmThreshold
id: ignore # just ignore nitrogen??? ??? ???
ignore: true

View File

@ -45,8 +45,8 @@
Plasma: danger # everything below is usually bad
Tritium: danger
WaterVapor: danger
Miasma: danger
NitrousOxide: danger
Miasma: stationMiasma
NitrousOxide: stationNO
Frezon: danger
- type: Tag
tags:
@ -134,8 +134,8 @@
Plasma: danger # everything below is usually bad
Tritium: danger
WaterVapor: danger
Miasma: danger
NitrousOxide: danger
Miasma: stationMiasma
NitrousOxide: stationNO
Frezon: danger
- type: Tag
tags:

View File

@ -52,8 +52,8 @@
Plasma: danger # everything below is usually bad
Tritium: danger
WaterVapor: danger
Miasma: danger
NitrousOxide: danger
Miasma: stationMiasma
NitrousOxide: stationNO
Frezon: danger
- type: Tag
tags: