diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
index aae8785b1f..e4b3be7e95 100644
--- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
+++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
@@ -40,6 +40,10 @@
+
+
+
+
diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
index fd3615d59f..62ff0d7e3f 100644
--- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
+++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
@@ -99,6 +99,14 @@ namespace Content.Client.HealthAnalyzer.UI
? $"{msg.BloodLevel * 100:F1} %"
: Loc.GetString("health-analyzer-window-entity-unknown-value-text");
+ HungerLabel.Text = msg.HungerLevel.HasValue && !float.IsNaN(msg.HungerLevel.Value)
+ ? $"{msg.HungerLevel.Value:F1} %"
+ : Loc.GetString("health-analyzer-window-entity-unknown-value-text");
+
+ ThirstLabel.Text = msg.ThirstLevel.HasValue && !float.IsNaN(msg.ThirstLevel.Value)
+ ? $"{msg.ThirstLevel.Value:F1} %"
+ : Loc.GetString("health-analyzer-window-entity-unknown-value-text");
+
StatusLabel.Text =
_entityManager.TryGetComponent(target.Value, out var mobStateComponent)
? GetStatus(mobStateComponent.CurrentState)
diff --git a/Content.Server/Body/Systems/BrainSystem.cs b/Content.Server/Body/Systems/BrainSystem.cs
index e916849a81..647e9ae32b 100644
--- a/Content.Server/Body/Systems/BrainSystem.cs
+++ b/Content.Server/Body/Systems/BrainSystem.cs
@@ -16,6 +16,7 @@ public sealed class BrainSystem : EntitySystem
{
base.Initialize();
+ SubscribeLocalEvent(OnBrainInit);
SubscribeLocalEvent((uid, _, args) => HandleMind(args.Body, uid));
SubscribeLocalEvent((uid, _, args) => HandleMind(uid, args.OldBody));
SubscribeLocalEvent(OnPointAttempt);
@@ -26,8 +27,12 @@ public sealed class BrainSystem : EntitySystem
if (TerminatingOrDeleted(newEntity) || TerminatingOrDeleted(oldEntity))
return;
- EnsureComp(newEntity);
- EnsureComp(oldEntity);
+ var newMindContainer = EnsureComp(newEntity);
+ var oldMindContainer = EnsureComp(oldEntity);
+
+ // Enable mind examination for brains
+ _mindSystem.SetExamineInfo(newEntity, true);
+ _mindSystem.SetExamineInfo(oldEntity, true);
var ghostOnMove = EnsureComp(newEntity);
ghostOnMove.MustBeDead = HasComp(newEntity); // Don't ghost living players out of their bodies.
@@ -38,6 +43,14 @@ public sealed class BrainSystem : EntitySystem
_mindSystem.TransferTo(mindId, newEntity, mind: mind);
}
+ private void OnBrainInit(Entity ent, ref ComponentInit args)
+ {
+ // Ensure brain has mind container with examination enabled
+ var mindContainer = EnsureComp(ent);
+ // Use the mind system to set the examine info
+ _mindSystem.SetExamineInfo(ent, true);
+ }
+
private void OnPointAttempt(Entity ent, ref PointAttemptEvent args)
{
args.Cancel();
diff --git a/Content.Server/Medical/HealthAnalyzerSystem.cs b/Content.Server/Medical/HealthAnalyzerSystem.cs
index 4b39dbcd63..afbbf7f6a3 100644
--- a/Content.Server/Medical/HealthAnalyzerSystem.cs
+++ b/Content.Server/Medical/HealthAnalyzerSystem.cs
@@ -14,6 +14,8 @@ using Content.Shared.MedicalScanner;
using Content.Shared.Mobs.Components;
using Content.Shared.Popups;
using Content.Shared.Traits.Assorted;
+using Content.Shared.Nutrition.Components;
+using Content.Shared.Nutrition.EntitySystems;
using Robust.Server.GameObjects;
namespace Content.Server.Medical;
@@ -62,6 +64,22 @@ public sealed class HealthAnalyzerSystem : AbstractAnalyzerSystem(target, out var unrevivableComp) && unrevivableComp.Analyzable)
unrevivable = true;
+ // Collect hunger and thirst data as percentages
+ float hungerLevel = -1;
+ float thirstLevel = -1;
+
+ if (TryComp(target, out var hunger))
+ {
+ // Calculate hunger as percentage (max hunger is 200.0f from Overfed threshold)
+ hungerLevel = (hunger.LastAuthoritativeHungerValue / 200.0f) * 100.0f;
+ }
+
+ if (TryComp(target, out var thirst))
+ {
+ // Calculate thirst as percentage (max thirst is 600.0f from OverHydrated threshold)
+ thirstLevel = (thirst.CurrentThirst / 600.0f) * 100.0f;
+ }
+
// Sunrise edit start - новый триггер
RaiseLocalEvent(target, new EntityAnalyzedEvent ());
// Sunrise edit end
@@ -72,7 +90,9 @@ public sealed class HealthAnalyzerSystem : AbstractAnalyzerSystem
+ /// Sets whether mind examination info should be shown for an entity.
+ ///
+ public void SetExamineInfo(EntityUid uid, bool showInfo)
+ {
+ if (TryComp(uid, out var mindContainer))
+ {
+ mindContainer.ShowExamineInfo = showInfo;
+ Dirty(uid, mindContainer);
+ }
+ }
+
private void OnVisitingTerminating(EntityUid uid, VisitingMindComponent component, ref EntityTerminatingEvent args)
{
if (component.MindId != null)
diff --git a/Resources/Locale/en-US/_strings/medical/components/health-analyzer-component.ftl b/Resources/Locale/en-US/_strings/medical/components/health-analyzer-component.ftl
index 68e8dd3806..8f519b0558 100644
--- a/Resources/Locale/en-US/_strings/medical/components/health-analyzer-component.ftl
+++ b/Resources/Locale/en-US/_strings/medical/components/health-analyzer-component.ftl
@@ -9,6 +9,8 @@ health-analyzer-window-entity-critical-text = Critical
health-analyzer-window-entity-temperature-text = Temperature:
health-analyzer-window-entity-blood-level-text = Blood Level:
+health-analyzer-window-entity-hunger-level-text = Hunger:
+health-analyzer-window-entity-thirst-level-text = Thirst:
health-analyzer-window-entity-status-text = Status:
health-analyzer-window-entity-damage-total-text = Total Damage:
diff --git a/Resources/Locale/ru-RU/_strings/medical/components/health-analyzer-component.ftl b/Resources/Locale/ru-RU/_strings/medical/components/health-analyzer-component.ftl
index 74bc6eeeaf..37ac7c8acd 100644
--- a/Resources/Locale/ru-RU/_strings/medical/components/health-analyzer-component.ftl
+++ b/Resources/Locale/ru-RU/_strings/medical/components/health-analyzer-component.ftl
@@ -7,6 +7,8 @@ health-analyzer-window-entity-dead-text = Мёртв
health-analyzer-window-entity-critical-text = Критическое состояние
health-analyzer-window-entity-temperature-text = Температура:
health-analyzer-window-entity-blood-level-text = Уровень крови:
+health-analyzer-window-entity-hunger-level-text = Голод:
+health-analyzer-window-entity-thirst-level-text = Жажда:
health-analyzer-window-entity-status-text = Статус:
health-analyzer-window-entity-damage-total-text = Общие повреждения:
health-analyzer-window-damage-group-text = { $damageGroup }: { $amount }