]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
development build ghostrole lottery changes (#30980)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Wed, 14 Aug 2024 01:57:09 +0000 (03:57 +0200)
committerGitHub <noreply@github.com>
Wed, 14 Aug 2024 01:57:09 +0000 (11:57 +1000)
debug ghostrole lottery changes

Content.Server/Ghost/Roles/GhostRoleSystem.cs
Content.Shared/CCVar/CCVars.cs
Resources/ConfigPresets/Build/development.toml

index 8b8aa7b8c8fcc8163a22d43c94e8ff8fd6bbf33f..d95fc922671958143db21b31fbf3b33b1c8d6a0e 100644 (file)
@@ -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);
index 3049df28aeb2b75716daada35ebf3045e191d64f..5ed13baf364805664d2d7e6d214e8c81b14bd48a 100644 (file)
@@ -2034,6 +2034,12 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<float> GhostRoleTime =
             CVarDef.Create("ghost.role_time", 3f, CVar.REPLICATED | CVar.SERVER);
 
+        /// <summary>
+        /// If ghost role lotteries should be made near-instanteous.
+        /// </summary>
+        public static readonly CVarDef<bool> GhostQuickLottery =
+            CVarDef.Create("ghost.quick_lottery", false, CVar.SERVERONLY);
+
         /// <summary>
         /// Whether or not to kill the player's mob on ghosting, when it is in a critical health state.
         /// </summary>
index a1900dbaa2493bcdff993d2a1a2f97134808bfe8..91be66c481b28a7dbec72585e9d1b7ba1a07be4b 100644 (file)
@@ -5,6 +5,10 @@ lobbyenabled = false
 map = "Dev"
 role_timers = false
 
+[ghost]
+role_time = 0.5
+quick_lottery = true
+
 [gateway]
 generator_enabled = false