]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Whisper bleed update v3 (#25434)
authorWhisper <121047731+QuietlyWhisper@users.noreply.github.com>
Mon, 26 Feb 2024 23:26:46 +0000 (18:26 -0500)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2024 23:26:46 +0000 (16:26 -0700)
* Whisper bleed update v3

* missed a few

* Add bleeding message to health analyzer.

* Fix bleed notification not updating.

* Apparently this either doesnt exist

Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
Content.Server/Body/Components/BloodstreamComponent.cs
Content.Server/Medical/CryoPodSystem.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Content.Shared/MedicalScanner/HealthAnalyzerScannedUserMessage.cs
Resources/Locale/en-US/medical/components/health-analyzer-component.ftl
Resources/Prototypes/Entities/Mobs/NPCs/argocyte.yml
Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
Resources/Prototypes/Entities/Mobs/base.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml

index 28872ef1d5d5ac15742ef2e136eec51299d8e561..401f9768629390fc4782b7bd5e3cf78afb3354fa 100644 (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"/>
index 2f19cd0a0500bdd4dd1b836b0354c6db6edc26fc..1d8d415bab96ac815f7f7d305230272ce279c558 100644 (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)
index 3ee8fe4d170ed538779e9b0a40b65d0eca9c244f..7041df444818c3195e45192606c3fceafddfe11f 100644 (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?
index 97ae72bd1100583f0e2291cb52a8242c175ef0ab..4ab94c72b9f468005a8ac322385a0c972a30603a 100644 (file)
@@ -203,6 +203,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
                 bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution))
                 ? bloodSolution.FillFraction
                 : 0,
+            null,
             null
         ));
     }
index a8abc4752df23a797941f3a9d208d38c76e90588..0e893c41145e7cf46ab0147a3d25ecc8454aa903 100644 (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
         ));
     }
 }
index 1e2c2575d9c59b07e4f86c676f680fcdcebe177a..78f26ed5c02f98f26258b5ba026a2640ef7bbd37 100644 (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;
     }
 }
 
index 9b0a8dd3ee3acf88862e7cc93c970df416d74c36..648db3f4ebdb649ef8de5ce94792d442f9522c0a 100644 (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}
index 472daed59b7a271b91798ad905383ac4fd71814b..39e68b63a789a998ffd6508f4f8b6ea7913e9637 100644 (file)
@@ -23,7 +23,7 @@
     bloodlossDamage:
       types:
         Bloodloss:
-          1
+          0.5
     bloodlossHealDamage:
       types:
         Bloodloss:
index 41fb6a5eec43844d7af191a3a8f98e748537f167..ca775ed35b19aa6d9a9da1728c7a319f29480e26 100644 (file)
@@ -64,7 +64,7 @@
     bloodlossDamage:
       types:
         Bloodloss:
-          1
+          0.5
     bloodlossHealDamage:
       types:
         Bloodloss:
index 788b14f322076e4de8e904a4d8fa3583c5ec31ef..d4e9a561c5e6a85e8a8ee8299820a155c30dac0a 100644 (file)
   - type: Bloodstream
     bloodlossDamage:
       types:
-        Bloodloss: 1
+        Bloodloss: 0.5
     bloodlossHealDamage:
       types:
         Bloodloss: -1
index de014c89121f7bd97d9e2cce53e8f5691abf226c..52407aba29f811186b6098d7aeadc7c4c5a7c162 100644 (file)
   components:
   - type: Stack
     lingering: true
+
 - type: entity
   parent: BaseHealingItem
   id: Tourniquet