diff --git a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs index 775dfa8cb6..180e73897b 100644 --- a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs +++ b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs @@ -5,7 +5,9 @@ using System.Linq; using Content.Server.Atmos; using Content.Server.GameObjects.Components.Body.Behavior; using Content.Server.GameObjects.Components.Body.Circulatory; +using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Temperature; +using Content.Shared.Alert; using Content.Shared.Atmos; using Content.Shared.Chemistry; using Content.Shared.Damage; @@ -389,6 +391,11 @@ namespace Content.Server.GameObjects.Components.Metabolism { Suffocating = true; + if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent)) + { + alertsComponent.ShowAlert(AlertType.LowOxygen); + } + if (!Owner.TryGetComponent(out IDamageableComponent? damageable)) { return; @@ -400,6 +407,11 @@ namespace Content.Server.GameObjects.Components.Metabolism private void StopSuffocation() { Suffocating = false; + + if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent)) + { + alertsComponent.ClearAlert(AlertType.LowOxygen); + } } public GasMixture Clean(BloodstreamComponent bloodstream) diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index 8c2afb48d8..95da080a50 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -7,6 +7,7 @@ { Pressure, Temperature, + Breathing, Buckled, Health, Piloting, @@ -22,6 +23,7 @@ public enum AlertType : byte { Error, + LowOxygen, LowPressure, HighPressure, Fire, diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 326ef60494..a12d8ccca7 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -10,12 +10,20 @@ - alertType: Pulling - category: Piloting - alertType: Stun + - category: Breathing # Vox gang not calling this oxygen - category: Pressure - category: Temperature - category: Hunger - 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 alertType: LowPressure diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/meta.json b/Resources/Textures/Interface/Alerts/breathing.rsi/meta.json new file mode 100644 index 0000000000..704f119830 --- /dev/null +++ b/Resources/Textures/Interface/Alerts/breathing.rsi/meta.json @@ -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]]}]} \ No newline at end of file diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_co2.png b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_co2.png new file mode 100644 index 0000000000..179f6ffc51 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_co2.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_nitro.png b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_nitro.png new file mode 100644 index 0000000000..1c62fcc845 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_nitro.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_oxy.png b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_oxy.png new file mode 100644 index 0000000000..df42778d93 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_oxy.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_tox.png b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_tox.png new file mode 100644 index 0000000000..f5a8ef2a68 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/not_enough_tox.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_co2.png b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_co2.png new file mode 100644 index 0000000000..5d600f45f4 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_co2.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_nitro.png b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_nitro.png new file mode 100644 index 0000000000..743260a34b Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_nitro.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_oxy.png b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_oxy.png new file mode 100644 index 0000000000..bf8d976e2f Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_oxy.png differ diff --git a/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_tox.png b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_tox.png new file mode 100644 index 0000000000..08773270d6 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/breathing.rsi/too_much_tox.png differ