From c28d8ff7d0680f2aaae757cfd896db5e555a1de5 Mon Sep 17 00:00:00 2001 From: Incoming Date: Tue, 3 Mar 2015 16:39:01 -0500 Subject: [PATCH] Adds the ability for admins to "take the shot" and end rounds at their discretion. This is behind a two confirmation gate with a 20 second reflection period between them. All this is logged. When mulligan antag is set to kick in, the suggestion for admins to end the round if they feel enough has happened is given. The option can also be found on the check antagonist panel. The check antagonist panel will show what the muligan roundtype is if it exists. If absolutely no one wants/can be the midround antags, the round ends there. The round will end no matter what if the primary antagonist survived over an hour before biting it (unless the shuttle is already past the point of no return, in which case a peaceful ending takes priority) Adds force_ending to VV editing protection, to avoid admins trying to shinanigans it on. --- code/controllers/subsystem/ticker.dm | 3 ++- code/game/gamemodes/game_mode.dm | 11 ++++++++--- code/modules/admin/player_panel.dm | 3 +++ code/modules/admin/topic.dm | 15 +++++++++++++++ code/modules/admin/verbs/modifyvariables.dm | 2 +- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index dac80e068a2..06e7ee4327c 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -9,6 +9,7 @@ var/datum/subsystem/ticker/ticker var/restart_timeout = 250 //delay when restarting server var/current_state = GAME_STATE_STARTUP //state of current round (used by process()) Use the defines GAME_STATE_* ! + var/force_ending = 0 //Round was ended by admin intervention var/hide_mode = 0 var/datum/game_mode/mode = null @@ -91,7 +92,7 @@ var/datum/subsystem/ticker/ticker if(GAME_STATE_PLAYING) mode.process(wait * 0.1) - if(!mode.explosion_in_progress && mode.check_finished()) + if(!mode.explosion_in_progress && mode.check_finished() || force_ending) current_state = GAME_STATE_FINISHED auto_toggle_ooc(1) // Turn it on declare_completion() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 04fa08b5a57..8a27e9f8a92 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -29,6 +29,7 @@ var/pre_setup_before_jobs = 0 var/antag_flag = null //preferences flag such as BE_WIZARD that need to be turned on for players to be antag var/datum/mind/sacrifice_target = null + var/list/datum/game_mode/replacementmode = null var/round_converted = 0 var/reroll_friendly //During mode conversion only these are in the running var/enemy_minimum_age = 7 //How many days must players have been playing before they can play this antagonist @@ -102,7 +103,7 @@ if(!runnable_modes) return 0 - var/list/datum/game_mode/replacementmode = pickweight(runnable_modes) + replacementmode = pickweight(runnable_modes) switch(SSshuttle.emergency.mode) //Rounds on the verge of ending don't get new antags, they just run out if(SHUTTLE_STRANDED, SHUTTLE_ESCAPE) @@ -111,6 +112,9 @@ if(SSshuttle.emergency.timeLeft(1) < initial(SSshuttle.emergencyCallTime)*0.5) return 1 + if(world.time >= 36000) //If it's been over an hour, just end it + return 0 + var/living_crew = 0 for(var/mob/Player in mob_list) @@ -126,8 +130,7 @@ antag_canadates += H if(!antag_canadates) - message_admins("The roundtype has been converted, antagonists may have been created") - return 1 + return 0 antag_canadates = shuffle(antag_canadates) @@ -136,6 +139,8 @@ if(config.protect_assistant_from_antagonist) replacementmode.restricted_jobs += "Assistant" + message_admins("The roundtype will be converted. If you feel that the round should not continue, end the round now.") + spawn(rand(1800,4200)) //somewhere between 3 and 7 minutes from now for(var/mob/living/carbon/human/H in antag_canadates) replacementmode.make_antag_chance(H) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 2e13a806984..10af3669fc4 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -368,6 +368,8 @@ if (ticker && ticker.current_state >= GAME_STATE_PLAYING) var/dat = "Round Status

Round Status

" dat += "Current Game Mode: [ticker.mode.name]
" + if(ticker.mode.replacementmode) + dat += "Replacement Game Mode: [ticker.mode.replacementmode.name]
" dat += "Round Duration: [round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]
" dat += "Emergency shuttle
" if(SSshuttle.emergency.mode < SHUTTLE_CALL) @@ -379,6 +381,7 @@ dat += "Send Back
" else dat += "ETA: [(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]
" + dat += "End Round Now
" dat += "[ticker.delay_end ? "End Round Normally" : "Delay Round End"]
" if(ticker.mode.syndicates.len) dat += "
" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ddb5f5c3868..43aa60f2f6b 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -226,6 +226,21 @@ message_admins("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].") href_list["secretsadmin"] = "check_antagonist" + else if(href_list["end_round"]) + if(!check_rights(R_ADMIN)) return + + message_admins("[key_name_admin(usr)] is considering ending the round.") + if(alert(usr, "This will end the round, are you SURE you want to do this?", "Confirmation", "Yes", "No") == "Yes") + spawn(200) //I wish you would step back from that ledge my friend + if(alert(usr, "Final Confirmation: End the round NOW?", "Confirmation", "Yes", "No") == "Yes") + message_admins("[key_name_admin(usr)] has ended the round.") + ticker.force_ending = 1 //Yeah there we go APC destroyed mission accomplished + return + else + message_admins("[key_name_admin(usr)] decided against ending the round.") + else + message_admins("[key_name_admin(usr)] decided against ending the round.") + else if(href_list["simplemake"]) if(!check_rights(R_SPAWN)) return diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 79ce1fb1f6a..f14df6a3fc9 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -5,7 +5,7 @@ var/list/forbidden_varedit_object_types = list( /datum/admin_rank //editing my own rank? it's more likely than you think ) -var/list/VVlocked = list("vars", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "step_x", "step_y") +var/list/VVlocked = list("vars", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "step_x", "step_y", "force_ending") var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays") var/list/VVckey_edit = list("key", "ckey")
Syndicates