From bc4fb3d79b585d5d010e55d06c22d425bac23523 Mon Sep 17 00:00:00 2001 From: tigercat2000 Date: Sun, 25 Mar 2018 23:01:04 -0700 Subject: [PATCH] Nightshifts & Randomized Station Time This commit adds the Nightshift lighting mode from /tg/. From 19:00 to 07:00 in station time, the station will go into a reduced-lighting mode, with dimmed lights across the station. In conjunction with this, there is a new configuration option to start the shift time at a random time other than 12:00, so that players are more likely to experience a night shift (as opposed to having to have a 7 hour round). --- code/__DEFINES/subsystems.dm | 2 + code/__HELPERS/text.dm | 2 +- code/__HELPERS/time.dm | 26 +++++--- code/_globalvars/misc.dm | 4 +- code/controllers/configuration.dm | 21 ++++--- code/controllers/subsystem/nightshift.dm | 59 +++++++++++++++++++ code/game/gamemodes/game_mode.dm | 2 +- code/game/gamemodes/gameticker.dm | 3 +- code/game/machinery/adv_med.dm | 2 +- code/game/machinery/computer/card.dm | 2 +- .../game/machinery/computer/communications.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/security.dm | 4 +- .../machinery/computer/telecrystalconsoles.dm | 2 +- code/game/machinery/doors/brigdoors.dm | 6 +- code/game/machinery/guestpass.dm | 8 +-- code/game/machinery/requests_console.dm | 2 +- code/game/machinery/slotmachine.dm | 2 +- code/game/machinery/status_display.dm | 4 +- code/game/machinery/supply_display.dm | 2 +- code/game/machinery/vending.dm | 2 +- code/game/objects/items/devices/autopsy.dm | 4 +- code/game/objects/items/devices/scanners.dm | 6 +- code/game/objects/items/weapons/cards_ids.dm | 4 +- code/modules/arcade/arcade_base.dm | 2 +- code/modules/detective_work/scanner.dm | 2 +- code/modules/economy/ATM.dm | 14 ++--- code/modules/economy/Accounts.dm | 12 ++-- code/modules/economy/Accounts_DB.dm | 2 +- code/modules/economy/EFTPOS.dm | 4 +- code/modules/economy/POS.dm | 4 +- code/modules/economy/utils.dm | 4 +- code/modules/events/event_manager.dm | 10 ++-- code/modules/events/money_hacker.dm | 4 +- code/modules/events/prison_break.dm | 2 +- code/modules/mining/equipment_locker.dm | 2 +- code/modules/mob/living/carbon/alien/death.dm | 2 +- .../mob/living/carbon/alien/larva/death.dm | 2 +- code/modules/mob/living/carbon/brain/death.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 16 ++--- code/modules/mob/living/silicon/ai/death.dm | 2 +- .../mob/living/silicon/robot/component.dm | 2 +- .../modules/mob/living/silicon/robot/death.dm | 2 +- code/modules/mob/mob.dm | 3 +- code/modules/mob/new_player/new_player.dm | 3 +- .../NTNet/NTNRC/conversation.dm | 4 +- code/modules/modular_computers/NTNet/NTNet.dm | 2 +- .../computers/item/computer_ui.dm | 2 +- .../file_system/programs/command/card.dm | 2 +- .../modular_computers/laptop_vendor.dm | 2 +- code/modules/ninja/suit/SpiderOS.dm | 2 +- code/modules/paperwork/fax.dm | 4 +- code/modules/pda/PDA.dm | 2 +- code/modules/pda/utilities.dm | 2 +- code/modules/power/apc.dm | 24 ++++++++ code/modules/power/lighting.dm | 24 ++++++-- .../chemistry/machinery/chem_master.dm | 2 +- .../scripting/Implementations/Telecomms.dm | 2 +- .../scripting/Implementations/_Logic.dm | 4 -- .../security_levels/keycard authentication.dm | 2 +- .../security_levels/security levels.dm | 1 + code/modules/store/store.dm | 2 +- code/world.dm | 3 +- config/example/config.txt | 2 +- config/example/game_options.txt | 8 ++- nano/templates/apc.tmpl | 17 ++++++ paradise.dme | 1 + 68 files changed, 264 insertions(+), 121 deletions(-) create mode 100644 code/controllers/subsystem/nightshift.dm diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 180007fa1b8..6057c439338 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -70,6 +70,7 @@ #define INIT_ORDER_STICKY_BAN -10 #define INIT_ORDER_LIGHTING -20 #define INIT_ORDER_SHUTTLE -21 +#define INIT_ORDER_NIGHTSHIFT -22 #define INIT_ORDER_SQUEAK -40 #define INIT_ORDER_PATH -50 #define INIT_ORDER_PERSISTENCE -100 @@ -77,6 +78,7 @@ // Subsystem fire priority, from lowest to highest priority // If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child) +#define FIRE_PRIORITY_NIGHTSHIFT 10 #define FIRE_PRIORITY_IDLE_NPC 10 #define FIRE_PRIORITY_SERVER_MAINT 10 #define FIRE_PRIORITY_RESEARCH 10 diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index ef2f8578783..0de4f548ee0 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -505,7 +505,7 @@ proc/checkhtml(var/t) text = replacetext(text, "\[row\]", "") text = replacetext(text, "\[cell\]", "") text = replacetext(text, "\[logo\]", "") - text = replacetext(text, "\[time\]", "[gameTimestamp()]") // TO DO + text = replacetext(text, "\[time\]", "[station_time_timestamp()]") // TO DO if(P) text = "[text]" else diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 6d28c2c0cd4..c91f5921a54 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -23,15 +23,27 @@ return wtime + (time_offset + wusage) * world.tick_lag //Returns the world time in english -/proc/worldtime2text(time = world.time) - time = (round_start_time ? (time - round_start_time) : (time - world.time)) - return "[round(time / 36000)+12]:[(time / 600 % 60) < 10 ? add_zero(time / 600 % 60, 1) : time / 600 % 60]" +/proc/worldtime2text() + return gameTimestamp("hh:mm:ss", world.time) -/proc/time_stamp() - return time2text(world.timeofday, "hh:mm:ss") +/proc/time_stamp(format = "hh:mm:ss", show_ds) + var/time_string = time2text(world.timeofday, format) + return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string -/proc/gameTimestamp(format = "hh:mm:ss") // Get the game time in text - return time2text(world.time - timezoneOffset + 432000, format) +/proc/gameTimestamp(format = "hh:mm:ss", wtime=null) + if(!wtime) + wtime = world.time + return time2text(wtime - timezoneOffset, format) + +/* This is used for displaying the "station time" equivelent of a world.time value + Calling it with no args will give you the current time, but you can specify a world.time-based value as an argument + - You can use this, for example, to do "This will expire at [station_time_at(world.time + 500)]" to display a "station time" expiration date + which is much more useful for a player)*/ +/proc/station_time(time=world.time) + return ((((time - round_start_time)) + GLOB.gametime_offset) % 864000) - timezoneOffset + +/proc/station_time_timestamp(format = "hh:mm:ss", time=world.time) + return time2text(station_time(time), format) /* Returns 1 if it is the selected month and day */ proc/isDay(var/month, var/day) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index bc61c854ab4..cb0fdba6916 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -78,4 +78,6 @@ var/timezoneOffset = 0 // The difference betwen midnight (of the host computer) // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. -var/fileaccess_timer = 0 \ No newline at end of file +var/fileaccess_timer = 0 + +GLOBAL_VAR_INIT(gametime_offset, 432000) // 12:00 in seconds \ No newline at end of file diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 88fdb83da10..cf9a05c54db 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -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() var/list/L = subtypesof(/datum/game_mode) for(var/T in L) @@ -605,19 +609,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]'" @@ -680,6 +683,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]'" diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm new file mode 100644 index 00000000000..7c7b017868b --- /dev/null +++ b/code/controllers/subsystem/nightshift.dm @@ -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 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 42fb3105f18..71c702537e6 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -164,7 +164,7 @@ T.purpose = "Payment" T.amount = pay T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = "\[CLASSIFIED\] Terminal #[rand(111,333)]" M.mind.initial_account.transaction_log.Add(T) msg += "You have been sent the $[pay], as agreed." diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 6612f1e7192..2390e3c19e5 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -35,7 +35,8 @@ var/round_start_time = 0 var/obj/screen/cinematic = null //used for station explosion cinematic - var/round_end_announced = 0 // Spam Prevention. Announce round end only once. + var/round_end_announced = 0 // Spam Prevention. Announce round end only once.\ + /datum/controller/gameticker/proc/pregame() login_music = pick(\ diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 3b20943e46d..cef92cb921a 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -474,7 +474,7 @@ var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc) playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) P.info = "
Body Scan - [href_list["name"]]

