Autovote System

This commit is contained in:
ZomgPonies
2013-09-26 06:46:33 -04:00
parent dadbd68741
commit 20444650a9
3 changed files with 34 additions and 8 deletions
+4 -2
View File
@@ -27,6 +27,8 @@
var/allow_admin_rev = 1 // allows admin revives
var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default)
var/vote_period = 600 // length of voting period (deciseconds, default 1 minute)
var/vote_autotransfer_initial = 108000 // Length of time before the first autotransfer vote is called
var/vote_autotransfer_interval = 3600 // length of time before next sequential autotransfer vote
var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi)
var/vote_no_dead = 0 // dead people can't vote (tbi)
// var/enable_authentication = 0 // goon authentication
@@ -47,10 +49,10 @@
var/list/votable_modes = list() // votable modes
var/list/probabilities = list() // relative probability of each mode
var/humans_need_surnames = 0
var/allow_random_events = 0 // enables random events mid-round when set to 1
var/allow_random_events = 1 // enables random events mid-round when set to 1
var/allow_ai = 1 // allow ai job
var/hostedby = null
var/respawn = 1
var/respawn = 0
var/guest_jobban = 1
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players
+17 -6
View File
@@ -46,6 +46,9 @@ datum/controller/vote
voting.Cut()
proc/autotransfer()
initiate_vote("crew_transfer","the server")
proc/reset()
initiator = null
time_remaining = 0
@@ -202,10 +205,18 @@ datum/controller/vote
return 0
choices.Add(config.votable_modes)
if("crew_transfer")
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
if (check_rights(R_ADMIN) || check_rights(R_MOD))
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
else
if (get_security_level() == "red" || get_security_level() == "delta")
return 0
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
if("custom")
question = html_encode(input(usr,"What is the vote for?") as text|null)
if(!question) return 0
@@ -278,9 +289,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></b></li>"
. += "<li><b><a href='?src=\ref[src];vote=[i]'>[choices[i]] ([votes] votes)</a></b></li>"
else
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></li>"
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]] ([votes] votes)</a></li>"
. += "</ul><hr>"
if(admin)