From 7d918c95d0adbe38e63b706ebf899ddca364af01 Mon Sep 17 00:00:00 2001 From: Killerqu00 <47712032+Killerqu00@users.noreply.github.com> Date: Thu, 9 May 2024 08:48:32 +0200 Subject: [PATCH] Revolutionaries can now cuff command instead of killing/exiling them (#27627) * command can now be restrained for revs victory * headrevs still must be killed --- .../Rules/RevolutionaryRuleSystem.cs | 44 ++++++++++++------- .../game-presets/preset-revolutionary.ftl | 14 +++--- .../Guidebook/Antagonist/Revolutionaries.xml | 6 +-- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs index e89d4614ff..58ced96295 100644 --- a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs @@ -28,6 +28,7 @@ using Content.Shared.Zombies; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Content.Server.GameTicking.Components; +using Content.Shared.Cuffs.Components; namespace Content.Server.GameTicking.Rules; @@ -179,7 +180,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem(); while (rev.MoveNext(out var uid, out _, out var mc)) @@ -235,35 +237,43 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem - /// Will take a group of entities and check if they are all alive or dead + /// Will take a group of entities and check if these entities are alive, dead or cuffed. /// /// The list of the entities - /// Bool for if you want to check if someone is in space and consider them dead. (Won't check when emergency shuttle arrives just in case) + /// Bool for if you want to check if someone is in space and consider them missing in action. (Won't check when emergency shuttle arrives just in case) + /// Bool for if you don't want to count cuffed entities. /// - private bool IsGroupDead(List list, bool checkOffStation) + private bool IsGroupDetainedOrDead(List list, bool checkOffStation, bool countCuffed) { - var dead = 0; + var gone = 0; foreach (var entity in list) { - if (TryComp(entity, out var state)) + if (TryComp(entity, out var cuffed) && cuffed.CuffedHandCount > 0 && countCuffed) { - if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid) + gone++; + } + else + { + if (TryComp(entity, out var state)) { - dead++; + if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid) + { + gone++; + } + else if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived) + { + gone++; + } } - else if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived) + //If they don't have the MobStateComponent they might as well be dead. + else { - dead++; + gone++; } } - //If they don't have the MobStateComponent they might as well be dead. - else - { - dead++; - } } - return dead == list.Count || list.Count == 0; + return gone == list.Count || list.Count == 0; } private static readonly string[] Outcomes = diff --git a/Resources/Locale/en-US/game-ticking/game-presets/preset-revolutionary.ftl b/Resources/Locale/en-US/game-ticking/game-presets/preset-revolutionary.ftl index 5fb1d40b3d..15b53cf14b 100644 --- a/Resources/Locale/en-US/game-ticking/game-presets/preset-revolutionary.ftl +++ b/Resources/Locale/en-US/game-ticking/game-presets/preset-revolutionary.ftl @@ -5,31 +5,31 @@ roles-antag-rev-head-objective = Your objective is to take over the station by c head-rev-role-greeting = You are a Head Revolutionary. - You are tasked with removing all of Command from station via death or exilement. + You are tasked with removing all of Command from station via death, exilement or imprisonment. The Syndicate has sponsored you with a flash that converts the crew to your side. Beware, this won't work on Security, Command, or those wearing sunglasses. Viva la revolución! head-rev-briefing = Use flashes to convert people to your cause. - Kill all heads to take over the station. + Get rid of all heads to take over the station. head-rev-break-mindshield = The Mindshield was destroyed! ## Rev roles-antag-rev-name = Revolutionary -roles-antag-rev-objective = Your objective is to ensure the safety and follow the orders of the Head Revolutionaries as well as killing all Command staff on station. +roles-antag-rev-objective = Your objective is to ensure the safety and follow the orders of the Head Revolutionaries as well as getting rid of all Command staff on station. rev-break-control = {$name} has remembered their true allegiance! rev-role-greeting = You are a Revolutionary. You are tasked with taking over the station and protecting the Head Revolutionaries. - Eliminate all of the Command staff. + Get rid of all of the Command staff. Viva la revolución! -rev-briefing = Help your head revolutionaries kill every head to take over the station. +rev-briefing = Help your head revolutionaries get rid of every head to take over the station. ## General @@ -40,9 +40,7 @@ rev-not-enough-ready-players = Not enough players readied up for the game. There rev-no-one-ready = No players readied up! Can't start a Revolution. rev-no-heads = There were no Head Revolutionaries to be selected. Can't start a Revolution. -rev-all-heads-dead = All the heads are dead, now finish up the rest of the crew! - -rev-won = The Head Revs survived and killed all of Command. +rev-won = The Head Revs survived and successfully seized control of the station. rev-lost = Command survived and killed all of the Head Revs. diff --git a/Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml b/Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml index 5f6d4ea937..4b1c2e67d6 100644 --- a/Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml +++ b/Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml @@ -4,13 +4,13 @@ - Revolutionaries are antagonists that are sponsored by the Syndicate to take over the station. ## Head Revolutionaries - + - [color=#5e9cff]Head Revolutionaries[/color] are chosen at the start of the shift and are tasked with taking over the station by killing or exiling all of the Command staff. Head Revolutionaries will be given a [color=#a4885c]Flash[/color] and a pair of [color=#a4885c]Sunglasses[/color] to aid them. + [color=#5e9cff]Head Revolutionaries[/color] are chosen at the start of the shift and are tasked with taking over the station by killing, exiling or cuffing all of the Command staff. Head Revolutionaries will be given a [color=#a4885c]Flash[/color] and a pair of [color=#a4885c]Sunglasses[/color] to aid them. ## Conversion @@ -41,7 +41,7 @@ ## Objectives - You must eliminate or exile all of the following Command staff on station in no particular order. + You must eliminate, exile or arrest all of the following Command staff on station in no particular order. - Captain - Head of Personnel - Chief Engineer -- 2.52.0