This commit is contained in:
BIGZi0348
2024-11-19 00:08:32 +03:00
parent 6f9f995ea9
commit 53bd0569ea

View File

@@ -3,11 +3,10 @@ using Content.Server.RoundEnd;
using Content.Server.Voting.Managers;
using Content.Shared.Voting;
using Robust.Server.Player;
using Robust.Shared.Timing;
namespace Content.Server._Honk.RoundEndVote;
public sealed class RoundEndVoteSystem : EntitySystem
{
[Dependency] private readonly IVoteManager _voteManager = default!;
@@ -24,6 +23,22 @@ public sealed class RoundEndVoteSystem : EntitySystem
if (_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
return;
if (_playerManager.PlayerCount == 0)
{
_gameTicker.DelayStart(TimeSpan.FromSeconds(60));
Timer.Spawn(60 * 1000, () =>
{
if (_playerManager.PlayerCount >= 15)
{
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
}
else if (_playerManager.PlayerCount >= 5)
{
_gameTicker.SetGamePreset("Extended");
}
});
}
if (_playerManager.PlayerCount >= 15)
{
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);