From 9de922adba82e434872eb250bd9fc091d567d4d2 Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Wed, 14 Aug 2024 03:57:09 +0200 Subject: [PATCH] development build ghostrole lottery changes (#30980) debug ghostrole lottery changes --- Content.Server/Ghost/Roles/GhostRoleSystem.cs | 6 +++++- Content.Shared/CCVar/CCVars.cs | 6 ++++++ Resources/ConfigPresets/Build/development.toml | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 8b8aa7b8c8..d95fc92267 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Ghost.Roles.Raffles; using Content.Server.Ghost.Roles.UI; using Content.Server.Mind.Commands; using Content.Shared.Administration; +using Content.Shared.CCVar; using Content.Shared.Database; using Content.Shared.Follower; using Content.Shared.GameTicking; @@ -20,6 +21,7 @@ using Content.Shared.Roles; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.Player; +using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Enums; using Robust.Shared.Player; @@ -37,6 +39,7 @@ namespace Content.Server.Ghost.Roles [UsedImplicitly] public sealed class GhostRoleSystem : EntitySystem { + [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly EuiManager _euiManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!; @@ -356,7 +359,8 @@ namespace Content.Server.Ghost.Roles var raffle = ent.Comp; raffle.Identifier = ghostRole.Identifier; - raffle.Countdown = TimeSpan.FromSeconds(settings.InitialDuration); + var countdown = _cfg.GetCVar(CCVars.GhostQuickLottery)? 1 : settings.InitialDuration; + raffle.Countdown = TimeSpan.FromSeconds(countdown); raffle.CumulativeTime = TimeSpan.FromSeconds(settings.InitialDuration); // we copy these settings into the component because they would be cumbersome to access otherwise raffle.JoinExtendsDurationBy = TimeSpan.FromSeconds(settings.JoinExtendsDurationBy); diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 3049df28ae..5ed13baf36 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -2034,6 +2034,12 @@ namespace Content.Shared.CCVar public static readonly CVarDef GhostRoleTime = CVarDef.Create("ghost.role_time", 3f, CVar.REPLICATED | CVar.SERVER); + /// + /// If ghost role lotteries should be made near-instanteous. + /// + public static readonly CVarDef GhostQuickLottery = + CVarDef.Create("ghost.quick_lottery", false, CVar.SERVERONLY); + /// /// Whether or not to kill the player's mob on ghosting, when it is in a critical health state. /// diff --git a/Resources/ConfigPresets/Build/development.toml b/Resources/ConfigPresets/Build/development.toml index a1900dbaa2..91be66c481 100644 --- a/Resources/ConfigPresets/Build/development.toml +++ b/Resources/ConfigPresets/Build/development.toml @@ -5,6 +5,10 @@ lobbyenabled = false map = "Dev" role_timers = false +[ghost] +role_time = 0.5 +quick_lottery = true + [gateway] generator_enabled = false -- 2.52.0