Files
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

249 lines
12 KiB
Plaintext

/obj/item/autopsy_scanner
name = "autopsy scanner"
desc = "Used in surgery to extract information from a cadaver. Can also scan the health of cadavers like an advanced health analyzer!"
icon = 'icons/obj/devices/scanner.dmi'
icon_state = "autopsy_scanner"
inhand_icon_state = "autopsy_scanner"
worn_icon_state = "autopsy_scanner"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
obj_flags = CONDUCTS_ELECTRICITY
item_flags = CRUEL_IMPLEMENT
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT*2)
custom_price = PAYCHECK_COMMAND
sound_vary = TRUE
pickup_sound = SFX_GENERIC_DEVICE_PICKUP
drop_sound = SFX_GENERIC_DEVICE_DROP
/obj/item/autopsy_scanner/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(!isliving(interacting_with))
return NONE
if(!user.can_read(src) || user.is_blind())
return ITEM_INTERACT_BLOCKING
var/mob/living/scanned = interacting_with
if(scanned.stat != DEAD && !HAS_TRAIT(scanned, TRAIT_FAKEDEATH)) // good job, you found a loophole
to_chat(user, span_deadsay("[icon2html(src, user)] ERROR! CANNOT SCAN LIVE CADAVERS. PROCURE HEALTH ANALYZER OR TERMINATE PATIENT."))
return ITEM_INTERACT_BLOCKING
. = ITEM_INTERACT_SUCCESS
// Clumsiness/brain damage check
if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50))
user.visible_message(span_warning("[user] analyzes the floor's vitals!"), \
span_notice("You stupidly try to analyze the floor's vitals!"))
to_chat(user, "[span_info("Analyzing results for The floor:\n\tOverall status: <b>Healthy</b>")]\
\n[span_info("Key: <font color='#00cccc'>Suffocation</font>/<font color='#00cc66'>Toxin</font>/<font color='#ffcc33'>Burn</font>/<font color='#ff3333'>Brute</font>")]\
\n[span_info("\tDamage specifics: <font color='#66cccc'>0</font>-<font color='#00cc66'>0</font>-<font color='#ff9933'>0</font>-<font color='#ff3333'>0</font>")]\
\n[span_info("Body temperature: ???")]")
return
user.visible_message(span_notice("[user] scans [scanned]'s cadaver."))
to_chat(user, span_deadsay("[icon2html(src, user)] ANALYZING CADAVER."))
healthscan(user, scanned, advanced = TRUE)
add_fingerprint(user)
/obj/item/autopsy_scanner/proc/scan_cadaver(mob/living/carbon/human/user, mob/living/carbon/scanned)
if(scanned.stat != DEAD)
return
var/obj/item/paper/autopsy_report = new(get_turf(src))
autopsy_report.color = "#99ccff"
autopsy_report.name = "autopsy report of [scanned] - [server_timestamp(format = "hh:mm", ic_time = TRUE)]"
var/final_report_text = "<center><b>Autopsy report</br>\
Time of Autopsy: [UNDERLINED_HTML_TEXT("[server_timestamp(format = "hh:mm", ic_time = TRUE)]", "Shift Time: [round_timestamp(format = "hh:mm")]")]</b></center>"
//A lot of this is extremely similar to /proc/healthscan() - but with different formatting, no color, and some added/removed info
//Does not list quirks/exhaustion/how to repair wounds
//DOES list wound sources/
var/list/autopsy_information = list()
autopsy_information += "Autopsy Coroner - [user.name]<hr>"
autopsy_information += "Analyzing results for <b>[scanned.name]</b>:</br></br>"
autopsy_information += "Time of Death - <b>[scanned.station_timestamp_timeofdeath]</b></br>"
autopsy_information += "Subject has been dead for <b>[DisplayTimeText(round(world.time - scanned.timeofdeath))]</b>.<hr>"
var/oxy_loss = scanned.get_oxy_loss()
var/tox_loss = scanned.get_tox_loss()
var/fire_loss = scanned.get_fire_loss()
var/brute_loss = scanned.get_brute_loss()
/// "Body Data" portion of the autopsy - damage, wounds, and limbs
var/dmgreport = "<u><b>Body Data:</b></u>\
<table class='ml-2'>\
<tr>\
<td style='width:7em;'><b>Damage:</b></td>\
<td style='width:5em;'><b>Brute</b></td>\
<td style='width:4em;'><b>Burn</b></td>\
<td style='width:4em;'><b>Toxin</b></td>\
<td style='width:8em;'><b>Suffocation</b></td>\
</tr>"
for(var/zone in scanned.get_all_limbs()) //Same order every time for consistency across all humans
var/obj/item/bodypart/limb = scanned.get_bodypart(zone)
if(isnull(limb))
dmgreport += "<tr>"
dmgreport += "<td><b>[capitalize(parse_zone(zone))]:</b></td>"
dmgreport += "<td>-</td>"
dmgreport += "<td>-</td>"
dmgreport += "</tr>"
dmgreport += "<tr><td colspan=6>&rdsh; Physical trauma: <u>Dismembered</u></td></tr>"
continue
var/has_any_embeds = LAZYLEN(limb.embedded_objects) >= 1
var/has_any_wounds = length(limb.wounds) >= 1
dmgreport += "<tr>"
dmgreport += "<td><b>[capitalize(limb.name)]:</b></td>"
dmgreport += "<td>[limb.brute_dam > 0 ? ceil(limb.brute_dam) : "0"]</td>"
dmgreport += "<td>[limb.burn_dam > 0 ? ceil(limb.burn_dam) : "0"]</td>"
if(zone == BODY_ZONE_CHEST) // tox/oxy is stored in the chest
dmgreport += "<td>[tox_loss > 0 ? ceil(tox_loss) : "0"]</td>"
dmgreport += "<td>[oxy_loss > 0 ? ceil(oxy_loss) : "0"]</td>"
dmgreport += "</tr>"
if(has_any_embeds)
var/list/embedded_names = list()
for(var/obj/item/embed as anything in limb.embedded_objects)
embedded_names[capitalize(embed.name)] += 1
for(var/embedded_name in embedded_names)
var/displayed = embedded_name
var/embedded_amt = embedded_names[embedded_name]
if(embedded_amt > 1)
displayed = "[embedded_amt]x [embedded_name]"
dmgreport += "<tr><td colspan=6><i>&rdsh; Foreign object(s): [displayed].</i></td></tr>"
if(has_any_wounds)
for(var/datum/wound/wound as anything in limb.wounds)
dmgreport += "<tr><td colspan=6><i>&rdsh; Physical trauma: [wound.name] ([wound.severity_text()]) - Caused by <u>[wound.wound_source].</u></i></td></tr>"
dmgreport += "<tr>\
<td><b>Overall:</b></td>\
<td><b>[ceil(brute_loss)] Brute</b></td>\
<td><b>[ceil(fire_loss)] Burn</b></td>\
<td><b>[ceil(tox_loss)] Toxin</b></td>\
<td><b>[ceil(oxy_loss)] Suffocation</b></td>\
</tr>"
dmgreport += "</table><hr>"
autopsy_information += dmgreport
// Only humanoids list organs, implants, gene stability, species and core-temp
if(ishuman(scanned))
var/mob/living/carbon/human/humantarget = scanned
/// "Organ Data" portion of the autopsy - damage, functional status (or if it's missing), and implants
var/organreport = "<u><b>Organ Data:</b></u>\
<table class='ml-2'>\
<tr>\
<td style='width:10em;'><b>Organ:</b></td>\
<td style='width:6em;'><b>Dmg</b></td>\
<td style='width:30em;'><b>Status</b></td>\
</tr>"
var/list/missing_organs = humantarget.get_missing_organs()
for(var/sorted_slot in GLOB.organ_process_order) //Same order every time for consistency across all humans
var/obj/item/organ/organ = humantarget.get_organ_slot(sorted_slot)
if(isnull(organ))
if(missing_organs[sorted_slot])
organreport += "<tr><td><b>[missing_organs[sorted_slot]]:</b></td>\
<td>-</td>\
<td><u>Missing</u></td></tr>"
continue
var/status = organ.get_status_text(advanced = TRUE, add_tooltips = FALSE, colored = FALSE)
var/appendix = organ.get_status_appendix(advanced = TRUE, add_tooltips = FALSE)
if(!status)
status ||= "OK" // otherwise flawless organs have no status reported by default
organreport += "<tr>\
<td><b>[capitalize(organ.name)]:</b></td>\
<td>[organ.damage > 0 ? ceil(organ.damage) : "0"]</td>\
<td>[status]</td>\
</tr>"
if(appendix)
organreport += "<tr><td colspan=4><i>&rdsh; [appendix]</i></td></tr>"
organreport += "</table>" //<hr> comes after Cybernetics below
autopsy_information += organreport
var/mutant = HAS_TRAIT(humantarget, TRAIT_HULK) //Also applied by genetics infusions
// Cybernetics
var/list/cyberimps
for(var/obj/item/organ/target_organ as anything in humantarget.organs)
if(IS_ROBOTIC_ORGAN(target_organ) && !(target_organ.organ_flags & ORGAN_HIDDEN))
LAZYADD(cyberimps, target_organ.examine_title(user))
if(target_organ.organ_flags & ORGAN_MUTANT)
mutant = TRUE
if(LAZYLEN(cyberimps))
autopsy_information += "<b>Detected cybernetic modifications:</b></br>"
autopsy_information += "[english_list(cyberimps, and_text = ", and ")]</br>"
autopsy_information += "<hr>"
// Genetic Stability, Species, and Body Temperature
if(humantarget.has_dna() && humantarget.dna.stability != initial(humantarget.dna.stability))
autopsy_information += "<b>Genetic Stability:</b> [humantarget.dna.stability]%.</br>"
var/datum/species/targetspecies = humantarget.dna.species
var/disguised = !ishumanbasic(humantarget) && istype(humantarget.head, /obj/item/clothing/head/hooded/human_head) && istype(humantarget.wear_suit, /obj/item/clothing/suit/hooded/bloated_human)
var/species_name = "[disguised ? "\"[/datum/species/human::name]\"" : targetspecies.name][mutant ? "-derived mutant" : ""]"
autopsy_information += "<b>Species:</b> [species_name]</br>"
autopsy_information += "<b>Core temperature:</b> [round(humantarget.coretemperature-T0C, 0.1)] &deg;C ([round(humantarget.coretemperature*1.8-459.67,0.1)] &deg;F)</br>"
// (End of humanoid-only information)
autopsy_information += "<b>Body temperature:</b> [round(scanned.bodytemperature-T0C, 0.1)] &deg;C ([round(scanned.bodytemperature*1.8-459.67,0.1)] &deg;F)</br>"
// Blood Info
if(HAS_TRAIT(scanned, TRAIT_HUSK))
autopsy_information += "Subject is husked by: "
if(HAS_TRAIT_FROM(scanned, TRAIT_HUSK, CHANGELING_DRAIN))
autopsy_information += "Desiccation, commonly caused by Changelings.</br>"
else if(HAS_TRAIT_FROM(scanned, TRAIT_HUSK, SKELETON_TRAIT))
autopsy_information += "Stripped flesh.</br>"
else if(!HAS_TRAIT_FROM(scanned, TRAIT_HUSK, BURN)) // prioritize showing unknown causes over burns
autopsy_information += "Unknown causes.</br>"
else
autopsy_information += "Severe burns.</br>"
var/datum/blood_type/blood_type = scanned.get_bloodtype()
if(blood_type)
var/cached_blood_volume = scanned.get_blood_volume(apply_modifiers = TRUE)
var/blood_percent = round((cached_blood_volume / BLOOD_VOLUME_NORMAL) * 100)
var/blood_type_format
var/level_format
if(cached_blood_volume <= BLOOD_VOLUME_SAFE && cached_blood_volume > BLOOD_VOLUME_OKAY)
level_format = "LOW [blood_percent]%, [cached_blood_volume] cl"
else if(cached_blood_volume <= BLOOD_VOLUME_OKAY)
level_format = "<u>CRITICAL [blood_percent]%</u>, [cached_blood_volume] cl"
else
level_format = "[blood_percent]%, [cached_blood_volume] cl"
if(blood_type.get_type())
blood_type_format = "type: [blood_type.get_type()]"
autopsy_information += "<b>[blood_type.get_blood_name()] level:</b> [level_format], [blood_type_format]</br>"
var/blood_alcohol_content = scanned.get_blood_alcohol_content()
if(blood_alcohol_content > 0)
autopsy_information += "&rdsh; [blood_type?.get_blood_name() || "Blood"] alcohol content: [blood_alcohol_content]%</br>"
autopsy_information += "<hr>"
autopsy_information += "<u>Chemical Data:</u></br>"
for(var/datum/reagent/scanned_reagents as anything in scanned.reagents.reagent_list)
if(scanned_reagents.chemical_flags & REAGENT_INVISIBLE)
continue
autopsy_information += "<b>[scanned_reagents.name]:</b> [round(scanned_reagents.volume, 0.1)] unit\s in bloodstream.</br>"
autopsy_information += "<i>&rdsh; [scanned_reagents.description]</i></br>"
autopsy_information += "<hr>"
autopsy_information += "<u>Disease Data:</u></br>"
for(var/datum/disease/diseases as anything in scanned.diseases)
autopsy_information += "<b>Disease Name:</b> \"[diseases.name]\"</br>"
autopsy_information += "<b>Transmission Type:</b> [diseases.spread_text]</br>"
if(!istype(diseases, /datum/disease/advance))
continue
autopsy_information += "<b>Symptoms:</b></br>"
var/datum/disease/advance/advanced_disease = diseases
for(var/datum/symptom/symptom as anything in advanced_disease.symptoms)
autopsy_information += "&rdsh; [symptom.name] - <i>[symptom.desc]</i></br>"
autopsy_information += "<hr>"
autopsy_information += "<b>Coroner's Notes:</b>" //Bottom of the page, anything past here is player-written
final_report_text += jointext(autopsy_information, "")
autopsy_report.add_raw_text(final_report_text, advanced_html = TRUE)
autopsy_report.update_appearance()
user.put_in_hands(autopsy_report)
user.balloon_alert(user, "report printed")
return TRUE