From: username <113782077+whateverusername0@users.noreply.github.com> Date: Fri, 10 May 2024 02:01:02 +0000 (+1000) Subject: Traitor objective issuers (#27855) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=42571b12e92da2cb929b1e6a2054f88e0d237b48;p=space-station-14.git Traitor objective issuers (#27855) * the thing * another one --------- Co-authored-by: whateverusername0 --- diff --git a/Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs b/Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs index 0db9d195dc..b85019d8af 100644 --- a/Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs +++ b/Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs @@ -31,6 +31,9 @@ public sealed partial class TraitorRuleComponent : Component [DataField] public ProtoId CodewordVerbs = "verbs"; + [DataField] + public ProtoId ObjectiveIssuers = "TraitorCorporations"; + public int TotalTraitors => TraitorMinds.Count; public string[] Codewords = new string[3]; diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index b6bcd5ee1e..1c894a460c 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -74,6 +74,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem return false; var briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords))); + var issuer = _random.Pick(_prototypeManager.Index(component.ObjectiveIssuers).Values); Note[]? code = null; if (giveUplink) @@ -97,7 +98,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#")))); } - _antag.SendBriefing(traitor, GenerateBriefing(component.Codewords, code), null, component.GreetSoundNotification); + _antag.SendBriefing(traitor, GenerateBriefing(component.Codewords, code, issuer), null, component.GreetSoundNotification); component.TraitorMinds.Add(mindId); @@ -142,10 +143,10 @@ public sealed class TraitorRuleSystem : GameRuleSystem args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords))); } - private string GenerateBriefing(string[] codewords, Note[]? uplinkCode) + private string GenerateBriefing(string[] codewords, Note[]? uplinkCode, string? objectiveIssuer = null) { var sb = new StringBuilder(); - sb.AppendLine(Loc.GetString("traitor-role-greeting")); + sb.AppendLine(Loc.GetString("traitor-role-greeting", ("corporation", objectiveIssuer ?? Loc.GetString("objective-issuer-unknown")))); sb.AppendLine(Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", codewords)))); if (uplinkCode != null) sb.AppendLine(Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", uplinkCode).Replace("sharp", "#")))); diff --git a/Resources/Locale/en-US/game-ticking/game-presets/preset-traitor.ftl b/Resources/Locale/en-US/game-ticking/game-presets/preset-traitor.ftl index 724b752fbb..e92676a216 100644 --- a/Resources/Locale/en-US/game-ticking/game-presets/preset-traitor.ftl +++ b/Resources/Locale/en-US/game-ticking/game-presets/preset-traitor.ftl @@ -4,6 +4,7 @@ traitor-round-end-codewords = The codewords were: [color=White]{$codewords}[/col traitor-round-end-agent-name = traitor objective-issuer-syndicate = [color=crimson]The Syndicate[/color] +objective-issuer-unknown = Unknown # Shown at the end of a round of Traitor @@ -23,7 +24,7 @@ traitor-death-match-end-round-description-entry = {$originalName}'s PDA, with {$ # TraitorRole traitor-role-greeting = - You are a syndicate agent. + You are an agent sent by {$corporation} on behalf of The Syndicate. Your objectives and codewords are listed in the character menu. Use the uplink loaded into your PDA to buy the tools you'll need for this mission. Death to Nanotrasen! diff --git a/Resources/Prototypes/Datasets/corporations.yml b/Resources/Prototypes/Datasets/corporations.yml new file mode 100644 index 0000000000..55b1d53d2f --- /dev/null +++ b/Resources/Prototypes/Datasets/corporations.yml @@ -0,0 +1,12 @@ +- type: dataset + id: TraitorCorporations + values: + - "CyberSun Industries" + - "Gorlex Marauders" + - "MI13" + - "Tiger Cooperative" + - "S.E.L.F." + - "Animal Rights Consortium" + - "Donk Corporation" + - "Waffle Corporation" + - "Interdyne Pharmaceutics" \ No newline at end of file