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 <Label
Name="BloodLevel" Name="BloodLevel"
Margin="0 5 0 0"/> Margin="0 5 0 0"/>
<Label
Name="Bleeding"
Margin="0 5 0 0"/>
<Label <Label
Name="patientDamageAmount" Name="patientDamageAmount"
Margin="0 15 0 0"/> 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} %") ("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( patientDamageAmount.Text = Loc.GetString(
"health-analyzer-window-entity-damage-total-text", "health-analyzer-window-entity-damage-total-text",
("amount", damageable.TotalDamage) ("amount", damageable.TotalDamage)

View File

@@ -35,7 +35,7 @@ namespace Content.Server.Body.Components
/// How much should bleeding should be reduced every update interval? /// How much should bleeding should be reduced every update interval?
/// </summary> /// </summary>
[DataField] [DataField]
public float BleedReductionAmount = 1.0f; public float BleedReductionAmount = 0.33f;
/// <summary> /// <summary>
/// How high can <see cref="BleedAmount"/> go? /// 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)) bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
? bloodSolution.FillFraction ? bloodSolution.FillFraction
: 0, : 0,
null,
null null
)); ));
} }

View File

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

View File

@@ -12,13 +12,15 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
public float Temperature; public float Temperature;
public float BloodLevel; public float BloodLevel;
public bool? ScanMode; 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; TargetEntity = targetEntity;
Temperature = temperature; Temperature = temperature;
BloodLevel = bloodLevel; BloodLevel = bloodLevel;
ScanMode = scanMode; 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-health-text = {$entityName}'s health:
health-analyzer-window-entity-temperature-text = Temperature: {$temperature} health-analyzer-window-entity-temperature-text = Temperature: {$temperature}
health-analyzer-window-entity-blood-level-text = Blood Level: {$bloodLevel} 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-entity-damage-total-text = Total Damage: {$amount}
health-analyzer-window-damage-group-text = {$damageGroup}: {$amount} health-analyzer-window-damage-group-text = {$damageGroup}: {$amount}
health-analyzer-window-damage-type-text = {$damageType}: {$amount} health-analyzer-window-damage-type-text = {$damageType}: {$amount}

View File

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

View File

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

View File

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

View File

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