Traitor objectives now include their target's job (#6417)
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Content.Server.Mind
|
|||||||
private readonly ISet<Role> _roles = new HashSet<Role>();
|
private readonly ISet<Role> _roles = new HashSet<Role>();
|
||||||
|
|
||||||
private readonly List<Objective> _objectives = new();
|
private readonly List<Objective> _objectives = new();
|
||||||
|
|
||||||
public string Briefing = String.Empty;
|
public string Briefing = String.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -223,6 +223,11 @@ namespace Content.Server.Mind
|
|||||||
return _roles.Any(role => role.GetType() == t);
|
return _roles.Any(role => role.GetType() == t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current job
|
||||||
|
/// </summary>
|
||||||
|
public Job? CurrentJob => _roles.OfType<Job>().SingleOrDefault();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an objective to this mind.
|
/// Adds an objective to this mind.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Objectives.Interfaces;
|
using Content.Server.Objectives.Interfaces;
|
||||||
|
using Content.Server.Roles;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
@@ -16,16 +17,17 @@ namespace Content.Server.Objectives.Conditions
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
var targetName = string.Empty;
|
var targetName = string.Empty;
|
||||||
|
var jobName = Target?.CurrentJob?.Name ?? "Unknown";
|
||||||
|
|
||||||
if (Target == null)
|
if (Target == null)
|
||||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
|
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName), ("job", jobName));
|
||||||
|
|
||||||
if (Target.CharacterName != null)
|
if (Target.CharacterName != null)
|
||||||
targetName = Target.CharacterName;
|
targetName = Target.CharacterName;
|
||||||
else if (Target.OwnedEntity is {Valid: true} owned)
|
else if (Target.OwnedEntity is {Valid: true} owned)
|
||||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owned).EntityName;
|
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owned).EntityName;
|
||||||
|
|
||||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
|
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName), ("job", jobName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Content.Server.Traitor;
|
using Content.Server.Traitor;
|
||||||
|
using Content.Server.Roles;
|
||||||
|
|
||||||
namespace Content.Server.Objectives.Conditions
|
namespace Content.Server.Objectives.Conditions
|
||||||
{
|
{
|
||||||
@@ -38,16 +39,17 @@ namespace Content.Server.Objectives.Conditions
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
var targetName = string.Empty;
|
var targetName = string.Empty;
|
||||||
|
var jobName = Target?.CurrentJob?.Name ?? "Unknown";
|
||||||
|
|
||||||
if (Target == null)
|
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)
|
if (Target.CharacterName != null)
|
||||||
targetName = Target.CharacterName;
|
targetName = Target.CharacterName;
|
||||||
else if (Target.OwnedEntity is {Valid: true} owned)
|
else if (Target.OwnedEntity is {Valid: true} owned)
|
||||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owned).EntityName;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
objective-condition-kill-person-title = Kill {$targetName}
|
objective-condition-kill-person-title = Kill {$targetName}, {CAPITALIZE($job)}
|
||||||
objective-condition-kill-person-description = Do it however you like, just make sure they don't last the shift.
|
objective-condition-kill-person-description = Do it however you like, just make sure they don't last the shift.
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
objective-condition-other-traitor-alive-title = Ensure fellow traitor {$targetName} stays alive.
|
objective-condition-other-traitor-alive-title = Ensure fellow traitor {$targetName}, {CAPITALIZE($job)} stays alive.
|
||||||
objective-condition-other-traitor-alive-description = Identify yourself at your own risk. We just need them alive.
|
objective-condition-other-traitor-alive-description = Identify yourself at your own risk. We just need them alive.
|
||||||
|
|||||||
Reference in New Issue
Block a user