Make UnrevivableComponent shared, give the component reason messages and if it shows up on the analyzer (#35013)

* Make UnrevivableComponent shared

- Move UnrevivableComponent to shared

- add reason messages and if the status shows up in a health analyzer

* Update Content.Shared/Traits/Assorted/UnrevivableComponent.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

* Make UnrevivableComponent networked

* Update Content.Shared/Traits/Assorted/UnrevivableComponent.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Zachary Higgs
2025-02-09 19:16:21 -04:00
committed by GitHub
parent cb723b0cdb
commit 6cb30b3092
4 changed files with 27 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ using Content.Server.EUI;
using Content.Server.Ghost;
using Content.Server.Popups;
using Content.Server.PowerCell;
using Content.Server.Traits.Assorted;
using Content.Shared.Traits.Assorted;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
@@ -193,9 +193,9 @@ public sealed class DefibrillatorSystem : EntitySystem
_chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"),
InGameICChatType.Speak, true);
}
else if (HasComp<UnrevivableComponent>(target))
else if (TryComp<UnrevivableComponent>(target, out var unrevivable))
{
_chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-unrevivable"),
_chatManager.TrySendInGameICMessage(uid, Loc.GetString(unrevivable.ReasonMessage),
InGameICChatType.Speak, true);
}
else