introduce Bleed alert (#18295)

Co-authored-by: Phill101 <holypics4@gmail.com>
This commit is contained in:
Phill101 2023-07-26 02:28:35 +05:00 committed by GitHub
parent 6ed4fa052c
commit ebe72ac2b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 91 additions and 2 deletions

View File

@ -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
}
/// <summary>
/// Change what someone's blood is made of, on the fly.
/// Change what someone's blood is made of, on the fly.
/// </summary>
public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamComponent? component = null)
{

View File

@ -38,6 +38,7 @@ namespace Content.Shared.Alert
VowBroken,
Essence,
Corporeal,
Bleed,
Debug1,
Debug2,
Debug3,

View File

@ -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].

View File

@ -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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View 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"
}
]
}