diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs index a26228797f..1c58793f67 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Numerics; using Content.Client._DV.Traits.Assorted; // DeltaV using Content.Shared._DV.Traits.Assorted; // DeltaV +using Content.Shared._DV.Medical; // DeltaV - Uncloneable using Content.Shared.Atmos; using Content.Client.UserInterface.Controls; using Content.Shared._DV.MedicalRecords; // DeltaV - Medical Records @@ -24,6 +25,7 @@ using Robust.Client.ResourceManagement; using Robust.Shared.Prototypes; using Robust.Shared.Utility; + namespace Content.Client.HealthAnalyzer.UI { [GenerateTypedNameReferences] @@ -35,6 +37,7 @@ namespace Content.Client.HealthAnalyzer.UI private readonly IResourceCache _cache; private readonly UnborgableSystem _unborgable; // DeltaV private readonly RedshirtSystem _redshirt; // DeltaV + private readonly UncloneableSystem _uncloneable; // DeltaV // Shitmed Change Start public event Action? OnBodyPartSelected; @@ -66,6 +69,7 @@ namespace Content.Client.HealthAnalyzer.UI _cache = dependencies.Resolve(); _unborgable = _entityManager.System(); // DeltaV _redshirt = _entityManager.System(); // DeltaV + _uncloneable = _entityManager.System(); // DeltaV // Shitmed Change Start _bodyPartControls = new Dictionary { @@ -212,10 +216,13 @@ namespace Content.Client.HealthAnalyzer.UI DamageLabel.Text = damageable.TotalDamage.ToString(); // Alerts - - var unborgable = _unborgable.IsUnborgable(_target.Value); // DeltaV + // DeltaV traits - This is going to be horrid if we just keep adding things like this. + var unborgable = _unborgable.IsUnborgable(_target.Value); var redshirt = _redshirt.IsRedshirt(_target.Value) && mobStateComponent?.CurrentState == MobState.Dead; // DeltaV - Redshirt - var showAlerts = msg.Unrevivable == true || msg.Bleeding == true || unborgable || redshirt || msg.Uncloneable == true; // DeltaV - Unborgable/Redshirt/Uncloneable + var uncloneable = _uncloneable.IsUncloneable(_target.Value) && mobStateComponent?.CurrentState == MobState.Dead; // DeltaV - Unclonable + // END DeltaV + + var showAlerts = msg.Unrevivable == true || msg.Bleeding == true || unborgable || redshirt || uncloneable; // DeltaV AlertsDivider.Visible = showAlerts; AlertsContainer.Visible = showAlerts; @@ -255,7 +262,7 @@ namespace Content.Client.HealthAnalyzer.UI MaxWidth = 300 }); - if (msg.Uncloneable == true) // DeltaV - Uncloneable + if (uncloneable) // DeltaV - Uncloneable AlertsContainer.AddChild(new RichTextLabel { Text = Loc.GetString("health-analyzer-window-entity-uncloneable-text"), diff --git a/Content.Server/Medical/CryoPodSystem.cs b/Content.Server/Medical/CryoPodSystem.cs index 6889adb3db..44d38aac46 100644 --- a/Content.Server/Medical/CryoPodSystem.cs +++ b/Content.Server/Medical/CryoPodSystem.cs @@ -60,7 +60,6 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem null, null, null, - null, // DeltaV - Uncloneable null // Shitmed Change )); } diff --git a/Content.Server/Medical/HealthAnalyzerSystem.cs b/Content.Server/Medical/HealthAnalyzerSystem.cs index 03e9e5853b..5bd0000f5d 100644 --- a/Content.Server/Medical/HealthAnalyzerSystem.cs +++ b/Content.Server/Medical/HealthAnalyzerSystem.cs @@ -28,7 +28,6 @@ using System.Linq; // Begin DeltaV using Content.Server._DV.MedicalRecords; using Content.Shared._DV.MedicalRecords; -using Content.Shared._DV.Traits.Assorted; // End DeltaV namespace Content.Server.Medical; @@ -293,7 +292,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem var bloodAmount = float.NaN; var bleeding = false; var unrevivable = false; - var uncloneable = false; // DeltaV - Uncloneable if (TryComp(target, out var bloodstream) && _solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, @@ -306,9 +304,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem if (TryComp(target, out var unrevivableComp) && unrevivableComp.Analyzable) unrevivable = true; - if (HasComp(target)) // DeltaV - Uncloneable - uncloneable = true; - // Shitmed Change Start Dictionary? body = null; if (HasComp(target)) @@ -322,7 +317,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem scanMode, bleeding, unrevivable, - uncloneable, // DeltaV - Uncloneable // Shitmed Change body, _medicalRecords.GetMedicalRecords(target), // DeltaV - Medical Records diff --git a/Content.Shared/MedicalScanner/HealthAnalyzerScannedUserMessage.cs b/Content.Shared/MedicalScanner/HealthAnalyzerScannedUserMessage.cs index 9b6092179a..1926cf21dd 100644 --- a/Content.Shared/MedicalScanner/HealthAnalyzerScannedUserMessage.cs +++ b/Content.Shared/MedicalScanner/HealthAnalyzerScannedUserMessage.cs @@ -1,5 +1,4 @@ using Content.Shared._DV.MedicalRecords; // DeltaV - Medical Records -using Content.Shared._DV.Traits.Assorted; using Content.Shared._Shitmed.Targeting; // Shitmed Change using Robust.Shared.Serialization; @@ -17,12 +16,11 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage public bool? ScanMode; public bool? Bleeding; public bool? Unrevivable; - public bool? Uncloneable; // DeltaV - Uncloneable public Dictionary? Body; // Shitmed Change public NetEntity? Part; // Shitmed Change public MedicalRecord? MedicalRecord; // DeltaV - Medical Records - public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable, bool? uncloneable, Dictionary? body, MedicalRecord? medicalRecord = null, NetEntity? part = null) // Shitmed Change // DeltaV - Medical Records + public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable, Dictionary? body, MedicalRecord? medicalRecord = null, NetEntity? part = null) // Shitmed Change // DeltaV - Medical Records { TargetEntity = targetEntity; Temperature = temperature; @@ -30,7 +28,6 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage ScanMode = scanMode; Bleeding = bleeding; Unrevivable = unrevivable; - Uncloneable = uncloneable; // DeltaV - Uncloneable Body = body; // Shitmed Change Part = part; // Shitmed Change MedicalRecord = medicalRecord; // DeltaV - Medical Records diff --git a/Content.Shared/_DV/Medical/UncloneableSystem.cs b/Content.Shared/_DV/Medical/UncloneableSystem.cs index 690b23edf0..d32d6d0abc 100644 --- a/Content.Shared/_DV/Medical/UncloneableSystem.cs +++ b/Content.Shared/_DV/Medical/UncloneableSystem.cs @@ -1,10 +1,20 @@ using Content.Shared._DV.Traits.Assorted; using Content.Shared.Cloning.Events; +using JetBrains.Annotations; namespace Content.Shared._DV.Medical; public sealed class UncloneableSystem : EntitySystem { + [PublicAPI] + public bool IsUncloneable(Entity entity) + { + if (!Resolve(entity, ref entity.Comp, false)) + return false; + + return true; + } + public override void Initialize() { base.Initialize();