Literally Murder IExamine (#7352)

This commit is contained in:
Rane
2022-04-08 17:17:25 -04:00
committed by GitHub
parent 427f7378c3
commit 7900abb888
27 changed files with 372 additions and 469 deletions

View File

@@ -0,0 +1,32 @@
using Content.Shared.Examine;
namespace Content.Server.Suspicion
{
public sealed class SuspicionRoleSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SuspicionRoleComponent, ExaminedEvent>(OnExamined);
}
private void OnExamined(EntityUid uid, SuspicionRoleComponent component, ExaminedEvent args)
{
if (!component.IsDead())
{
return;
}
var traitor = component.IsTraitor();
var color = traitor ? "red" : "green";
var role = traitor ? "suspicion-role-component-role-traitor" : "suspicion-role-component-role-innocent";
var article = traitor ? "generic-article-a" : "generic-article-an";
var tooltip = Loc.GetString("suspicion-role-component-on-examine-tooltip",
("article", Loc.GetString(article)),
("colorName", color),
("role",Loc.GetString(role)));
args.PushMarkup(tooltip);
}
}
}