Whisper bleed update v3 (#25434)

* Whisper bleed update v3

* missed a few

* Add bleeding message to health analyzer.

* Fix bleed notification not updating.

* Apparently this either doesnt exist
This commit is contained in:
Whisper
2024-02-26 18:26:46 -05:00
committed by GitHub
parent 88ae71715b
commit ff65cb7b0c
11 changed files with 33 additions and 7 deletions

View File

@@ -32,6 +32,9 @@
<Label
Name="BloodLevel"
Margin="0 5 0 0"/>
<Label
Name="Bleeding"
Margin="0 5 0 0"/>
<Label
Name="patientDamageAmount"
Margin="0 15 0 0"/>

View File

@@ -86,6 +86,16 @@ namespace Content.Client.HealthAnalyzer.UI
("bloodLevel", float.IsNaN(msg.BloodLevel) ? "N/A" : $"{msg.BloodLevel * 100:F1} %")
);
if (msg.Bleeding == true)
{
Bleeding.Text = Loc.GetString("health-analyzer-window-entity-bleeding-text");
Bleeding.FontColorOverride = Color.Red;
}
else
{
Bleeding.Text = string.Empty; // Clear the text
}
patientDamageAmount.Text = Loc.GetString(
"health-analyzer-window-entity-damage-total-text",
("amount", damageable.TotalDamage)

View File

@@ -35,7 +35,7 @@ namespace Content.Server.Body.Components
/// How much should bleeding should be reduced every update interval?
/// </summary>
[DataField]
public float BleedReductionAmount = 1.0f;
public float BleedReductionAmount = 0.33f;
/// <summary>
/// How high can <see cref="BleedAmount"/> go?

View File

@@ -203,6 +203,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
? bloodSolution.FillFraction
: 0,
null,
null
));
}

View File

@@ -179,16 +179,24 @@ public sealed class HealthAnalyzerSystem : EntitySystem
bodyTemperature = temp.CurrentTemperature;
var bloodAmount = float.NaN;
var bleeding = false;
if (TryComp<BloodstreamComponent>(target, out var bloodstream) &&
_solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
_solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName,
ref bloodstream.BloodSolution, out var bloodSolution))
{
bloodAmount = bloodSolution.FillFraction;
bleeding = bloodstream.BleedAmount > 0;
}
_uiSystem.SendUiMessage(ui, new HealthAnalyzerScannedUserMessage(
GetNetEntity(target),
bodyTemperature,
bloodAmount,
scanMode
scanMode,
bleeding
));
}
}

View File

@@ -12,13 +12,15 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
public float Temperature;
public float BloodLevel;
public bool? ScanMode;
public bool? Bleeding;
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode)
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding)
{
TargetEntity = targetEntity;
Temperature = temperature;
BloodLevel = bloodLevel;
ScanMode = scanMode;
Bleeding = bleeding;
}
}

View File

@@ -3,6 +3,7 @@ health-analyzer-window-entity-unknown-text = unknown
health-analyzer-window-entity-health-text = {$entityName}'s health:
health-analyzer-window-entity-temperature-text = Temperature: {$temperature}
health-analyzer-window-entity-blood-level-text = Blood Level: {$bloodLevel}
health-analyzer-window-entity-bleeding-text = Patient is bleeding!
health-analyzer-window-entity-damage-total-text = Total Damage: {$amount}
health-analyzer-window-damage-group-text = {$damageGroup}: {$amount}
health-analyzer-window-damage-type-text = {$damageType}: {$amount}

View File

@@ -23,7 +23,7 @@
bloodlossDamage:
types:
Bloodloss:
1
0.5
bloodlossHealDamage:
types:
Bloodloss:

View File

@@ -64,7 +64,7 @@
bloodlossDamage:
types:
Bloodloss:
1
0.5
bloodlossHealDamage:
types:
Bloodloss:

View File

@@ -207,7 +207,7 @@
- type: Bloodstream
bloodlossDamage:
types:
Bloodloss: 1
Bloodloss: 0.5
bloodlossHealDamage:
types:
Bloodloss: -1

View File

@@ -229,6 +229,7 @@
components:
- type: Stack
lingering: true
- type: entity
parent: BaseHealingItem
id: Tourniquet