namespace Content.Server.GameTicking.Rules.Components; [RegisterComponent, Access(typeof(CaptureAreaSystem))] public sealed partial class CaptureAreaRuleComponent : Component { /// /// The type of captures possible /// - King of the Hill: All factions try to capture a specific area. /// - Asymmetric: One faction attacks, another defends. Only the attacker can capture. /// There is a timer for the defender. /// - Symmetric: Factions have to capture each other's bases. /// [DataField("mode")] public string Mode { get; set; } = "King of the Hill"; /// /// The timer before the defender wins, in minutes. Only applies if Mode is Asymmetric. /// [DataField("timer")] public float Timer { get; set; } = 40f; /// /// The faction that is defending on this map. /// [DataField("defenderFactionName")] public string DefenderFactionName { get; set; } = "Defender"; /// /// How much time has elapsed in an Asymmetric mode game. /// [DataField("asymmetricGameTimeElapsed"), ViewVariables(VVAccess.ReadWrite)] public float AsymmetricGameTimeElapsed { get; set; } = 0f; } [RegisterComponent] public sealed partial class CaptureAreaComponent : Component { /// /// The name for this capturable area /// [DataField("name")] public string Name { get; set; } = "Objective Area"; /// /// How long does the area need to be held for, in seconds /// [DataField("captureDuration")] public float CaptureDuration { get; set; } = 300f; /// /// How far entities need to be to count towards capture /// [DataField("captureRadius")] public float CaptureRadius { get; set; } = 4f; /// /// What the capture timer is currently at /// [DataField("captureTimer")] public float CaptureTimer { get; set; } = 0f; /// /// Has 1 minute left been announced? /// [DataField("captureTimerAnnouncement1")] public bool CaptureTimerAnnouncement1 { get; set; } = false; /// /// Has 2 minute left been announced? /// [DataField("captureTimerAnnouncement2")] public bool CaptureTimerAnnouncement2 { get; set; } = false; /// /// Is the area currently occupied? /// [DataField("occupied")] public bool Occupied { get; set; } = false; /// /// Which faction is occupying the area? /// [DataField("controller")] public string Controller { get; set; } = ""; /// /// The previous controller (for announcements when controller changes) /// [DataField("previousController")] public string PreviousController { get; set; } = ""; /// /// Which factions can occupy this area? /// [DataField("capturableFactions")] public List CapturableFactions { get; set; } = []; /// /// How long the area needs to be contested or lost before the capture timer resets /// [DataField("contestedResetTime")] public float ContestedResetTime { get; set; } = 10f; /// /// Current timer tracking how long the area has been contested or lost /// [DataField("contestedTimer")] public float ContestedTimer { get; set; } = 0f; /// /// The last controller before the area became contested or lost /// [DataField("lastController")] public string LastController { get; set; } = ""; }