mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 18:13:35 +00:00
Voting changes
This commit is contained in:
@@ -7,7 +7,7 @@ datum/controller/transfer_controller
|
|||||||
var/shift_last_vote = 0 //VOREStation Edit
|
var/shift_last_vote = 0 //VOREStation Edit
|
||||||
datum/controller/transfer_controller/New()
|
datum/controller/transfer_controller/New()
|
||||||
timerbuffer = config.vote_autotransfer_initial
|
timerbuffer = config.vote_autotransfer_initial
|
||||||
shift_hard_end = config.vote_autotransfer_initial + (config.vote_autotransfer_interval * 3) //CHOMPStation Edit //Change this "1" to how many extend votes you want there to be.
|
shift_hard_end = config.vote_autotransfer_initial + (config.vote_autotransfer_interval * 2) //CHOMPStation Edit //Change this "1" to how many extend votes you want there to be. //Note: Fuck you whoever just slapped a number here instead of using the FUCKING CONFIG LIKE ALL THE OTHER NUMBERS HERE
|
||||||
shift_last_vote = shift_hard_end - config.vote_autotransfer_interval //VOREStation Edit
|
shift_last_vote = shift_hard_end - config.vote_autotransfer_interval //VOREStation Edit
|
||||||
START_PROCESSING(SSprocessing, src)
|
START_PROCESSING(SSprocessing, src)
|
||||||
|
|
||||||
|
|||||||
@@ -72,13 +72,24 @@ SUBSYSTEM_DEF(vote)
|
|||||||
/datum/controller/subsystem/vote/proc/get_result() // Get the highest number of votes
|
/datum/controller/subsystem/vote/proc/get_result() // Get the highest number of votes
|
||||||
var/greatest_votes = 0
|
var/greatest_votes = 0
|
||||||
var/total_votes = 0
|
var/total_votes = 0
|
||||||
|
//CHOMPEdit Begin
|
||||||
for(var/option in choices)
|
if(mode == VOTE_CREW_TRANSFER)
|
||||||
var/votes = choices[option]
|
var/transfer_votes = choices["Initiate Crew Transfer"]
|
||||||
total_votes += votes
|
var/extend_votes = choices["Extend the Shift"]
|
||||||
if(votes > greatest_votes)
|
total_votes = extend_votes + transfer_votes
|
||||||
greatest_votes = votes
|
if(transfer_votes / total_votes > 0.7)
|
||||||
|
greatest_votes = transfer_votes
|
||||||
|
. = list("Initiate Crew Transfer")
|
||||||
|
else
|
||||||
|
greatest_votes = extend_votes
|
||||||
|
. = list("Extend the Shift")
|
||||||
|
else
|
||||||
|
for(var/option in choices)
|
||||||
|
var/votes = choices[option]
|
||||||
|
total_votes += votes
|
||||||
|
if(votes > greatest_votes)
|
||||||
|
greatest_votes = votes
|
||||||
|
//CHOMPEdit End
|
||||||
if(!config.vote_no_default && choices.len) // Default-vote for everyone who didn't vote
|
if(!config.vote_no_default && choices.len) // Default-vote for everyone who didn't vote
|
||||||
var/non_voters = (GLOB.clients.len - total_votes)
|
var/non_voters = (GLOB.clients.len - total_votes)
|
||||||
if(non_voters > 0)
|
if(non_voters > 0)
|
||||||
@@ -107,12 +118,14 @@ SUBSYSTEM_DEF(vote)
|
|||||||
choices["Initiate Crew Transfer"] = round(choices["Initiate Crew Transfer"] * factor)
|
choices["Initiate Crew Transfer"] = round(choices["Initiate Crew Transfer"] * factor)
|
||||||
to_world("<font color='purple'>Crew Transfer Factor: [factor]</font>")
|
to_world("<font color='purple'>Crew Transfer Factor: [factor]</font>")
|
||||||
greatest_votes = max(choices["Initiate Crew Transfer"], choices["Extend the Shift"]) //VOREStation Edit
|
greatest_votes = max(choices["Initiate Crew Transfer"], choices["Extend the Shift"]) //VOREStation Edit
|
||||||
|
//CHOMPEdit Begin
|
||||||
. = list() // Get all options with that many votes and return them in a list
|
if(!(mode == VOTE_CREW_TRANSFER))
|
||||||
if(greatest_votes)
|
. = list() // Get all options with that many votes and return them in a list
|
||||||
for(var/option in choices)
|
if(greatest_votes)
|
||||||
if(choices[option] == greatest_votes)
|
for(var/option in choices)
|
||||||
. += option
|
if(choices[option] == greatest_votes)
|
||||||
|
. += option
|
||||||
|
//CHOMPEdit End
|
||||||
|
|
||||||
/datum/controller/subsystem/vote/proc/announce_result()
|
/datum/controller/subsystem/vote/proc/announce_result()
|
||||||
var/list/winners = get_result()
|
var/list/winners = get_result()
|
||||||
|
|||||||
Reference in New Issue
Block a user