mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
Autovote System
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -35,6 +35,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
var/delay_end = 0 //if set to nonzero, the round will not restart on it's own
|
||||
|
||||
var/triai = 0//Global holder for Triumvirate
|
||||
var/initialtpass = 0 //holder for inital autotransfer vote timer
|
||||
|
||||
/datum/controller/gameticker/proc/pregame()
|
||||
login_music = pick(\
|
||||
@@ -56,6 +57,17 @@ var/global/datum/controller/gameticker/ticker
|
||||
current_state = GAME_STATE_SETTING_UP
|
||||
while (!setup())
|
||||
|
||||
/datum/controller/gameticker/proc/votetimer()
|
||||
var/timerbuffer = 0
|
||||
if (initialtpass == 0)
|
||||
timerbuffer = config.vote_autotransfer_initial
|
||||
else
|
||||
timerbuffer = config.vote_autotransfer_interval
|
||||
sleep(timerbuffer)
|
||||
vote.autotransfer()
|
||||
initialtpass = 1
|
||||
votetimer()
|
||||
|
||||
/datum/controller/gameticker/proc/setup()
|
||||
//Create and announce mode
|
||||
if(master_mode=="secret")
|
||||
@@ -153,6 +165,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
spawn(3000)
|
||||
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
|
||||
|
||||
votetimer()
|
||||
return 1
|
||||
|
||||
/datum/controller/gameticker
|
||||
|
||||
Reference in New Issue
Block a user