]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Removable mindshields and revolutionary tweaks. (#35769)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Tue, 11 Mar 2025 09:41:13 +0000 (10:41 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Mar 2025 09:41:13 +0000 (10:41 +0100)
* I fucking hate revs

* Update preset-revolutionary.ftl

* fixy fix

Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Content.Server/Mindshield/MindShieldSystem.cs
Content.Shared/Mindshield/Components/MindShieldImplantComponent.cs [new file with mode: 0644]
Resources/Locale/en-US/game-ticking/game-presets/preset-revolutionary.ftl
Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml

index a313b78eaf13d7de66154713e8c98a3fd8ee32c7..9ec932b06fcbf12a9206f1d17c5204221d88178b 100644 (file)
@@ -189,7 +189,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
             commandList.Add(id);
         }
 
-        return IsGroupDetainedOrDead(commandList, true, true);
+        return IsGroupDetainedOrDead(commandList, true, true, true);
     }
 
     private void OnHeadRevMobStateChanged(EntityUid uid, HeadRevolutionaryComponent comp, MobStateChangedEvent ev)
@@ -214,7 +214,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
 
         // If no Head Revs are alive all normal Revs will lose their Rev status and rejoin Nanotrasen
         // Cuffing Head Revs is not enough - they must be killed.
-        if (IsGroupDetainedOrDead(headRevList, false, false))
+        if (IsGroupDetainedOrDead(headRevList, false, false, false))
         {
             var rev = AllEntityQuery<RevolutionaryComponent, MindContainerComponent>();
             while (rev.MoveNext(out var uid, out _, out var mc))
@@ -251,35 +251,46 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
     /// <param name="list">The list of the entities</param>
     /// <param name="checkOffStation">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)</param>
     /// <param name="countCuffed">Bool for if you don't want to count cuffed entities.</param>
+    /// <param name="countRevolutionaries">Bool for if you want to count revolutionaries.</param>
     /// <returns></returns>
-    private bool IsGroupDetainedOrDead(List<EntityUid> list, bool checkOffStation, bool countCuffed)
+    private bool IsGroupDetainedOrDead(List<EntityUid> list, bool checkOffStation, bool countCuffed, bool countRevolutionaries)
     {
         var gone = 0;
+
         foreach (var entity in list)
         {
             if (TryComp<CuffableComponent>(entity, out var cuffed) && cuffed.CuffedHandCount > 0 && countCuffed)
             {
                 gone++;
+                continue;
             }
-            else
+
+            if (TryComp<MobStateComponent>(entity, out var state))
             {
-                if (TryComp<MobStateComponent>(entity, out var state))
+                if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid)
                 {
-                    if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid)
-                    {
-                        gone++;
-                    }
-                    else if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived)
-                    {
-                        gone++;
-                    }
+                    gone++;
+                    continue;
                 }
-                //If they don't have the MobStateComponent they might as well be dead.
-                else
+
+                if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived)
                 {
                     gone++;
+                    continue;
                 }
             }
+            //If they don't have the MobStateComponent they might as well be dead.
+            else
+            {
+                gone++;
+                continue;
+            }
+
+            if ((HasComp<RevolutionaryComponent>(entity) || HasComp<HeadRevolutionaryComponent>(entity)) && countRevolutionaries)
+            {
+                gone++;
+                continue;
+            }
         }
 
         return gone == list.Count || list.Count == 0;
index bfca6c008ea528d3a61b42d24410e98810270b41..63d6bf097e68e12aab715ae87d7995ebe447e597 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Implants.Components;
 using Content.Shared.Mindshield.Components;
 using Content.Shared.Revolutionary.Components;
 using Content.Shared.Tag;
+using Robust.Shared.Containers;
 
 namespace Content.Server.Mindshield;
 
