diff --git a/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs b/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs index 3724f2e87b..e2960ba212 100644 --- a/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs +++ b/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs @@ -130,6 +130,7 @@ public sealed class CultRuleSystem : GameRuleSystem while (querry.MoveNext(out _, out var cultRuleComponent, out _)) { + var cultists = 0; foreach (var cultistComponent in cultRuleComponent.Cultists) { var owner = cultistComponent.Owner; @@ -138,9 +139,14 @@ public sealed class CultRuleSystem : GameRuleSystem if (_mobStateSystem.IsAlive(owner, mobState)) { - aliveCultistsCount++; + cultists++; } } + + if (cultists == 0) + cultRuleComponent.WinCondition = CultWinCondition.CultFailure; + + aliveCultistsCount += cultists; } if (aliveCultistsCount == 0) @@ -470,6 +476,13 @@ public sealed class CultRuleSystem : GameRuleSystem private void OnNarsieSummon(CultNarsieSummoned ev) { + foreach (var rule in EntityQuery()) + { + rule.WinCondition = CultWinCondition.CultWin; + } + + _roundEndSystem.EndRound(); + var query = EntityQuery().ToList(); foreach (var (mobState, mindContainer, _) in query) @@ -484,7 +497,5 @@ public sealed class CultRuleSystem : GameRuleSystem _bodySystem.GibBody(mobState.Owner); } - - _roundEndSystem.EndRound(); } }