" - P.info += "Time of scan: [worldtime2text(world.time)]

" + P.info += "Time of scan: [station_time_timestamp()]

" P.info += "[printing_text]" P.info += "

Notes:
" P.name = "Body Scan - [href_list["name"]]" diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index d6792073f9d..ddce464a9f2 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -429,7 +429,7 @@ var/time_last_changed_position = 0 var/obj/item/weapon/paper/P = new(loc) if(mode == 2) - P.name = text("crew manifest ([])", worldtime2text()) + P.name = "crew manifest ([station_time_timestamp()])" P.info = {"

Crew Manifest


[data_core ? data_core.get_manifest(0) : ""] diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index e46182b735e..db8ea782aa8 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -255,7 +255,7 @@ nanomanager.update_uis(src) return Centcomm_announce(input, usr) - print_centcom_report(input, worldtime2text() +" Captain's Message") + print_centcom_report(input, station_time_timestamp() + " Captain's Message") to_chat(usr, "Message transmitted.") log_say("[key_name(usr)] has made a Centcomm announcement: [input]") centcomm_message_cooldown = 1 diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index d016a0df7bd..183dcb841e2 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -453,7 +453,7 @@ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN) if(!t1 || ..() || active2 != a2) return 1 - active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [worldtime2text()]
[t1]" + active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [station_time_timestamp()]
[t1]" if(href_list["del_c"]) var/index = min(max(text2num(href_list["del_c"]) + 1, 1), length(active2.fields["comments"])) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 8289e8714e3..8cb230c484b 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -198,7 +198,7 @@ active2.fields["criminal"] = "Released" var/newstatus = active2.fields["criminal"] log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [newstatus], comment: [t1]") - active2.fields["comments"] += "Set to [newstatus] by [usr.name] ([rank]) on [current_date_string] [worldtime2text()], comment: [t1]" + active2.fields["comments"] += "Set to [newstatus] by [usr.name] ([rank]) on [current_date_string] [station_time_timestamp()], comment: [t1]" update_all_mob_security_hud() if("rank") if(active1) @@ -404,7 +404,7 @@ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Secure. records", null, null) as message)), 1, MAX_MESSAGE_LEN) if(!t1 || ..() || active2 != a2) return 1 - active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [worldtime2text()]
[t1]" + active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [station_time_timestamp()]
[t1]" else if(href_list["del_c"]) var/index = min(max(text2num(href_list["del_c"]) + 1, 1), length(active2.fields["comments"])) diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index e2119247409..4006e005b12 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -137,7 +137,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F var/list/transferlog = list() /obj/machinery/computer/telecrystals/boss/proc/logTransfer(var/logmessage) - transferlog += ("[worldtime2text()] [logmessage]") + transferlog += ("[station_time_timestamp()] [logmessage]") /obj/machinery/computer/telecrystals/boss/proc/scanUplinkers() for(var/obj/machinery/computer/telecrystals/uplinker/A in range(scanrange, src.loc)) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 5914d9b5d87..b8f00b60131 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -40,11 +40,11 @@ for(var/obj/machinery/computer/prisoner/C in prisoncomputer_list) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(C.loc) - P.name = "[id] log - [logname] [worldtime2text()]" + P.name = "[id] log - [logname] [station_time_timestamp()]" P.info = "
[id] - Brig record



