Демократия
This commit is contained in:
58
Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs
Normal file
58
Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using Content.Server.GameTicking;
|
||||
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!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<RoundEndSystemChangedEvent>(OnRoundEndSystemChange);
|
||||
}
|
||||
|
||||
private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (_playerManager.PlayerCount >= 5)
|
||||
{
|
||||
_gameTicker.SetGamePreset("Extended");
|
||||
}
|
||||
else
|
||||
{
|
||||
_gameTicker.SetGamePreset("Greenshift");
|
||||
}
|
||||
|
||||
_voteManager.CreateStandardVote(null, StandardVoteType.Map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
id: DryDock
|
||||
mapName: 'DryDock Station'
|
||||
mapPath: /Maps/White/DryDock.yml
|
||||
minPlayers: 10
|
||||
minPlayers: 0
|
||||
stations:
|
||||
DryDockStation:
|
||||
stationProto: StandardNanotrasenStation
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
id: WhiteMoose
|
||||
mapName: 'WhiteMoose Station'
|
||||
mapPath: /Maps/White/WhiteMoose.yml
|
||||
minPlayers: 10
|
||||
minPlayers: 0
|
||||
stations:
|
||||
WhiteMooseStation:
|
||||
stationProto: StandardNanotrasenStation
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
id: WonderBox
|
||||
mapName: 'WonderBox Station'
|
||||
mapPath: /Maps/White/WonderBox.yml
|
||||
minPlayers: 20
|
||||
minPlayers: 0
|
||||
stations:
|
||||
WonderBoxStation:
|
||||
stationProto: StandardNanotrasenStation
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
id: Meta
|
||||
mapName: 'Meta Station'
|
||||
mapPath: /Maps/meta.yml
|
||||
minPlayers: 50
|
||||
minPlayers: 0
|
||||
stations:
|
||||
Meta:
|
||||
stationProto: StandardNanotrasenStation
|
||||
@@ -43,9 +43,9 @@
|
||||
Paramedic: [ 1, 1 ]
|
||||
#science
|
||||
ResearchDirector: [ 1, 1 ]
|
||||
SeniorResearcher: [ 1, 1 ]
|
||||
SeniorResearcher: [ 1, 1 ]
|
||||
Scientist: [ 4, 6 ]
|
||||
ResearchAssistant: [ 3, 6 ]
|
||||
ResearchAssistant: [ 3, 6 ]
|
||||
Borg: [ 2, 2 ]
|
||||
#security
|
||||
HeadOfSecurity: [ 1, 1 ]
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
- extended
|
||||
- shittersafari
|
||||
name: extended-title
|
||||
showInVote: false #2boring2vote
|
||||
showInVote: true # WD EDIT
|
||||
description: extended-description
|
||||
rules:
|
||||
- BasicStationEventScheduler
|
||||
@@ -46,7 +46,7 @@
|
||||
- greenshift
|
||||
- shittersafarideluxeedition
|
||||
name: greenshift-title
|
||||
showInVote: false #4boring4vote
|
||||
showInVote: true # WD EDIT
|
||||
description: greenshift-description
|
||||
rules:
|
||||
- BasicRoundstartVariation
|
||||
|
||||
Reference in New Issue
Block a user