development build ghostrole lottery changes (#30980)

debug ghostrole lottery changes
This commit is contained in:
Errant
2024-08-14 03:57:09 +02:00
committed by GitHub
parent 381e0d6f93
commit 9de922adba
3 changed files with 15 additions and 1 deletions

View 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);