@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Antag;
|
using Content.Server.Antag;
|
||||||
using Content.Server.GameTicking.Rules.Components;
|
using Content.Server.GameTicking.Rules.Components;
|
||||||
using Content.Server.Mind;
|
using Content.Server.Mind;
|
||||||
@@ -5,6 +6,7 @@ using Content.Server.Objectives;
|
|||||||
using Content.Server.PDA.Ringer;
|
using Content.Server.PDA.Ringer;
|
||||||
using Content.Server.Roles;
|
using Content.Server.Roles;
|
||||||
using Content.Server.Traitor.Uplink;
|
using Content.Server.Traitor.Uplink;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.GameTicking.Components;
|
using Content.Shared.GameTicking.Components;
|
||||||
using Content.Shared.Mind;
|
using Content.Shared.Mind;
|
||||||
using Content.Shared.NPC.Systems;
|
using Content.Shared.NPC.Systems;
|
||||||
@@ -25,6 +27,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
|||||||
{
|
{
|
||||||
private static readonly Color TraitorCodewordColor = Color.FromHex("#cc3b3b");
|
private static readonly Color TraitorCodewordColor = Color.FromHex("#cc3b3b");
|
||||||
|
|
||||||
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
|
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
|
||||||
@@ -47,7 +50,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
|||||||
protected override void Added(EntityUid uid, TraitorRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
|
protected override void Added(EntityUid uid, TraitorRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
|
||||||
{
|
{
|
||||||
base.Added(uid, component, gameRule, args);
|
base.Added(uid, component, gameRule, args);
|
||||||
SetCodewords(component);
|
SetCodewords(component, args.RuleEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AfterEntitySelected(Entity<TraitorRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
|
private void AfterEntitySelected(Entity<TraitorRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
|
||||||
@@ -55,9 +58,10 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
|||||||
MakeTraitor(args.EntityUid, ent);
|
MakeTraitor(args.EntityUid, ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetCodewords(TraitorRuleComponent component)
|
private void SetCodewords(TraitorRuleComponent component, EntityUid ruleEntity)
|
||||||
{
|
{
|
||||||
component.Codewords = GenerateTraitorCodewords(component);
|
component.Codewords = GenerateTraitorCodewords(component);
|
||||||
|
_adminLogger.Add(LogType.EventStarted, LogImpact.Low, $"Codewords generated for game rule {ToPrettyString(ruleEntity)}: {string.Join(", ", component.Codewords)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] GenerateTraitorCodewords(TraitorRuleComponent component)
|
public string[] GenerateTraitorCodewords(TraitorRuleComponent component)
|
||||||
|
|||||||
Reference in New Issue
Block a user