" P.info += {"
[station_name()] - Security Department

Admission data:

- Log generated at: [worldtime2text()]
+ Log generated at: [station_time_timestamp()]
Detainee: [logname]
Duration: [seconds_to_time(timetoset / 10)]
Charge(s): [logcharges]
@@ -68,7 +68,7 @@ rank = I.assignment if(!R.fields["comments"] || !islist(R.fields["comments"])) //copied from security computer code because apparently these need to be initialized R.fields["comments"] = list() - R.fields["comments"] += "Autogenerated by [name] on [current_date_string] [worldtime2text()]
Sentenced to [timetoset/10] seconds for the charges of \"[logcharges]\" by [rank] [usr.name]." + R.fields["comments"] += "Autogenerated by [name] on [current_date_string] [station_time_timestamp()]
Sentenced to [timetoset/10] seconds for the charges of \"[logcharges]\" by [rank] [usr.name]." update_all_mob_security_hud() return 1 diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm index bc70868cf8f..8e043af82ad 100644 --- a/code/game/machinery/guestpass.dm +++ b/code/game/machinery/guestpass.dm @@ -19,9 +19,9 @@ /obj/item/weapon/card/id/guest/examine(mob/user) ..(user) if(world.time < expiration_time) - to_chat(user, "This pass expires at [worldtime2text(expiration_time)].") + to_chat(user, "This pass expires at [station_time_timestamp("hh:mm:ss", expiration_time)].") else - to_chat(user, "It expired at [worldtime2text(expiration_time)].") + to_chat(user, "It expired at [station_time_timestamp("hh:mm:ss", expiration_time)].") to_chat(user, "It grants access to following areas:") for(var/A in temp_access) to_chat(user, "[get_access_desc(A)].") @@ -166,13 +166,13 @@ if("issue") if(giver) var/number = add_zero("[rand(0,9999)]", 4) - var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: " + var/entry = "\[[station_time()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: " for(var/i=1 to accesses.len) var/A = accesses[i] if(A) var/area = get_access_desc(A) entry += "[i > 1 ? ", [area]" : "[area]"]" - entry += ". Expires at [worldtime2text(world.time + duration*10*60)]." + entry += ". Expires at [station_time(world.time + duration*10*60)]." internal_log.Add(entry) var/obj/item/weapon/card/id/guest/pass = new(src.loc) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index c10f4044f78..4bd4edefd5e 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -221,7 +221,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() radiochannel = "AI Private" if(recipient == "Cargo Bay") radiochannel = "Supply" - message_log += "Message sent to [recipient] at [worldtime2text()]
[message]" + message_log += "Message sent to [recipient] at [station_time_timestamp()]
[message]" Radio.autosay("Alert; a new requests console message received for [recipient] from [department]", null, "[radiochannel]") else audible_message(text("[bicon(src)] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index ca6484d8dd4..b32d24b6fe1 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -113,5 +113,5 @@ T.purpose = "Slot Winnings" T.amount = "[amt]" T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() account.transaction_log.Add(T) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 614f4d8f53f..414ec8d2e62 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -98,7 +98,7 @@ message2 = "Error!" else message1 = "TIME" - message2 = worldtime2text() + message2 = station_time_timestamp("hh:mm") update_display(message1, message2, use_warn) return 1 if(STATUS_DISPLAY_MESSAGE) //custom messages @@ -126,7 +126,7 @@ return 1 if(STATUS_DISPLAY_TIME) message1 = "TIME" - message2 = worldtime2text() + message2 = station_time_timestamp("hh:mm") update_display(message1, message2) return 1 return 0 diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm index 9c945fff989..863d76ef7b6 100644 --- a/code/game/machinery/supply_display.dm +++ b/code/game/machinery/supply_display.dm @@ -10,7 +10,7 @@ message2 = "Docked" else message1 = "TIME" - message2 = worldtime2text() + message2 = station_time_timestamp("hh:mm") else message1 = "CARGO" message2 = shuttle_master.supply.getTimerStr() diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 1329922235f..bcbb279e627 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -430,7 +430,7 @@ T.amount = "[currently_vending.price]" T.source_terminal = src.name T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() vendor_account.transaction_log.Add(T) /obj/machinery/vending/attack_ai(mob/user) diff --git a/code/game/objects/items/devices/autopsy.dm b/code/game/objects/items/devices/autopsy.dm index 62e4354f238..d7d416c36d0 100644 --- a/code/game/objects/items/devices/autopsy.dm +++ b/code/game/objects/items/devices/autopsy.dm @@ -96,7 +96,7 @@ var/scan_data = "" if(timeofdeath) - scan_data += "Time of death: [worldtime2text(timeofdeath)]

" + scan_data += "Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]

" var/n = 1 for(var/wdata_idx in wdata) @@ -146,7 +146,7 @@ if(damaging_weapon) scan_data += "Severity: [damage_desc]
" scan_data += "Hits by weapon: [total_hits]
" - scan_data += "Approximate time of wound infliction: [worldtime2text(age)]
" + scan_data += "Approximate time of wound infliction: [station_time(age)]
" scan_data += "Affected limbs: [D.organ_names]
" scan_data += "Possible weapons:
" for(var/weapon_name in weapon_chances) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index dfec1d1ba09..3aba9d2d95b 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -160,7 +160,7 @@ REAGENT SCANNER user.show_message("\t Damage Specifics: [OX] - [TX] - [BU] - [BR]") user.show_message("Body Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)", 1) if(M.timeofdeath && (M.stat == DEAD || (M.status_flags & FAKEDEATH))) - user.show_message("Time of Death: [worldtime2text(M.timeofdeath)]") + user.show_message("Time of Death: [station_time_timestamp("hh:mm:ss", M.timeofdeath)]") if(istype(M, /mob/living/carbon/human) && mode == 1) var/mob/living/carbon/human/H = M var/list/damaged = H.get_damaged_organs(1,1) @@ -432,7 +432,7 @@ REAGENT SCANNER sleep(50) var/obj/item/weapon/paper/P = new(get_turf(src)) - P.name = "Mass Spectrometer Scanner Report: [worldtime2text()]" + P.name = "Mass Spectrometer Scanner Report: [station_time_timestamp()]" P.info = "
Mass Spectrometer

