diff --git a/Content.Server/GameTicking/Presets/PresetTraitor.cs b/Content.Server/GameTicking/Presets/PresetTraitor.cs index 6d656c44dc..e89f15cff1 100644 --- a/Content.Server/GameTicking/Presets/PresetTraitor.cs +++ b/Content.Server/GameTicking/Presets/PresetTraitor.cs @@ -8,6 +8,7 @@ using Content.Server.Items; using Content.Server.Objectives.Interfaces; using Content.Server.PDA; using Content.Server.Players; +using Content.Server.Roles; using Content.Server.Traitor; using Content.Server.Traitor.Uplink; using Content.Server.Traitor.Uplink.Account; @@ -72,7 +73,10 @@ namespace Content.Server.GameTicking.Presets return false; } - var list = new List(readyPlayers); + var list = new List(readyPlayers).Where(x => + x.Data.ContentData()?.Mind?.AllRoles.All(role => role is not Job {CanBeAntag: false}) ?? false + ).ToList(); + var prefList = new List(); foreach (var player in list) diff --git a/Content.Server/Roles/Job.cs b/Content.Server/Roles/Job.cs index 3fccfbd357..df32c69dbe 100644 --- a/Content.Server/Roles/Job.cs +++ b/Content.Server/Roles/Job.cs @@ -14,10 +14,13 @@ namespace Content.Server.Roles public string? StartingGear => Prototype.StartingGear; + public bool CanBeAntag; + public Job(Mind.Mind mind, JobPrototype jobPrototype) : base(mind) { Prototype = jobPrototype; Name = jobPrototype.Name; + CanBeAntag = jobPrototype.CanBeAntag; } public override void Greet() diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index 8374315636..d11d88ff1c 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -33,6 +33,9 @@ namespace Content.Shared.Roles [DataField("requireAdminNotify")] public bool RequireAdminNotify { get; } = false; + [DataField("canBeAntag")] + public bool CanBeAntag { get; } = true; + /// /// Whether this job is a head. /// The job system will try to pick heads before other jobs on the same priority level. diff --git a/Resources/Prototypes/Roles/Jobs/Command/captain.yml b/Resources/Prototypes/Roles/Jobs/Command/captain.yml index bf865805bb..527043b1f6 100644 --- a/Resources/Prototypes/Roles/Jobs/Command/captain.yml +++ b/Resources/Prototypes/Roles/Jobs/Command/captain.yml @@ -10,6 +10,7 @@ requireAdminNotify: true joinNotifyCrew: true supervisors: "Nanotrasen officials" + canBeAntag: false access: # All of em. # Could probably do with some kind of wildcard or whatever to automate this. diff --git a/Resources/Prototypes/Roles/Jobs/Command/head_of_personnel.yml b/Resources/Prototypes/Roles/Jobs/Command/head_of_personnel.yml index 1e6ae9889f..b01640bf44 100644 --- a/Resources/Prototypes/Roles/Jobs/Command/head_of_personnel.yml +++ b/Resources/Prototypes/Roles/Jobs/Command/head_of_personnel.yml @@ -9,6 +9,7 @@ icon: "HeadOfPersonnel" requireAdminNotify: true supervisors: "the captain" + canBeAntag: false access: - Command - HeadOfPersonnel diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml index 71c21667d9..9fe410d1b3 100644 --- a/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml +++ b/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml @@ -10,6 +10,7 @@ icon: "ChiefEngineer" requireAdminNotify: true supervisors: "the captain" + canBeAntag: false access: - Maintenance - Engineering diff --git a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml index f1507a3925..1415d19113 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml @@ -12,6 +12,7 @@ icon: "ChiefMedicalOfficer" requireAdminNotify: true supervisors: "the captain" + canBeAntag: false access: - Medical - Command diff --git a/Resources/Prototypes/Roles/Jobs/Science/research_director.yml b/Resources/Prototypes/Roles/Jobs/Science/research_director.yml index 797452b079..3cb5621ba2 100644 --- a/Resources/Prototypes/Roles/Jobs/Science/research_director.yml +++ b/Resources/Prototypes/Roles/Jobs/Science/research_director.yml @@ -10,6 +10,7 @@ icon: "ResearchDirector" requireAdminNotify: true supervisors: "the captain" + canBeAntag: false access: - Research - Command diff --git a/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml b/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml index 41ddd65852..258f332194 100644 --- a/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml +++ b/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml @@ -10,6 +10,7 @@ icon: "HeadOfSecurity" requireAdminNotify: true supervisors: "the captain" + canBeAntag: false access: - Command - Brig diff --git a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml index a1cd4b7fec..c0f554d3f5 100644 --- a/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml +++ b/Resources/Prototypes/Roles/Jobs/Security/security_officer.yml @@ -8,6 +8,7 @@ - Security icon: "SecurityOfficer" supervisors: "the head of security" + canBeAntag: false access: - Security - Maintenance