diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index dba2b9a506b..430e85cdbb3 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -98,11 +98,8 @@ var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling - var/continuous_round_rev = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke. - var/continuous_round_gang = 0 - var/continuous_round_wiz = 0 - var/continuous_round_malf = 0 - var/continuous_round_blob = 0 + var/list/continuous = list() // which roundtypes continue if all antagonists die + var/list/midround_antag = list() // which roundtypes use the midround antagonist system var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist var/shuttle_refuel_delay = 12000 @@ -397,16 +394,18 @@ config.sec_start_brig = 1 if("gateway_delay") config.gateway_delay = text2num(value) - if("continuous_round_rev") - config.continuous_round_rev = 1 - if("continuous_round_gang") - config.continuous_round_gang = 1 - if("continuous_round_wiz") - config.continuous_round_wiz = 1 - if("continuous_round_malf") - config.continuous_round_malf = 1 - if("continuous_round_blob") - config.continuous_round_blob = 1 + if("continuous") + var/mode_name = lowertext(value) + if(mode_name in config.modes) + config.continuous[mode_name] = 1 + else + diary << "Unknown continuous configuration definition: [mode_name]." + if("midround_antag") + var/mode_name = lowertext(value) + if(mode_name in config.modes) + config.midround_antag[mode_name] = 1 + else + diary << "Unknown midround antagonist configuration definition: [mode_name]." if("midround_antag_time_check") config.midround_antag_time_check = text2num(value) if("midround_antag_life_check") diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm index 32073430a46..c16c462e1a1 100644 --- a/code/game/gamemodes/blob/blob_finish.dm +++ b/code/game/gamemodes/blob/blob_finish.dm @@ -1,4 +1,6 @@ /datum/game_mode/blob/check_finished() + if(replacementmode && round_converted == 2) + return replacementmode.check_finished() if(round_converted) return ..() if(infected_crew.len > burst)//Some blobs have yet to burst @@ -6,15 +8,16 @@ if(blobwincount <= blobs.len)//Blob took over return 1 if(!blob_cores.len) // blob is dead - if(config.continuous_round_blob) - round_converted = convert_roundtype() - if(!round_converted) - return 1 + if(config.continuous["blob"]) + if(config.midround_antag["blob"]) + round_converted = convert_roundtype() + if(!round_converted) + return 1 if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time priority_announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg', "Priority") - return 0 + return ..() return 1 if(station_was_nuked)//Nuke went off return 1 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 6794f75137b..7be427bcb97 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -150,9 +150,12 @@ 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.") + message_admins("The roundtype will be converted. If you have other plans for the station or think the round should end stop the creation of antags or end the round now.") - spawn(rand(1800,4200)) //somewhere between 3 and 7 minutes from now + spawn(rand(1200,3000)) //somewhere between 2 and 5 minutes from now + if(!config.midround_antag[ticker.mode.config_tag]) + round_converted = 0 + return 1 for(var/mob/living/carbon/human/H in antag_canadates) replacementmode.make_antag_chance(H) round_converted = 2 diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 76d11848dfe..f64e6e6c438 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -220,7 +220,7 @@ //Checks if the round is over// /////////////////////////////// /datum/game_mode/gang/check_finished() - if(finished && !config.continuous_round_gang) //Check for Gang Boss death + if(finished && !config.continuous["gang"]) //Check for Gang Boss death return 1 return ..() //Check for evacuation/nuke diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index f9a33fb2308..42d4635bc2e 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -170,12 +170,14 @@ /datum/game_mode/malfunction/check_finished() - if(round_converted) - return ..() + if(replacementmode && round_converted == 2) + return replacementmode.check_finished() + if((config.continuous["malfunction"] && !config.midround_antag["malfunction"]) || round_converted == 1) //No reason to waste resources + return ..() //Check for evacuation/nuke if (station_captured && !to_nuke_or_not_to_nuke) return 1 if (is_malf_ai_dead() || !check_ai_loc()) - if(config.continuous_round_malf) + if(config.continuous["malfunction"]) if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 5e6433647f4..8a31deb551c 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -213,7 +213,7 @@ //Checks if the round is over// /////////////////////////////// /datum/game_mode/revolution/check_finished() - if(config.continuous_round_rev) + if(config.continuous["revolution"]) if(finished != 0) SSshuttle.emergencyNoEscape = 0 return ..() diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index b6a7df9996f..4a946eb6f4b 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -171,30 +171,24 @@ /datum/game_mode/wizard/check_finished() - if(round_converted) - return ..() + if(replacementmode && round_converted == 2) + return replacementmode.check_finished() + + if((config.continuous["wizard"] && !config.midround_antag["wizard"]) || round_converted == 1 || !wizards) //No reason to waste resources + return ..() //Check for evacuation/nuke - var/wizards_alive = 0 - var/traitors_alive = 0 for(var/datum/mind/wizard in wizards) - if(!istype(wizard.current,/mob/living/carbon)) - continue - if(wizard.current.stat==2) - continue - wizards_alive++ + if(wizard.current.stat != DEAD) + return ..() - if(!wizards_alive) - for(var/datum/mind/traitor in traitors) - if(!istype(traitor.current,/mob/living/carbon)) - continue - if(traitor.current.stat==2) - continue - traitors_alive++ + for(var/datum/mind/traitor in traitors) + if(traitor.current.stat != DEAD) + return ..() - if (wizards_alive || traitors_alive) - return ..() + if(!config.continuous["wizard"] || !config.midround_antag["wizard"]) + return 1 - if(config.continuous_round_wiz) + else round_converted = convert_roundtype() if(!round_converted) finished = 1 @@ -203,10 +197,7 @@ if(SSevent.wizardmode) //If summon events was active, turn it off SSevent.toggleWizardmode() SSevent.resetFrequency() - return ..() - - finished = 1 - return 1 + return ..() /datum/game_mode/wizard/declare_completion() if(finished) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 4b50cfa3af0..8810c6f98e0 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -305,6 +305,8 @@ usr << browse(dat, "window=players;size=600x480") /datum/admins/proc/check_antagonists() + var/list/supported_continuous_modes = list("revolution", "gang", "wizard", "malfunction", "blob") + var/list/supported_midround_antag_modes = list("wizard", "malfunction", "blob") if (ticker && ticker.current_state >= GAME_STATE_PLAYING) var/dat = "