Files
Bubberstation/code/modules/admin/admin_investigate.dm
tattle ad5debaaa1 Add investigate_deaths (#71112)
## About The Pull Request
Adds INVESTIGATE_DEATHS, an investigate category intended to better show
causes of death.


![image](https://user-images.githubusercontent.com/66640614/200142461-c17b5e51-1116-4eef-bbfb-49bc024c0953.png)


![image](https://user-images.githubusercontent.com/66640614/200147306-09bef76e-68c6-4f0a-bdf9-0211eb274e66.png)

Also makes suicide_act take a `mob/living` as an argument instead of a
`mob`, and some minor style improvements since apparently I hate
atomicity.

## Why It's Good For The Game
Inspired by a mysterious death and dusting. More logging and leads for
admins investigating deaths.

Also fixes #59028

## Changelog
🆑 Tattle
admin: added investigate deaths to shed some more light on unusual
demises, dustings, and gibbings
/🆑

Co-authored-by: tattle <article.disaster@gmail.com>
2022-11-07 16:22:37 -08:00

62 lines
1.6 KiB
Plaintext

/atom/proc/investigate_log(message, subject)
if(!message || !subject)
return
var/F = file("[GLOB.log_directory]/[subject].html")
WRITE_FILE(F, "[time_stamp()] [REF(src)] ([x],[y],[z]) || [src] [message]<br>")
/client/proc/investigate_show()
set name = "Investigate"
set category = "Admin.Game"
if(!holder)
return
var/list/investigates = list(
INVESTIGATE_ACCESSCHANGES,
INVESTIGATE_ATMOS,
INVESTIGATE_BOTANY,
INVESTIGATE_CARGO,
INVESTIGATE_CRAFTING,
INVESTIGATE_DEATHS,
INVESTIGATE_ENGINE,
INVESTIGATE_EXPERIMENTOR,
INVESTIGATE_GRAVITY,
INVESTIGATE_HALLUCINATIONS,
INVESTIGATE_HYPERTORUS,
INVESTIGATE_PORTAL,
INVESTIGATE_PRESENTS,
INVESTIGATE_RADIATION,
INVESTIGATE_RECORDS,
INVESTIGATE_RESEARCH,
INVESTIGATE_WIRES,
)
var/list/logs_present = list("notes, memos, watchlist")
var/list/logs_missing = list("---")
for(var/subject in investigates)
var/temp_file = file("[GLOB.log_directory]/[subject].html")
if(fexists(temp_file))
logs_present += subject
else
logs_missing += "[subject] (empty)"
var/list/combined = sort_list(logs_present) + sort_list(logs_missing)
var/selected = tgui_input_list(src, "Investigate what?", "Investigation", combined)
if(isnull(selected))
return
if(!(selected in combined) || selected == "---")
return
selected = replacetext(selected, " (empty)", "")
if(selected == "notes, memos, watchlist" && check_rights(R_ADMIN))
browse_messages()
return
var/F = file("[GLOB.log_directory]/[selected].html")
if(!fexists(F))
to_chat(src, span_danger("No [selected] logfile was found."), confidential = TRUE)
return
src << browse(F,"window=investigate[selected];size=800x300")