mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Merge remote-tracking branch 'upstream/master' into gc-ss-port
# Conflicts: # paradise.dme
This commit is contained in:
@@ -13,6 +13,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
|
||||
var/emergencyCallTime = 6000 //time taken for emergency shuttle to reach the station when called (in deciseconds)
|
||||
var/emergencyDockTime = 1800 //time taken for emergency shuttle to leave again once it has docked (in deciseconds)
|
||||
var/emergencyEscapeTime = 1200 //time taken for emergency shuttle to reach a safe distance after leaving station (in deciseconds)
|
||||
var/emergency_sec_level_time = 0 // time sec level was last raised to red or higher
|
||||
var/area/emergencyLastCallLoc
|
||||
var/emergencyNoEscape
|
||||
|
||||
@@ -134,7 +135,11 @@ DECLARE_GLOBAL_CONTROLLER(shuttle, shuttle_master)
|
||||
var/area/signal_origin = get_area(user)
|
||||
var/emergency_reason = "\nNature of emergency:\n\n[call_reason]"
|
||||
if(seclevel2num(get_security_level()) >= SEC_LEVEL_RED) // There is a serious threat we gotta move no time to give them five minutes.
|
||||
emergency.request(null, 0.5, signal_origin, html_decode(emergency_reason), 1)
|
||||
var/extra_minutes = 0
|
||||
var/priority_time = emergencyCallTime * 0.5
|
||||
if(world.time - emergency_sec_level_time < priority_time)
|
||||
extra_minutes = 5
|
||||
emergency.request(null, 0.5 + extra_minutes / (emergencyCallTime / 600), signal_origin, html_decode(emergency_reason), 1)
|
||||
else
|
||||
emergency.request(null, 1, signal_origin, html_decode(emergency_reason), 0)
|
||||
|
||||
|
||||
@@ -199,6 +199,10 @@
|
||||
var/high_pop_mc_mode_amount = 65
|
||||
var/disable_high_pop_mc_mode_amount = 60
|
||||
|
||||
// Nightshift
|
||||
var/randomize_shift_time = FALSE
|
||||
var/enable_night_shifts = FALSE
|
||||
|
||||
/datum/configuration/New()
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
@@ -601,19 +605,18 @@
|
||||
shutdown_shell_command = value
|
||||
|
||||
if("disable_karma")
|
||||
disable_karma = 1
|
||||
config.disable_karma = 1
|
||||
|
||||
if("tick_limit_mc_init")
|
||||
tick_limit_mc_init = text2num(value)
|
||||
config.tick_limit_mc_init = text2num(value)
|
||||
if("base_mc_tick_rate")
|
||||
base_mc_tick_rate = text2num(value)
|
||||
config.base_mc_tick_rate = text2num(value)
|
||||
if("high_pop_mc_tick_rate")
|
||||
high_pop_mc_tick_rate = text2num(value)
|
||||
config.high_pop_mc_tick_rate = text2num(value)
|
||||
if("high_pop_mc_mode_amount")
|
||||
high_pop_mc_mode_amount = text2num(value)
|
||||
config.high_pop_mc_mode_amount = text2num(value)
|
||||
if("disable_high_pop_mc_mode_amount")
|
||||
disable_high_pop_mc_mode_amount = text2num(value)
|
||||
|
||||
config.disable_high_pop_mc_mode_amount = text2num(value)
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
@@ -676,6 +679,10 @@
|
||||
MAX_EX_FLAME_RANGE = BombCap
|
||||
if("default_laws")
|
||||
config.default_laws = text2num(value)
|
||||
if("randomize_shift_time")
|
||||
config.randomize_shift_time = TRUE
|
||||
if("enable_night_shifts")
|
||||
config.enable_night_shifts = TRUE
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
SUBSYSTEM_DEF(nightshift)
|
||||
name = "Night Shift"
|
||||
init_order = INIT_ORDER_NIGHTSHIFT
|
||||
priority = FIRE_PRIORITY_NIGHTSHIFT
|
||||
wait = 600
|
||||
flags = SS_NO_TICK_CHECK
|
||||
|
||||
var/nightshift_active = FALSE
|
||||
var/nightshift_start_time = 702000 //7:30 PM, station time
|
||||
var/nightshift_end_time = 270000 //7:30 AM, station time
|
||||
var/nightshift_first_check = 30 SECONDS
|
||||
|
||||
var/high_security_mode = FALSE
|
||||
|
||||
/datum/controller/subsystem/nightshift/Initialize()
|
||||
if(!config.enable_night_shifts)
|
||||
can_fire = FALSE
|
||||
if(config.randomize_shift_time)
|
||||
GLOB.gametime_offset = rand(0, 23) HOURS
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/nightshift/fire(resumed = FALSE)
|
||||
if(world.time - round_start_time < nightshift_first_check)
|
||||
return
|
||||
check_nightshift()
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/announce(message)
|
||||
priority_announcement.Announce(message, new_sound = 'sound/misc/notice2.ogg', new_title = "Automated Lighting System Announcement")
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/check_nightshift()
|
||||
var/emergency = security_level >= SEC_LEVEL_RED
|
||||
var/announcing = TRUE
|
||||
var/time = station_time()
|
||||
var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time)
|
||||
if(high_security_mode != emergency)
|
||||
high_security_mode = emergency
|
||||
if(night_time)
|
||||
announcing = FALSE
|
||||
if(!emergency)
|
||||
announce("Restoring night lighting configuration to normal operation.")
|
||||
else
|
||||
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)
|
||||
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.")
|
||||
for(var/A in apcs)
|
||||
var/obj/machinery/power/apc/APC = A
|
||||
if(is_station_level(APC.z))
|
||||
APC.set_nightshift(active)
|
||||
CHECK_TICK
|
||||
Reference in New Issue
Block a user