diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm
index 75842ca30f..991d64e20b 100644
--- a/code/_helpers/time.dm
+++ b/code/_helpers/time.dm
@@ -29,16 +29,16 @@
return wtime + (time_offset + wusage) * world.tick_lag
-var/roundstart_hour = 0
+var/roundstart_hour
var/station_date = ""
var/next_station_date_change = 1 DAY
-#define station_adjusted_time(time) time2text(time + station_time_in_ticks, "hh:mm")
+#define duration2stationtime(time) time2text(station_time_in_ticks + time, "hh:mm")
+#define worldtime2stationtime(time) time2text(roundstart_hour HOURS + time, "hh:mm")
#define round_duration_in_ticks (round_start_time ? world.time - round_start_time : 0)
#define station_time_in_ticks (roundstart_hour HOURS + round_duration_in_ticks)
/proc/stationtime2text()
- if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
return time2text(station_time_in_ticks, "hh:mm")
/proc/stationdate2text()
@@ -53,7 +53,7 @@ var/next_station_date_change = 1 DAY
return station_date
/proc/time_stamp()
- return time2text(world.timeofday, "hh:mm:ss")
+ return time2text(station_time_in_ticks, "hh:mm:ss")
/* Returns 1 if it is the selected month and day */
proc/isDay(var/month, var/day)
@@ -96,4 +96,8 @@ var/round_start_time = 0
//Can be useful for things dependent on process timing
/proc/process_schedule_interval(var/process_name)
var/datum/controller/process/process = processScheduler.getProcess(process_name)
- return process.schedule_interval
\ No newline at end of file
+ return process.schedule_interval
+
+/hook/startup/proc/set_roundstart_hour()
+ roundstart_hour = pick(2,7,12,17)
+ return 1
\ No newline at end of file
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 27e0281e63..3fd49c4828 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -410,7 +410,7 @@
visible_message("\The [src] rattles and prints out a sheet of paper.")
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.info = "
Body Scan - [href_list["name"]]
"
- P.info += "Time of scan: [stationtime2text(world.time)]
"
+ P.info += "Time of scan: [worldtime2stationtime(world.time)]
"
P.info += "[printing_text]"
P.info += "
Notes:
"
P.name = "Body Scan - [href_list["name"]]"
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index bb70d668bd..4c0f0591b2 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -20,17 +20,17 @@
/obj/item/weapon/card/id/guest/examine(mob/user)
..(user)
if (world.time < expiration_time)
- user << "This pass expires at [stationtime2text(expiration_time)]."
+ user << "This pass expires at [worldtime2stationtime(expiration_time)]."
else
- user << "It expired at [stationtime2text(expiration_time)]."
+ user << "It expired at [worldtime2stationtime(expiration_time)]."
/obj/item/weapon/card/id/guest/read()
if(!Adjacent(usr))
return //Too far to read
if (world.time > expiration_time)
- usr << "This pass expired at [stationtime2text(expiration_time)]."
+ usr << "This pass expired at [worldtime2stationtime(expiration_time)]."
else
- usr << "This pass expires at [stationtime2text(expiration_time)]."
+ usr << "This pass expires at [worldtime2stationtime(expiration_time)]."
usr << "It grants access to following areas:"
for (var/A in temp_access)
@@ -213,7 +213,7 @@
if (A)
var/area = get_access_desc(A)
entry += "[i > 1 ? ", [area]" : "[area]"]"
- entry += ". Expires at [stationtime2text(world.time + duration*10*60)]."
+ entry += ". Expires at [worldtime2stationtime(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/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm
index 1c5e9c97d2..a68e65b6ea 100644
--- a/code/game/objects/items/devices/uplink.dm
+++ b/code/game/objects/items/devices/uplink.dm
@@ -158,7 +158,7 @@
nanoui_data["categories"] = categories
nanoui_data["discount_name"] = discount_item ? discount_item.name : ""
nanoui_data["discount_amount"] = (1-discount_amount)*100
- nanoui_data["offer_expiry"] = stationtime2text(next_offer_time)
+ nanoui_data["offer_expiry"] = worldtime2stationtime(next_offer_time)
else if(nanoui_menu == 1)
var/items[0]
for(var/datum/uplink_item/item in category.items)
diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm
index 65632493dc..3cbc75bfeb 100644
--- a/code/game/objects/items/weapons/autopsy.dm
+++ b/code/game/objects/items/weapons/autopsy.dm
@@ -86,7 +86,7 @@
var/scan_data = ""
if(timeofdeath)
- scan_data += "Time of death: [stationtime2text(timeofdeath)]
"
+ scan_data += "Time of death: [worldtime2stationtime(timeofdeath)]
"
var/n = 1
for(var/wdata_idx in wdata)
@@ -133,7 +133,7 @@
if(damaging_weapon)
scan_data += "Severity: [damage_desc]
"
scan_data += "Hits by weapon: [total_hits]
"
- scan_data += "Approximate time of wound infliction: [stationtime2text(age)]
"
+ scan_data += "Approximate time of wound infliction: [worldtime2stationtime(age)]
"
scan_data += "Affected limbs: [D.organ_names]
"
scan_data += "Possible weapons:
"
for(var/weapon_name in weapon_chances)
diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm
index 127ae5898e..534c5aa56d 100644
--- a/code/modules/events/event_manager.dm
+++ b/code/modules/events/event_manager.dm
@@ -44,7 +44,7 @@
if(EM.add_to_queue)
EC.available_events += EM
- log_debug("Event '[EM.name]' has completed at [stationtime2text()].")
+ log_debug("Event '[EM.name]' has completed at [worldtime2stationtime(world.time)].")
/datum/event_manager/proc/delay_events(var/severity, var/delay)
var/list/datum/event_container/EC = event_containers[severity]
@@ -67,12 +67,12 @@
var/datum/event_meta/EM = E.event_meta
if(EM.name == "Nothing")
continue
- var/message = "'[EM.name]' began at [stationtime2text(E.startedAt)] "
+ var/message = "'[EM.name]' began at [worldtime2stationtime(E.startedAt)] "
if(E.isRunning)
message += "and is still running."
else
if(E.endedAt - E.startedAt > MinutesToTicks(5)) // Only mention end time if the entire duration was more than 5 minutes
- message += "and ended at [stationtime2text(E.endedAt)]."
+ message += "and ended at [worldtime2stationtime(E.endedAt)]."
else
message += "and ran to completion."
@@ -130,7 +130,7 @@
var/next_event_at = max(0, EC.next_event_time - world.time)
html += ""
html += "| [severity_to_string[severity]] | "
- html += "[stationtime2text(max(EC.next_event_time, world.time))] | "
+ html += "[worldtime2stationtime(max(EC.next_event_time, world.time))] | "
html += "[round(next_event_at / 600, 0.1)] | "
html += ""
html += "--"
@@ -178,7 +178,7 @@
html += " |
"
html += "| [severity_to_string[EM.severity]] | "
html += "[EM.name] | "
- html += "[stationtime2text(ends_at)] | "
+ html += "[worldtime2stationtime(ends_at)] | "
html += "[ends_in] | "
html += "Stop | "
html += "
"