diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 1d6e07b04c6..9662358a32f 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -12,12 +12,12 @@
light_color = "#00FF00"
- power_change()
- ..()
- if(!(stat & (BROKEN|NOPOWER)))
- set_light(2)
- else
- set_light(0)
+/obj/machinery/bodyscanner/power_change()
+ ..()
+ if(!(stat & (BROKEN|NOPOWER)))
+ set_light(2)
+ else
+ set_light(0)
/obj/machinery/bodyscanner/New()
..()
@@ -66,130 +66,85 @@
default_deconstruction_crowbar(G)
if(istype(G, /obj/item/weapon/grab))
+ var/obj/item/weapon/grab/TYPECAST_YOUR_SHIT = G
if(panel_open)
- user << "\blue Close the maintenance panel first."
+ user << "Close the maintenance panel first."
return
- if(!ismob(G:affecting))
+ if(!ismob(TYPECAST_YOUR_SHIT.affecting))
return
- if (src.occupant)
- user << "\blue The scanner is already occupied!"
+ if(occupant)
+ user << "The scanner is already occupied!"
return
- for(var/mob/living/carbon/slime/M in range(1,G:affecting))
- if(M.Victim == G:affecting)
- usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
+ for(var/mob/living/carbon/slime/M in range(1, TYPECAST_YOUR_SHIT.affecting))
+ if(M.Victim == TYPECAST_YOUR_SHIT.affecting)
+ user << "[TYPECAST_YOUR_SHIT.affecting.name] has a fucking slime attached to them, deal with that first."
return
- var/mob/M = G:affecting
- if (M.abiotic())
- user << "\blue Subject cannot have abiotic items on."
+ var/mob/M = TYPECAST_YOUR_SHIT.affecting
+ if(M.abiotic())
+ user << "Subject cannot have abiotic items on."
return
- if (M.client)
+ /*if(M.client)
M.client.perspective = EYE_PERSPECTIVE
- M.client.eye = src
- M.loc = src
- src.occupant = M
- src.icon_state = "body_scanner_1"
- src.add_fingerprint(user)
- //G = null
+ M.client.eye = src*///THIS IS FUCKING POINTLESS BECAUSE OF ON-LIFE() FUCKING RESET_VIEW() AHHHHHHHHHHGGGGGGGGGG
+ M.forceMove(src)
+ occupant = M
+ icon_state = "body_scanner_1"
+ add_fingerprint(user)
qdel(G)
- return
-/obj/machinery/bodyscanner/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
+
+/obj/machinery/bodyscanner/MouseDrop_T(mob/living/carbon/O, mob/user as mob)
if(!istype(O))
- return
- if(O.loc == user) //no you can't pull things out of your ass
- return
- if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.resting) //are you cuffed, dying, lying, stunned or other
- return
- if(O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
- return
- if(!ismob(O)) //humans only
- return
- if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robutts dont fit
- return
- if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper
- return
- if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems
- return
- if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc?
- return
+ return 0 //not a mob
+ if(user.incapacitated())
+ return 0 //user shouldn't be doing things
+ if(O.anchored)
+ return 0 //mob is anchored???
+ if(get_dist(user, src) > 1 || get_dist(user, O) > 1)
+ return 0 //doesn't use adjacent() to allow for non-cardinal (fuck my life)
+ if(!ishuman(user) && !isrobot(user))
+ return 0 //not a borg or human
if(panel_open)
- user << "\blue Close the maintenance panel first."
- return
+ user << "Close the maintenance panel first."
+ return 0 //panel open
if(occupant)
- user << "\blue The body scanner is already occupied!"
- return
- var/mob/living/L = O
- if(!istype(L) || L.buckled)
- return
- if(L.abiotic())
- user << "\blue Subject cannot have abiotic items on."
- return
- for(var/mob/living/carbon/slime/M in range(1,L))
- if(M.Victim == L)
- usr << "[L.name] will not fit into the body scanner because they have a slime latched onto their head."
- return
- if(L == user)
- visible_message("[user] climbs into the body scanner.")
+ user << "\The [src] is already occupied."
+ return 0 //occupied
+
+ if(O.buckled)
+ return 0
+ if(O.abiotic())
+ user << "Subject cannot have abiotic items on."
+ return 0
+ for(var/mob/living/carbon/slime/M in range(1, O))
+ if(M.Victim == O)
+ user << "[O] has a fucking slime attached to them, deal with that first."
+ return 0
+
+ if(O == user)
+ visible_message("[user] climbs into \the [src].")
else
- visible_message("[user] puts [L.name] into the body scanner.")
+ visible_message("[user] puts [O] into the body scanner.")
- if (L.client)
- L.client.perspective = EYE_PERSPECTIVE
- L.client.eye = src
- L.loc = src
- src.occupant = L
- src.icon_state = "bodyscanner"
- src.add_fingerprint(user)
- return
-
-/*/obj/machinery/bodyscanner/allow_drop()
- return 0*/
+ O.forceMove(src)
+ occupant = O
+ icon_state = "bodyscanner"
+ add_fingerprint(user)
/obj/machinery/bodyscanner/relaymove(mob/user as mob)
- if (user.stat)
- return
- src.go_out()
- return
+ if(user.incapacitated())
+ return 0 //maybe they should be able to get out with cuffs, but whatever
+ go_out()
/obj/machinery/bodyscanner/verb/eject()
set src in oview(1)
set category = "Object"
set name = "Eject Body Scanner"
- if (usr.stat != 0)
+ if(usr.incapacitated())
return
- src.go_out()
+ go_out()
add_fingerprint(usr)
- return
-
-/obj/machinery/bodyscanner/verb/move_inside()
- set src in oview(1)
- set category = "Object"
- set name = "Enter Body Scanner"
-
- if (usr.stat != 0)
- return
- if (src.occupant)
- usr << "\blue The scanner is already occupied!"
- return
- if (panel_open)
- usr << "\blue Close the maintenance panel first."
- return
- if (usr.abiotic())
- usr << "\blue Subject cannot have abiotic items on."
- return
- usr.pulling = null
- usr.client.perspective = EYE_PERSPECTIVE
- usr.client.eye = src
- usr.loc = src
- src.occupant = usr
- src.icon_state = "bodyscanner"
- for(var/obj/O in src)
- //O = null
- qdel(O)
- //Foreach goto(124)
- src.add_fingerprint(usr)
- return
/obj/machinery/bodyscanner/proc/go_out()
if ((!( src.occupant ) || src.locked))
@@ -305,28 +260,6 @@
return
return
-/*
-
-/obj/machinery/body_scanconsole/process() //not really used right now
- if(stat & (NOPOWER|BROKEN))
- return
- //use_power(250) // power stuff
-
-// var/mob/M //occupant
-// if (!( src.status )) //remove this
-// return
-// if ((src.connected && src.connected.occupant)) //connected & occupant ok
-// M = src.connected.occupant
-// else
-// if (istype(M, /mob))
-// //do stuff
-// else
-/// src.temphtml = "Process terminated due to lack of occupant in scanning chamber."
-// src.status = null
-// src.updateDialog()
-// return
-
-*/
/obj/machinery/body_scanconsole/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params)
if (istype(G, /obj/item/weapon/screwdriver))
@@ -365,181 +298,315 @@
if(!src.connected)
findscanner()
- if (src.connected)
- if(!connected.occupant)
- user << "The scanner is empty."
- return
- if(!ishuman(connected.occupant))
- user << "\red This device can only scan compatible lifeforms."
- return
- var/dat
- if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
- src.delete = src.delete
- else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
- dat = text("[]
Main Menu", src.temphtml, src)
- else
- if (src.connected) //Is something connected?
- var/mob/living/carbon/human/occupant = src.connected.occupant
- dat = "Occupant Statistics:
" //Blah obvious
- if (istype(occupant)) //is there REALLY someone in there?
- var/t1
- switch(occupant.stat) // obvious, see what their status is
- if(0)
- t1 = "Conscious"
- if(1)
- t1 = "Unconscious"
- else
- t1 = "*dead*"
- if (!istype(occupant,/mob/living/carbon/human))
- dat += "This device can only scan human occupants."
- else
- dat += text("[]\tHealth %: [] ([])
", (occupant.health > 50 ? "" : ""), occupant.health, t1)
+ ui_interact(user)
- if(occupant.virus2.len)
- dat += text("Viral pathogen detected in blood stream.
")
- dat += text("[]\t-Brute Damage %: []
", (occupant.getBruteLoss() < 60 ? "" : ""), occupant.getBruteLoss())
- dat += text("[]\t-Respiratory Damage %: []
", (occupant.getOxyLoss() < 60 ? "" : ""), occupant.getOxyLoss())
- dat += text("[]\t-Toxin Content %: []
", (occupant.getToxLoss() < 60 ? "" : ""), occupant.getToxLoss())
- dat += text("[]\t-Burn Severity %: []
", (occupant.getFireLoss() < 60 ? "" : ""), occupant.getFireLoss())
+/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ var/data[0]
- dat += text("[]\tRadiation Level %: []
", (occupant.radiation < 10 ?"" : ""), occupant.radiation)
- dat += text("[]\tGenetic Tissue Damage %: []
", (occupant.getCloneLoss() < 1 ?"" : ""), occupant.getCloneLoss())
- dat += text("[]\tApprox. Brain Damage %: []
", (occupant.getBrainLoss() < 1 ?"" : ""), occupant.getBrainLoss())
- dat += text("Paralysis Summary %: [] ([] seconds left!)
", occupant.paralysis, round(occupant.paralysis / 4))
- dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)
")
+ data["connected"] = connected ? 1 : 0
- if(occupant.has_brain_worms())
- dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
"
+ if(connected)
+ data["occupied"] = connected.occupant ? 1 : 0
- if(occupant.vessel)
- var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
- var/blood_percent = blood_volume / 560
- blood_percent *= 100
- dat += text("[]\tBlood Level %: [] ([] units)
", (blood_volume > 448 ?"" : ""), blood_percent, blood_volume)
- if(occupant.reagents)
- dat += text("Epinephrine units: [] units
", occupant.reagents.get_reagent_amount("Epinephrine"))
- dat += text("Ether: [] units
", occupant.reagents.get_reagent_amount("ether"))
- dat += text("[]\tSilver Sulfadiazine: [] units
", (occupant.reagents.get_reagent_amount("silver_sulfadiazine") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("silver_sulfadiazine"))
- dat += text("[]\tStyptic Powder: [] units
", (occupant.reagents.get_reagent_amount("styptic_powder") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("styptic_powder"))
- dat += text("[]\tsalbutamol: [] units
", (occupant.reagents.get_reagent_amount("salbutamol") < 30 ? "" : ""), occupant.reagents.get_reagent_amount("salbutamol"))
+ var/occupantData[0]
+ if(connected.occupant && ishuman(connected.occupant))
+ var/mob/living/carbon/human/H = connected.occupant
+ occupantData["name"] = H.name
+ occupantData["stat"] = H.stat
+ occupantData["health"] = H.health
- dat += "
"
- dat += ""
- dat += "| Organ | "
- dat += "Burn Damage | "
- dat += "Brute Damage | "
- dat += "Other Wounds | "
- dat += "
"
+ occupantData["hasVirus"] = H.virus2.len
- for(var/obj/item/organ/external/e in occupant.organs)
+ occupantData["bruteLoss"] = H.getBruteLoss()
+ occupantData["oxyLoss"] = H.getOxyLoss()
+ occupantData["toxLoss"] = H.getToxLoss()
+ occupantData["fireLoss"] = H.getFireLoss()
- dat += ""
- var/AN = ""
- var/open = ""
- var/infected = ""
- var/robot = ""
- var/imp = ""
- var/bled = ""
- var/splint = ""
- var/internal_bleeding = ""
- var/lung_ruptured = ""
- for(var/datum/wound/W in e.wounds) if(W.internal)
- internal_bleeding = "
Internal bleeding"
- break
- if(istype(e, /obj/item/organ/external/chest) && occupant.is_lung_ruptured())
- lung_ruptured = "Lung ruptured:"
- if(e.status & ORGAN_SPLINTED)
- splint = "Splinted:"
- if(e.status & ORGAN_BLEEDING)
- bled = "Bleeding:"
- if(e.status & ORGAN_BROKEN)
- AN = "[e.broken_description]:"
- if(e.status & ORGAN_ROBOT)
- robot = "Prosthetic:"
- if(e.open)
- open = "Open:"
- switch (e.germ_level)
- if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
- infected = "Mild Infection:"
- if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
- infected = "Mild Infection+:"
- if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
- infected = "Mild Infection++:"
- if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
- infected = "Acute Infection:"
- if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
- infected = "Acute Infection+:"
- if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
- infected = "Acute Infection++:"
- if (INFECTION_LEVEL_THREE to INFINITY)
- infected = "Septic:"
+ occupantData["radLoss"] = H.radiation
+ occupantData["cloneLoss"] = H.getCloneLoss()
+ occupantData["brainLoss"] = H.getBrainLoss()
+ occupantData["paralysis"] = H.paralysis
+ occupantData["paralysisSeconds"] = round(H.paralysis / 4)
+ occupantData["bodyTempC"] = H.bodytemperature-T0C
+ occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32)
- var/unknown_body = 0
- for(var/I in e.implants)
- if(is_type_in_list(I,known_implants))
- imp += "[I] implanted:"
- else
- unknown_body++
+ occupantData["hasBorer"] = H.has_brain_worms()
- if(unknown_body || e.hidden)
- imp += "Unknown body present:"
- if(!AN && !open && !infected & !imp)
- AN = "None:"
- if(!(e.status & ORGAN_DESTROYED))
- dat += "[e.name] | [e.burn_dam] | [e.brute_dam] | [robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured] | "
- else
- dat += "[e.name] | - | - | Not Found | "
- dat += "
"
- for(var/obj/item/organ/i in occupant.internal_organs)
- var/mech = i.desc
- var/infection = "None"
- switch (i.germ_level)
- if (1 to INFECTION_LEVEL_ONE + 200)
- infection = "Mild Infection:"
- if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
- infection = "Mild Infection+:"
- if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
- infection = "Mild Infection++:"
- if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
- infection = "Acute Infection:"
- if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
- infection = "Acute Infection+:"
- if (INFECTION_LEVEL_TWO + 300 to INFINITY)
- infection = "Acute Infection++:"
+ var/bloodData[0]
+ if(H.vessel)
+ var/blood_volume = round(H.vessel.get_reagent_amount("blood"))
+ bloodData["volume"] = blood_volume
+ bloodData["percent"] = round(((blood_volume / 560)*100))
+
+ occupantData["blood"] = bloodData
+
+ var/reagentData[0]
+ if(H.reagents)
+ reagentData["epinephrine"] = H.reagents.get_reagent_amount("Epinephrine")
+ reagentData["ether"] = H.reagents.get_reagent_amount("ether")
+ reagentData["silver_sulfadiazine"] = H.reagents.get_reagent_amount("silver_sulfadiazine")
+ reagentData["styptic_powder"] = H.reagents.get_reagent_amount("styptic_powder")
+ reagentData["salbutamol"] = H.reagents.get_reagent_amount("salbutamol")
+
+ occupantData["reagents"] = reagentData
+
+ var/extOrganData[0]
+ for(var/obj/item/organ/external/E in H.organs)
+ var/organData[0]
+ organData["name"] = E.name
+ organData["open"] = E.open
+ organData["germ_level"] = E.germ_level
+ organData["bruteLoss"] = E.brute_dam
+ organData["fireLoss"] = E.burn_dam
+
+ var/implantData[0]
+ for(var/obj/I in E.implants)
+ var/implantSubData[0]
+ implantSubData["name"] = I.name
+ if(is_type_in_list(I, known_implants))
+ implantSubData["known"] = 1
+
+ implantData.Add(list(implantSubData))
+
+ organData["implants"] = implantData
+ organData["implants_len"] = implantData.len
+
+ var/organStatus[0]
+ if(E.status & ORGAN_DESTROYED)
+ organStatus["destroyed"] = 1
+ if(E.status & ORGAN_BROKEN)
+ organStatus["broken"] = E.broken_description
+ if(E.status & ORGAN_ROBOT)
+ organStatus["robotic"] = 1
+ if(E.status & ORGAN_SPLINTED)
+ organStatus["splinted"] = 1
+ if(E.status & ORGAN_BLEEDING)
+ organStatus["bleeding"] = 1
+
+ organData["status"] = organStatus
+
+ if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured())
+ organData["lungRuptured"] = 1
+
+ for(var/datum/wound/W in E.wounds)
+ if(W.internal)
+ organData["internalBleeding"] = 1
+ break
+
+ extOrganData.Add(list(organData))
+
+ occupantData["extOrgan"] = extOrganData
+
+ var/intOrganData[0]
+ for(var/obj/item/organ/I in H.internal_organs)
+ var/organData[0]
+ organData["name"] = I.name
+ organData["desc"] = I.desc
+ organData["germ_level"] = I.germ_level
+ organData["damage"] = I.damage
+
+ intOrganData.Add(list(organData))
+
+ occupantData["intOrgan"] = intOrganData
+
+ occupantData["blind"] = (H.sdisabilities & BLIND)
+ occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED)
+
+ data["occupant"] = occupantData
+
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600)
+ ui.set_initial_data(data)
+ ui.open()
+ ui.set_auto_update(1)
- dat += ""
- dat += "| [i.name] | N/A | [i.damage] | [infection]:[mech] | | "
- dat += "
"
- dat += "
"
- if(occupant.sdisabilities & BLIND)
- dat += text("Cataracts detected.
")
- if(occupant.sdisabilities & NEARSIGHTED)
- dat += text("Retinal misalignment detected.
")
- src.printing_text = dat
- dat += "
Print medical condition
"
- else
- dat += "\The [src] is empty."
- else
- dat = " Error: No Body Scanner connected."
- dat += text("Close", user)
- user << browse(dat, "window=scanconsole;size=430x600")
- return
/obj/machinery/body_scanconsole/Topic(href, href_list)
if(..())
return 1
if (href_list["print_p"])
- if (!(src.printing) && src.printing_text)
- src.printing = 1
- for(var/mob/O in viewers(usr))
- O.show_message("\blue \the [src] rattles and prints out a sheet of paper.", 1)
- var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
+ generate_printing_text()
+
+ if (!(printing) && printing_text)
+ printing = 1
+ visible_message("\The [src] rattles and prints out a sheet of paper.")
+ var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.info = "
Body Scan - [href_list["name"]]
"
P.info += "Time of scan: [worldtime2text(world.time)]
"
- P.info += "[src.printing_text]"
+ P.info += "[printing_text]"
P.info += "
Notes:
"
P.name = "Body Scan - [href_list["name"]]"
- src.printing = null
- src.printing_text = null
\ No newline at end of file
+ printing = null
+ printing_text = null
+
+/obj/machinery/body_scanconsole/proc/generate_printing_text()
+ var/dat = ""
+
+ if(connected)
+ var/mob/living/carbon/human/occupant = connected.occupant
+ dat = "Occupant Statistics:
" //Blah obvious
+ if(istype(occupant)) //is there REALLY someone in there?
+ var/t1
+ switch(occupant.stat) // obvious, see what their status is
+ if(0)
+ t1 = "Conscious"
+ if(1)
+ t1 = "Unconscious"
+ else
+ t1 = "*dead*"
+ dat += "[occupant.health > 50 ? "" : ""]\tHealth %: [occupant.health], ([t1])
"
+
+ if(occupant.virus2.len)
+ dat += "Viral pathogen detected in blood stream.
"
+
+ var/extra_font = null
+ extra_font = (occupant.getBruteLoss() < 60 ? "" : "")
+ dat += "[extra_font]\t-Brute Damage %: [occupant.getBruteLoss()]
"
+
+ extra_font = (occupant.getOxyLoss() < 60 ? "" : "")
+ dat += "[extra_font]\t-Respiratory Damage %: [occupant.getOxyLoss()]
"
+
+ extra_font = (occupant.getToxLoss() < 60 ? "" : "")
+ dat += "[extra_font]\t-Toxin Content %: [occupant.getToxLoss()]
"
+
+ extra_font = (occupant.getFireLoss() < 60 ? "" : "")
+ dat += "[extra_font]\t-Burn Severity %: [occupant.getFireLoss()]
"
+
+ extra_font = (occupant.radiation < 10 ?"" : "")
+ dat += "[extra_font]\tRadiation Level %: [occupant.radiation]
"
+
+ extra_font = (occupant.getCloneLoss() < 1 ?"" : "")
+ dat += "[extra_font]\tGenetic Tissue Damage %: [occupant.getCloneLoss()]
"
+
+ extra_font = (occupant.getBrainLoss() < 1 ?"" : "")
+ dat += "[extra_font]\tApprox. Brain Damage %: [occupant.getBrainLoss()]
"
+
+ dat += "Paralysis Summary %: [occupant.paralysis] ([round(occupant.paralysis / 4)] seconds left!)
"
+ dat += "Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)
"
+
+ dat += "
"
+
+ if(occupant.has_brain_worms())
+ dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
"
+
+ if(occupant.vessel)
+ var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
+ var/blood_percent = blood_volume / 560
+ blood_percent *= 100
+
+ extra_font = (blood_volume > 448 ? "" : "")
+ dat += "[extra_font]\tBlood Level %: [blood_percent] ([blood_volume] units)
"
+
+ if(occupant.reagents)
+ dat += "Epinephrine units: [occupant.reagents.get_reagent_amount("Epinephrine")] units
"
+ dat += "Ether: [occupant.reagents.get_reagent_amount("ether")] units
"
+
+ extra_font = (occupant.reagents.get_reagent_amount("silver_sulfadiazine") < 30 ? "" : "")
+ dat += "[extra_font]\tSilver Sulfadiazine: [occupant.reagents.get_reagent_amount("silver_sulfadiazine")]
"
+
+ extra_font = (occupant.reagents.get_reagent_amount("styptic_powder") < 30 ? "" : "")
+ dat += "[extra_font]\tStyptic Powder: [occupant.reagents.get_reagent_amount("styptic_powder")] units
"
+
+ extra_font = (occupant.reagents.get_reagent_amount("salbutamol") < 30 ? "" : "")
+ dat += "[extra_font]\tSalbutamol: [occupant.reagents.get_reagent_amount("salbutamol")] units
"
+
+ dat += "
"
+ dat += ""
+ dat += "| Organ | "
+ dat += "Burn Damage | "
+ dat += "Brute Damage | "
+ dat += "Other Wounds | "
+ dat += "
"
+
+ for(var/obj/item/organ/external/e in occupant.organs)
+ dat += ""
+ var/AN = ""
+ var/open = ""
+ var/infected = ""
+ var/robot = ""
+ var/imp = ""
+ var/bled = ""
+ var/splint = ""
+ var/internal_bleeding = ""
+ var/lung_ruptured = ""
+ for(var/datum/wound/W in e.wounds) if(W.internal)
+ internal_bleeding = "
Internal bleeding"
+ break
+ if(istype(e, /obj/item/organ/external/chest) && occupant.is_lung_ruptured())
+ lung_ruptured = "Lung ruptured:"
+ if(e.status & ORGAN_SPLINTED)
+ splint = "Splinted:"
+ if(e.status & ORGAN_BLEEDING)
+ bled = "Bleeding:"
+ if(e.status & ORGAN_BROKEN)
+ AN = "[e.broken_description]:"
+ if(e.status & ORGAN_ROBOT)
+ robot = "Prosthetic:"
+ if(e.open)
+ open = "Open:"
+ switch (e.germ_level)
+ if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
+ infected = "Mild Infection:"
+ if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
+ infected = "Mild Infection+:"
+ if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
+ infected = "Mild Infection++:"
+ if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
+ infected = "Acute Infection:"
+ if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
+ infected = "Acute Infection+:"
+ if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
+ infected = "Acute Infection++:"
+ if (INFECTION_LEVEL_THREE to INFINITY)
+ infected = "Septic:"
+
+ var/unknown_body = 0
+ for(var/I in e.implants)
+ if(is_type_in_list(I,known_implants))
+ imp += "[I] implanted:"
+ else
+ unknown_body++
+
+ if(unknown_body || e.hidden)
+ imp += "Unknown body present:"
+ if(!AN && !open && !infected & !imp)
+ AN = "None:"
+ if(!(e.status & ORGAN_DESTROYED))
+ dat += "[e.name] | [e.burn_dam] | [e.brute_dam] | [robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured] | "
+ else
+ dat += "[e.name] | - | - | Not Found | "
+ dat += "
"
+ for(var/obj/item/organ/i in occupant.internal_organs)
+ var/mech = i.desc
+ var/infection = "None"
+ switch (i.germ_level)
+ if (1 to INFECTION_LEVEL_ONE + 200)
+ infection = "Mild Infection:"
+ if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
+ infection = "Mild Infection+:"
+ if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
+ infection = "Mild Infection++:"
+ if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
+ infection = "Acute Infection:"
+ if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
+ infection = "Acute Infection+:"
+ if (INFECTION_LEVEL_TWO + 300 to INFINITY)
+ infection = "Acute Infection++:"
+
+ dat += ""
+ dat += "| [i.name] | N/A | [i.damage] | [infection]:[mech] | | "
+ dat += "
"
+ dat += "
"
+ if(occupant.sdisabilities & BLIND)
+ dat += "Cataracts detected.
"
+ if(occupant.disabilities & NEARSIGHTED)
+ dat += "Retinal misalignment detected.
"
+ else
+ dat += "\The [src] is empty."
+ else
+ dat = " Error: No Body Scanner connected."
+
+ printing_text = dat
\ No newline at end of file
diff --git a/nano/templates/adv_med.tmpl b/nano/templates/adv_med.tmpl
new file mode 100644
index 00000000000..92049364561
--- /dev/null
+++ b/nano/templates/adv_med.tmpl
@@ -0,0 +1,308 @@
+
+{{if !data.occupied}}
+ No occupant detected.
+{{else}}
+ Occupant Data:
+
+
+ Name:
+
+
+ {{:data.occupant.name}}
+
+
+
+
+ Health:
+
+ {{:helper.displayBar(data.occupant.health, 0, 100, (data.occupant.health >= 50) ? 'good' : (data.occupant.health >= 25) ? 'average' : 'bad')}}
+
+ {{:helper.round(data.occupant.health*10)/10}}%
+
+
+
+ Status:
+
+
+ {{if data.occupant.stat==0}}
+ Alive
+ {{else data.occupant.stat==1}}
+ Critical
+ {{else}}
+ Dead
+ {{/if}}
+
+
+ {{:helper.link('Print', 'document', {'print_p' : 1, 'name' : data.occupant.name})}}
+
+
Damage:
+
+ Brute:
+
+
+ {{:data.occupant.bruteLoss}}
+
+
+ Burn:
+
+
+ {{:data.occupant.fireLoss}}
+
+
+ Oxygen:
+
+
+ {{:data.occupant.oxyLoss}}
+
+
+ Toxins:
+
+
+ {{:data.occupant.toxLoss}}
+
+
+ Brain:
+
+
+ {{:data.occupant.brainLoss}}
+
+
+ Radiation Level:
+
+
+ {{:data.occupant.radLoss}}
+
+
+ Genetic:
+
+
+ {{:data.occupant.cloneLoss}}
+
+
+ Paralysis:
+
+
+ {{:data.occupant.paralysis}}% ({{:data.occupant.paralysisSeconds}} seconds left!)
+
+
+
+
+ Body Temperature:
+
+
+ {{:data.occupant.bodyTempC}}°C, {{:data.occupant.bodyTempF}}°F
+
+
+ {{if data.occupant.hasVirus}}
+
+ Viral pathogen detected in blood stream.
+
+ {{/if}}
+ {{if data.occupant.hasBorer}}
+
+ Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
+
+ {{/if}}
+ {{if data.occupant.blind}}
+
Pupils unresponsive.
+ {{/if}}
+ {{if data.occupant.nearsighted}}
+
Retinal Misalignment Detected
+ {{/if}}
+
+
+
Blood
+
+ Volume
+
+
+ {{:data.occupant.blood.volume}}
+
+
+ Percent
+
+
+ {{:data.occupant.blood.percent}}%
+
+
+
+
+
Reagents
+
+ Epinephrine
+
+
+ {{:data.occupant.reagents.epinephrine}}
+
+
+ Ether
+
+
+ {{:data.occupant.reagents.ether}}
+
+
+
+ Silver Sulfadiazine
+
+
+
+
+ {{:data.occupant.reagents.silver_sulfadiazine}}
+
+
+
+
+ Styptic Powder
+
+
+
+
+ {{:data.occupant.reagents.styptic_powder}}
+
+
+
+
+ Salbutamol
+
+
+
+
+ {{:data.occupant.reagents.salbutamol}}
+
+
+
+
+
External Organs
+
+ {{for data.occupant.extOrgan}}
+
+ {{if value.status.destroyed}}
+
+ {{:value.name}} - DESTROYED
+
+ {{else}}
+
+ {{:value.name}}
+
+
+ {{if value.status.broken}}
+ {{:value.status.broken}}
+ {{else value.status.splinted}}
+ Splinted
+ {{else value.status.robotic}}
+ Robotic
+ {{/if}}
+
+
+ Brute/Burn
+
+
+ {{:value.bruteLoss}}/{{:value.fireLoss}}
+
+
+ Injuries
+
+
+ {{if !value.status.bleeding}}
+ {{if !value.status.internalBleeding}}
+ No Injuries Detected
+ {{else}}
+
Internal Bleeding Detected
+ {{/if}}
+ {{else}}
+ {{if value.status.internalBleeding}}
+
Internal Bleeding Detected. External Bleeding Detected.
+ {{else}}
+
External Bleeding Detected
+ {{/if}}
+ {{/if}}
+
+ {{if value.germ_level > 100}}
+
+ Infection
+
+
+ {{if value.germ_level < 300}}
+ Mild Infection
+ {{else value.germ_level < 400}}
+ Mild Infection+
+ {{else value.germ_level < 500}}
+ Mild Infection++
+ {{else value.germ_level < 700}}
+ Acute Infection
+ {{else value.germ_level < 800}}
+ Acute Infection+
+ {{else value.germ_level < 900}}
+ Acute Infection++
+ {{else value.germ_level >= 900}}
+ Septic
+ {{/if}}
+
+ {{/if}}
+ {{if value.open}}
+
+ Operation Status
+
+
+ Open Incision
+
+ {{/if}}
+ {{if value.implants_len}}
+
+ Implants
+
+ {{for value.implants :impValue:impindex}}
+
+ {{:impValue.known ? impValue.name : "Unknown"}}
+
+ {{/for}}
+ {{/if}}
+ {{/if}}
+
+ {{/for}}
+
+
Internal Organs
+
+ {{for data.occupant.intOrgan}}
+
+
+ {{:value.name}}
+
+
+ {{:value.desc != null ? value.desc : ""}}
+
+ {{if value.germ_level > 100}}
+
+ Infection
+
+
+ {{if value.germ_level < 300}}
+ Mild Infection
+ {{else value.germ_level < 400}}
+ Mild Infection+
+ {{else value.germ_level < 500}}
+ Mild Infection++
+ {{else value.germ_level < 700}}
+ Acute Infection
+ {{else value.germ_level < 800}}
+ Acute Infection+
+ {{else value.germ_level < 900}}
+ Acute Infection++
+ {{else value.germ_level >= 900}}
+ Septic
+ {{/if}}
+
+ {{/if}}
+
+ Damage
+
+
+ {{:value.damage}}
+
+
+ {{/for}}
+
+{{/if}}
\ No newline at end of file