introduce Bleed alert (#18295)
Co-authored-by: Phill101 <holypics4@gmail.com>
@@ -5,6 +5,7 @@ using Content.Server.Fluids.EntitySystems;
|
|||||||
using Content.Server.Forensics;
|
using Content.Server.Forensics;
|
||||||
using Content.Server.HealthExaminable;
|
using Content.Server.HealthExaminable;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Chemistry.Components;
|
using Content.Shared.Chemistry.Components;
|
||||||
using Content.Shared.Chemistry.Reaction;
|
using Content.Shared.Chemistry.Reaction;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
@@ -37,6 +38,7 @@ public sealed class BloodstreamSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedDrunkSystem _drunkSystem = default!;
|
[Dependency] private readonly SharedDrunkSystem _drunkSystem = default!;
|
||||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||||
[Dependency] private readonly SharedStutteringSystem _stutteringSystem = default!;
|
[Dependency] private readonly SharedStutteringSystem _stutteringSystem = default!;
|
||||||
|
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
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
|
// storing the drunk and stutter time so we can remove it independently from other effects additions
|
||||||
bloodstream.StatusTime += bloodstream.UpdateInterval * 2;
|
bloodstream.StatusTime += bloodstream.UpdateInterval * 2;
|
||||||
}
|
}
|
||||||
else if (!_mobStateSystem.IsDead(uid))
|
else if (!_mobStateSystem.IsDead(uid))
|
||||||
{
|
{
|
||||||
// If they're healthy, we'll try and heal some bloodloss instead.
|
// 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 += amount;
|
||||||
component.BleedAmount = Math.Clamp(component.BleedAmount, 0, component.MaxBleedAmount);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,7 +387,7 @@ public sealed class BloodstreamSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Change what someone's blood is made of, on the fly.
|
/// Change what someone's blood is made of, on the fly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamComponent? component = null)
|
public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamComponent? component = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace Content.Shared.Alert
|
|||||||
VowBroken,
|
VowBroken,
|
||||||
Essence,
|
Essence,
|
||||||
Corporeal,
|
Corporeal,
|
||||||
|
Bleed,
|
||||||
Debug1,
|
Debug1,
|
||||||
Debug2,
|
Debug2,
|
||||||
Debug3,
|
Debug3,
|
||||||
|
|||||||
@@ -83,3 +83,6 @@ alerts-pulled-desc = You're being pulled. Move to break free.
|
|||||||
|
|
||||||
alerts-pulling-name = Pulling
|
alerts-pulling-name = Pulling
|
||||||
alerts-pulling-desc = You're pulling something. Click the alert to stop.
|
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].
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
- alertType: Stun
|
- alertType: Stun
|
||||||
- category: Breathing # Vox gang not calling this oxygen
|
- category: Breathing # Vox gang not calling this oxygen
|
||||||
- category: Pressure
|
- category: Pressure
|
||||||
|
- alertType: Bleed
|
||||||
- category: Temperature
|
- category: Temperature
|
||||||
- category: Hunger
|
- category: Hunger
|
||||||
- category: Thirst
|
- category: Thirst
|
||||||
@@ -284,6 +285,36 @@
|
|||||||
name: alerts-pulling-name
|
name: alerts-pulling-name
|
||||||
description: alerts-pulling-desc
|
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
|
- type: alert
|
||||||
id: Debug1
|
id: Debug1
|
||||||
icons:
|
icons:
|
||||||
|
|||||||
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed0.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed1.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed10.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed2.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed3.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed4.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed5.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed6.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed7.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed8.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/Textures/Interface/Alerts/bleed.rsi/bleed9.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
44
Resources/Textures/Interface/Alerts/bleed.rsi/meta.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||