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).
This commit is contained in:
tigercat2000
2018-03-25 23:01:04 -07:00
parent 80cef82ebd
commit bc4fb3d79b
68 changed files with 264 additions and 121 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -159,7 +159,7 @@
spawn(0)
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(fingerprints && fingerprints.len)
+7 -7
View File
@@ -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, "<span class='info'>You insert [C] into [src].</span>")
@@ -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)]<span class='warning'>Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.</span>")
@@ -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)]<span class='notice'>Access granted. Welcome user '[authenticated_account.owner_name].'</span>")
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)]<span class='warning'>You don't have enough funds to do that!</span>")
@@ -288,7 +288,7 @@ log transactions
<i>Account holder:</i> [authenticated_account.owner_name]<br>
<i>Account number:</i> [authenticated_account.account_number]<br>
<i>Balance:</i> $[authenticated_account.money]<br>
<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>
<i>Date and time:</i> [station_time_timestamp()], [current_date_string]<br><br>
<i>Service terminal ID:</i> [machine_id]<br>"}
//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
+6 -6
View File
@@ -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()
<i>Account number:</i> [M.account_number]<br>
<i>Account pin:</i> [M.remote_access_pin]<br>
<i>Starting balance:</i> $[M.money]<br>
<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>
<i>Date and time:</i> [station_time_timestamp()], [current_date_string]<br><br>
<i>Creation terminal ID:</i> [source_db.machine_id]<br>
<i>Authorised NT officer overseeing creation:</i> [overseer]<br>"}
// 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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)]<span class='warning'>You don't have that much money!</span>")
+2 -2
View File
@@ -173,7 +173,7 @@ var/const/POS_HEADER = {"<html>
receipt += myArea.name
receipt += "</div>"
receipt += {"<br />
<div>[worldtime2text()], [current_date_string]</div>
<div>[station_time_timestamp()], [current_date_string]</div>
<table>
<tr class=\"first\">
<th class=\"first\">Item</th>
@@ -369,7 +369,7 @@ var/const/POS_HEADER = {"<html>
logindata={"<a href="?src=[UID()];logout=1">[logged_in.name]</a>"}
var/dat = POS_HEADER + {"
<div class="navbar">
[worldtime2text()], [current_date_string]<br />
[station_time_timestamp()], [current_date_string]<br />
[logindata]
<a href="?src=[UID()];screen=[POS_SCREEN_ORDER]">Order</a> |
<a href="?src=[UID()];screen=[POS_SCREEN_PRODUCTS]">Products</a> |
+2 -2
View File
@@ -72,7 +72,7 @@
if(terminal_id)
T.source_terminal = terminal_id
T.date = current_date_string
T.time = worldtime2text()
T.time = station_time_timestamp()
dest.transaction_log.Add(T)
//
T = new()
@@ -84,7 +84,7 @@
if(terminal_id)
T.source_terminal = terminal_id
T.date = current_date_string
T.time = worldtime2text()
T.time = station_time_timestamp()
transaction_log.Add(T)
return 1
else
+5 -5
View File
@@ -55,7 +55,7 @@
var/datum/event_meta/EM = E.event_meta
EC.available_events += EM
log_debug("Event '[EM.name]' has completed at [worldtime2text()].")
log_debug("Event '[EM.name]' has completed at [station_time_timestamp()].")
/datum/event_manager/proc/delay_events(var/severity, var/delay)
var/list/datum/event_container/EC = event_containers[severity]
@@ -78,12 +78,12 @@
var/datum/event_meta/EM = E.event_meta
if(EM.name == "Nothing")
continue
var/message = "'[EM.name]' began at [worldtime2text(E.startedAt)] "
var/message = "'[EM.name]' began at [station_time_timestamp("hh:mm:ss", 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 [worldtime2text(E.endedAt)]."
message += "and ended at [station_time_timestamp("hh:mm:ss", E.endedAt)]."
else
message += "and ran to completion."
@@ -139,7 +139,7 @@
var/next_event_at = max(0, EC.next_event_time - world.time)
html += "<tr>"
html += "<td>[severity_to_string[severity]]</td>"
html += "<td>[worldtime2text(max(EC.next_event_time, world.time))]</td>"
html += "<td>[station_time_timestamp("hh:mm:ss", max(EC.next_event_time, world.time))]</td>"
html += "<td>[round(next_event_at / 600, 0.1)]</td>"
html += "<td>"
html += "<A align='right' href='?src=[UID()];dec_timer=2;event=\ref[EC]'>--</A>"
@@ -188,7 +188,7 @@
html += "<tr>"
html += "<td>[severity_to_string[EM.severity]]</td>"
html += "<td>[EM.name]</td>"
html += "<td>[no_end ? "N/A" : worldtime2text(ends_at)]</td>"
html += "<td>[no_end ? "N/A" : station_time_timestamp("hh:mm:ss", ends_at)]</td>"
html += "<td>[no_end ? "N/A" : ends_in]</td>"
html += "<td><A align='right' href='?src=[UID()];stop=\ref[E]'>Stop</A></td>"
html += "</tr>"
+2 -2
View File
@@ -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.<br>"
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)
+1 -1
View File
@@ -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.<br>"
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.<br>"
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)
+1 -1
View File
@@ -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]))
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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]<BR>"
R.fields["comments"] += "Set to [setcriminal] by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
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]<BR>"
R.fields["comments"] += "Set to [setcriminal] by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
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]<BR>"
R.fields["comments"] += "Set to [setcriminal] by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
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()]<BR>[t1]"
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[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()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[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()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]<BR>[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()]<BR>[t1]"
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[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()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
+1 -1
View File
@@ -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)
@@ -206,7 +206,7 @@
to_chat(user, "\t Key: <font color='#FFA500'>Electronics</font>/<font color='red'>Brute</font>")
to_chat(user, "\t Damage Specifics: <font color='#FFA500'>[BU]</font> - <font color='red'>[BR]</font>")
if(M.timeofdeath && M.stat == DEAD)
to_chat(user, "<span class='notice'>Time of Disable: [worldtime2text(M.timeofdeath)]</span>")
to_chat(user, "<span class='notice'>Time of Disable: [station_time_timestamp("hh:mm:ss", M.timeofdeath)]</span>")
var/mob/living/silicon/robot/H = M
var/list/damaged = H.get_damaged_components(1,1,1)
to_chat(user, "<span class='notice'>Localized Damage:</span>")
@@ -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)
+2 -1
View File
@@ -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()
+1 -2
View File
@@ -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[])
@@ -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()
@@ -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
@@ -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
@@ -259,7 +259,7 @@
var/title
var/content
if(mode == 2)
title = "crew manifest ([worldtime2text()])"
title = "crew manifest ([station_time_timestamp()])"
content = "<h4>Crew Manifest</h4><br>[data_core ? data_core.get_manifest(0) : ""]"
else if(modify && !mode)
title = "access report"
@@ -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
+1 -1
View File
@@ -30,7 +30,7 @@
dat += "<h2 ALIGN=CENTER>SpiderOS v.1.337</h2>"
dat += "Welcome, <b>[U.real_name]</b>.<br>"
dat += "<br>"
dat += "<img src=sos_10.png> Current Time: [worldtime2text()]<br>"
dat += "<img src=sos_10.png> Current Time: [station_time_timestamp()]<br>"
dat += "<img src=sos_9.png> Battery Life: [round(cell.charge/100)]%<br>"
dat += "<img src=sos_11.png> Smoke Bombs: \Roman [s_bombs]<br>"
dat += "<br><br>"
+2 -2
View File
@@ -42,7 +42,7 @@ var/list/adminfaxes = list()
html += "<td>[A.name]</td>"
html += "<td>[A.from_department]</td>"
html += "<td>[A.to_department]</td>"
html += "<td>[worldtime2text(A.sent_at)]</td>"
html += "<td>[station_time_timestamp("hh:mm:ss", A.sent_at)]</td>"
if(A.sent_by)
var/mob/living/S = A.sent_by
html += "<td><A HREF='?_src_=holder;adminplayeropts=\ref[A.sent_by]'>[S.name]</A></td>"
@@ -71,7 +71,7 @@ var/list/adminfaxes = list()
html += "<td>[F.name]</td>"
html += "<td>[F.from_department]</td>"
html += "<td>[F.to_department]</td>"
html += "<td>[worldtime2text(F.sent_at)]</td>"
html += "<td>[station_time_timestamp("hh:mm:ss", F.sent_at)]</td>"
if(F.sent_by)
var/mob/living/S = F.sent_by
html += "<td><A HREF='?_src_=holder;adminplayeropts=\ref[F.sent_by]'>[S.name]</A></td>"
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -49,7 +49,7 @@
user.show_message("<span class=notice>\t Key: Suffocation/Toxin/Burns/Brute</span>", 1)
user.show_message("<span class=notice>\t Body Temperature: [C.bodytemperature-T0C]&deg;C ([C.bodytemperature*1.8-459.67]&deg;F)</span>", 1)
if(C.timeofdeath && (C.stat == DEAD || (C.status_flags & FAKEDEATH)))
user.show_message("<span class=notice>\t Time of Death: [worldtime2text(C.timeofdeath)]</span>")
user.show_message("<span class=notice>\t Time of Death: [station_time_timestamp("hh:mm:ss", C.timeofdeath)]</span>")
if(istype(C, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C
var/list/damaged = H.get_damaged_organs(1,1)
+24
View File
@@ -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, "<span class='warning'>[src]'s night lighting circuit breaker is still cycling!</span>")
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
+19 -5
View File
@@ -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)
@@ -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 = "<CENTER><B>Chemical Analysis</B></CENTER><BR>"
P.info += "<b>Time of analysis:</b> [worldtime2text(world.time)]<br><br>"
P.info += "<b>Time of analysis:</b> [station_time_timestamp()]<br><br>"
P.info += "<b>Chemical name:</b> [href_list["name"]]<br>"
if(href_list["name"] == "Blood")
var/datum/reagents/R = beaker.reagents
@@ -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()
@@ -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)))
@@ -159,7 +159,7 @@
to_chat(usr, "<span class='warning'>All Emergency Response Teams are dispatched and can not be called at this time.</span>")
return
to_chat(usr, "<span class = 'notice'>ERT request transmitted.</span>")
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)
@@ -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
+1 -1
View File
@@ -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