using Content.Shared.Roles; using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.GameTicking.Rules.Components; [RegisterComponent, Access(typeof(ZombieRuleSystem))] public sealed class ZombieRuleComponent : Component { [DataField("initialInfectedNames")] public Dictionary InitialInfectedNames = new(); [DataField("patientZeroPrototypeId", customTypeSerializer: typeof(PrototypeIdSerializer))] public string PatientZeroPrototypeId = "InitialInfected"; /// /// Whether or not the initial infected have been chosen. /// [DataField("infectedChosen")] public bool InfectedChosen; /// /// When the round will next check for round end. /// [DataField("nextRoundEndCheck", customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextRoundEndCheck; /// /// The amount of time between each check for the end of the round. /// [DataField("endCheckDelay")] public TimeSpan EndCheckDelay = TimeSpan.FromSeconds(30); /// /// The time at which the initial infected will be chosen. /// [DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan? StartTime; /// /// The minimum amount of time after the round starts that the initial infected will be chosen. /// [DataField("minStartDelay")] public TimeSpan MinStartDelay = TimeSpan.FromMinutes(10); /// /// The maximum amount of time after the round starts that the initial infected will be chosen. /// [DataField("maxStartDelay")] public TimeSpan MaxStartDelay = TimeSpan.FromMinutes(15); /// /// The sound that plays when someone becomes an initial infected. /// todo: this should have a unique sound instead of reusing the zombie one. /// [DataField("initialInfectedSound")] public SoundSpecifier InitialInfectedSound = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg"); /// /// The minimum amount of time initial infected have before they start taking infection damage. /// [DataField("minInitialInfectedGrace")] public TimeSpan MinInitialInfectedGrace = TimeSpan.FromMinutes(12.5f); /// /// The maximum amount of time initial infected have before they start taking damage. /// [DataField("maxInitialInfectedGrace")] public TimeSpan MaxInitialInfectedGrace = TimeSpan.FromMinutes(15f); /// /// How many players for each initial infected. /// [DataField("playersPerInfected")] public int PlayersPerInfected = 10; /// /// The maximum number of initial infected. /// [DataField("maxInitialInfected")] public int MaxInitialInfected = 6; /// /// After this amount of the crew become zombies, the shuttle will be automatically called. /// [DataField("zombieShuttleCallPercentage")] public float ZombieShuttleCallPercentage = 0.5f; /// /// Have we called the evac shuttle yet? /// [DataField("shuttleCalled")] public bool ShuttleCalled; public const string ZombifySelfActionPrototype = "TurnUndead"; }