]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Traitor objective issuers (#27855)
authorusername <113782077+whateverusername0@users.noreply.github.com>
Fri, 10 May 2024 02:01:02 +0000 (12:01 +1000)
committerGitHub <noreply@github.com>
Fri, 10 May 2024 02:01:02 +0000 (19:01 -0700)
* the thing

* another one

---------

Co-authored-by: whateverusername0 <whateveremail>
Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs
Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Resources/Locale/en-US/game-ticking/game-presets/preset-traitor.ftl
Resources/Prototypes/Datasets/corporations.yml [new file with mode: 0644]

index 0db9d195dc75472c7ca982e0fa5b663e40ac2de6..b85019d8afa61801e038d0793d2e7028f986594c 100644 (file)
@@ -31,6 +31,9 @@ public sealed partial class TraitorRuleComponent : Component
     [DataField]
     public ProtoId<DatasetPrototype> CodewordVerbs = "verbs";
 
+    [DataField]
+    public ProtoId<DatasetPrototype> ObjectiveIssuers = "TraitorCorporations";
+
     public int TotalTraitors => TraitorMinds.Count;
     public string[] Codewords = new string[3];
 
index b6bcd5ee1e8908ba1a06d61a3741aa2b29636011..1c894a460cca0d663951457e0647cd70724584e8 100644 (file)
@@ -74,6 +74,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
             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<TraitorRuleComponent>
                 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<TraitorRuleComponent>
         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", "#"))));
index 724b752fbb64274cc7fb03d71899791ad02e0927..e92676a216017bcabc0f23689321ea01c4c1376b 100644 (file)
@@ -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 (file)
index 0000000..55b1d53
--- /dev/null
@@ -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