Files
Aurora.3/code/game/objects/items/weapons/autopsy.dm
T
Matt Atlas 659752e2ea Removes goonchat, adds TGChat and TG Stat Panels (#16514)
* tgui the beginning

* binaries and the like

* Bring in the last of it

* Example radio UI

* delete example

* NTOS Main Menu, start on manifest, tgui states

* tasks.json

* gunnery ui pt 1

* okay

* fix everything

* scss update

* oops

* manifest gigablast

* downloader part 1

* download prt 2

* NTOSDownloader final

* mfw committing to_worlds

* gunnery console pt2

* i cooked

* targeting (finished)

* one vueui down

* voting ui almost done

* MY MIND FEELS LIKE AN ARCH ENEMYYYY

* voting ui down

* photocopier

* ntos config + download fixes

* photocopier 2

* refactor define

* NTOS client manager + fixes

* fax machine final (it also uses toner now)

* marching forwards... left behind...

* ntnrc part 1

* canister

* add quotes

* portable pumps pt1 + more backgrounds

* oops

* finish the portable pump

* freezers

so I'll keep on pushing forward... you haven't seen the last of me... oooooooh...

* doors ui pt1

* finish doors UI (forgive me wildkins it's a bit of shitcode)

* vitals monitor, make things use labeled lists, new backgrounds

* mais j'envoyé aucun mayday...

* maglock pt1

* pour ça je me suis perdu...

* infrared

* fix that

* prox sensor pt1

* prox sensor

* signaler (this was actually pretty hard)

* atmos control pt1

* atmos control pt1.1

* atmos pt 2

* fuel injector

* multitool UI

* jammer

* list viewer

* APC

* portgen

* targeting console updates + SMES ui

* new themes, shield generator

* supermatter

* Add ore detector and (shitty) NTNet Relay

* orderterminal pt1

* orderterminal pt2

* smartfridge

* Add (air-)tank GUI update ore detector size

* Adds Transfer Valves

* Add AtmoScrubber

* analyzer pt1

* weapons analyzer pt2

* bodyscanner pt1

* bodyscanner pt2

* fix this shitcode

* seed storage

* appearance changer

* appearance changer final

* sleeper pt1

* sleeper

* gps

* vehicles

* chem dispenser

* lily request

* holopad

* tgui modules pt1

* ppanel

* damage menu

* fixes

* im here too now

* follow menu, search bars

* quikpay

* quikpay fixes

* circuit printer

* ppanel

* ppanel updates

* pai

* turret controls (i want to kill myself)

* tweak

* remove the boardgame

* guntracker

* implant tracker

* penal mechs

come close to me, come close to me

* chem codex

* pai radio

* doorjack

* pai directives

* signaler removal, sensors

* ghost spawner

* spawnpoint

* fixes

* teleporter

* one more to the chopping block

* account database

* remove divider

* scanner, atmos

* latejoin ui pt1

* latejoin

* records pt1

* RECORDS UI DONE

* delete interpreter & records

* CHAT FUCKING CLIENT

* data updates

* fix some things

* final UI, log

* basic nanoui fix

* antag panel

* remove vueui

* atm update

* vending update

* warrants, cameras

* ntmonitor

* time comes for all

* preserve this legacy

* bring that back (oops)

* rcon, ui auto update for computer UIs, remove rcon computers

* alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles)

* A LIKE SUPREME

* a

* power monitor

* lights on

* fuck this code, fuck nanoui modules, and fuck nanoui

* LEAVE IT OH SO FAR BEHIND

* fix alarm monitoring for synths

* I SAW IN YOU WHAT LIFE WAS MISSING

* comms console

* idcard and record updates

* turn the light on

* arcade

* pt2

* news browser

* static

* crusher

* f

* COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO

* codeowners & suit sensors

* html ui style removal

* make lint happy

* tgchat

* tgpanels pt1

* THE SOUL LONGS FOR OBLIVION!!!!!!!!!!!!!!!!!

* figure out why stat isnt working

* goodbye ping

* shhh

* stat updates

* An oath sworn in scors! Omni vortex lies!

* final almost edits

* fix that

* last skin adjustments

* resist and disorder

* i slowly get up and turn off the noise, already fed up...

* pleaseeeeeeeeeeeeeee

* THE CREDIT LARP IS NECESSARY

* i hold the keys

* RISE UP

* fix that?

* harry's suggestions xoxo

* runtime fix pt2

* You are the only thing that I still care about

* fix runtimes and cl

* whoops

* misc fixes

* fix that too

* adds build workflow

* f

* Update update_tgui.yml

* adds some needed steps

* ATM

* misc fixes and tweaks

* fixes 2

* make newscasters usable and fix use power on freezers

* turret control is clearer

* remove duplicate

* makes some verb tabs work properly

* makes verbs work properly for real

* sans moi

* fixes pt2

* fix the chat unnecessarily reloading

* fixes

* epic

* fixes

* fix missing consoles

---------

Co-authored-by: John Wildkins <john.wildkins@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
Co-authored-by: Werner <Arrow768@users.noreply.github.com>
Co-authored-by: Geeves <ggrobler447@gmail.com>
Co-authored-by: harryob <me@harryob.live>
2023-06-26 02:00:14 +02:00

184 lines
4.8 KiB
Plaintext

//moved these here from code/defines/obj/weapon.dm
//please preference put stuff where it's easy to find - C
/obj/item/autopsy_scanner
name = "autopsy scanner"
desc = "Extracts information on wounds."
icon = 'icons/obj/device.dmi'
icon_state = "autopsy"
flags = CONDUCT
w_class = ITEMSIZE_SMALL
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
var/list/datum/autopsy_data_scanner/wdata = list()
var/list/datum/autopsy_data_scanner/chemtraces = list()
var/target_name = null
var/timeofdeath = null
/datum/autopsy_data_scanner
var/weapon = null // this is the DEFINITE weapon type that was used
var/list/organs_scanned = list() // this maps a number of scanned organs to
// the wounds to those organs with this data's weapon type
var/organ_names = ""
/datum/autopsy_data
var/weapon = null
var/pretend_weapon = null
var/damage = 0
var/hits = 0
var/time_inflicted = 0
/datum/autopsy_data/proc/copy()
var/datum/autopsy_data/W = new()
W.weapon = weapon
W.pretend_weapon = pretend_weapon
W.damage = damage
W.hits = hits
W.time_inflicted = time_inflicted
return W
/obj/item/autopsy_scanner/proc/add_data(var/obj/item/organ/external/O)
if(!O.autopsy_data.len && !O.trace_chemicals.len) return
for(var/V in O.autopsy_data)
var/datum/autopsy_data/W = O.autopsy_data[V]
if(!W.pretend_weapon)
W.pretend_weapon = W.weapon
var/datum/autopsy_data_scanner/D = wdata[V]
if(!D)
D = new()
D.weapon = W.weapon
wdata[V] = D
if(!D.organs_scanned[O.name])
if(D.organ_names == "")
D.organ_names = O.name
else
D.organ_names += ", [O.name]"
qdel(D.organs_scanned[O.name])
D.organs_scanned[O.name] = W.copy()
for(var/V in O.trace_chemicals)
if(O.trace_chemicals[V] > 0 && !chemtraces.Find(V))
chemtraces += V
/obj/item/autopsy_scanner/verb/print_data()
set name = "Print Data"
set category = "Object"
set src in usr
if(use_check_and_message(usr))
return
var/scan_data = ""
if(timeofdeath)
scan_data += "<b>Time of death:</b> [worldtime2text(timeofdeath)]<br><br>"
var/n = 1
for(var/wdata_idx in wdata)
var/datum/autopsy_data_scanner/D = wdata[wdata_idx]
var/total_hits = 0
var/total_score = 0
var/list/weapon_chances = list() // maps weapon names to a score
var/age = 0
for(var/wound_idx in D.organs_scanned)
var/datum/autopsy_data/W = D.organs_scanned[wound_idx]
total_hits += W.hits
var/wname = W.pretend_weapon
if(wname in weapon_chances) weapon_chances[wname] += W.damage
else weapon_chances[wname] = max(W.damage, 1)
total_score+=W.damage
var/wound_age = W.time_inflicted
age = max(age, wound_age)
var/damage_desc
var/damaging_weapon = (total_score != 0)
// total score happens to be the total damage
switch(total_score)
if(0)
damage_desc = "Unknown"
if(1 to 5)
damage_desc = "<span class='good'>negligible</span>"
if(5 to 15)
damage_desc = "<span class='good'>light</span>"
if(15 to 30)
damage_desc = "<font color='orange'>moderate</font>"
if(30 to 1000)
damage_desc = "<span class='warning'>severe</span>"
if(!total_score) total_score = D.organs_scanned.len
scan_data += "<b>Weapon #[n]</b><br>"
if(damaging_weapon)
scan_data += "Severity: [damage_desc]<br>"
scan_data += "Hits by weapon: [total_hits]<br>"
scan_data += "Approximate time of wound infliction: [worldtime2text(age)]<br>"
scan_data += "Affected limbs: [D.organ_names]<br>"
scan_data += "Possible weapons:<br>"
for(var/weapon_name in weapon_chances)
scan_data += "\t[100*weapon_chances[weapon_name]/total_score]% [weapon_name]<br>"
scan_data += "<br>"
n++
if(chemtraces.len)
scan_data += "<b>Trace Chemicals: </b><br>"
for(var/chemID in chemtraces)
scan_data += chemID
scan_data += "<br>"
for(var/mob/O in viewers(usr))
O.show_message(SPAN_NOTICE("\The [src] rattles and prints out a sheet of paper."), 1)
playsound(loc, "sound/bureaucracy/print_short.ogg", 50, 1)
sleep(10)
var/obj/item/paper/P = new(usr.loc)
P.name = "Autopsy Data ([target_name])"
P.info = "<tt>[scan_data]</tt>"
P.icon_state = "paper_words"
usr.put_in_hands(P)
/obj/item/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
if(!istype(M))
return
if(!can_operate(M))
return
if(target_name != M.name)
target_name = M.name
src.wdata = list()
src.chemtraces = list()
src.timeofdeath = null
to_chat(user, SPAN_NOTICE("A new patient has been registered. Purging data for previous patient."))
src.timeofdeath = M.timeofdeath
var/obj/item/organ/external/S = M.get_organ(user.zone_sel.selecting)
if(!S)
to_chat(usr, SPAN_WARNING("You can't scan this body part."))
return
if(!S.open)
to_chat(usr, SPAN_WARNING("You have to cut the limb open first!"))
return
for(var/mob/O in viewers(M))
O.show_message(SPAN_NOTICE("\The [user] scans the wounds on [M.name]'s [S.name] with \the [src]"), 1)
src.add_data(S)
return 1