diff --git a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs index c5f88ab6cf1..04ab7fd71e6 100644 --- a/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs @@ -194,7 +194,8 @@ private void OnHeadRevMobStateChanged(EntityUid uid, HeadRevolutionaryComponent /// private bool CheckRevsLose() { - var stunTime = TimeSpan.FromSeconds(4); + ///ADT метод полностью переписан + ///ADT start var headRevList = new List(); var headRevs = AllEntityQuery(); @@ -204,37 +205,51 @@ private bool CheckRevsLose() } // 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 (IsGroupDead(headRevList, false)) { - var rev = AllEntityQuery(); - while (rev.MoveNext(out var uid, out _, out var mc)) + var headrev = AllEntityQuery(); + while (headrev.MoveNext(out var uid, out _, out var mc)) { if (HasComp(uid)) continue; + if (TryComp(uid, out var mobstate) && mobstate.CurrentState != MobState.Dead) + { + AddComp(uid); + return false; + } + } + } + return true; - _npcFaction.RemoveFaction(uid, RevolutionaryNpcFaction); - _stun.TryParalyze(uid, stunTime, true); - RemCompDeferred(uid); - _popup.PopupEntity(Loc.GetString("rev-break-control", ("name", Identity.Entity(uid, EntityManager))), uid); - _adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(uid)} was deconverted due to all Head Revolutionaries dying."); - - if (!_mind.TryGetMind(uid, out var mindId, out _, mc)) - continue; - - // remove their antag role - _role.MindTryRemoveRole(mindId); - - // make it very obvious to the rev they've been deconverted since - // they may not see the popup due to antag and/or new player tunnel vision - if (_mind.TryGetSession(mindId, out var session)) - _euiMan.OpenEui(new DeconvertedEui(), session); + } + private bool IsGroupDead(List list, bool checkOffStation, int? Dead = 0) + { + var dead = Dead; + foreach (var entity in list) + { + if (TryComp(entity, out var state)) + { + if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid) + { + dead++; + } + else if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived) + { + dead++; + } + } + //If they don't have the MobStateComponent they might as well be dead. + else + { + dead++; } - return true; } - return false; + return dead == list.Count || list.Count == 0; } + ///ADT end + + /// /// Will take a group of entities and check if these entities are alive, dead or cuffed. 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 15b53cf14b1..a7f1d7b110b 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 @@ -21,8 +21,6 @@ head-rev-break-mindshield = The Mindshield was destroyed! 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. -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. diff --git a/Resources/Locale/ru-RU/game-ticking/game-presets/preset-revolutionary.ftl b/Resources/Locale/ru-RU/game-ticking/game-presets/preset-revolutionary.ftl index 14e00b4667d..8a8c38f430c 100644 --- a/Resources/Locale/ru-RU/game-ticking/game-presets/preset-revolutionary.ftl +++ b/Resources/Locale/ru-RU/game-ticking/game-presets/preset-revolutionary.ftl @@ -17,12 +17,6 @@ head-rev-break-mindshield = Щит разума был уничтожен! roles-antag-rev-name = Революционер roles-antag-rev-objective = Ваша задача - защищать и выполнять приказы глав революции, а также избавиться от всего командного состава станции. -rev-break-control = { $name } { GENDER($name) -> - [male] вспомнил, кому он верен - [female] вспомнила, кому она верна - [epicene] вспомнили, кому они верни - *[neuter] вспомнило, кому оно верно - } на самом деле! rev-role-greeting = Вы - Революционер. Вам поручено захватить станцию и защищать глав революции.