Merge pull request #2393 from tigercat2000/bodyscanner_nano

NanoUI Bodyscanner
This commit is contained in:
Fox McCloud
2015-10-20 17:39:28 -04:00
2 changed files with 660 additions and 285 deletions
+352 -285
View File
@@ -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 <b>Close the maintenance panel first.</b>"
user << "<span class='notice'>Close the maintenance panel first.</span>"
return
if(!ismob(G:affecting))
if(!ismob(TYPECAST_YOUR_SHIT.affecting))
return
if (src.occupant)
user << "\blue <B>The scanner is already occupied!</B>"
if(occupant)
user << "<span class='notice'>The scanner is already occupied!</span>"
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 << "<span class='danger'>[TYPECAST_YOUR_SHIT.affecting.name] has a fucking slime attached to them, deal with that first.</span>"
return
var/mob/M = G:affecting
if (M.abiotic())
user << "\blue <B>Subject cannot have abiotic items on.</B>"
var/mob/M = TYPECAST_YOUR_SHIT.affecting
if(M.abiotic())
user << "<span class='notice'>Subject cannot have abiotic items on.</span>"
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 <B>Close the maintenance panel first.</B>"
return
user << "<span class='notice'>Close the maintenance panel first.</span>"
return 0 //panel open
if(occupant)
user << "\blue <B>The body scanner is already occupied!</B>"
return
var/mob/living/L = O
if(!istype(L) || L.buckled)
return
if(L.abiotic())
user << "\blue <B>Subject cannot have abiotic items on.</B>"
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 << "<span class='notice'>\The [src] is already occupied.</span>"
return 0 //occupied
if(O.buckled)
return 0
if(O.abiotic())
user << "<span class='notice'>Subject cannot have abiotic items on.</span>"
return 0
for(var/mob/living/carbon/slime/M in range(1, O))
if(M.Victim == O)
user << "<span class='danger'>[O] has a fucking slime attached to them, deal with that first.</span>"
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 <B>The scanner is already occupied!</B>"
return
if (panel_open)
usr << "\blue <B>Close the maintenance panel first.</B>"
return
if (usr.abiotic())
usr << "\blue <B>Subject cannot have abiotic items on.</B>"
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 << "<span class='notice'>The scanner is empty.</span>"
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("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
else
if (src.connected) //Is something connected?
var/mob/living/carbon/human/occupant = src.connected.occupant
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //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 += "<font color='red'>This device can only scan human occupants.</FONT>"
else
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
ui_interact(user)
if(occupant.virus2.len)
dat += text("<font color='red'>Viral pathogen detected in blood stream.</font><BR>")
dat += text("[]\t-Brute Damage %: []</FONT><BR>", (occupant.getBruteLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getBruteLoss())
dat += text("[]\t-Respiratory Damage %: []</FONT><BR>", (occupant.getOxyLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getOxyLoss())
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getToxLoss())
dat += text("[]\t-Burn Severity %: []</FONT><BR><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), 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 %: []</FONT><BR>", (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>"), occupant.radiation)
dat += text("[]\tGenetic Tissue Damage %: []</FONT><BR>", (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getCloneLoss())
dat += text("[]\tApprox. Brain Damage %: []</FONT><BR>", (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getBrainLoss())
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
dat += text("Body Temperature: [occupant.bodytemperature-T0C]&deg;C ([occupant.bodytemperature*1.8-459.67]&deg;F)<BR><HR>")
data["connected"] = connected ? 1 : 0
if(occupant.has_brain_worms())
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
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)</FONT><BR>", (blood_volume > 448 ?"<font color='blue'>" : "<font color='red'>"), blood_percent, blood_volume)
if(occupant.reagents)
dat += text("Epinephrine units: [] units<BR>", occupant.reagents.get_reagent_amount("Epinephrine"))
dat += text("Ether: [] units<BR>", occupant.reagents.get_reagent_amount("ether"))
dat += text("[]\tSilver Sulfadiazine: [] units</FONT><BR>", (occupant.reagents.get_reagent_amount("silver_sulfadiazine") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("silver_sulfadiazine"))
dat += text("[]\tStyptic Powder: [] units<BR>", (occupant.reagents.get_reagent_amount("styptic_powder") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("styptic_powder"))
dat += text("[]\tsalbutamol: [] units<BR>", (occupant.reagents.get_reagent_amount("salbutamol") < 30 ? "<font color='black'>" : "<font color='red'>"), 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 += "<HR><table border='1'>"
dat += "<tr>"
dat += "<th>Organ</th>"
dat += "<th>Burn Damage</th>"
dat += "<th>Brute Damage</th>"
dat += "<th>Other Wounds</th>"
dat += "</tr>"
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 += "<tr>"
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 = "<br>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 += "<td>[e.name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
else
dat += "<td>[e.name]</td><td>-</td><td>-</td><td>Not Found</td>"
dat += "</tr>"
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 += "<tr>"
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
dat += "</tr>"
dat += "</table>"
if(occupant.sdisabilities & BLIND)
dat += text("<font color='red'>Cataracts detected.</font><BR>")
if(occupant.sdisabilities & NEARSIGHTED)
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
src.printing_text = dat
dat += "<BR><BR><A href='?src=\ref[src];print_p=1;name=[occupant.name]'>Print medical condition</A><BR>"
else
dat += "\The [src] is empty."
else
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
dat += text("<A href='?src=\ref[];mach_close=scanconsole'>Close</A>", 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("<span class='notice'>\The [src] rattles and prints out a sheet of paper.</span>")
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.info = "<CENTER><B>Body Scan - [href_list["name"]]</B></CENTER><BR>"
P.info += "<b>Time of scan:</b> [worldtime2text(world.time)]<br><br>"
P.info += "[src.printing_text]"
P.info += "[printing_text]"
P.info += "<br><br><b>Notes:</b><br>"
P.name = "Body Scan - [href_list["name"]]"
src.printing = null
src.printing_text = null
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 = "<font color='blue'><b>Occupant Statistics:</b></font><br>" //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 ? "<font color='blue'>" : "<font color='red'>"]\tHealth %: [occupant.health], ([t1])</font><br>"
if(occupant.virus2.len)
dat += "<font color='red'>Viral pathogen detected in blood stream.</font><BR>"
var/extra_font = null
extra_font = (occupant.getBruteLoss() < 60 ? "<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\t-Brute Damage %: [occupant.getBruteLoss()]</font><br>"
extra_font = (occupant.getOxyLoss() < 60 ? "<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\t-Respiratory Damage %: [occupant.getOxyLoss()]</font><br>"
extra_font = (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\t-Toxin Content %: [occupant.getToxLoss()]</font><br>"
extra_font = (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\t-Burn Severity %: [occupant.getFireLoss()]</font><br>"
extra_font = (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\tRadiation Level %: [occupant.radiation]</font><br>"
extra_font = (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\tGenetic Tissue Damage %: [occupant.getCloneLoss()]<br>"
extra_font = (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\tApprox. Brain Damage %: [occupant.getBrainLoss()]<br>"
dat += "Paralysis Summary %: [occupant.paralysis] ([round(occupant.paralysis / 4)] seconds left!)<br>"
dat += "Body Temperature: [occupant.bodytemperature-T0C]&deg;C ([occupant.bodytemperature*1.8-459.67]&deg;F)<br>"
dat += "<hr>"
if(occupant.has_brain_worms())
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<br>"
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 ? "<font color='blue'>" : "<font color='red'>")
dat += "[extra_font]\tBlood Level %: [blood_percent] ([blood_volume] units)</font><br>"
if(occupant.reagents)
dat += "Epinephrine units: [occupant.reagents.get_reagent_amount("Epinephrine")] units<BR>"
dat += "Ether: [occupant.reagents.get_reagent_amount("ether")] units<BR>"
extra_font = (occupant.reagents.get_reagent_amount("silver_sulfadiazine") < 30 ? "<font color='black'>" : "<font color='red'>")
dat += "[extra_font]\tSilver Sulfadiazine: [occupant.reagents.get_reagent_amount("silver_sulfadiazine")]</font><br>"
extra_font = (occupant.reagents.get_reagent_amount("styptic_powder") < 30 ? "<font color='black'>" : "<font color='red'>")
dat += "[extra_font]\tStyptic Powder: [occupant.reagents.get_reagent_amount("styptic_powder")] units<BR>"
extra_font = (occupant.reagents.get_reagent_amount("salbutamol") < 30 ? "<font color='black'>" : "<font color='red'>")
dat += "[extra_font]\tSalbutamol: [occupant.reagents.get_reagent_amount("salbutamol")] units<BR>"
dat += "<hr><table border='1'>"
dat += "<tr>"
dat += "<th>Organ</th>"
dat += "<th>Burn Damage</th>"
dat += "<th>Brute Damage</th>"
dat += "<th>Other Wounds</th>"
dat += "</tr>"
for(var/obj/item/organ/external/e in occupant.organs)
dat += "<tr>"
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 = "<br>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 += "<td>[e.name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
else
dat += "<td>[e.name]</td><td>-</td><td>-</td><td>Not Found</td>"
dat += "</tr>"
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 += "<tr>"
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
dat += "</tr>"
dat += "</table>"
if(occupant.sdisabilities & BLIND)
dat += "<font color='red'>Cataracts detected.</font><BR>"
if(occupant.disabilities & NEARSIGHTED)
dat += "<font color='red'>Retinal misalignment detected.</font><BR>"
else
dat += "\The [src] is empty."
else
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
printing_text = dat
+308
View File
@@ -0,0 +1,308 @@
<!--
Title: Body Scanner UI
Used In File(s): \code\game\machinery\adv_med.dm
-->
{{if !data.occupied}}
<h3>No occupant detected.</h3>
{{else}}
<h4><b>Occupant Data:</b></h4>
<div class="item">
<div class="itemLabelNarrow">
Name:
</div>
<div class="itemContent">
{{:data.occupant.name}}
</div>
</div>
<div class="item">
<div class="itemLabelNarrow">
Health:
</div>
{{:helper.displayBar(data.occupant.health, 0, 100, (data.occupant.health >= 50) ? 'good' : (data.occupant.health >= 25) ? 'average' : 'bad')}}
<div class="itemContent" style="width: 60px">
{{:helper.round(data.occupant.health*10)/10}}%
</div>
<div class="item">
<div class="itemLabelNarrow">
Status:
</div>
<div class="itemContent">
{{if data.occupant.stat==0}}
Alive
{{else data.occupant.stat==1}}
Critical
{{else}}
Dead
{{/if}}
</div>
</div>
{{:helper.link('Print', 'document', {'print_p' : 1, 'name' : data.occupant.name})}}
<div class="item">
<h4><b>Damage:</b></h4>
<div class="itemLabelWide">
Brute:
</div>
<div class="itemContentMedium">
{{:data.occupant.bruteLoss}}
</div><br>
<div class="itemLabelWide">
Burn:
</div>
<div class="itemContentMedium">
{{:data.occupant.fireLoss}}
</div><br>
<div class="itemLabelWide">
Oxygen:
</div>
<div class="itemContentMedium">
{{:data.occupant.oxyLoss}}
</div><br>
<div class="itemLabelWide">
Toxins:
</div>
<div class="itemContentMedium">
{{:data.occupant.toxLoss}}
</div><br>
<div class="itemLabelWide">
Brain:
</div>
<div class="itemContentMedium">
{{:data.occupant.brainLoss}}
</div><br>
<div class="itemLabelWide">
Radiation Level:
</div>
<div class="itemContentMedium">
{{:data.occupant.radLoss}}
</div><br>
<div class="itemLabelWide">
Genetic:
</div>
<div class="itemContentMedium">
{{:data.occupant.cloneLoss}}
</div><br>
<div class="itemLabelWide">
Paralysis:
</div>
<div class="itemContentMedium">
{{:data.occupant.paralysis}}% ({{:data.occupant.paralysisSeconds}} seconds left!)
</div><br>
</div>
<div class="item">
<div class="itemLabelWide">
Body Temperature:
</div>
<div class="itemContentMedium">
{{:data.occupant.bodyTempC}}&deg;C, {{:data.occupant.bodyTempF}}&deg;F
</div>
</div>
{{if data.occupant.hasVirus}}
<div class="notice">
Viral pathogen detected in blood stream.
</div>
{{/if}}
{{if data.occupant.hasBorer}}
<div class="notice">
Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
</div>
{{/if}}
{{if data.occupant.blind}}
<span class="bad">Pupils unresponsive.</span><br>
{{/if}}
{{if data.occupant.nearsighted}}
<span class="bad">Retinal Misalignment Detected</span>
{{/if}}
<br>
<div class="item">
<b>Blood</b>
<div class="itemLabelWide">
Volume
</div>
<div class="itemContentMedium">
{{:data.occupant.blood.volume}}
</div>
<div class="itemLabelWide">
Percent
</div>
<div class="itemContentMedium">
{{:data.occupant.blood.percent}}%
</div>
</div>
<br>
<div class="item">
<b>Reagents</b>
<div class="itemLabelWide">
Epinephrine
</div>
<div class="itemContentMedium">
{{:data.occupant.reagents.epinephrine}}
</div>
<div class="itemLabelWide">
Ether
</div>
<div class="itemContentMedium">
{{:data.occupant.reagents.ether}}
</div>
<div class="itemLabelWide">
<span class="{{:data.occupant.reagents.silver_sulfadiazine < 30 ? "average" : "bad"}}">
Silver Sulfadiazine
</span>
</div>
<div class="itemContentMedium">
<span class="{{:data.occupant.reagents.silver_sulfadiazine < 30 ? "average" : "bad"}}">
{{:data.occupant.reagents.silver_sulfadiazine}}
</span>
</div>
<div class="itemLabelWide">
<span class="{{:data.occupant.reagents.styptic_powder < 30 ? "average" : "bad"}}">
Styptic Powder
</span>
</div>
<div class="itemContentMedium">
<span class="{{:data.occupant.reagents.styptic_powder < 30 ? "average" : "bad"}}">
{{:data.occupant.reagents.styptic_powder}}
</span>
</div>
<div class="itemLabelWide">
<span class="{{:data.occupant.reagents.salbutamol < 30 ? "average" : "bad"}}">
Salbutamol
</span>
</div>
<div class="itemContentMedium">
<span class="{{:data.occupant.reagents.salbutamol < 30 ? "average" : "bad"}}">
{{:data.occupant.reagents.salbutamol}}
</span>
</div>
</div>
<br>
<b>External Organs</b>
<div class="itemGroup">
{{for data.occupant.extOrgan}}
<div class="item">
{{if value.status.destroyed}}
<div class="itemLabelWide">
<b>{{:value.name}}</b><span class="bad"> - DESTROYED</span>
</div>
{{else}}
<div class="itemLabelWide">
<b>{{:value.name}}</b>
</div>
<div class="itemContentNarrow">
{{if value.status.broken}}
{{:value.status.broken}}
{{else value.status.splinted}}
Splinted
{{else value.status.robotic}}
Robotic
{{/if}}
</div>
<div class="itemLabelWide">
&nbsp;Brute/Burn
</div>
<div class="itemContentNarrow">
{{:value.bruteLoss}}/{{:value.fireLoss}}
</div>
<div class="itemLabelWide">
&nbsp;Injuries
</div>
<div class="itemContentNarrow">
{{if !value.status.bleeding}}
{{if !value.status.internalBleeding}}
No Injuries Detected
{{else}}
<span class="bad">Internal Bleeding Detected</span>
{{/if}}
{{else}}
{{if value.status.internalBleeding}}
<div class='notice'>Internal Bleeding Detected. External Bleeding Detected.</div>
{{else}}
<span class="average">External Bleeding Detected</span>
{{/if}}
{{/if}}
</div>
{{if value.germ_level > 100}}
<div class="itemLabelWide">
&nbsp;Infection
</div>
<div class="itemContentNarrow">
{{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}}
</div>
{{/if}}
{{if value.open}}
<div class="itemLabelWider">
&nbsp;Operation Status
</div>
<div class="itemContentNarrow">
Open Incision
</div>
{{/if}}
{{if value.implants_len}}
<div class="itemLabelWide">
&nbsp;Implants
</div><br>
{{for value.implants :impValue:impindex}}
<div class="itemContentNarrow">
&nbsp;&nbsp;{{:impValue.known ? impValue.name : "Unknown"}}
</div><br>
{{/for}}
{{/if}}
{{/if}}
</div><br>
{{/for}}
</div>
<b>Internal Organs</b>
<div class="itemGroup">
{{for data.occupant.intOrgan}}
<div class="item">
<div class="itemLabelWide">
<b>{{:value.name}}</b>
</div>
<div class="itemContentNarrow">
{{:value.desc != null ? value.desc : ""}}
</div>
{{if value.germ_level > 100}}
<div class="itemLabelWide">
&nbsp;Infection
</div>
<div class="itemContentNarrow">
{{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}}
</div>
{{/if}}
<div class="itemLabelWide">
&nbsp;Damage
</div>
<div class="itemContentNarrow">
{{:value.damage}}
</div>
</div>
{{/for}}
</div>
{{/if}}