diff --git a/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs b/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs index 3df94d9eed..e53d01994b 100644 --- a/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs +++ b/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs @@ -53,6 +53,9 @@ public sealed class NukeopsRuleComponent : Component [DataField("operativeRoleProto", customTypeSerializer: typeof(PrototypeIdSerializer))] public string OperativeRoleProto = "Nukeops"; + [DataField("medicRoleProto", customTypeSerializer: typeof(PrototypeIdSerializer))] + public string MedicRoleProto = "NukeopsMedic"; + [DataField("commanderStartingGearProto", customTypeSerializer: typeof(PrototypeIdSerializer))] public string CommanderStartGearPrototype = "SyndicateCommanderGearFull"; diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index 2d372cf3d5..e7171c5627 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -408,8 +408,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem var playersPerOperative = nukeops.PlayersPerOperative; var maxOperatives = nukeops.MaxOperatives; + // Dear lord what is happening HERE. var everyone = new List(ev.PlayerPool); var prefList = new List(); + var medPrefList = new List(); var cmdrPrefList = new List(); var operatives = new List(); @@ -427,7 +429,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem { prefList.Add(player); } - + if (profile.AntagPreferences.Contains(nukeops.MedicRoleProto)) + { + medPrefList.Add(player); + } if (profile.AntagPreferences.Contains(nukeops.CommanderRolePrototype)) { cmdrPrefList.Add(player); @@ -438,31 +443,38 @@ public sealed class NukeopsRuleSystem : GameRuleSystem for (var i = 0; i < numNukies; i++) { + // TODO: Please fix this if you touch it. IPlayerSession nukeOp; // Only one commander, so we do it at the start if (i == 0) { if (cmdrPrefList.Count == 0) { - if (prefList.Count == 0) + if (medPrefList.Count == 0) { - if (everyone.Count == 0) + if (prefList.Count == 0) { - Logger.InfoS("preset", - "Insufficient ready players to fill up with nukeops, stopping the selection"); - break; + if (everyone.Count == 0) + { + Logger.InfoS("preset", "Insufficient ready players to fill up with nukeops, stopping the selection"); + break; + } + nukeOp = _random.PickAndTake(everyone); + Logger.InfoS("preset", "Insufficient preferred nukeop commanders, agents or nukies, picking at random."); + } + else + { + nukeOp = _random.PickAndTake(prefList); + everyone.Remove(nukeOp); + Logger.InfoS("preset", "Insufficient preferred nukeop commander or agents, picking at random from regular op list."); } - - nukeOp = _random.PickAndTake(everyone); - Logger.InfoS("preset", - "Insufficient preferred nukeop commanders or nukies, picking at random."); } else { - nukeOp = _random.PickAndTake(prefList); + nukeOp = _random.PickAndTake(medPrefList); everyone.Remove(nukeOp); - Logger.InfoS("preset", - "Insufficient preferred nukeop commanders, picking at random from regular op list."); + prefList.Remove(nukeOp); + Logger.InfoS("preset", "Insufficient preferred nukeop commanders, picking an agent"); } } else @@ -470,29 +482,44 @@ public sealed class NukeopsRuleSystem : GameRuleSystem nukeOp = _random.PickAndTake(cmdrPrefList); everyone.Remove(nukeOp); prefList.Remove(nukeOp); + medPrefList.Remove(nukeOp); Logger.InfoS("preset", "Selected a preferred nukeop commander."); } } - else + else if (i == 1) { - if (prefList.Count == 0) + if (medPrefList.Count == 0) { - if (everyone.Count == 0) + if (prefList.Count == 0) { - Logger.InfoS("preset", - "Insufficient ready players to fill up with nukeops, stopping the selection"); - break; + if (everyone.Count == 0) + { + Logger.InfoS("preset", "Insufficient ready players to fill up with nukeops, stopping the selection"); + break; + } + nukeOp = _random.PickAndTake(everyone); + Logger.InfoS("preset", "Insufficient preferred nukeop commanders, agents or nukies, picking at random."); + } + else + { + nukeOp = _random.PickAndTake(prefList); + everyone.Remove(nukeOp); + Logger.InfoS("preset", "Insufficient preferred nukeop commander or agents, picking at random from regular op list."); } - - nukeOp = _random.PickAndTake(everyone); - Logger.InfoS("preset", "Insufficient preferred nukeops, picking at random."); } else { - nukeOp = _random.PickAndTake(prefList); + nukeOp = _random.PickAndTake(medPrefList); everyone.Remove(nukeOp); - Logger.InfoS("preset", "Selected a preferred nukeop."); + Logger.InfoS("preset", "Insufficient preferred nukeop commanders, picking an agent"); } + + } + else + { + nukeOp = _random.PickAndTake(prefList); + everyone.Remove(nukeOp); + Logger.InfoS("preset", "Selected a preferred nukeop commander."); } operatives.Add(nukeOp); @@ -641,7 +668,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem break; case 1: name = Loc.GetString("nukeops-role-agent") + " " + _random.PickAndTake(component.OperativeNames[component.NormalNames]); - role = component.OperativeRoleProto; + role = component.MedicRoleProto; gear = component.MedicStartGearPrototype; break; default: diff --git a/Resources/Locale/en-US/prototypes/roles/antags.ftl b/Resources/Locale/en-US/prototypes/roles/antags.ftl index fb3e14d677..21a8809e69 100644 --- a/Resources/Locale/en-US/prototypes/roles/antags.ftl +++ b/Resources/Locale/en-US/prototypes/roles/antags.ftl @@ -16,5 +16,8 @@ roles-antag-suspicion-suspect-objective = Kill the innocents. roles-antag-nuclear-operative-commander-name = Nuclear operative commander roles-antag-nuclear-operative-commander-objective = Lead your team to the destruction of the station. +roles-antag-nuclear-operative-agent-name = Nuclear operative agent +roles-antag-nuclear-operative-agent-objective = Like default operative, the team's treatment will have priority. + roles-antag-nuclear-operative-name = Nuclear operative roles-antag-nuclear-operative-objective = Find the nuke disk and blow up the station. diff --git a/Resources/Prototypes/Roles/Antags/nukeops.yml b/Resources/Prototypes/Roles/Antags/nukeops.yml index 9dd30256b4..7370d805a3 100644 --- a/Resources/Prototypes/Roles/Antags/nukeops.yml +++ b/Resources/Prototypes/Roles/Antags/nukeops.yml @@ -5,6 +5,13 @@ setPreference: true objective: roles-antag-nuclear-operative-objective +- type: antag + id: NukeopsMedic + name: roles-antag-nuclear-operative-agent-name + antagonist: true + setPreference: true + objective: roles-antag-nuclear-operative-agent-objective + - type: antag id: NukeopsCommander name: roles-antag-nuclear-operative-commander-name