From 5dc6778563112079981af71d067ceba663ce0576 Mon Sep 17 00:00:00 2001 From: SkaldetSkaeg Date: Fri, 9 Aug 2024 14:19:09 +0700 Subject: [PATCH] minds+endtext --- .../Rules/Components/CultYoggRuleComponent.cs | 5 +--- .../GameTicking/Rules/CultYoggRuleSystem.cs | 26 ++++++++++++++----- .../game-ticking/game-presets/preset-cult.ftl | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Content.Server/SS220/GameTicking/Rules/Components/CultYoggRuleComponent.cs b/Content.Server/SS220/GameTicking/Rules/Components/CultYoggRuleComponent.cs index 175400254c0b..6d1629ebdab1 100644 --- a/Content.Server/SS220/GameTicking/Rules/Components/CultYoggRuleComponent.cs +++ b/Content.Server/SS220/GameTicking/Rules/Components/CultYoggRuleComponent.cs @@ -18,10 +18,7 @@ public sealed partial class CultYoggRuleComponent : Component [DataField] public Dictionary InitialCultistsNames = new();//Who was cultist on the gamestart. - [DataField] - public Dictionary CultistsNames = new(); - - public readonly List CultistMinds = new(); + public readonly List InitialCultistMinds = new(); /// /// Storage for a sacraficials diff --git a/Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs b/Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs index ce2fe30dce64..221212e18e74 100644 --- a/Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs +++ b/Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs @@ -261,7 +261,8 @@ public bool MakeCultist(EntityUid uid, CultYoggRuleComponent component, bool ini _antagSelection.SendBriefing(uid, Loc.GetString("cult-yogg-role-greeting"), null, component.GreetSoundNotification); - component.CultistMinds.Add(mindId); + if (initial) + component.CultistMinds.Add(mindId); // Change the faction _npcFaction.RemoveFaction(uid, component.NanoTrasenFaction, false); @@ -286,7 +287,7 @@ protected override void AppendRoundEndText(EntityUid uid, CultYoggRuleComponent if (component.Summoned) { - args.AddLine(Loc.GetString("cult-yogg-round-end-amount-win")); + args.AddLine(Loc.GetString("cult-yogg-round-end-win")); } else { @@ -304,19 +305,30 @@ protected override void AppendRoundEndText(EntityUid uid, CultYoggRuleComponent args.AddLine(Loc.GetString("cult-yogg-round-end-initial-count", ("initialCount", component.InitialCultistsNames.Count))); var antags = _antag.GetAntagIdentifiers(uid); - args.AddLine(Loc.GetString("zombie-round-end-initial-count", ("initialCount", antags.Count))); - foreach (var (_, data, entName) in antags) + //args.AddLine(Loc.GetString("zombie-round-end-initial-count", ("initialCount", antags.Count))); // ToDo Should we add this? + foreach (var (mind, data, entName) in antags) { + if (component.InitialCultistMinds.Contains(mind)) + continue; + args.AddLine(Loc.GetString("cult-yogg-round-end-user-was-initial", ("name", entName), ("username", data.UserName))); } } - private float GetCultistsFraction()//надо учесть МиГо + private float GetCultistsFraction() { int cultistsCount = 0; - var query = EntityQueryEnumerator(); - while (query.MoveNext(out _, out _, out _, out var mob)) + var queryCultists = EntityQueryEnumerator(); + while (queryCultists.MoveNext(out _, out _, out _, out var mob)) + { + if (mob.CurrentState == MobState.Dead) + continue; + cultistsCount++; + } + + var queryMiGo = EntityQueryEnumerator(); + while (queryMiGo.MoveNext(out _, out _, out var mob)) { if (mob.CurrentState == MobState.Dead) continue; diff --git a/Resources/Locale/ru-RU/ss220/game-ticking/game-presets/preset-cult.ftl b/Resources/Locale/ru-RU/ss220/game-ticking/game-presets/preset-cult.ftl index b5f12583caef..823fdface2b5 100644 --- a/Resources/Locale/ru-RU/ss220/game-ticking/game-presets/preset-cult.ftl +++ b/Resources/Locale/ru-RU/ss220/game-ticking/game-presets/preset-cult.ftl @@ -13,4 +13,4 @@ cult-yogg-round-end-amount-none = [color=green]Все сторонники ку cult-yogg-round-end-amount-low = [color=green]Почти все сторонники культа были уничтожены.[/color] cult-yogg-round-end-amount-medium = [color=yellow]Культ провалил призыв.[/color] cult-yogg-round-end-amount-high = [color=crimson]культ был близок к призыву.[/color] -cult-yogg-round-end-amount-win = [color=darkred]Повелитель явился в наш мир![/color] +cult-yogg-round-end-win = [color=darkred]Повелитель явился в наш мир![/color]