@@ -29,6 +30,7 @@ public sealed class MindShieldSystem : EntitySystem
     {
         base.Initialize();
         SubscribeLocalEvent<SubdermalImplantComponent, ImplantImplantedEvent>(ImplantCheck);
+        SubscribeLocalEvent<MindShieldImplantComponent, EntGotRemovedFromContainerMessage>(OnImplantDraw);
     }
 
     /// <summary>
@@ -61,4 +63,10 @@ public sealed class MindShieldSystem : EntitySystem
             _adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(implanted)} was deconverted due to being implanted with a Mindshield.");
         }
     }
+
+    private void OnImplantDraw(Entity<MindShieldImplantComponent> ent, ref EntGotRemovedFromContainerMessage args)
+    {
+        RemComp<MindShieldComponent>(args.Container.Owner);
+    }
 }
+
diff --git a/Content.Shared/Mindshield/Components/MindShieldImplantComponent.cs b/Content.Shared/Mindshield/Components/MindShieldImplantComponent.cs
new file mode 100644 (file)
index 0000000..09de446
--- /dev/null
@@ -0,0 +1,10 @@
+using Content.Shared.Revolutionary;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Mindshield.Components;
+
+/// <summary>
+/// Component given to an entity to mark it is a mindshield implant.
+/// </summary>
+[RegisterComponent, NetworkedComponent, Access(typeof(SharedRevolutionarySystem))]
+public sealed partial class MindShieldImplantComponent : Component;
index 15b53cf14b1f425052c6fcd4ce90b7c34fb32a54..83edfd4d690e72b00cbdc3ebe0132c10c7fec390 100644 (file)
@@ -5,28 +5,28 @@ 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, exilement or imprisonment.
+    You are tasked with removing all of Command from station via conversion, death 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.
+    Beware, this won't work on those with a mindshield or wearing eye protection.
     Viva la revolución!
 
 head-rev-briefing =
     Use flashes to convert people to your cause.
-    Get rid of all heads to take over the station.
+    Get rid of or convert 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 getting rid of 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 or converting 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.
-    Get rid of all of the Command staff.
+    Get rid of all of or convert the Command staff.
     Viva la revolución!
 
 rev-briefing = Help your head revolutionaries get rid of every head to take over the station.
index c4e270176927aa90f04bc494d507879a29f6b59f..7336f2726fd157ac9e2af450d795b39208428623 100644 (file)
   categories: [ HideSpawnMenu ]
   components:
    - type: SubdermalImplant
-     permanent: true
+   - type: MindShieldImplant
    - type: Tag
      tags:
        - MindShield
index 9bc0b28068bf58afeed016b05fb99fbc3ffa3c1b..c2ff931f85281af8c40bd9e1250ddd9126d7bbbb 100644 (file)
@@ -11,7 +11,7 @@
   Revolutionaries are conversion antagonists sponsored by the [color=#ff0000]Syndicate[/color] who are tasked with taking control of the station. They have no fancy gimmicks or cheap tricks, they only have a cause and strength in numbers.
 
   ## Objectives
-  You must cuff, kill, or exile all of the [textlink="Command staff" link="Command"] on station in no particular order.
+  You must convert, cuff or kill all of the [textlink="Command staff" link="Command"] on station in no particular order.
 
   Your objective is [bold]not to destroy the station[/bold], but [italic]to take it over[/italic], so try to minimize damage where possible.
 
@@ -40,7 +40,7 @@
   - [bold]Visibly be destroyed upon being implanted into a [color=#5e9cff]Head Revolutionary[/color][/bold], giving you away
   - NOT protect against flash disorientation
 
-  Assume all of [color=#cb0000]Security[/color] and [color=#1b67a5]Command[/color] are implanted with mindshields already.
+  Assume all of [color=#cb0000]Security[/color] and [color=#1b67a5]Command[/color] are implanted with mindshields already, [bold]however they can be removed using an empty implanter, obtainable from the Medical department's MedFab.[/bold]
 
   <Box>
     <GuideEntityEmbed Entity="MindShieldImplanter"/>