[READY]Randomized Station Time + Night Shifts
This commit is contained in:
committed by
CitadelStationBot
parent
c1d66af3a1
commit
bc2f2a9728
@@ -24,4 +24,4 @@ When using time2text(), please use "DDD" to find the weekday. Refrain from using
|
||||
|
||||
#define DS2TICKS(DS) ((DS)/world.tick_lag)
|
||||
|
||||
#define TICKS2DS(T) ((T) TICKS)
|
||||
#define TICKS2DS(T) ((T) TICKS)
|
||||
|
||||
@@ -9,7 +9,23 @@
|
||||
/proc/gameTimestamp(format = "hh:mm:ss", wtime=null)
|
||||
if(!wtime)
|
||||
wtime = world.time
|
||||
return time2text(wtime - GLOB.timezoneOffset + SSticker.gametime_offset - SSticker.round_start_time, format)
|
||||
return time2text(wtime - GLOB.timezoneOffset, format)
|
||||
|
||||
/proc/station_time()
|
||||
return ((((world.time - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - GLOB.timezoneOffset
|
||||
|
||||
/proc/station_time_timestamp(format = "hh:mm:ss")
|
||||
return time2text(station_time(), format)
|
||||
|
||||
/proc/station_time_debug(force_set)
|
||||
if(isnum(force_set))
|
||||
SSticker.gametime_offset = force_set
|
||||
return
|
||||
SSticker.gametime_offset = rand(0, 864000) //hours in day * minutes in hour * seconds in minute * deciseconds in second
|
||||
if(prob(50))
|
||||
SSticker.gametime_offset = FLOOR(SSticker.gametime_offset, 3600)
|
||||
else
|
||||
SSticker.gametime_offset = CEILING(SSticker.gametime_offset, 3600)
|
||||
|
||||
/* Returns 1 if it is the selected month and day */
|
||||
/proc/isDay(month, day)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//#define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green
|
||||
#endif
|
||||
|
||||
//#define UNIT_TESTS //Enables unit tests via TEST_RUN_PARAMETER
|
||||
//#define UNIT_TESTS //Enables unit tests via TEST_RUN_PARAMETER
|
||||
|
||||
#ifndef PRELOAD_RSC //set to:
|
||||
#define PRELOAD_RSC 0 // 0 to allow using external resources or on-demand behaviour;
|
||||
|
||||
@@ -275,3 +275,9 @@
|
||||
integer = FALSE
|
||||
|
||||
/datum/config_entry/flag/ic_printing
|
||||
|
||||
/datum/config_entry/flag/enable_night_shifts
|
||||
|
||||
/datum/config_entry/flag/randomize_shift_time
|
||||
|
||||
/datum/config_entry/flag/shift_time_realtime
|
||||
|
||||
68
code/controllers/subsystem/nightshift.dm
Normal file
68
code/controllers/subsystem/nightshift.dm
Normal file
@@ -0,0 +1,68 @@
|
||||
SUBSYSTEM_DEF(nightshift)
|
||||
name = "Night Shift"
|
||||
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/obey_security_level = TRUE
|
||||
var/high_security_mode = FALSE
|
||||
|
||||
/datum/controller/subsystem/nightshift/Initialize()
|
||||
if(!CONFIG_GET(flag/enable_night_shifts))
|
||||
can_fire = FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/nightshift/fire(resumed = FALSE)
|
||||
if(world.time - SSticker.round_start_time < nightshift_first_check)
|
||||
return
|
||||
check_nightshift()
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/check_nightshift(force_set = FALSE)
|
||||
var/time = station_time()
|
||||
var/nightshift = time < nightshift_end_time || time > nightshift_start_time
|
||||
var/red_or_delta = GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA
|
||||
var/announcing = TRUE
|
||||
if(nightshift && red_or_delta)
|
||||
nightshift = FALSE
|
||||
if(high_security_mode && !red_or_delta)
|
||||
high_security_mode = FALSE
|
||||
priority_announce("Restoring night lighting configuration to normal operation.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement")
|
||||
announcing = FALSE
|
||||
else if(!high_security_mode && red_or_delta)
|
||||
high_security_mode = TRUE
|
||||
priority_announce("Night lighting disabled: Station is in a state of emergency.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement")
|
||||
announcing = FALSE
|
||||
|
||||
if((nightshift_active != nightshift) || force_set)
|
||||
nightshift? activate_nightshift(announcing) : deactivate_nightshift(announcing)
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/activate_nightshift(announce = TRUE)
|
||||
if(!nightshift_active)
|
||||
if(announce)
|
||||
priority_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.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement")
|
||||
nightshift_active = TRUE
|
||||
var/list/area/affected = return_nightshift_area_types()
|
||||
for(var/i in affected)
|
||||
var/area/A = locate(i) in GLOB.sortedAreas
|
||||
for(var/obj/machinery/power/apc/APC in A)
|
||||
APC.set_nightshift(TRUE)
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/deactivate_nightshift(announce = TRUE)
|
||||
if(nightshift_active)
|
||||
if(announce)
|
||||
priority_announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.", sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement")
|
||||
nightshift_active = FALSE
|
||||
var/list/area/affected = return_nightshift_area_types()
|
||||
for(var/i in affected)
|
||||
var/area/A = locate(i) in GLOB.sortedAreas
|
||||
for(var/obj/machinery/power/apc/APC in A)
|
||||
APC.set_nightshift(FALSE)
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/return_nightshift_area_types()
|
||||
return GLOB.the_station_areas.Copy()
|
||||
@@ -43,7 +43,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/timeLeft //pregame timer
|
||||
var/start_at
|
||||
|
||||
var/gametime_offset = 432000 // equal to 12 hours, making gametime at roundstart 12:00:00
|
||||
var/gametime_offset = 432000 //Deciseconds to add to world.time for station time.
|
||||
var/station_time_rate_multiplier = 24 //factor of station time progressal vs real time.
|
||||
|
||||
var/totalPlayers = 0 //used for pregame stats on statpanel
|
||||
var/totalPlayersReady = 0 //used for pregame stats on statpanel
|
||||
@@ -144,6 +145,10 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
..()
|
||||
start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
|
||||
if(CONFIG_GET(flag/randomize_shift_time))
|
||||
gametime_offset = rand(0, 23) HOURS
|
||||
else if(CONFIG_GET(flag/shift_time_realtime))
|
||||
gametime_offset = world.timeofday
|
||||
|
||||
/datum/controller/subsystem/ticker/fire()
|
||||
switch(current_state)
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
interact(usr) //Refresh the UI after a filter changes
|
||||
|
||||
/obj/machinery/computer/apc_control/emag_act(mob/user)
|
||||
if(!authenticated)
|
||||
if(!authenticated)
|
||||
to_chat(user, "<span class='warning'>You bypass [src]'s access requirements using your emag.</span>")
|
||||
authenticated = TRUE
|
||||
log_activity("logged in")
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
/obj/machinery/computer/apc_control/proc/log_activity(log_text)
|
||||
var/op_string = operator && !(obj_flags & EMAGGED) ? operator : "\[NULL OPERATOR\]"
|
||||
LAZYADD(logs, "<b>([worldtime2text()])</b> [op_string] [log_text]")
|
||||
LAZYADD(logs, "<b>([station_time_timestamp()])</b> [op_string] [log_text]")
|
||||
|
||||
/mob/proc/using_power_flow_console()
|
||||
for(var/obj/machinery/computer/apc_control/A in range(1, src))
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
|
||||
else if(href_list["del_c"])
|
||||
if((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
|
||||
@@ -474,7 +474,7 @@ What a mess.*/
|
||||
var/counter = 1
|
||||
while(active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
|
||||
if("Delete Record (ALL)")
|
||||
if(active1)
|
||||
@@ -616,7 +616,7 @@ What a mess.*/
|
||||
if(active1.fields["photo_front"])
|
||||
if(istype(active1.fields["photo_front"], /obj/item/photo))
|
||||
var/obj/item/photo/P = active1.fields["photo_front"]
|
||||
print_photo(P.img, active1.fields["name"])
|
||||
print_photo(P.img, active1.fields["name"])
|
||||
if("show_photo_side")
|
||||
if(active1.fields["photo_side"])
|
||||
if(istype(active1.fields["photo_side"], /obj/item/photo))
|
||||
@@ -631,14 +631,14 @@ What a mess.*/
|
||||
if(active1.fields["photo_side"])
|
||||
if(istype(active1.fields["photo_side"], /obj/item/photo))
|
||||
var/obj/item/photo/P = active1.fields["photo_side"]
|
||||
print_photo(P.img, active1.fields["name"])
|
||||
print_photo(P.img, active1.fields["name"])
|
||||
if("mi_crim_add")
|
||||
if(istype(active1, /datum/data/record))
|
||||
var/t1 = stripped_input(usr, "Please input minor crime names:", "Secure. records", "", null)
|
||||
var/t2 = stripped_input(usr, "Please input minor crime details:", "Secure. records", "", null)
|
||||
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text())
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, station_time_timestamp())
|
||||
GLOB.data_core.addMinorCrime(active1.fields["id"], crime)
|
||||
if("mi_crim_delete")
|
||||
if(istype(active1, /datum/data/record))
|
||||
@@ -652,7 +652,7 @@ What a mess.*/
|
||||
var/t2 = stripped_input(usr, "Please input major crime details:", "Secure. records", "", null)
|
||||
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text())
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, station_time_timestamp())
|
||||
GLOB.data_core.addMajorCrime(active1.fields["id"], crime)
|
||||
if("ma_crim_delete")
|
||||
if(istype(active1, /datum/data/record))
|
||||
|
||||
@@ -141,7 +141,7 @@ GLOBAL_LIST_INIT(possible_uplinker_IDs, list("Alfa","Bravo","Charlie","Delta","E
|
||||
var/list/transferlog = list()
|
||||
|
||||
/obj/machinery/computer/telecrystals/boss/proc/logTransfer(logmessage)
|
||||
transferlog += ("<b>[worldtime2text()]</b> [logmessage]")
|
||||
transferlog += ("<b>[station_time_timestamp()]</b> [logmessage]")
|
||||
|
||||
/obj/machinery/computer/telecrystals/boss/proc/scanUplinkers()
|
||||
for(var/obj/machinery/computer/telecrystals/uplinker/A in urange(scanrange, src.loc))
|
||||
|
||||
@@ -122,7 +122,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
|
||||
newMsg.author = author
|
||||
newMsg.body = msg
|
||||
newMsg.time_stamp = "[worldtime2text()]"
|
||||
newMsg.time_stamp = "[station_time_timestamp()]"
|
||||
newMsg.is_admin_message = adminMessage
|
||||
newMsg.locked = !allow_comments
|
||||
if(photo)
|
||||
@@ -701,7 +701,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
var/datum/newscaster/feed_comment/FC = new/datum/newscaster/feed_comment
|
||||
FC.author = scanned_user
|
||||
FC.body = cominput
|
||||
FC.time_stamp = worldtime2text()
|
||||
FC.time_stamp = station_time_timestamp()
|
||||
FM.comments += FC
|
||||
log_talk(usr,"[key_name(usr)] as [scanned_user] commented on message [FM.returnBody(-1)] -- [FC.body]",LOGCOMMENT)
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -996,7 +996,7 @@
|
||||
|
||||
/obj/mecha/proc/log_message(message as text,red=null)
|
||||
log.len++
|
||||
log[log.len] = list("time"="[worldtime2text()]","date","year"="[GLOB.year_integer+540]","message"="[red?"<font color='red'>":null][message][red?"</font>":null]")
|
||||
log[log.len] = list("time"="[station_time_timestamp()]","date","year"="[GLOB.year_integer+540]","message"="[red?"<font color='red'>":null][message][red?"</font>":null]")
|
||||
return log.len
|
||||
|
||||
/obj/mecha/proc/log_append_to_last(message as text,red=null)
|
||||
|
||||
@@ -212,7 +212,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
dat += text("ID: <a href='?src=[REF(src)];choice=Authenticate'>[id ? "[id.registered_name], [id.assignment]" : "----------"]")
|
||||
dat += text("<br><a href='?src=[REF(src)];choice=UpdateInfo'>[id ? "Update PDA Info" : ""]</A><br><br>")
|
||||
|
||||
dat += "[worldtime2text()]<br>" //:[world.time / 100 % 6][world.time / 100 % 10]"
|
||||
dat += "[station_time_timestamp()]<br>" //:[world.time / 100 % 6][world.time / 100 % 10]"
|
||||
dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]"
|
||||
|
||||
dat += "<br><br>"
|
||||
|
||||
@@ -1072,7 +1072,7 @@
|
||||
|
||||
/obj/item/toy/clockwork_watch/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='info'>Station Time: [worldtime2text()]")
|
||||
to_chat(user, "<span class='info'>Station Time: [station_time_timestamp()]")
|
||||
|
||||
/*
|
||||
* Toy Dagger
|
||||
|
||||
@@ -64,12 +64,14 @@
|
||||
return FALSE
|
||||
|
||||
/datum/ntnet/proc/log_data_transfer(datum/netdata/data)
|
||||
logs += "[worldtime2text()] - [data.generate_netlog()]"
|
||||
logs += "[station_time_timestamp()] - [data.generate_netlog()]"
|
||||
if(logs.len > setting_maxlogcount)
|
||||
logs = logs.Copy(logs.len - setting_maxlogcount, 0)
|
||||
return
|
||||
|
||||
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
|
||||
/datum/ntnet/proc/add_log(log_string, obj/item/computer_hardware/network_card/source = null)
|
||||
var/log_text = "[worldtime2text()] - "
|
||||
var/log_text = "[station_time_timestamp()] - "
|
||||
if(source)
|
||||
log_text += "[source.get_network_tag()] - "
|
||||
else
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/effect/proc_holder/changeling/fakedeath
|
||||
name = "Reviving Stasis"
|
||||
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
|
||||
@@ -35,3 +36,42 @@
|
||||
if("No")
|
||||
return
|
||||
return ..()
|
||||
=======
|
||||
/obj/effect/proc_holder/changeling/fakedeath
|
||||
name = "Reviving Stasis"
|
||||
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
|
||||
chemical_cost = 15
|
||||
dna_cost = 0
|
||||
req_dna = 1
|
||||
req_stat = DEAD
|
||||
|
||||
//Fake our own death and fully heal. You will appear to be dead but regenerate fully after a short delay.
|
||||
/obj/effect/proc_holder/changeling/fakedeath/sting_action(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>We begin our stasis, preparing energy to arise once more.</span>")
|
||||
if(user.stat != DEAD)
|
||||
user.emote("deathgasp")
|
||||
user.tod = station_time_timestamp()
|
||||
user.fakedeath("changeling") //play dead
|
||||
user.update_stat()
|
||||
user.update_canmove()
|
||||
|
||||
addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/fakedeath/proc/ready_to_regenerate(mob/user)
|
||||
if(user && user.mind)
|
||||
var/datum/antagonist/changeling/C = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(C && C.purchasedpowers)
|
||||
to_chat(user, "<span class='notice'>We are ready to revive.</span>")
|
||||
C.purchasedpowers += new /obj/effect/proc_holder/changeling/revive(null)
|
||||
|
||||
/obj/effect/proc_holder/changeling/fakedeath/can_sting(mob/living/user)
|
||||
if(user.has_trait(TRAIT_FAKEDEATH, "changeling"))
|
||||
to_chat(user, "<span class='warning'>We are already reviving.</span>")
|
||||
return
|
||||
if(!user.stat) //Confirmation for living changelings if they want to fake their death
|
||||
switch(alert("Are we sure we wish to fake our own death?",,"Yes", "No"))
|
||||
if("No")
|
||||
return
|
||||
return ..()
|
||||
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
// We gathered everything. Create a fork and slowly display the results to the holder of the scanner.
|
||||
|
||||
var/found_something = 0
|
||||
add_log("<B>[worldtime2text()][get_timestamp()] - [target_name]</B>", 0)
|
||||
add_log("<B>[station_time_timestamp()][get_timestamp()] - [target_name]</B>", 0)
|
||||
|
||||
// Fingerprints
|
||||
if(length(fingerprints))
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit
|
||||
if(statpanel("SpiderOS"))
|
||||
stat("SpiderOS Status:","[SN.s_initialized ? "Initialized" : "Disabled"]")
|
||||
stat("Current Time:", "[worldtime2text()]")
|
||||
stat("Current Time:", "[station_time_timestamp()]")
|
||||
if(SN.s_initialized)
|
||||
//Suit gear
|
||||
stat("Energy Charge:", "[round(SN.cell.charge/100)]%")
|
||||
@@ -423,7 +423,7 @@
|
||||
return
|
||||
else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, station_time_timestamp())
|
||||
GLOB.data_core.addMinorCrime(R.fields["id"], crime)
|
||||
to_chat(usr, "<span class='notice'>Successfully added a minor crime.</span>")
|
||||
return
|
||||
@@ -438,7 +438,7 @@
|
||||
return
|
||||
else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, station_time_timestamp())
|
||||
GLOB.data_core.addMajorCrime(R.fields["id"], crime)
|
||||
to_chat(usr, "<span class='notice'>Successfully added a major crime.</span>")
|
||||
return
|
||||
@@ -470,7 +470,7 @@
|
||||
var/counter = 1
|
||||
while(R.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []<BR>[]", allowed_access, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []<BR>[]", allowed_access, station_time_timestamp(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1)
|
||||
to_chat(usr, "<span class='notice'>Successfully added comment.</span>")
|
||||
return
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
stat = DEAD
|
||||
unset_machine()
|
||||
timeofdeath = world.time
|
||||
tod = worldtime2text()
|
||||
tod = station_time_timestamp()
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/item/I in contents)
|
||||
I.on_mob_death(src, gibbed)
|
||||
|
||||
@@ -228,5 +228,5 @@
|
||||
if(stat == DEAD)
|
||||
return
|
||||
add_trait(TRAIT_FAKEDEATH, source)
|
||||
tod = worldtime2text()
|
||||
tod = station_time_timestamp()
|
||||
update_stat()
|
||||
@@ -285,7 +285,7 @@
|
||||
else
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.eye = loc
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/mob/living/reset_perspective(atom/A)
|
||||
if(..())
|
||||
@@ -603,7 +603,8 @@
|
||||
stat(null, "Next Map: [cached.map_name]")
|
||||
stat(null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]")
|
||||
stat(null, "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]")
|
||||
stat(null, "Station Time: [worldtime2text()]")
|
||||
stat(null, "Round Time: [worldtime2text()]")
|
||||
stat(null, "Station Time: [station_time_timestamp()]")
|
||||
stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
|
||||
if(SSshuttle.emergency)
|
||||
var/ETA = SSshuttle.emergency.getModeStr()
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
return ..()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_message(message, username)
|
||||
message = "[worldtime2text()] [username]: [message]"
|
||||
message = "[station_time_timestamp()] [username]: [message]"
|
||||
messages.Add(message)
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_status_message(message)
|
||||
messages.Add("[worldtime2text()] -!- [message]")
|
||||
messages.Add("[station_time_timestamp()] -!- [message]")
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/trim_message_list()
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
|
||||
data["PC_programheaders"] = program_headers
|
||||
|
||||
data["PC_stationtime"] = worldtime2text()
|
||||
data["PC_stationtime"] = station_time_timestamp()
|
||||
data["PC_hasheader"] = 1
|
||||
data["PC_showexitprogram"] = active_program ? 1 : 0 // Hides "Exit Program" button on mainscreen
|
||||
return data
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
<br>
|
||||
[GLOB.data_core ? GLOB.data_core.get_manifest(0) : ""]
|
||||
"}
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", worldtime2text())))
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
t = replacetext(t, "\[/i\]", "</I>")
|
||||
t = replacetext(t, "\[u\]", "<U>")
|
||||
t = replacetext(t, "\[/u\]", "</U>")
|
||||
t = replacetext(t, "\[time\]", "[worldtime2text()]")
|
||||
t = replacetext(t, "\[time\]", "[station_time_timestamp()]")
|
||||
t = replacetext(t, "\[date\]", "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]")
|
||||
t = replacetext(t, "\[large\]", "<font size=\"4\">")
|
||||
t = replacetext(t, "\[/large\]", "</font>")
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
var/failure_timer = 0
|
||||
var/force_update = 0
|
||||
var/emergency_lights = FALSE
|
||||
var/nightshift_lights = FALSE
|
||||
var/last_nightshift_switch = 0
|
||||
var/update_state = -1
|
||||
var/update_overlay = -1
|
||||
var/icon_update_needed = FALSE
|
||||
@@ -755,6 +757,7 @@
|
||||
"siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console(),
|
||||
"malfStatus" = get_malf_status(user),
|
||||
"emergencyLights" = !emergency_lights,
|
||||
"nightshiftLights" = nightshift_lights,
|
||||
|
||||
"powerChannels" = list(
|
||||
list(
|
||||
@@ -857,6 +860,13 @@
|
||||
if("breaker")
|
||||
toggle_breaker()
|
||||
. = TRUE
|
||||
if("toggle_nightshift")
|
||||
if(last_nightshift_switch > world.time + 100) //don't spam..
|
||||
to_chat(usr, "<span class='warning'>[src]'s night lighting circuit breaker is still cycling!</span>")
|
||||
return
|
||||
last_nightshift_switch = world.time
|
||||
set_nightshift(!nightshift_lights)
|
||||
. = TRUE
|
||||
if("charge")
|
||||
chargemode = !chargemode
|
||||
if(!chargemode)
|
||||
@@ -1304,6 +1314,16 @@
|
||||
|
||||
failure_timer = max(failure_timer, round(duration))
|
||||
|
||||
/obj/machinery/power/apc/proc/set_nightshift(on)
|
||||
set waitfor = FALSE
|
||||
nightshift_lights = on
|
||||
for(var/area/A in area.related)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
if(L.nightshift_allowed)
|
||||
L.nightshift_enabled = nightshift_lights
|
||||
L.update(FALSE)
|
||||
CHECK_TICK
|
||||
|
||||
#undef UPSTATE_CELL_IN
|
||||
#undef UPSTATE_OPENED1
|
||||
#undef UPSTATE_OPENED2
|
||||
|
||||
@@ -210,6 +210,13 @@
|
||||
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
var/start_with_cell = TRUE // if true, this fixture generates a very weak cell at roundstart
|
||||
|
||||
var/nightshift_enabled = FALSE //Currently in night shift mode?
|
||||
var/nightshift_allowed = TRUE //Set to FALSE to never let this light get switched to night mode.
|
||||
var/nightshift_brightness = 8
|
||||
var/nightshift_light_power = 0.45
|
||||
var/nightshift_light_color = "#FFDDCC"
|
||||
|
||||
var/emergency_mode = FALSE // if true, the light is in emergency mode
|
||||
var/no_emergency = FALSE // if true, this light cannot ever have an emergency mode
|
||||
var/bulb_emergency_brightness_mul = 0.25 // multiplier for this light's base brightness in emergency power mode
|
||||
@@ -301,24 +308,36 @@
|
||||
return
|
||||
|
||||
// update the icon_state and luminosity of the light depending on its state
|
||||
/obj/machinery/light/proc/update(trigger = 1)
|
||||
/obj/machinery/light/proc/update(trigger = TRUE)
|
||||
switch(status)
|
||||
if(LIGHT_BROKEN,LIGHT_BURNED,LIGHT_EMPTY)
|
||||
on = FALSE
|
||||
emergency_mode = FALSE
|
||||
if(on)
|
||||
<<<<<<< HEAD
|
||||
if(!light || light.light_range != brightness || SSnightshift.nightshift != nightshift) //Cit change - makes lights update when nightshift triggers
|
||||
=======
|
||||
var/BR = nightshift_enabled? nightshift_brightness : brightness
|
||||
var/PO = nightshift_enabled? nightshift_light_power : bulb_power
|
||||
var/CO = nightshift_enabled? nightshift_light_color : bulb_colour
|
||||
var/matching = light && BR == light.light_range && PO == light.light_power && CO == light.light_color
|
||||
if(!matching)
|
||||
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
|
||||
switchcount++
|
||||
nightshift = SSnightshift.nightshift // Cit change - makes lights update when nightshift triggers
|
||||
if(rigged)
|
||||
if(status == LIGHT_OK && trigger)
|
||||
explode()
|
||||
else if( prob( min(60, switchcount*switchcount*0.01) ) )
|
||||
else if( prob( min(60, (switchcount^2)*0.01) ) )
|
||||
if(trigger)
|
||||
burn_out()
|
||||
else
|
||||
use_power = ACTIVE_POWER_USE
|
||||
<<<<<<< HEAD
|
||||
set_light(brightness, ((SSnightshift.nightshift && obeysnightshift) ? SSnightshift.nightshift_light_power : bulb_power), ((SSnightshift.nightshift && obeysnightshift) ? SSnightshift.nightshift_light_color : bulb_colour)) // Citadel change. Allows nightshift and admins to modify station light power and color
|
||||
=======
|
||||
set_light(BR, PO, CO)
|
||||
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
|
||||
else if(has_emergency_power(LIGHT_EMERGENCY_POWER_USE) && !turned_off())
|
||||
use_power = IDLE_POWER_USE
|
||||
emergency_mode = TRUE
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
GLOBAL_VAR_INIT(security_level, 0)
|
||||
//0 = code green
|
||||
//1 = code blue
|
||||
//2 = code red
|
||||
//3 = code delta
|
||||
GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
|
||||
//SEC_LEVEL_GREEN = code green
|
||||
//SEC_LEVEL_BLUE = code blue
|
||||
//SEC_LEVEL_RED = code red
|
||||
//SEC_LEVEL_DELTA = code delta
|
||||
|
||||
//config.alert_desc_blue_downto
|
||||
|
||||
@@ -91,6 +91,7 @@ GLOBAL_VAR_INIT(security_level, 0)
|
||||
SSnightshift.updatenightlights()
|
||||
//End of citadel changes
|
||||
SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level())
|
||||
SSnightshift.check_nightshift()
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
@@ -488,6 +488,7 @@ MICE_ROUNDSTART 10
|
||||
## Determines if players are allowed to print integrated circuits, uncomment to allow.
|
||||
#IC_PRINTING
|
||||
|
||||
<<<<<<< HEAD
|
||||
## CITADEL Races
|
||||
ROUNDSTART_RACES mammal
|
||||
ROUNDSTART_RACES avian
|
||||
@@ -518,3 +519,13 @@ NIGHTSHIFT_ENABLED
|
||||
## These values determine the start and end of night shift. By default, night shift starts at 8 PM, and ends at 6 AM.
|
||||
NIGHTSHIFT_START 20
|
||||
NIGHTSHIFT_FINISH 6
|
||||
=======
|
||||
## Enable night shifts ##
|
||||
ENABLE_NIGHT_SHIFTS
|
||||
|
||||
## Enable randomized shift start times##
|
||||
RANDOMIZE_SHIFT_TIME
|
||||
|
||||
## Sets shift time to server time at roundstart. Overridden by RANDOMIZE_SHIFT_TIME ##
|
||||
#SHIFT_TIME_REALTIME
|
||||
>>>>>>> 3622768... Merge pull request #35775 from kevinz000/night_shift
|
||||
|
||||
@@ -257,6 +257,7 @@
|
||||
#include "code\controllers\subsystem\medals.dm"
|
||||
#include "code\controllers\subsystem\minimap.dm"
|
||||
#include "code\controllers\subsystem\mobs.dm"
|
||||
#include "code\controllers\subsystem\nightshift.dm"
|
||||
#include "code\controllers\subsystem\npcpool.dm"
|
||||
#include "code\controllers\subsystem\orbit.dm"
|
||||
#include "code\controllers\subsystem\overlays.dm"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -130,6 +130,15 @@
|
||||
{{/if}}
|
||||
</ui-section>
|
||||
</ui-notice>
|
||||
<ui-notice>
|
||||
<ui-section label='Night Shift Lighting'>
|
||||
{{#if data.locked && !data.siliconUser}}
|
||||
<span>{{data.nightshiftLights ? "Enabled" : "Disabled"}}</span>
|
||||
{{else}}
|
||||
<ui-button icon='lightbulb-o' action='toggle_nightshift'>{{data.nightshiftLights ? "Enabled" : "Disabled"}}</ui-button>
|
||||
{{/if}}
|
||||
</ui-section>
|
||||
</ui-notice>
|
||||
<ui-notice>
|
||||
<ui-section label='Cover Lock'>
|
||||
{{#if data.locked && !data.siliconUser}}
|
||||
|
||||
Reference in New Issue
Block a user