Data Analysis:



Trace chemicals detected:
[datatoprint]

" if(ismob(loc)) @@ -502,7 +502,7 @@ REAGENT SCANNER sleep(50) var/obj/item/weapon/paper/P = new(get_turf(src)) - P.name = "Reagent Scanner Report: [worldtime2text()]" + P.name = "Reagent Scanner Report: [station_time_timestamp()]" P.info = "
Reagent Scanner

Data Analysis:



Chemical agents detected:
[datatoprint]

" if(ismob(loc)) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index dc4f23657b5..2c080cdafcc 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -123,9 +123,9 @@ if(guest_pass) to_chat(user, "There is a guest pass attached to this ID card") if(world.time < guest_pass.expiration_time) - to_chat(user, "It expires at [worldtime2text(guest_pass.expiration_time)].") + to_chat(user, "It expires at [station_time_timestamp("hh:mm:ss", guest_pass.expiration_time)].") else - to_chat(user, "It expired at [worldtime2text(guest_pass.expiration_time)].") + to_chat(user, "It expired at [station_time_timestamp("hh:mm:ss", guest_pass.expiration_time)].") to_chat(user, "It grants access to following areas:") for(var/A in guest_pass.temp_access) to_chat(user, "[get_access_desc(A)].") diff --git a/code/modules/arcade/arcade_base.dm b/code/modules/arcade/arcade_base.dm index b043eb934c9..26f1462201b 100644 --- a/code/modules/arcade/arcade_base.dm +++ b/code/modules/arcade/arcade_base.dm @@ -131,7 +131,7 @@ T.amount = "[token_price]" T.source_terminal = src.name T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() customer_account.transaction_log.Add(T) return 1 diff --git a/code/modules/detective_work/scanner.dm b/code/modules/detective_work/scanner.dm index c8c2ace6d88..c183bedb610 100644 --- a/code/modules/detective_work/scanner.dm +++ b/code/modules/detective_work/scanner.dm @@ -159,7 +159,7 @@ spawn(0) var/found_something = 0 - add_log("[worldtime2text()][get_timestamp()] - [target_name]", 0) + add_log("[station_time_timestamp()][get_timestamp()] - [target_name]", 0) // Fingerprints if(fingerprints && fingerprints.len) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 3470302c057..16ee4d52485 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -107,7 +107,7 @@ log transactions T.amount = C.amount T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() authenticated_account.transaction_log.Add(T) to_chat(user, "You insert [C] into [src].") @@ -183,7 +183,7 @@ log transactions T.purpose = transfer_purpose T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.amount = "([transfer_amount])" authenticated_account.transaction_log.Add(T) else @@ -225,7 +225,7 @@ log transactions T.purpose = "Unauthorised login attempt" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() failed_account.transaction_log.Add(T) else to_chat(usr, "[bicon(src)]Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.") @@ -245,7 +245,7 @@ log transactions T.purpose = "Remote terminal access" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() authenticated_account.transaction_log.Add(T) to_chat(usr, "[bicon(src)]Access granted. Welcome user '[authenticated_account.owner_name].'") previous_account_number = tried_account_num @@ -271,7 +271,7 @@ log transactions T.amount = "([amount])" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() authenticated_account.transaction_log.Add(T) else to_chat(usr, "[bicon(src)]You don't have enough funds to do that!") @@ -288,7 +288,7 @@ log transactions Account holder: [authenticated_account.owner_name]
Account number: [authenticated_account.account_number]
Balance: $[authenticated_account.money]
- Date and time: [worldtime2text()], [current_date_string]

+ Date and time: [station_time_timestamp()], [current_date_string]

Service terminal ID: [machine_id]
"} //stamp the paper @@ -345,7 +345,7 @@ log transactions T.purpose = "Remote terminal access" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() authenticated_account.transaction_log.Add(T) view_screen = NO_SCREEN diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index c43f14d1283..ca000bc3f85 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -54,8 +54,8 @@ var/global/list/all_money_accounts = list() department_accounts[department] = department_account -//the current ingame time (hh:mm) can be obtained by calling: -//worldtime2text() +//the current ingame time (hh:mm:ss) can be obtained by calling: +//station_time_timestamp("hh:mm:ss") /proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/computer/account_database/source_db) @@ -79,7 +79,7 @@ var/global/list/all_money_accounts = list() M.account_number = rand(111111, 999999) else T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = source_db.machine_id M.account_number = next_account_number @@ -101,7 +101,7 @@ var/global/list/all_money_accounts = list() Account number: [M.account_number]
Account pin: [M.remote_access_pin]
Starting balance: $[M.money]
- Date and time: [worldtime2text()], [current_date_string]

+ Date and time: [station_time_timestamp()], [current_date_string]

