using Content.Shared.Dataset; using Content.Shared.FixedPoint; using Content.Shared.NPC.Prototypes; using Content.Shared.Random; using Content.Shared.Roles; using Robust.Shared.Audio; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.GameTicking.Rules.Components; [RegisterComponent, Access(typeof(TraitorRuleSystem))] public sealed partial class TraitorRuleComponent : Component { public readonly List TraitorMinds = new(); [DataField] public ProtoId TraitorPrototypeId = "Traitor"; [DataField] public ProtoId NanoTrasenFaction = "NanoTrasen"; [DataField] public ProtoId SyndicateFaction = "Syndicate"; [DataField] public ProtoId CodewordAdjectives = "Adjectives"; [DataField] public ProtoId CodewordVerbs = "Verbs"; [DataField] public ProtoId ObjectiveIssuers = "TraitorCorporations"; /// /// Give this traitor an Uplink on spawn. /// [DataField] public bool GiveUplink = true; /// /// Give this traitor the codewords. /// [DataField] public bool GiveCodewords = true; /// /// Give this traitor a briefing in chat. /// [DataField] public bool GiveBriefing = true; public int TotalTraitors => TraitorMinds.Count; public string[] Codewords = new string[3]; public enum SelectionState { WaitingForSpawn = 0, ReadyToStart = 1, Started = 2, } /// /// Current state of the rule /// public SelectionState SelectionStatus = SelectionState.WaitingForSpawn; /// /// When should traitors be selected and the announcement made /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan? AnnounceAt; /// /// The amount of codewords that are selected. /// [DataField] public int CodewordCount = 4; /// /// The amount of TC traitors start with. /// [DataField] public FixedPoint2 StartingBalance = 20; }