Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes transfer votes way less annoying #4091

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ SUBSYSTEM_DEF(vote)
generated_actions += voting_action

if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/toggle/sound_announcements)))
SEND_SOUND(new_voter, sound(current_vote.vote_sound))
SEND_SOUND(new_voter, sound(current_vote.vote_sound, volume = current_vote.vote_sound_volume)) // monkestation edit

return TRUE

Expand Down
4 changes: 4 additions & 0 deletions monkestation/code/datums/votes/_vote_datum.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/datum/vote
/// The volume of the vote sound, from 0 to 100 or above.
var/vote_sound_volume = 100

/datum/vote/proc/can_vote(mob/voter)
return TRUE
19 changes: 19 additions & 0 deletions monkestation/code/datums/votes/transfer_vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
CHOICE_CONTINUE,
)
player_startable = FALSE
vote_sound_volume = 150 // Make it loud so people don't miss it.

/datum/vote/shuttle_call/reset()
. = ..()
Expand All @@ -29,6 +30,12 @@
/datum/vote/shuttle_call/initiate_vote(initiator, duration)
. = ..()
SSautotransfer.doing_transfer_vote = TRUE
priority_announce(
text = "The shift has eclipsed its standard duration. If the crew wish to leave, a scheduled shuttle will be sent to the station from Central Command.",
title = "Crew Transfer Vote",
has_important_message = TRUE,
color_override = "green",
)

/datum/vote/shuttle_call/finalize_vote(winning_option)
switch(winning_option)
Expand All @@ -46,5 +53,17 @@
if(isobserver(voter) || voter.stat == DEAD || !(voter.ckey in GLOB.joined_player_list)) // only living crew gets to vote
return FALSE

/datum/vote/shuttle_call/tiebreaker(list/winners)
return CHOICE_CONTINUE // Generally, this is less likely to make people mad. It still can, don't get me wrong, but it's safer.

/datum/vote/shuttle_call/get_vote_result(list/non_voters)
for(var/ckey in non_voters)
var/client/client = non_voters[ckey]
if(client?.mob && can_vote(client.mob))
choices[CHOICE_CONTINUE]++ // Everyone defaults to continue, since they may be in the middle of something when the vote starts.
if(choices[CHOICE_CALL] + choices[CHOICE_CONTINUE] <= 0) // No-one is alive. Call it.
return CHOICE_CALL
return ..()

#undef CHOICE_CONTINUE
#undef CHOICE_CALL
Loading