Creation terminal ID: [source_db.machine_id]
Authorised NT officer overseeing creation: [overseer]
"} // END AUTOFIX @@ -302,7 +302,7 @@ var/global/list/all_money_accounts = list() T.purpose = "New account funds initialisation" T.amount = "([starting_funds])" T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = machine_id station_account.transaction_log.Add(T) @@ -354,7 +354,7 @@ var/global/list/all_money_accounts = list() else T.amount = "[amount]" T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = terminal_id D.transaction_log.Add(T) diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index a2bb2552824..7507b2b7b9d 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -31,7 +31,7 @@ T.purpose = reason T.amount = amount T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = machine_id return T diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index babbac30b11..b22b2ffb300 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -203,7 +203,7 @@ T.amount = "[transaction_amount]" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() D.transaction_log.Add(T) // T = new() @@ -212,7 +212,7 @@ T.amount = "[transaction_amount]" T.source_terminal = machine_id T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() linked_account.transaction_log.Add(T) else to_chat(user, "[bicon(src)]You don't have that much money!") diff --git a/code/modules/economy/POS.dm b/code/modules/economy/POS.dm index ca5189ce122..67f2f3b190e 100644 --- a/code/modules/economy/POS.dm +++ b/code/modules/economy/POS.dm @@ -173,7 +173,7 @@ var/const/POS_HEADER = {" receipt += myArea.name receipt += "" receipt += {"
-
[worldtime2text()], [current_date_string]
+
[station_time_timestamp()], [current_date_string]
@@ -369,7 +369,7 @@ var/const/POS_HEADER = {" logindata={"[logged_in.name]"} var/dat = POS_HEADER + {" " html += "" - html += "" + html += "" html += "" html += "" html += "" html += "" - html += "" + html += "" html += "" html += "" html += "" diff --git a/code/modules/events/money_hacker.dm b/code/modules/events/money_hacker.dm index e3665815515..641fec1405e 100644 --- a/code/modules/events/money_hacker.dm +++ b/code/modules/events/money_hacker.dm @@ -15,7 +15,7 @@ kill() /datum/event/money_hacker/announce() - var/message = "A brute force hack has been detected (in progress since [worldtime2text()]). The target of the attack is: Financial account #[affected_account.account_number], \ + var/message = "A brute force hack has been detected (in progress since [station_time_timestamp()]). The target of the attack is: Financial account #[affected_account.account_number], \ without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \ Notifications will be sent as updates occur.
" var/my_department = "[station_name()] firewall subroutines" @@ -50,7 +50,7 @@ T.date = pick("", current_date_string, date1, date2) var/time1 = rand(0, 99999999) var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]" - T.time = pick("", worldtime2text(), time2) + T.time = pick("", station_time_timestamp(), time2) T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD") affected_account.transaction_log.Add(T) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index 8f16d2636ea..2ea618acd32 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -46,7 +46,7 @@ if(areas && areas.len > 0) var/my_department = "[station_name()] firewall subroutines" - var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [worldtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.
" + var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [station_time_timestamp()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.
" for(var/obj/machinery/message_server/MS in world) MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2) for(var/mob/living/silicon/ai/A in player_list) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 3d3ce0aa613..df035379331 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -68,7 +68,7 @@ stack_list[processed_sheet] = s // Not including tg's ignoring of metal, glass being stocked because if cargo's not telling science when ores are there, they probably won't // help with restocking metal/glass either - var/msg = "\[[worldtime2text()]\]: [capitalize(s.name)] sheets have been stocked in the ore reclaimer." + var/msg = "\[[station_time_timestamp()]\]: [capitalize(s.name)] sheets have been stocked in the ore reclaimer." for(var/obj/machinery/requests_console/D in allConsoles) if(D.department in src.supply_consoles) if(supply_consoles[D.department] == null || (s.name in supply_consoles[D.department])) diff --git a/code/modules/mob/living/carbon/alien/death.dm b/code/modules/mob/living/carbon/alien/death.dm index 2229d4c9d0c..6d663d6f3d4 100644 --- a/code/modules/mob/living/carbon/alien/death.dm +++ b/code/modules/mob/living/carbon/alien/death.dm @@ -55,6 +55,6 @@ update_icons() timeofdeath = world.time - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) return ..(gibbed) diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index 6db93c4ddd2..7d1101ca7d8 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -9,7 +9,7 @@ update_canmove() timeofdeath = world.time - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) living_mob_list -= src return ..(gibbed) diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/carbon/brain/death.dm index 8303c3ef04a..cbec4409fd6 100644 --- a/code/modules/mob/living/carbon/brain/death.dm +++ b/code/modules/mob/living/carbon/brain/death.dm @@ -11,7 +11,7 @@ see_invisible = SEE_INVISIBLE_LEVEL_TWO timeofdeath = world.time - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) //mind. ? + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) //mind. ? return ..(gibbed) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 8ad380dbc9f..514fd2fe83f 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -119,7 +119,7 @@ timeofdeath = world.time med_hud_set_health() med_hud_set_status() - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) if(ticker && ticker.mode) // log_to_dd("k") sql_report_death(src) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index dca0d82874e..ae079eb8c0c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -835,13 +835,13 @@ else if(ishuman(usr)) var/mob/living/carbon/human/U = usr - R.fields["comments"] += "Set to [setcriminal] by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [worldtime2text()] with comment: [t1]
" + R.fields["comments"] += "Set to [setcriminal] by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()] with comment: [t1]
" if(isrobot(usr)) var/mob/living/silicon/robot/U = usr - R.fields["comments"] += "Set to [setcriminal] by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [worldtime2text()] with comment: [t1]
" + R.fields["comments"] += "Set to [setcriminal] by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()] with comment: [t1]
" if(isAI(usr)) var/mob/living/silicon/ai/U = usr - R.fields["comments"] += "Set to [setcriminal] by [U.name] (artificial intelligence) on [current_date_string] [worldtime2text()] with comment: [t1]
" + R.fields["comments"] += "Set to [setcriminal] by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()] with comment: [t1]
" R.fields["criminal"] = setcriminal log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [setcriminal], comment: [t1]") @@ -931,13 +931,13 @@ return if(ishuman(usr)) var/mob/living/carbon/human/U = usr - R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [worldtime2text()]
[t1]" + R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]
[t1]" if(isrobot(usr)) var/mob/living/silicon/robot/U = usr - R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [worldtime2text()]
[t1]" + R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]
[t1]" if(isAI(usr)) var/mob/living/silicon/ai/U = usr - R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [worldtime2text()]
[t1]" + R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]
[t1]" if(href_list["medical"]) if(hasHUD(usr,"medical")) @@ -1053,10 +1053,10 @@ return if(ishuman(usr)) var/mob/living/carbon/human/U = usr - R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [worldtime2text()]
[t1]" + R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]
[t1]" if(isrobot(usr)) var/mob/living/silicon/robot/U = usr - R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [worldtime2text()]
[t1]" + R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]
[t1]" if(href_list["lookitem"]) var/obj/item/I = locate(href_list["lookitem"]) diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 9947e6faeec..48718f2ab10 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -44,6 +44,6 @@ loc.icon_state = "aicard-404" timeofdeath = world.time - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) return ..(gibbed) diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 1c514a891ca..34af6a0d76a 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -206,7 +206,7 @@ to_chat(user, "\t Key: Electronics/Brute") to_chat(user, "\t Damage Specifics: [BU] - [BR]") if(M.timeofdeath && M.stat == DEAD) - to_chat(user, "Time of Disable: [worldtime2text(M.timeofdeath)]") + to_chat(user, "Time of Disable: [station_time_timestamp("hh:mm:ss", M.timeofdeath)]") var/mob/living/silicon/robot/H = M var/list/damaged = H.get_damaged_components(1,1,1) to_chat(user, "Localized Damage:") diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 99b79d35360..82667be2d3d 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -64,7 +64,7 @@ see_invisible = SEE_INVISIBLE_LEVEL_TWO update_icons() timeofdeath = world.time - if(mind) mind.store_memory("Time of death: [worldtime2text(timeofdeath)]", 0) + if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) sql_report_cyborg_death(src) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 06bd75f39e8..65a6745e5f2 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -970,7 +970,8 @@ var/list/slot_equipment_priority = list( \ // this function displays the station time in the status panel /mob/proc/show_stat_station_time() - stat(null, "Station Time: [worldtime2text()]") + stat(null, "Round Time: [worldtime2text()]") + stat(null, "Station Time: [station_time_timestamp()]") // this function displays the shuttles ETA in the status panel if the shuttle has been called /mob/proc/show_stat_emergency_shuttle_eta() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 9d16d66a64c..569730aefd3 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -97,8 +97,7 @@ statpanel("Status") if(client.statpanel == "Status" && ticker) - if(ticker.current_state != GAME_STATE_PREGAME) - stat(null, "Station Time: [worldtime2text()]") + show_stat_station_time() /mob/new_player/Topic(href, href_list[]) diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index 55998071e71..33a94cc31a5 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -21,12 +21,12 @@ var/global/static/ntnrc_uid = 0 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() diff --git a/code/modules/modular_computers/NTNet/NTNet.dm b/code/modules/modular_computers/NTNet/NTNet.dm index ed69207f0ee..0fbcdae9f08 100644 --- a/code/modules/modular_computers/NTNet/NTNet.dm +++ b/code/modules/modular_computers/NTNet/NTNet.dm @@ -36,7 +36,7 @@ var/global/datum/ntnet/ntnet_global = new() // Simplified logging: Adds a log. log_string is mandatory parameter, source is optional. /datum/ntnet/proc/add_log(log_string, obj/item/weapon/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 diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index 4044e2530bf..49cef4ffa26 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -105,7 +105,7 @@ data["PC_programheaders"] = program_headers - data["PC_stationtime"] = worldtime2text() + data["PC_stationtime"] = station_time_timestamp() data["PC_showexitprogram"] = active_program ? 1 : 0 // Hides "Exit Program" button on mainscreen return data diff --git a/code/modules/modular_computers/file_system/programs/command/card.dm b/code/modules/modular_computers/file_system/programs/command/card.dm index 8cd1043bea6..8457b5026da 100644 --- a/code/modules/modular_computers/file_system/programs/command/card.dm +++ b/code/modules/modular_computers/file_system/programs/command/card.dm @@ -259,7 +259,7 @@ var/title var/content if(mode == 2) - title = "crew manifest ([worldtime2text()])" + title = "crew manifest ([station_time_timestamp()])" content = "

