Дермократия changed
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using Content.Server.RoundEnd;
|
using Content.Server.RoundEnd;
|
||||||
using Content.Server.Voting.Managers;
|
using Content.Server.Voting.Managers;
|
||||||
using Content.Shared.Voting;
|
using Content.Shared.Voting;
|
||||||
|
using Robust.Server.Player;
|
||||||
|
|
||||||
|
|
||||||
namespace Content.Server._Honk.RoundEndVote;
|
namespace Content.Server._Honk.RoundEndVote;
|
||||||
@@ -11,6 +12,7 @@ public sealed class RoundEndVoteSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IVoteManager _voteManager = default!;
|
[Dependency] private readonly IVoteManager _voteManager = default!;
|
||||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||||
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -19,12 +21,19 @@ public sealed class RoundEndVoteSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev)
|
private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev)
|
||||||
{
|
{
|
||||||
//Эта строка проверяет, не находится ли игра в состоянии "PreRoundLobby".
|
|
||||||
if(_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
|
if(_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var player = _playerManager.PlayerCount;
|
||||||
|
|
||||||
|
if (player >= 20)
|
||||||
|
{
|
||||||
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
|
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
|
||||||
|
}
|
||||||
|
|
||||||
_voteManager.CreateStandardVote(null, StandardVoteType.Map);
|
_voteManager.CreateStandardVote(null, StandardVoteType.Map);
|
||||||
|
|
||||||
|
_gameTicker.SetGamePreset("Secret");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user