Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Content.Server/RoundEnd/RoundEndSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ public override void Update(float frameTime)
{
if (!_shuttle.EmergencyShuttleArrived && ExpectedCountdownEnd is null)
{
RequestRoundEnd(checkCooldown: false, text: "round-end-system-shuttle-auto-called-announcement");
CallEvacuationVote(); // DeltaV - call OOC vote for ending round
// RequestRoundEnd(checkCooldown: false, text: "round-end-system-shuttle-auto-called-announcement");
_autoCalledBefore = true;
}

Expand Down
31 changes: 31 additions & 0 deletions Content.Server/_DVA/RoundEnd/RoundEndSystem.EvacVote.cs
Comment thread
nlaky marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Voting.Managers;
using Content.Server.Voting;
using Content.Shared._DVA.CCVars;

namespace Content.Server.RoundEnd;

public sealed partial class RoundEndSystem : EntitySystem
{
[Dependency] IVoteManager _vote = default!;

public void CallEvacuationVote()
{
var options = new VoteOptions
{
Title = Loc.GetString("round-end-system-vote-title"),
Duration = _cfg.GetCVar(DCCVars.EmergencyShuttleVoteTime),
InitiatorText = Loc.GetString("vote-options-server-initiator-text")
};

options.Options.Add((Loc.GetString("round-end-system-vote-end"), true));
options.Options.Add((Loc.GetString("round-end-system-vote-continue"), false));

var vote = _vote.CreateVote(options);

vote.OnFinished += (_, args) =>
{
if (args.Winner == null || (bool)args.Winner)
RequestRoundEnd(checkCooldown: false, text: "round-end-system-vote-shuttle-called-announcement");
};
}
}
8 changes: 8 additions & 0 deletions Content.Shared/_DVA/CCVars/DCCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public sealed partial class DCCVars
* Misc.
*/

/* OOC shuttle vote */

/// <summary>
/// How long players should have to vote on the round end shuttle being sent
/// </summary>
public static readonly CVarDef<TimeSpan> EmergencyShuttleVoteTime =
CVarDef.Create("shuttle.vote_time", TimeSpan.FromMinutes(1), CVar.SERVER);

/// <summary>
/// The total time a player has to be SSD to be considered cryoable (stage 3).
/// Default is 20 minutes. Value should be bigger than <see cref="SsdIndicatorRecentAfterSeconds"/>.
Expand Down
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/_DVA/roundend/round-end-system.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
round-end-system-vote-title = Should the shift end?
round-end-system-vote-end = Initiate Crew Transfer
round-end-system-vote-continue = Continue Round
round-end-system-vote-shuttle-called-announcement = An automatic crew shift change shuttle has been sent. ETA: {$time} {$units}.
Loading