Crew Manifest


[data_core ? data_core.get_manifest(0) : ""]" else if(modify && !mode) title = "access report" diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index 81281fe3dcc..e17913e3671 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -296,7 +296,7 @@ obj/machinery/lapvend/attackby(obj/item/I, mob/user) T.amount = "[total_price]" T.source_terminal = name T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() vendor_account.transaction_log.Add(T) return 1 return 0 diff --git a/code/modules/ninja/suit/SpiderOS.dm b/code/modules/ninja/suit/SpiderOS.dm index 8a2fadc7634..2764e3d0270 100644 --- a/code/modules/ninja/suit/SpiderOS.dm +++ b/code/modules/ninja/suit/SpiderOS.dm @@ -30,7 +30,7 @@ dat += "

SpiderOS v.1.337

" dat += "Welcome, [U.real_name].
" dat += "
" - dat += " Current Time: [worldtime2text()]
" + dat += " Current Time: [station_time_timestamp()]
" dat += " Battery Life: [round(cell.charge/100)]%
" dat += " Smoke Bombs: \Roman [s_bombs]
" dat += "

" diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 71b1bee18a2..ade10febd2c 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -42,7 +42,7 @@ var/list/adminfaxes = list() html += "" html += "" html += "" - html += "" + html += "" if(A.sent_by) var/mob/living/S = A.sent_by html += "" @@ -71,7 +71,7 @@ var/list/adminfaxes = list() html += "" html += "" html += "" - html += "" + html += "" if(F.sent_by) var/mob/living/S = F.sent_by html += "" diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index e002049e55f..33ad0644440 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -169,7 +169,7 @@ var/global/list/obj/item/device/pda/PDAs = list() data["useRetro"] = retro_mode data["cartridge_name"] = cartridge ? cartridge.name : "" - data["stationTime"] = worldtime2text() + data["stationTime"] = station_time_timestamp() data["app"] = list() current_app.update_ui(user, data) diff --git a/code/modules/pda/utilities.dm b/code/modules/pda/utilities.dm index 558af083eb8..f53de429c55 100644 --- a/code/modules/pda/utilities.dm +++ b/code/modules/pda/utilities.dm @@ -49,7 +49,7 @@ user.show_message("\t Key: Suffocation/Toxin/Burns/Brute", 1) user.show_message("\t Body Temperature: [C.bodytemperature-T0C]°C ([C.bodytemperature*1.8-459.67]°F)", 1) if(C.timeofdeath && (C.stat == DEAD || (C.status_flags & FAKEDEATH))) - user.show_message("\t Time of Death: [worldtime2text(C.timeofdeath)]") + user.show_message("\t Time of Death: [station_time_timestamp("hh:mm:ss", C.timeofdeath)]") if(istype(C, /mob/living/carbon/human)) var/mob/living/carbon/human/H = C var/list/damaged = H.get_damaged_organs(1,1) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 4842fcd2631..dac03bf0f16 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -104,6 +104,10 @@ var/shock_proof = 0 //if set to 1, this APC will not arc bolts of electricity if it's overloaded. + // Nightshift + var/nightshift_lights = FALSE + var/last_nightshift_switch = 0 + /obj/machinery/power/apc/worn_out name = "\improper Worn out APC" keep_preset_name = 1 @@ -773,6 +777,7 @@ data["siliconUser"] = istype(user, /mob/living/silicon) data["siliconLock"] = locked data["malfStatus"] = get_malf_status(user) + data["nightshiftLights"] = nightshift_lights var/powerChannels[0] powerChannels[++powerChannels.len] = list( @@ -904,6 +909,16 @@ toggle_breaker() + else if(href_list["toggle_nightshift"]) + if(!is_authenticated(usr)) + return + + if(last_nightshift_switch < world.time + 100) // don't spam... + to_chat(usr, "[src]'s night lighting circuit breaker is still cycling!") + return + last_nightshift_switch = world.time + set_nightshift(!nightshift_lights) + else if(href_list["cmode"]) if(!is_authenticated(usr)) return @@ -1353,4 +1368,13 @@ else return 0 +/obj/machinery/power/apc/proc/set_nightshift(on) + set waitfor = FALSE + nightshift_lights = on + for(var/obj/machinery/light/L in area) + if(L.nightshift_allowed) + L.nightshift_enabled = nightshift_lights + L.update(FALSE) + CHECK_TICK + #undef APC_UPDATE_ICON_COOLDOWN diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 7a6c648610f..16a9b577e90 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -153,6 +153,13 @@ var/rigged = 0 // true if rigged to explode var/lightmaterials = list(MAT_GLASS=100) //stores the materials the light is made of to stop infinite glass exploit + 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_light_range = 8 + var/nightshift_light_power = 0.45 + var/nightshift_light_color = "#FFDDCC" + + // the smaller bulb light fixture /obj/machinery/light/small @@ -161,6 +168,7 @@ fitting = "bulb" brightness_range = 4 brightness_color = "#a0a080" + nightshift_light_range = 4 desc = "A small lighting fixture." light_type = /obj/item/weapon/light/bulb @@ -226,18 +234,24 @@ return // update the icon_state and luminosity of the light depending on its state -/obj/machinery/light/proc/update(var/trigger = 1) - +/obj/machinery/light/proc/update(var/trigger = TRUE) + switch(status) + if(LIGHT_BROKEN, LIGHT_BURNED, LIGHT_EMPTY) + on = FALSE update_icon() if(on) - if(light_range != brightness_range || light_power != brightness_power || light_color != brightness_color) + var/BR = nightshift_enabled ? nightshift_light_range : brightness_range + var/PO = nightshift_enabled ? nightshift_light_power : brightness_power + var/CO = nightshift_enabled ? nightshift_light_color : brightness_color + var/matching = light_range == BR && light_power == PO && light_color == CO + if(!matching) switchcount++ if(rigged) if(status == LIGHT_OK && trigger) log_admin("LOG: Rigged light explosion, last touched by [fingerprintslast]") message_admins("LOG: Rigged light explosion, last touched by [fingerprintslast]") explode() - else if( prob( min(60, switchcount*switchcount*0.01) ) ) + else if(prob(min(60, switchcount * switchcount * 0.01))) if(status == LIGHT_OK && trigger) status = LIGHT_BURNED icon_state = "[base_state]-burned" @@ -245,7 +259,7 @@ set_light(0) else use_power = 2 - set_light(brightness_range, brightness_power, brightness_color) + set_light(BR, PO, CO) else use_power = 1 set_light(0) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 86ec72e238b..8b3c20be3ce 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -99,7 +99,7 @@ playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc) P.info = "
Chemical Analysis

