diff --git a/Content.Server/GameTicking/Rules/TraitorDeathMatchRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorDeathMatchRuleSystem.cs index 2941d6a44a..388c4a0c76 100644 --- a/Content.Server/GameTicking/Rules/TraitorDeathMatchRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorDeathMatchRuleSystem.cs @@ -20,6 +20,7 @@ using Content.Shared.Damage.Prototypes; using Content.Shared.Inventory; using Content.Shared.MobState.Components; using Content.Shared.PDA; +using Content.Shared.Roles; using Content.Shared.Traitor.Uplink; using Robust.Server.Player; using Robust.Shared.Configuration; @@ -52,6 +53,8 @@ public class TraitorDeathMatchRuleSystem : GameRuleSystem private readonly Dictionary _allOriginalNames = new(); + private const string TraitorPrototypeID = "Traitor"; + public override void Initialize() { base.Initialize(); @@ -77,7 +80,8 @@ public class TraitorDeathMatchRuleSystem : GameRuleSystem return; } - var traitorRole = new TraitorRole(mind); + var antagPrototype = _prototypeManager.Index(TraitorPrototypeID); + var traitorRole = new TraitorRole(mind, antagPrototype); mind.AddRole(traitorRole); // Delete anything that may contain "dangerous" role-specific items. diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index b1c7dc90ea..cb089c5f07 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -10,6 +10,7 @@ using Content.Server.Traitor.Uplink; using Content.Server.Traitor.Uplink.Account; using Content.Shared.CCVar; using Content.Shared.Dataset; +using Content.Shared.Roles; using Content.Shared.Sound; using Content.Shared.Traitor.Uplink; using Robust.Server.Player; @@ -39,6 +40,8 @@ public class TraitorRuleSystem : GameRuleSystem private readonly SoundSpecifier _addedSound = new SoundPathSpecifier("/Audio/Misc/tatoralert.ogg"); private readonly List _traitors = new (); + private const string TraitorPrototypeID = "Traitor"; + public override void Initialize() { base.Initialize(); @@ -105,7 +108,7 @@ public class TraitorRuleSystem : GameRuleSystem continue; } var profile = ev.Profiles[player.UserId]; - if (profile.AntagPreferences.Contains("Traitor")) + if (profile.AntagPreferences.Contains(TraitorPrototypeID)) { prefList.Add(player); } @@ -117,7 +120,7 @@ public class TraitorRuleSystem : GameRuleSystem for (var i = 0; i < numTraitors; i++) { IPlayerSession traitor; - if(prefList.Count < numTraitors) + if(prefList.Count == 0) { if (list.Count == 0) { @@ -153,7 +156,8 @@ public class TraitorRuleSystem : GameRuleSystem .AddUplink(mind.OwnedEntity!.Value, uplinkAccount)) continue; - var traitorRole = new TraitorRole(mind); + var antagPrototype = _prototypeManager.Index(TraitorPrototypeID); + var traitorRole = new TraitorRole(mind, antagPrototype); mind.AddRole(traitorRole); _traitors.Add(traitorRole); } diff --git a/Content.Server/Traitor/TraitorRole.cs b/Content.Server/Traitor/TraitorRole.cs index 7b6b25dfaf..7c63426e13 100644 --- a/Content.Server/Traitor/TraitorRole.cs +++ b/Content.Server/Traitor/TraitorRole.cs @@ -1,5 +1,6 @@ using Content.Server.Chat.Managers; using Content.Server.Roles; +using Content.Shared.Roles; using Robust.Shared.IoC; using Robust.Shared.Localization; @@ -7,12 +8,17 @@ namespace Content.Server.Traitor { public class TraitorRole : Role { - public TraitorRole(Mind.Mind mind) : base(mind) + public AntagPrototype Prototype { get; } + + public TraitorRole(Mind.Mind mind, AntagPrototype antagPrototype) : base(mind) { + Prototype = antagPrototype; + Name = antagPrototype.Name; + Antagonist = antagPrototype.Antagonist; } - public override string Name => Loc.GetString("traitor-role-name"); - public override bool Antagonist => true; + public override string Name { get; } + public override bool Antagonist { get; } public void GreetTraitor(string[] codewords) { 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 f15743b696..6648e5ed37 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 @@ -39,6 +39,5 @@ traitor-death-match-end-round-description-entry = {$originalName}'s PDA, with {$ ## TraitorRole # TraitorRole -traitor-role-name = Syndicate Agent traitor-role-greeting = Hello Agent traitor-role-codewords = Your codewords are: {$codewords} diff --git a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml index 92c73b550f..810f15088d 100644 --- a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml +++ b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml @@ -1,6 +1,6 @@ - type: antag id: SuspicionInnocent - name: "innocent" + name: "Innocent" antagonist: false setPreference: false objective: "Discover and eliminate all traitors." diff --git a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml index c70b160f2f..c3a13f8524 100644 --- a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml +++ b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml @@ -1,6 +1,6 @@ - type: antag id: SuspicionTraitor - name: "suspect" + name: "Suspect" antagonist: true setPreference: true objective: "Kill the innocents." diff --git a/Resources/Prototypes/Roles/Antags/traitor.yml b/Resources/Prototypes/Roles/Antags/traitor.yml index 346b434347..ef434537d0 100644 --- a/Resources/Prototypes/Roles/Antags/traitor.yml +++ b/Resources/Prototypes/Roles/Antags/traitor.yml @@ -1,6 +1,6 @@ - type: antag id: Traitor - name: "traitor" + name: "Syndicate Agent" antagonist: true setPreference: true objective: "Complete your objectives without being caught."