nightshift changes

This commit is contained in:
kevinz000
2020-01-02 23:56:40 -08:00
parent 82db38d5d6
commit 8e1affa1f5
7 changed files with 128 additions and 65 deletions
@@ -362,6 +362,15 @@
/datum/config_entry/flag/enable_night_shifts
/datum/config_entry/number/night_shift_public_areas_only
config_entry_value = NIGHTSHIFT_AREA_PUBLIC
/datum/config_entry/flag/nightshift_toggle_requires_auth
config_entry_value = FALSE
/datum/config_entry/flag/nightshift_toggle_public_requires_auth
config_entry_value = TRUE
/datum/config_entry/flag/randomize_shift_time
/datum/config_entry/flag/shift_time_realtime
+4 -4
View File
@@ -35,21 +35,21 @@ SUBSYSTEM_DEF(nightshift)
if(!emergency)
announce("Restoring night lighting configuration to normal operation.")
else
announce("Disabling night lighting: Station is in a state of emergency.")
announce("Disabling night lighting: Station is in a state of emergency.")
if(emergency)
night_time = FALSE
if(nightshift_active != night_time)
update_nightshift(night_time, announcing)
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE)
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE, max_level = (!active? INFINITY : CONFIG_GET(number/night_shift_public_area_only)))
nightshift_active = active
if(announce)
if (active)
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
else
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
var/public_only = CONFIG_GET(number/night_shift_public_area_only)
for(var/A in GLOB.apcs_list)
var/obj/machinery/power/apc/APC = A
if (APC.area && (APC.area.type in GLOB.the_station_areas))
if(APC.area && (!max_level || !APC.area.nightshift_public_area || (APC.area.nightshift_public_area <= max_level)) && (APC.area.type in GLOB.the_station_areas))
APC.set_nightshift(active)
CHECK_TICK