Traitor objectives now include their target's job (#6417)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user