mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Merge pull request #3262 from Zuhayr/feature
Replaces forcedrafting with voter drafting, removes visible tallies from votes.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
var/datum/controller/vote/vote = new()
|
||||
|
||||
var/global/list/round_voters = list() //Keeps track of the individuals voting for a given round, for use in forcedrafting.
|
||||
|
||||
datum/controller/vote
|
||||
var/initiator = null
|
||||
var/started_time = null
|
||||
@@ -119,6 +121,11 @@ datum/controller/vote
|
||||
for(var/option in winners)
|
||||
text += "\t[option]\n"
|
||||
. = pick(winners)
|
||||
|
||||
for(var/key in current_votes)
|
||||
if(choices[current_votes[key]] == .)
|
||||
round_voters += key // Keep track of who voted for the winning round.
|
||||
|
||||
text += "<b>Vote Result: [.]</b>"
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
@@ -270,9 +277,9 @@ datum/controller/vote
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes) votes = 0
|
||||
if(current_votes[C.ckey] == i)
|
||||
. += "<li><b><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</b></li>"
|
||||
. += "<li><b><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></b></li>"
|
||||
else
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></li>"
|
||||
|
||||
. += "</ul><hr>"
|
||||
if(admin)
|
||||
|
||||
@@ -264,8 +264,8 @@ Implants;
|
||||
/datum/game_mode/proc/get_players_for_role(var/role, override_jobbans=0)
|
||||
var/list/players = list()
|
||||
var/list/candidates = list()
|
||||
var/list/drafted = list()
|
||||
var/datum/mind/applicant = null
|
||||
//var/list/drafted = list()
|
||||
//var/datum/mind/applicant = null
|
||||
|
||||
var/roletext
|
||||
switch(role)
|
||||
@@ -277,29 +277,40 @@ Implants;
|
||||
if(BE_CULTIST) roletext="cultist"
|
||||
if(BE_NINJA) roletext="ninja"
|
||||
|
||||
// Ultimate randomizing code right here
|
||||
// Assemble a list of active players without jobbans.
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.client && player.ready)
|
||||
players += player
|
||||
if( player.client && player.ready )
|
||||
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext))
|
||||
players += player
|
||||
|
||||
// Shuffling, the players list is now ping-independent!!!
|
||||
// Goodbye antag dante
|
||||
// Shuffle the players list so that it becomes ping-independent.
|
||||
players = shuffle(players)
|
||||
|
||||
// Get a list of all the people who want to be the antagonist for this round
|
||||
for(var/mob/new_player/player in players)
|
||||
if(player.client && player.ready)
|
||||
if(player.client.prefs.be_special & role)
|
||||
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans
|
||||
candidates += player.mind // Get a list of all the people who want to be the antagonist for this round
|
||||
log_debug("[player.key] had [roletext] enabled, so drafting them.")
|
||||
if(player.client.prefs.be_special & role)
|
||||
log_debug("[player.key] had [roletext] enabled, so we are drafting them.")
|
||||
candidates += player.mind
|
||||
players -= player
|
||||
|
||||
// If we don't have enough antags, draft people who voted for the round.
|
||||
if(candidates.len < recommended_enemies)
|
||||
for(var/key in round_voters)
|
||||
for(var/mob/new_player/player in players)
|
||||
if(player.ckey == key)
|
||||
log_debug("[player.key] voted for this round, so we are drafting them.")
|
||||
candidates += player.mind
|
||||
players -= player
|
||||
break
|
||||
|
||||
// Remove candidates who want to be antagonist but have a job that precludes it
|
||||
if(restricted_jobs)
|
||||
for(var/datum/mind/player in candidates)
|
||||
for(var/job in restricted_jobs) // Remove people who want to be antagonist but have a job already that precludes it
|
||||
for(var/job in restricted_jobs)
|
||||
if(player.assigned_role == job)
|
||||
candidates -= player
|
||||
|
||||
if(candidates.len < recommended_enemies)
|
||||
/*if(candidates.len < recommended_enemies)
|
||||
for(var/mob/new_player/player in players)
|
||||
if(player.client && player.ready)
|
||||
if(!(player.client.prefs.be_special & role)) // We don't have enough people who want to be antagonist, make a seperate list of people who don't want to be one
|
||||
@@ -349,6 +360,7 @@ Implants;
|
||||
|
||||
else // Not enough scrubs, ABORT ABORT ABORT
|
||||
break
|
||||
*/
|
||||
|
||||
return candidates // Returns: The number of people who had the antagonist role set to yes, regardless of recomended_enemies, if that number is greater than recommended_enemies
|
||||
// recommended_enemies if the number of people with that role set to yes is less than recomended_enemies,
|
||||
|
||||
Reference in New Issue
Block a user