" - P.info += "Time of analysis: [worldtime2text(world.time)]

" + P.info += "Time of analysis: [station_time_timestamp()]

" P.info += "Chemical name: [href_list["name"]]
" if(href_list["name"] == "Blood") var/datum/reagents/R = beaker.reagents diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index 0a6432e6d48..35d47c9be28 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -228,7 +228,7 @@ // Time interpreter.SetProc("time", /proc/time) - interpreter.SetProc("timestamp", /proc/timestamp) + interpreter.SetProc("timestamp", /proc/gameTimestamp) // Run the compiled code interpreter.Run() diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index c31d55f3077..1cb55edf6d8 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -155,10 +155,6 @@ //writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/time() called tick#: [world.time]") return world.time + (12 HOURS) -/proc/timestamp(var/format = "hh:mm:ss") // Get the game time in text - //writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/timestamp() called tick#: [world.time]") - return time2text(world.time + (10 HOURS), format) // Yes, 10, not 12 hours, for some reason time2text() is being moronic (T-thanks BYOND), and it's adding 2 hours to this, I don't even know either. - proc/string_explode(var/string, var/separator = "") //writepanic("[__FILE__].[__LINE__] \\/proc/string_explode() called tick#: [world.time]") if(istext(string) && (istext(separator) || isnull(separator))) diff --git a/code/modules/security_levels/keycard authentication.dm b/code/modules/security_levels/keycard authentication.dm index e8e5a78d597..4400d6b96b8 100644 --- a/code/modules/security_levels/keycard authentication.dm +++ b/code/modules/security_levels/keycard authentication.dm @@ -159,7 +159,7 @@ to_chat(usr, "All Emergency Response Teams are dispatched and can not be called at this time.") return to_chat(usr, "ERT request transmitted.") - print_centcom_report(ert_reason, worldtime2text() +" ERT Request") + print_centcom_report(ert_reason, station_time_timestamp() + " ERT Request") var/fullmin_count = 0 for(var/client/C in admins) diff --git a/code/modules/security_levels/security levels.dm b/code/modules/security_levels/security levels.dm index fa1e6b6c841..c6a0e8783f3 100644 --- a/code/modules/security_levels/security levels.dm +++ b/code/modules/security_levels/security levels.dm @@ -123,6 +123,7 @@ atc.reroute_traffic(yes = TRUE) // Tell them fuck off we're busy. else atc.reroute_traffic(yes = FALSE) + SSnightshift.check_nightshift() else return diff --git a/code/modules/store/store.dm b/code/modules/store/store.dm index d93d56acc41..84c85fea29e 100644 --- a/code/modules/store/store.dm +++ b/code/modules/store/store.dm @@ -41,7 +41,7 @@ var/global/datum/store/centcomm_store=new T.purpose = "Purchase of [item.name]" T.amount = -amount T.date = current_date_string - T.time = worldtime2text() + T.time = station_time_timestamp() T.source_terminal = "\[CLASSIFIED\] Terminal #[rand(111,333)]" mind.initial_account.transaction_log.Add(T) return 1 diff --git a/code/world.dm b/code/world.dm index df7fc20437c..872b0cbd037 100644 --- a/code/world.dm +++ b/code/world.dm @@ -116,7 +116,8 @@ var/world_topic_spam_protect_time = world.timeofday s["ai"] = config.allow_ai s["host"] = host ? host : null s["players"] = list() - s["stationtime"] = worldtime2text() + s["roundtime"] = worldtime2text() + s["stationtime"] = station_time_timestamp() var/player_count = 0 var/admin_count = 0 diff --git a/config/example/config.txt b/config/example/config.txt index 5e6f9465708..95ec5292021 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -370,4 +370,4 @@ HIGH_POP_MC_TICK_RATE 1.1 HIGH_POP_MC_MODE_AMOUNT 65 ##Disengage high pop mode if player count drops below this -DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 \ No newline at end of file +DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 diff --git a/config/example/game_options.txt b/config/example/game_options.txt index ae3cc153995..8a477dd6610 100644 --- a/config/example/game_options.txt +++ b/config/example/game_options.txt @@ -65,4 +65,10 @@ BOMBCAP 20 ## Set to 0/commented for "off", silicons will just start with Crewsimov. ## Set to 1 for "random", silicons will start with a random lawset picked from (at the time of writing): Nanotrasen Default, P.A.L.A.D.I.N., Corporate, Robop and Crewsimov. More can be added by changing the law datum "default" variable in ai_laws.dm. -DEFAULT_LAWS 1 \ No newline at end of file +DEFAULT_LAWS 1 + +## Randomize roundstart time (anywhere from 00:00 to 23:00 instead of always starting at 12:00) +RANDOMIZE_SHIFT_TIME + +## Enable Nightshift - Causes the station to go into "night mode" from 19:30 to 07:30. Best used with RANDOMIZED_SHIFT_TIME. +ENABLE_NIGHT_SHIFTS \ No newline at end of file diff --git a/nano/templates/apc.tmpl b/nano/templates/apc.tmpl index 9e0959c1d09..234074fe577 100644 --- a/nano/templates/apc.tmpl +++ b/nano/templates/apc.tmpl @@ -177,4 +177,21 @@ {{/if}} +
+
+ Night Shift Lighting: +
+
+ {{if data.locked}} + {{if data.nightshiftLights}} + On + {{else}} + Off + {{/if}} + {{else}} + {{:helper.link('Enabled', 'lightbulb-o', {'toggle_nightshift' : 1}, data.nightshiftLights ? 'selected' : null)}}{{:helper.link('Disabled', 'lightbulb-o', {'toggle_nightshift' : 1}, data.nightshiftLights ? null : 'selected')}} + {{/if}} +
+
+ diff --git a/paradise.dme b/paradise.dme index 75274b9ee46..e12ff9f6372 100644 --- a/paradise.dme +++ b/paradise.dme @@ -209,6 +209,7 @@ #include "code\controllers\ProcessScheduler\core\processScheduler.dm" #include "code\controllers\subsystem\air.dm" #include "code\controllers\subsystem\fires.dm" +#include "code\controllers\subsystem\nightshift.dm" #include "code\controllers\subsystem\spacedrift.dm" #include "code\controllers\subsystem\throwing.dm" #include "code\datums\action.dm"
Item
[severity_to_string[severity]][worldtime2text(max(EC.next_event_time, world.time))][station_time_timestamp("hh:mm:ss", max(EC.next_event_time, world.time))][round(next_event_at / 600, 0.1)]" html += "--" @@ -188,7 +188,7 @@ html += "
[severity_to_string[EM.severity]][EM.name][no_end ? "N/A" : worldtime2text(ends_at)][no_end ? "N/A" : station_time_timestamp("hh:mm:ss", ends_at)][no_end ? "N/A" : ends_in]Stop
[A.name][A.from_department][A.to_department][worldtime2text(A.sent_at)][station_time_timestamp("hh:mm:ss", A.sent_at)][S.name][F.name][F.from_department][F.to_department][worldtime2text(F.sent_at)][station_time_timestamp("hh:mm:ss", F.sent_at)][S.name]