diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index 822025ee35..f6cd6d9082 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -36,6 +36,7 @@ var/list/modes = list() // allowed modes var/list/votable_modes = list() // votable modes var/list/probabilities = list() // relative probability of each mode + var/allow_random_events = 0 // enables random events mid-round when set to 1 var/allow_ai = 1 // allow ai job var/hostedby = null var/respawn = 1 @@ -245,7 +246,10 @@ else diary << "Incorrect probability configuration definition: [prob_name] [prob_value]." - if ("kick_inactive") + if("allow_random_events") + config.allow_random_events = 1 + + if("kick_inactive") config.kick_inactive = 1 if("load_jobs_from_txt") diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 726a03b8db..197ee13c8f 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -2,7 +2,7 @@ if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station spawn(1) dust_swarm("weak") - if (!event && prob(eventchance)) + if (!event && prob(eventchance) && config.allow_random_events) //CARN: checks to see if random events are enabled. event() hadevent = 1 spawn(1300) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 583f359277..575a3276e3 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -115,9 +115,13 @@ var/global/datum/controller/gameticker/ticker world << sound('welcome.ogg') // Skie spawn (3000) - start_events() - spawn ((18000+rand(3000))) - event() + start_events() //handles random events and space dust. + + //CARN: Seems supefluous so I commented it out. Start_events already handles random events nicely. + //spawn ((18000+rand(3000))) + // if (config.allow_random_events) + // event() + spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE //Start master_controller.process() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ccde233def..bfabbc85b3 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -25,7 +25,7 @@ holder.rank = rank if(!holder.state) - var/state = alert("Which state do you the admin to begin in?", "Admin-state", "Play", "Observe", "Neither") + var/state = alert("Which state do you want the admin to begin in?", "Admin-state", "Play", "Observe", "Neither") if(state == "Play") holder.state = 1 admin_play() @@ -173,6 +173,7 @@ verbs += /client/proc/cmd_switch_radio // BEEP BOOP FARTE -- Doohl verbs += /client/proc/toggle_gravity_on verbs += /client/proc/toggle_gravity_off + verbs += /client/proc/toggle_random_events if (holder.level >= 4)//Badmin******************************************************************** verbs += /obj/admins/proc/adrev //toggle admin revives @@ -403,6 +404,7 @@ verbs -= /client/proc/player_panel_new verbs -= /client/proc/toggle_gravity_on verbs -= /client/proc/toggle_gravity_off + verbs -= /client/proc/toggle_random_events return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 20a13a4b30..97ac9aaf1d 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -876,6 +876,16 @@ Traitors and the like can also be revived with the previous role mostly intact. command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.") - - - +//CARN +/client/proc/toggle_random_events() + set category = "Server" + set name = "Toggle random events on/off" + set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off" + if(!config.allow_random_events) + config.allow_random_events = 1 + usr << "Random events enabled" + message_admins("Admin [key_name_admin(usr)] has enabled random events.", 1) + else + config.allow_random_events = 0 + usr << "Random events disabled" + message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1) diff --git a/config/config.txt b/config/config.txt index 7e4ab713c9..f5af8f0a03 100644 --- a/config/config.txt +++ b/config/config.txt @@ -64,6 +64,10 @@ PROBABILITY CHANGELING 0 PROBABILITY CULT 1 PROBABILITY MONKEY 0 PROBABILITY TRAITORCHAN 0 + +## Hash out to disable random events during the round. +ALLOW_RANDOM_EVENTS + ## if amount of traitors scales or not #TRAITOR_SCALING