Traitor objectives now include their target's job (#6417)

This commit is contained in:
Rane
2022-02-06 21:25:04 -05:00
committed by GitHub
parent 03a5a71243
commit be7a770b78
5 changed files with 17 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Utility;
using Robust.Shared.Serialization.Manager.Attributes;
using Content.Server.Traitor;
using Content.Server.Roles;
namespace Content.Server.Objectives.Conditions
{
@@ -38,16 +39,17 @@ namespace Content.Server.Objectives.Conditions
get
{
var targetName = string.Empty;
var jobName = Target?.CurrentJob?.Name ?? "Unknown";
if (Target == null)
return Loc.GetString("objective-condition-other-traitor-alive-title", ("targetName", targetName));
return Loc.GetString("objective-condition-other-traitor-alive-title", ("targetName", targetName), ("job", jobName));
if (Target.CharacterName != null)
targetName = Target.CharacterName;
else if (Target.OwnedEntity is {Valid: true} owned)
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owned).EntityName;
return Loc.GetString("objective-condition-other-traitor-alive-title", ("targetName", targetName));
return Loc.GetString("objective-condition-other-traitor-alive-title", ("targetName", targetName), ("job", jobName));
}
}