Merge pull request #11110 from Hatterhat/hyper-96-aus-unk

you kids like extend votes?
This commit is contained in:
Ghom
2020-02-24 16:39:16 +01:00
committed by GitHub
12 changed files with 91 additions and 19 deletions
@@ -404,10 +404,6 @@
lowercase = FALSE
splitter = ","
/datum/config_entry/number/auto_transfer_delay
config_entry_value = 72000
min_val = 0
/datum/config_entry/flag/pai_custom_holoforms
/datum/config_entry/number/marauder_delay_non_reebe
@@ -82,6 +82,18 @@
config_entry_value = 600
min_val = 0
/datum/config_entry/number/vote_autotransfer_initial //length of time before the first autotransfer vote is called (deciseconds, default 2 hours)
config_entry_value = 72000
min_val = 0
/datum/config_entry/number/vote_autotransfer_interval //length of time to wait before subsequent autotransfer votes (deciseconds, default 30 minutes)
config_entry_value = 18000
min_val = 0
/datum/config_entry/number/vote_autotransfer_maximum // maximum extensions until the round autoends
config_entry_value = 4
min_val = 0
/datum/config_entry/flag/default_no_vote // vote does not default to nochange/norestart
/datum/config_entry/flag/no_dead_vote // dead people can't vote
@@ -0,0 +1,27 @@
SUBSYSTEM_DEF(autotransfer)
name = "Autotransfer Vote"
flags = SS_KEEP_TIMING | SS_BACKGROUND
wait = 1 MINUTES
var/starttime
var/targettime
var/voteinterval
var/maxvotes
var/curvotes
/datum/controller/subsystem/autotransfer/Initialize(timeofday)
starttime = world.time
targettime = starttime + CONFIG_GET(number/vote_autotransfer_initial)
voteinterval = CONFIG_GET(number/vote_autotransfer_interval)
maxvotes = CONFIG_GET(number/vote_autotransfer_maximum)
curvotes = 0
return ..()
/datum/controller/subsystem/autotransfer/fire()
if(maxvotes > curvotes)
if(world.time > targettime)
SSvote.initiate_vote("transfer",null) //TODO figure out how to not use null as the user
targettime = targettime + voteinterval
curvotes += 1
else
SSshuttle.autoEnd()
+8 -7
View File
@@ -55,7 +55,8 @@ SUBSYSTEM_DEF(shuttle)
var/lockdown = FALSE //disallow transit after nuke goes off
var/auto_call = 72000 //CIT CHANGE - time before in deciseconds in which the shuttle is auto called. Default is 2ish hours plus 15 for the shuttle. So total is 3.
var/endvote_passed = FALSE
var/realtimeofstart = 0
/datum/controller/subsystem/shuttle/Initialize(timeofday)
@@ -78,7 +79,6 @@ SUBSYSTEM_DEF(shuttle)
if(!supply)
WARNING("No /obj/docking_port/mobile/supply placed on the map!")
realtimeofstart = world.realtime
auto_call = CONFIG_GET(number/auto_transfer_delay)
return ..()
/datum/controller/subsystem/shuttle/proc/initial_load()
@@ -643,10 +643,11 @@ SUBSYSTEM_DEF(shuttle)
QDEL_LIST(remove_images)
/datum/controller/subsystem/shuttle/proc/autoEnd() //CIT CHANGE - allows shift to end after 2 hours have passed.
if((world.realtime - SSshuttle.realtimeofstart) > auto_call && EMERGENCY_IDLE_OR_RECALLED) //2 hours
/datum/controller/subsystem/shuttle/proc/autoEnd() //CIT CHANGE - allows shift to end without being a proper shuttle call?
if(EMERGENCY_IDLE_OR_RECALLED)
SSshuttle.emergency.request(silent = TRUE)
priority_announce("The shift has come to an end and the shuttle called. [seclevel2num(get_security_level()) == SEC_LEVEL_RED ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [emergency.timeLeft(600)] minutes.", null, "shuttlecalled", "Priority")
log_game("Round time limit reached. Shuttle has been auto-called.")
message_admins("Round time limit reached. Shuttle called.")
emergencyNoRecall = TRUE
log_game("Round end vote passed. Shuttle has been auto-called.")
message_admins("Round end vote passed. Shuttle has been auto-called.")
emergencyNoRecall = TRUE
endvote_passed = TRUE
+1 -1
View File
@@ -213,7 +213,7 @@ SUBSYSTEM_DEF(ticker)
check_queue()
check_maprotate()
scripture_states = scripture_unlock_alert(scripture_states)
SSshuttle.autoEnd()
//SSshuttle.autoEnd()
if(!roundend_check_paused && mode.check_finished(force_ending) || force_ending)
current_state = GAME_STATE_FINISHED
+24 -1
View File
@@ -89,6 +89,20 @@ SUBSYSTEM_DEF(vote)
choices[GLOB.master_mode] += non_voters.len
if(choices[GLOB.master_mode] >= greatest_votes)
greatest_votes = choices[GLOB.master_mode]
else if(mode == "transfer") // austation begin -- Crew autotransfer vote
var/factor = 1
switch(world.time / (1 MINUTES))
if(0 to 60)
factor = 0.5
if(61 to 120)
factor = 0.8
if(121 to 240)
factor = 1
if(241 to 300)
factor = 1.2
else
factor = 1.4
choices["Initiate Crew Transfer"] += round(non_voters.len * factor) // austation end
//get all options with that many votes and return them in a list
. = list()
if(greatest_votes)
@@ -365,6 +379,12 @@ SUBSYSTEM_DEF(vote)
log_admin("The map has been voted for and will change to: [VM.map_name]")
if(SSmapping.changemap(config.maplist[.]))
to_chat(world, "<span class='boldannounce'>The map vote has chosen [VM.map_name] for next round!</span>")
if("transfer") // austation begin -- Crew autotransfer vote
if(. == "Initiate Crew Transfer")
SSshuttle.autoEnd()
var/obj/machinery/computer/communications/C = locate() in GLOB.machines
if(C)
C.post_status("shuttle") // austation end
if(restart)
var/active_admins = 0
for(var/client/C in GLOB.admins)
@@ -444,6 +464,7 @@ SUBSYSTEM_DEF(vote)
to_chat(usr, "<span class='warning'>A vote was initiated recently, you must wait [DisplayTimeText(next_allowed_time-world.time)] before a new vote can be started!</span>")
return 0
SEND_SOUND(world, sound('sound/misc/notice2.ogg'))
reset()
obfuscated = hideresults //CIT CHANGE - adds obfuscated votes
switch(vote_type)
@@ -465,6 +486,8 @@ SUBSYSTEM_DEF(vote)
if(targetmap.max_round_search_span && count_occurences_of_value(lastmaps, M, targetmap.max_round_search_span) >= targetmap.max_rounds_played)
continue
choices |= M
if("transfer") // austation begin -- Crew autotranfer vote
choices.Add("Initiate Crew Transfer","Continue Playing") // austation end
if("roundtype") //CIT CHANGE - adds the roundstart secret/extended vote
choices.Add("secret", "extended")
if("mode tiers")
@@ -496,7 +519,7 @@ SUBSYSTEM_DEF(vote)
else
return 0
mode = vote_type
initiator = initiator_key
initiator = initiator_key ? initiator_key : "the Server" // austation -- Crew autotransfer vote
started_time = world.time
var/text = "[capitalize(mode)] vote started by [initiator]."
if(mode == "custom")