diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index 605a46ad7f..59e50c9161 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Fluids.EntitySystems; using Content.Server.Forensics; using Content.Server.HealthExaminable; using Content.Server.Popups; +using Content.Shared.Alert; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reaction; using Content.Shared.Damage; @@ -37,6 +38,7 @@ public sealed class BloodstreamSystem : EntitySystem [Dependency] private readonly SharedDrunkSystem _drunkSystem = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly SharedStutteringSystem _stutteringSystem = default!; + [Dependency] private readonly AlertsSystem _alertsSystem = default!; public override void Initialize() { @@ -125,7 +127,7 @@ public sealed class BloodstreamSystem : EntitySystem // storing the drunk and stutter time so we can remove it independently from other effects additions bloodstream.StatusTime += bloodstream.UpdateInterval * 2; - } + } else if (!_mobStateSystem.IsDead(uid)) { // If they're healthy, we'll try and heal some bloodloss instead. @@ -344,6 +346,14 @@ public sealed class BloodstreamSystem : EntitySystem component.BleedAmount += amount; component.BleedAmount = Math.Clamp(component.BleedAmount, 0, component.MaxBleedAmount); + if (component.BleedAmount == 0) + _alertsSystem.ClearAlert(uid, AlertType.Bleed); + else + { + var severity = (short) Math.Clamp(Math.Round(component.BleedAmount, MidpointRounding.ToZero), 0, 10); + _alertsSystem.ShowAlert(uid, AlertType.Bleed, severity); + } + return true; } @@ -377,7 +387,7 @@ public sealed class BloodstreamSystem : EntitySystem } /// - /// Change what someone's blood is made of, on the fly. + /// Change what someone's blood is made of, on the fly. /// public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamComponent? component = null) { diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index 4d80a8acfd..75447e90d7 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -38,6 +38,7 @@ namespace Content.Shared.Alert VowBroken, Essence, Corporeal, + Bleed, Debug1, Debug2, Debug3, diff --git a/Resources/Locale/en-US/alerts/alerts.ftl b/Resources/Locale/en-US/alerts/alerts.ftl index 4b5980696d..1469543c33 100644 --- a/Resources/Locale/en-US/alerts/alerts.ftl +++ b/Resources/Locale/en-US/alerts/alerts.ftl @@ -83,3 +83,6 @@ alerts-pulled-desc = You're being pulled. Move to break free. alerts-pulling-name = Pulling alerts-pulling-desc = You're pulling something. Click the alert to stop. + +alerts-bleed-name = [color=red]Bleed[/color] +alerts-bleed-desc = You're [color=red]bleeding[/color]. diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 090256de7a..6e207e39c2 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -17,6 +17,7 @@ - alertType: Stun - category: Breathing # Vox gang not calling this oxygen - category: Pressure + - alertType: Bleed - category: Temperature - category: Hunger - category: Thirst @@ -284,6 +285,36 @@ name: alerts-pulling-name description: alerts-pulling-desc +- type: alert + id: Bleed + icons: + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed0 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed1 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed2 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed3 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed4 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed5 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed6 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed7 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed8 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed9 + - sprite: /Textures/Interface/Alerts/bleed.rsi + state: bleed10 + name: alerts-bleed-name + description: alerts-bleed-desc + minSeverity: 0 + maxSeverity: 10 + - type: alert id: Debug1 icons: diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed0.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed0.png new file mode 100644 index 0000000000..636f3dfaad Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed0.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed1.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed1.png new file mode 100644 index 0000000000..c0884356bb Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed1.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed10.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed10.png new file mode 100644 index 0000000000..d802f2a9eb Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed10.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed2.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed2.png new file mode 100644 index 0000000000..5b0342937c Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed2.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed3.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed3.png new file mode 100644 index 0000000000..0c5f2a1f14 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed3.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed4.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed4.png new file mode 100644 index 0000000000..df7e7f93fa Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed4.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed5.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed5.png new file mode 100644 index 0000000000..cfbeb66cdf Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed5.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed6.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed6.png new file mode 100644 index 0000000000..bab041f9b0 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed6.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed7.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed7.png new file mode 100644 index 0000000000..6ffd8caba9 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed7.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed8.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed8.png new file mode 100644 index 0000000000..fcb401f708 Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed8.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/bleed9.png b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed9.png new file mode 100644 index 0000000000..10f6752a5e Binary files /dev/null and b/Resources/Textures/Interface/Alerts/bleed.rsi/bleed9.png differ diff --git a/Resources/Textures/Interface/Alerts/bleed.rsi/meta.json b/Resources/Textures/Interface/Alerts/bleed.rsi/meta.json new file mode 100644 index 0000000000..c8fba1b36b --- /dev/null +++ b/Resources/Textures/Interface/Alerts/bleed.rsi/meta.json @@ -0,0 +1,44 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "https://github.com/tgstation/tgstation/blob/master/icons/effects/bleed.dmi", + "states": [ + { + "name": "bleed0" + }, + { + "name": "bleed1" + }, + { + "name": "bleed2" + }, + { + "name": "bleed3" + }, + { + "name": "bleed4" + }, + { + "name": "bleed5" + }, + { + "name": "bleed6" + }, + { + "name": "bleed7" + }, + { + "name": "bleed8" + }, + { + "name": "bleed9" + }, + { + "name": "bleed10" + } + ] +}