Skip to content

Commit

Permalink
minds+endtext
Browse files Browse the repository at this point in the history
  • Loading branch information
SkaldetSkaeg committed Aug 9, 2024
1 parent 57e4a36 commit 5dc6778
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ public sealed partial class CultYoggRuleComponent : Component
[DataField]
public Dictionary<string, string> InitialCultistsNames = new();//Who was cultist on the gamestart.

[DataField]
public Dictionary<string, string> CultistsNames = new();

public readonly List<EntityUid> CultistMinds = new();
public readonly List<EntityUid> InitialCultistMinds = new();

/// <summary>
/// Storage for a sacraficials
Expand Down
26 changes: 19 additions & 7 deletions Content.Server/SS220/GameTicking/Rules/CultYoggRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
{
Expand All @@ -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<HumanoidAppearanceComponent, CultYoggComponent, MobStateComponent>();
while (query.MoveNext(out _, out _, out _, out var mob))
var queryCultists = EntityQueryEnumerator<HumanoidAppearanceComponent, CultYoggComponent, MobStateComponent>();
while (queryCultists.MoveNext(out _, out _, out _, out var mob))
{
if (mob.CurrentState == MobState.Dead)
continue;
cultistsCount++;
}

var queryMiGo = EntityQueryEnumerator<MiGoComponent, MobStateComponent>();
while (queryMiGo.MoveNext(out _, out _, out var mob))
{
if (mob.CurrentState == MobState.Dead)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit 5dc6778

Please sign in to comment.