mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
more time proc call fixes
This commit is contained in:
@@ -29,16 +29,16 @@
|
|||||||
|
|
||||||
return wtime + (time_offset + wusage) * world.tick_lag
|
return wtime + (time_offset + wusage) * world.tick_lag
|
||||||
|
|
||||||
var/roundstart_hour = 0
|
var/roundstart_hour
|
||||||
var/station_date = ""
|
var/station_date = ""
|
||||||
var/next_station_date_change = 1 DAY
|
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 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)
|
#define station_time_in_ticks (roundstart_hour HOURS + round_duration_in_ticks)
|
||||||
|
|
||||||
/proc/stationtime2text()
|
/proc/stationtime2text()
|
||||||
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
|
|
||||||
return time2text(station_time_in_ticks, "hh:mm")
|
return time2text(station_time_in_ticks, "hh:mm")
|
||||||
|
|
||||||
/proc/stationdate2text()
|
/proc/stationdate2text()
|
||||||
@@ -53,7 +53,7 @@ var/next_station_date_change = 1 DAY
|
|||||||
return station_date
|
return station_date
|
||||||
|
|
||||||
/proc/time_stamp()
|
/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 */
|
/* Returns 1 if it is the selected month and day */
|
||||||
proc/isDay(var/month, var/day)
|
proc/isDay(var/month, var/day)
|
||||||
@@ -97,3 +97,7 @@ var/round_start_time = 0
|
|||||||
/proc/process_schedule_interval(var/process_name)
|
/proc/process_schedule_interval(var/process_name)
|
||||||
var/datum/controller/process/process = processScheduler.getProcess(process_name)
|
var/datum/controller/process/process = processScheduler.getProcess(process_name)
|
||||||
return process.schedule_interval
|
return process.schedule_interval
|
||||||
|
|
||||||
|
/hook/startup/proc/set_roundstart_hour()
|
||||||
|
roundstart_hour = pick(2,7,12,17)
|
||||||
|
return 1
|
||||||
@@ -410,7 +410,7 @@
|
|||||||
visible_message("<span class='notice'>\The [src] rattles and prints out a sheet of paper.</span>")
|
visible_message("<span class='notice'>\The [src] rattles and prints out a sheet of paper.</span>")
|
||||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
|
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
|
||||||
P.info = "<CENTER><B>Body Scan - [href_list["name"]]</B></CENTER><BR>"
|
P.info = "<CENTER><B>Body Scan - [href_list["name"]]</B></CENTER><BR>"
|
||||||
P.info += "<b>Time of scan:</b> [stationtime2text(world.time)]<br><br>"
|
P.info += "<b>Time of scan:</b> [worldtime2stationtime(world.time)]<br><br>"
|
||||||
P.info += "[printing_text]"
|
P.info += "[printing_text]"
|
||||||
P.info += "<br><br><b>Notes:</b><br>"
|
P.info += "<br><br><b>Notes:</b><br>"
|
||||||
P.name = "Body Scan - [href_list["name"]]"
|
P.name = "Body Scan - [href_list["name"]]"
|
||||||
|
|||||||
@@ -20,17 +20,17 @@
|
|||||||
/obj/item/weapon/card/id/guest/examine(mob/user)
|
/obj/item/weapon/card/id/guest/examine(mob/user)
|
||||||
..(user)
|
..(user)
|
||||||
if (world.time < expiration_time)
|
if (world.time < expiration_time)
|
||||||
user << "<span class='notice'>This pass expires at [stationtime2text(expiration_time)].</span>"
|
user << "<span class='notice'>This pass expires at [worldtime2stationtime(expiration_time)].</span>"
|
||||||
else
|
else
|
||||||
user << "<span class='warning'>It expired at [stationtime2text(expiration_time)].</span>"
|
user << "<span class='warning'>It expired at [worldtime2stationtime(expiration_time)].</span>"
|
||||||
|
|
||||||
/obj/item/weapon/card/id/guest/read()
|
/obj/item/weapon/card/id/guest/read()
|
||||||
if(!Adjacent(usr))
|
if(!Adjacent(usr))
|
||||||
return //Too far to read
|
return //Too far to read
|
||||||
if (world.time > expiration_time)
|
if (world.time > expiration_time)
|
||||||
usr << "<span class='notice'>This pass expired at [stationtime2text(expiration_time)].</span>"
|
usr << "<span class='notice'>This pass expired at [worldtime2stationtime(expiration_time)].</span>"
|
||||||
else
|
else
|
||||||
usr << "<span class='notice'>This pass expires at [stationtime2text(expiration_time)].</span>"
|
usr << "<span class='notice'>This pass expires at [worldtime2stationtime(expiration_time)].</span>"
|
||||||
|
|
||||||
usr << "<span class='notice'>It grants access to following areas:</span>"
|
usr << "<span class='notice'>It grants access to following areas:</span>"
|
||||||
for (var/A in temp_access)
|
for (var/A in temp_access)
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
if (A)
|
if (A)
|
||||||
var/area = get_access_desc(A)
|
var/area = get_access_desc(A)
|
||||||
entry += "[i > 1 ? ", [area]" : "[area]"]"
|
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)
|
internal_log.Add(entry)
|
||||||
|
|
||||||
var/obj/item/weapon/card/id/guest/pass = new(src.loc)
|
var/obj/item/weapon/card/id/guest/pass = new(src.loc)
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
nanoui_data["categories"] = categories
|
nanoui_data["categories"] = categories
|
||||||
nanoui_data["discount_name"] = discount_item ? discount_item.name : ""
|
nanoui_data["discount_name"] = discount_item ? discount_item.name : ""
|
||||||
nanoui_data["discount_amount"] = (1-discount_amount)*100
|
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)
|
else if(nanoui_menu == 1)
|
||||||
var/items[0]
|
var/items[0]
|
||||||
for(var/datum/uplink_item/item in category.items)
|
for(var/datum/uplink_item/item in category.items)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
var/scan_data = ""
|
var/scan_data = ""
|
||||||
|
|
||||||
if(timeofdeath)
|
if(timeofdeath)
|
||||||
scan_data += "<b>Time of death:</b> [stationtime2text(timeofdeath)]<br><br>"
|
scan_data += "<b>Time of death:</b> [worldtime2stationtime(timeofdeath)]<br><br>"
|
||||||
|
|
||||||
var/n = 1
|
var/n = 1
|
||||||
for(var/wdata_idx in wdata)
|
for(var/wdata_idx in wdata)
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
if(damaging_weapon)
|
if(damaging_weapon)
|
||||||
scan_data += "Severity: [damage_desc]<br>"
|
scan_data += "Severity: [damage_desc]<br>"
|
||||||
scan_data += "Hits by weapon: [total_hits]<br>"
|
scan_data += "Hits by weapon: [total_hits]<br>"
|
||||||
scan_data += "Approximate time of wound infliction: [stationtime2text(age)]<br>"
|
scan_data += "Approximate time of wound infliction: [worldtime2stationtime(age)]<br>"
|
||||||
scan_data += "Affected limbs: [D.organ_names]<br>"
|
scan_data += "Affected limbs: [D.organ_names]<br>"
|
||||||
scan_data += "Possible weapons:<br>"
|
scan_data += "Possible weapons:<br>"
|
||||||
for(var/weapon_name in weapon_chances)
|
for(var/weapon_name in weapon_chances)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
if(EM.add_to_queue)
|
if(EM.add_to_queue)
|
||||||
EC.available_events += EM
|
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)
|
/datum/event_manager/proc/delay_events(var/severity, var/delay)
|
||||||
var/list/datum/event_container/EC = event_containers[severity]
|
var/list/datum/event_container/EC = event_containers[severity]
|
||||||
@@ -67,12 +67,12 @@
|
|||||||
var/datum/event_meta/EM = E.event_meta
|
var/datum/event_meta/EM = E.event_meta
|
||||||
if(EM.name == "Nothing")
|
if(EM.name == "Nothing")
|
||||||
continue
|
continue
|
||||||
var/message = "'[EM.name]' began at [stationtime2text(E.startedAt)] "
|
var/message = "'[EM.name]' began at [worldtime2stationtime(E.startedAt)] "
|
||||||
if(E.isRunning)
|
if(E.isRunning)
|
||||||
message += "and is still running."
|
message += "and is still running."
|
||||||
else
|
else
|
||||||
if(E.endedAt - E.startedAt > MinutesToTicks(5)) // Only mention end time if the entire duration was more than 5 minutes
|
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
|
else
|
||||||
message += "and ran to completion."
|
message += "and ran to completion."
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
var/next_event_at = max(0, EC.next_event_time - world.time)
|
var/next_event_at = max(0, EC.next_event_time - world.time)
|
||||||
html += "<tr>"
|
html += "<tr>"
|
||||||
html += "<td>[severity_to_string[severity]]</td>"
|
html += "<td>[severity_to_string[severity]]</td>"
|
||||||
html += "<td>[stationtime2text(max(EC.next_event_time, world.time))]</td>"
|
html += "<td>[worldtime2stationtime(max(EC.next_event_time, world.time))]</td>"
|
||||||
html += "<td>[round(next_event_at / 600, 0.1)]</td>"
|
html += "<td>[round(next_event_at / 600, 0.1)]</td>"
|
||||||
html += "<td>"
|
html += "<td>"
|
||||||
html += "<A align='right' href='?src=\ref[src];dec_timer=2;event=\ref[EC]'>--</A>"
|
html += "<A align='right' href='?src=\ref[src];dec_timer=2;event=\ref[EC]'>--</A>"
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
html += "<tr>"
|
html += "<tr>"
|
||||||
html += "<td>[severity_to_string[EM.severity]]</td>"
|
html += "<td>[severity_to_string[EM.severity]]</td>"
|
||||||
html += "<td>[EM.name]</td>"
|
html += "<td>[EM.name]</td>"
|
||||||
html += "<td>[stationtime2text(ends_at)]</td>"
|
html += "<td>[worldtime2stationtime(ends_at)]</td>"
|
||||||
html += "<td>[ends_in]</td>"
|
html += "<td>[ends_in]</td>"
|
||||||
html += "<td><A align='right' href='?src=\ref[src];stop=\ref[E]'>Stop</A></td>"
|
html += "<td><A align='right' href='?src=\ref[src];stop=\ref[E]'>Stop</A></td>"
|
||||||
html += "</tr>"
|
html += "</tr>"
|
||||||
|
|||||||
Reference in New Issue
Block a user