Add alert for low oxygen.

This commit is contained in:
Pieter-Jan Briers
2020-12-23 23:46:01 +01:00
parent 44e3cc9395
commit 159f7192df
12 changed files with 24 additions and 1 deletions

View File

@@ -5,7 +5,9 @@ using System.Linq;
using Content.Server.Atmos; using Content.Server.Atmos;
using Content.Server.GameObjects.Components.Body.Behavior; using Content.Server.GameObjects.Components.Body.Behavior;
using Content.Server.GameObjects.Components.Body.Circulatory; using Content.Server.GameObjects.Components.Body.Circulatory;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Temperature; using Content.Server.GameObjects.Components.Temperature;
using Content.Shared.Alert;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Chemistry; using Content.Shared.Chemistry;
using Content.Shared.Damage; using Content.Shared.Damage;
@@ -389,6 +391,11 @@ namespace Content.Server.GameObjects.Components.Metabolism
{ {
Suffocating = true; Suffocating = true;
if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent))
{
alertsComponent.ShowAlert(AlertType.LowOxygen);
}
if (!Owner.TryGetComponent(out IDamageableComponent? damageable)) if (!Owner.TryGetComponent(out IDamageableComponent? damageable))
{ {
return; return;
@@ -400,6 +407,11 @@ namespace Content.Server.GameObjects.Components.Metabolism
private void StopSuffocation() private void StopSuffocation()
{ {
Suffocating = false; Suffocating = false;
if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent))
{
alertsComponent.ClearAlert(AlertType.LowOxygen);
}
} }
public GasMixture Clean(BloodstreamComponent bloodstream) public GasMixture Clean(BloodstreamComponent bloodstream)

View File

@@ -7,6 +7,7 @@
{ {
Pressure, Pressure,
Temperature, Temperature,
Breathing,
Buckled, Buckled,
Health, Health,
Piloting, Piloting,
@@ -22,6 +23,7 @@
public enum AlertType : byte public enum AlertType : byte
{ {
Error, Error,
LowOxygen,
LowPressure, LowPressure,
HighPressure, HighPressure,
Fire, Fire,

View File

@@ -10,12 +10,20 @@
- alertType: Pulling - alertType: Pulling
- category: Piloting - category: Piloting
- alertType: Stun - alertType: Stun
- category: Breathing # Vox gang not calling this oxygen
- category: Pressure - category: Pressure
- category: Temperature - category: Temperature
- category: Hunger - category: Hunger
- category: Thirst - category: Thirst
- type: alert
alertType: LowOxygen
category: Breathing
icon:
sprite: /Textures/Interface/Alerts/breathing.rsi
state: not_enough_oxy
name: "[color=red]Low Oxygen[/color]"
description: "There is not [color=red]not enough oxygen[/color] in the air you are breathing. Put on [color=green]internals[/color]."
- type: alert - type: alert
alertType: LowPressure alertType: LowPressure

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA 3.0", "copyright": "https://github.com/tgstation/tgstation/blob/2f18e6232ce5897554351194082469a043c5ab06/icons/hud/screen_alert.dmi", "states": [{"name": "not_enough_co2", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "not_enough_nitro", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "not_enough_oxy", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "not_enough_tox", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "too_much_co2", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "too_much_nitro", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "too_much_oxy", "directions": 1, "delays": [[0.5, 0.5]]}, {"name": "too_much_tox", "directions": 1, "delays": [[0.5, 0.5]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B