Files
Bubberstation/code/controllers/subsystem/security_level.dm
T
John Willard aa4dc56835 Removes Station-time (more time changes) (#95744)
## About The Pull Request

Removes Station-Time entirely
Server Time is now NST (Nanotrasen Standard Time). SS13 takes place
exactly 540 years in the future of the current day, so every second is 1
second in-game.
Round Time is now PT (Pay-Time), how Nanotrasen keeps track of how long
the current rotation of Employees has been working for.

Telecomms uses NST due to its importance of being the communication to
the blackbox.

Autopsy report, clocks, scientific reports and requisitions use both
timestamps due to them being more official documents that NT may need to
know beyond just the current round (just for flavortext).

Pretty much everything else (Det scanner, PDA, IC logs, Time-of-Death,
AI law changes, Cyborg file downloading) uses PT

PT
<img width="305" height="217" alt="image"
src="https://github.com/user-attachments/assets/cef73025-6292-4f9c-8565-197397bda2ca"
/>
<img width="168" height="59" alt="image"
src="https://github.com/user-attachments/assets/a99db568-045d-45fc-8206-0d9a7b13c7d2"
/>
<img width="308" height="122" alt="image"
src="https://github.com/user-attachments/assets/37ca6f17-8916-4af2-9c91-0f0707038ca5"
/>



https://github.com/user-attachments/assets/29445051-c98b-4af3-a657-812083aab91a


Clock (Literate)
<img width="748" height="292" alt="image"
src="https://github.com/user-attachments/assets/c824e812-91b5-4737-858d-768336e9a7c4"
/>

Clock (Illiterate)
<img width="446" height="94" alt="image"
src="https://github.com/user-attachments/assets/90d5ea0d-eaff-4ced-aa31-ffdf0b4832a5"
/>

New paperwork time working properly

<img width="311" height="190" alt="image"
src="https://github.com/user-attachments/assets/6d048926-db61-4c91-893b-ce93e1ea7775"
/>

NST
<img width="800" height="115" alt="image"
src="https://github.com/user-attachments/assets/35ffde49-13c1-4ce7-ab24-858e48b608bd"
/>
<img width="1288" height="142" alt="image"
src="https://github.com/user-attachments/assets/40c30d16-e0de-4efc-b460-9486eeb901d6"
/>

# Other changes

1. Circuit time checker will now get the value of the given input (Hour,
Minute, Second) rather than the full dedisecond time converted into
hour/minutes/seconds

<img width="270" height="67" alt="image"
src="https://github.com/user-attachments/assets/097440cc-1c45-447f-9976-18de7f9c722c"
/>

2. Turns nightshift into a round event that'll last approximately 22
minutes
3. 12-hour pref (doesn't apply to the stat panel because it's global
info) & removal of "TCT" time

<img width="569" height="440" alt="image"
src="https://github.com/user-attachments/assets/d39083b1-d248-41c0-9a1c-b2398ca203a7"
/>

4. The chocolate pudding negative moodlet is now based on the server's
IRL time.
5. Admins can now use ``class``, ``style`` and ``background`` (they were
already given perms to use ``img`` so hiding background, which was
removed to prevent image embedding, is pointless)
6. Also fixes ``year`` being off on localhost.


## Why It's Good For The Game

Server Time is approximately 1s = 12s converted, not including it
desyncing from lag (I believe?).
This makes it pretty much impossible for people to actually use this as
a unit of measurement for in-game actions.
Different things also uses different timestamps which is a bit more
confusing.

The main change here is for accessibility and, hopefully, using time as
a source of immersion. "20 minutes ago" is no longer OOC, they're just
speaking in PT. There's no timezones in space, Nanotrasen Standard Time
is the closest there is, but Pay Time is how NT considers when you get
your paychecks, so it's what is more commonly used.

It also fixes major inconsistencies between "IC time" and "Station
time", things like breakfast moodlet was the first 15mins of the round
despite the round starting like 7 hours in? Nukies with an L6 SAW firing
down the halls was shooting like 1 bullet every 3 seconds (assuming 4
bullets per second), overall there was just a disconnect between how
long time actually is in the universe.

The secondary reason for this change (though it is what pushed me to
actually get around to making this change) is the greater stat-panel
removal. This hopes to lessen the dependence on the stat panel for
station-time by making it easier to understand, and the end-goal I have
is for this information to be limited to Admins & the AI (AI will get
the IC version with the accurate year), so until that happens I would
like to improve the use of station-time by making it consistent (for
example, you should only care for PT for IC, which is also what your PDA
displays), so that when it gets removed it won't leave players timeless.

If you haven't already, and is interested in helping remove the stat
panel, every entry that needs to be removed can be found here -
https://hackmd.io/443_dE5lRWeEAp9bjGcKYw?view

Closes https://github.com/tgstation/tgstation/issues/94988

## Changelog

🆑
del: Removed Station Time, now we use NST (Nanotrasen Standard Time),
which is IRL server time +540 years, and PT (Pay Time), the amount of
time since the round has started.
del: Station nightshift is now a Station event rather than being based
on Server time.
balance: Time circuit's Unit of Measure now tells the amount of time in
hour/minute/seconds rather than giving the whole time translated to
hours/minutes/seconds.
qol: Added a 12-hour clock pref for people who prefer it.
qol: Hovering over NST timestamps on official documents will now
translate how much it is in PT/Shift Time.
admin: Admins can now use style/class/background in their papercode.
/🆑

---------

Co-authored-by: Isratosh <Isratosh@hotmail.com>
2026-04-25 14:13:31 -06:00

95 lines
3.9 KiB
Plaintext

SUBSYSTEM_DEF(security_level)
name = "Security Level"
can_fire = FALSE // We will control when we fire in this subsystem
/// Currently set security level
var/datum/security_level/current_security_level
/// A list of initialised security level datums.
var/list/available_levels = list()
/// A list of alert icon states for use in [/obj/machinery/status_display/evac] (to differentiate them from other display images)
var/list/alert_level_icons = list()
/datum/controller/subsystem/security_level/Initialize()
for(var/iterating_security_level_type in subtypesof(/datum/security_level))
var/datum/security_level/new_security_level = new iterating_security_level_type
available_levels[new_security_level.name] = new_security_level
alert_level_icons += new_security_level.status_display_icon_state
current_security_level = available_levels[number_level_to_text(SEC_LEVEL_GREEN)]
return SS_INIT_SUCCESS
/datum/controller/subsystem/security_level/fire(resumed)
if(!current_security_level.looping_sound) // No sound? No play.
can_fire = FALSE
return
sound_to_playing_players(current_security_level.looping_sound, volume_preference = /datum/preference/numeric/volume/sound_ambience_volume)
/**
* Sets a new security level as our current level
*
* This is how everything should change the security level.
*
* Arguments:
* * new_level - The new security level that will become our current level
* * announce - Play the announcement, set FALSE if you're doing your own custom announcement to prevent duplicates
*/
/datum/controller/subsystem/security_level/proc/set_level(new_level, announce = TRUE)
new_level = istext(new_level) ? new_level : number_level_to_text(new_level)
if(new_level == current_security_level.name) // If we are already at the desired level, do nothing
return
var/datum/security_level/selected_level = available_levels[new_level]
if(!selected_level)
CRASH("set_level was called with an invalid security level([new_level])")
if(announce)
level_announce(selected_level, current_security_level.number_level) // We want to announce BEFORE updating to the new level
SSsecurity_level.current_security_level = selected_level
if(selected_level.looping_sound)
wait = selected_level.looping_sound_interval
can_fire = TRUE
else
can_fire = FALSE
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) // By god this is absolutely shit
SSshuttle.emergency.alert_coeff_change(selected_level.shuttle_call_time_mod)
SEND_SIGNAL(src, COMSIG_SECURITY_LEVEL_CHANGED, selected_level.number_level)
SSblackbox.record_feedback("tally", "security_level_changes", 1, selected_level.name)
/**
* Returns the current security level as a number
*/
/datum/controller/subsystem/security_level/proc/get_current_level_as_number()
return ((!initialized || !current_security_level) ? SEC_LEVEL_GREEN : current_security_level.number_level) //Send the default security level in case the subsystem hasn't finished initializing yet
/**
* Returns the current security level as text
*/
/datum/controller/subsystem/security_level/proc/get_current_level_as_text()
return ((!initialized || !current_security_level) ? "green" : current_security_level.name)
/**
* Converts a text security level to a number
*
* Arguments:
* * level - The text security level to convert
*/
/datum/controller/subsystem/security_level/proc/text_level_to_number(text_level)
var/datum/security_level/selected_level = available_levels[text_level]
return selected_level?.number_level
/**
* Converts a number security level to a text
*
* Arguments:
* * level - The number security level to convert
*/
/datum/controller/subsystem/security_level/proc/number_level_to_text(number_level)
for(var/iterating_level_text in available_levels)
var/datum/security_level/iterating_security_level = available_levels[iterating_level_text]
if(iterating_security_level.number_level == number_level)
return iterating_security_level.name