Демократия
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
|
id: DryDock
|
||||||
mapName: 'DryDock Station'
|
mapName: 'DryDock Station'
|
||||||
mapPath: /Maps/White/DryDock.yml
|
mapPath: /Maps/White/DryDock.yml
|
||||||
minPlayers: 10
|
minPlayers: 0
|
||||||
stations:
|
stations:
|
||||||
DryDockStation:
|
DryDockStation:
|
||||||
stationProto: StandardNanotrasenStation
|
stationProto: StandardNanotrasenStation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
id: WhiteMoose
|
id: WhiteMoose
|
||||||
mapName: 'WhiteMoose Station'
|
mapName: 'WhiteMoose Station'
|
||||||
mapPath: /Maps/White/WhiteMoose.yml
|
mapPath: /Maps/White/WhiteMoose.yml
|
||||||
minPlayers: 10
|
minPlayers: 0
|
||||||
stations:
|
stations:
|
||||||
WhiteMooseStation:
|
WhiteMooseStation:
|
||||||
stationProto: StandardNanotrasenStation
|
stationProto: StandardNanotrasenStation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
id: WonderBox
|
id: WonderBox
|
||||||
mapName: 'WonderBox Station'
|
mapName: 'WonderBox Station'
|
||||||
mapPath: /Maps/White/WonderBox.yml
|
mapPath: /Maps/White/WonderBox.yml
|
||||||
minPlayers: 20
|
minPlayers: 0
|
||||||
stations:
|
stations:
|
||||||
WonderBoxStation:
|
WonderBoxStation:
|
||||||
stationProto: StandardNanotrasenStation
|
stationProto: StandardNanotrasenStation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
id: Meta
|
id: Meta
|
||||||
mapName: 'Meta Station'
|
mapName: 'Meta Station'
|
||||||
mapPath: /Maps/meta.yml
|
mapPath: /Maps/meta.yml
|
||||||
minPlayers: 50
|
minPlayers: 0
|
||||||
stations:
|
stations:
|
||||||
Meta:
|
Meta:
|
||||||
stationProto: StandardNanotrasenStation
|
stationProto: StandardNanotrasenStation
|
||||||
@@ -43,9 +43,9 @@
|
|||||||
Paramedic: [ 1, 1 ]
|
Paramedic: [ 1, 1 ]
|
||||||
#science
|
#science
|
||||||
ResearchDirector: [ 1, 1 ]
|
ResearchDirector: [ 1, 1 ]
|
||||||
SeniorResearcher: [ 1, 1 ]
|
SeniorResearcher: [ 1, 1 ]
|
||||||
Scientist: [ 4, 6 ]
|
Scientist: [ 4, 6 ]
|
||||||
ResearchAssistant: [ 3, 6 ]
|
ResearchAssistant: [ 3, 6 ]
|
||||||
Borg: [ 2, 2 ]
|
Borg: [ 2, 2 ]
|
||||||
#security
|
#security
|
||||||
HeadOfSecurity: [ 1, 1 ]
|
HeadOfSecurity: [ 1, 1 ]
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
- extended
|
- extended
|
||||||
- shittersafari
|
- shittersafari
|
||||||
name: extended-title
|
name: extended-title
|
||||||
showInVote: false #2boring2vote
|
showInVote: true # WD EDIT
|
||||||
description: extended-description
|
description: extended-description
|
||||||
rules:
|
rules:
|
||||||
- BasicStationEventScheduler
|
- BasicStationEventScheduler
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
- greenshift
|
- greenshift
|
||||||
- shittersafarideluxeedition
|
- shittersafarideluxeedition
|
||||||
name: greenshift-title
|
name: greenshift-title
|
||||||
showInVote: false #4boring4vote
|
showInVote: true # WD EDIT
|
||||||
description: greenshift-description
|
description: greenshift-description
|
||||||
rules:
|
rules:
|
||||||
- BasicRoundstartVariation
|
- BasicRoundstartVariation
|
||||||
|
|||||||
Reference in New Issue
Block a user