diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index abc8d137679..f5d8815a371 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -8,7 +8,7 @@ idle_power_usage = 4 active_power_usage = 250 var/obj/item/charging = null - var/list/allowed_devices = list(/obj/item/gun/energy, /obj/item/melee/baton, /obj/item/modular_computer, /obj/item/rcs) + var/list/allowed_devices = list(/obj/item/gun/energy, /obj/item/melee/baton, /obj/item/modular_computer, /obj/item/rcs, /obj/item/bodyanalyzer) var/icon_state_off = "rechargeroff" var/icon_state_charged = "recharger2" var/icon_state_charging = "recharger1" diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 62d8dc6c87d..d7f5740f611 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -632,3 +632,236 @@ REAGENT SCANNER if(T.cores > 1) user.show_message("Anomalous slime core amount detected", 1) user.show_message("Growth progress: [T.amount_grown]/10", 1) + +/obj/item/bodyanalyzer + name = "body analyzer" + icon = 'icons/obj/device.dmi' + icon_state = "bodyanalyzer_0" + item_state = "healthanalyser" + desc = "A handheld scanner capable of deep-scanning an entire body." + slot_flags = SLOT_BELT + throwforce = 3 + w_class = WEIGHT_CLASS_TINY + throw_speed = 5 + throw_range = 10 + origin_tech = "magnets=6;biotech=6" + var/time_to_use = 0 + var/obj/item/stock_parts/cell/power_supply + var/cell_type = /obj/item/stock_parts/cell + var/printing = FALSE + +/obj/item/bodyanalyzer/New() + ..() + power_supply = new cell_type(src) + power_supply.give(power_supply.maxcharge) + update_icon() + +/obj/item/bodyanalyzer/update_icon() + overlays.Cut() + + var/iconid + if(percent > 60) + icon_state = bodyanalyzer_1 + else + icon_state = bodyanalyzer_2 + + var/percent = power_supply.percent() + var/overlayid = round(percent) + overlayid = "bodyanalyzer_charge[overlayid]" + overlays += icon(overlayid) + + if(printing) + overlays += icon('bodyanalyzer_printing') + +/obj/item/bodyanalyzer/attack(mob/living/M, mob/living/carbon/human/user) + if(user.incapacitated() || !user.Adjacent(M)) + return + + if(time_to_use > world.time) + to_chat(user, "The scanner beeps angrily at you! It's currently recharging - [round((time_to_use - world.time) * 0.1)] seconds remaining.") + playsound(user.loc, 'sound/machines/buzz-sigh.ogg', 50, 1) + return + + user.visible_message("[user] begins scanning [M] with [src]", "You begin scanning [M]") + if(do_after(user, 100, target = M)) + var/report = mobScan(M, user) + if(report) + var/obj/item/paper/printout = new + printout.info = report + printout.name = "Scan report" + playsound(user.loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) + user.put_in_hands(printout) + time_to_use = world.time + 600 + power_supply.use(300) + else + to_chat(user, "Scanning error detected.") + +/obj/item/bodyanalyzer/proc/mobScan(mob/living/M, mob/user) + if(istype(M, /mob/living/carbon/human)) + var/dat = generate_printing_text(M, user) + if(dat) + return dat + +/obj/item/bodyanalyzer/proc/generate_printing_text(mob/living/M, mob/user) + var/dat = "" + var/mob/living/carbon/human/target = M + if(!istype(target)) + to_chat(user, "Target Invalid: Unable to collect data") + return + + dat = "Target Statistics:
" + var/t1 + switch(target.stat) // obvious, see what their status is + if(CONSCIOUS) + t1 = "Conscious" + if(UNCONSCIOUS) + t1 = "Unconscious" + else + t1 = "*dead*" + dat += "[target.health > 50 ? "" : ""]\tHealth %: [target.health], ([t1])
" + + var/found_disease = FALSE + for(var/thing in target.viruses) + var/datum/disease/D = thing + if(D.visibility_flags & HIDDEN_SCANNER || D.visibility_flags & HIDDEN_PANDEMIC) + continue + found_disease = TRUE + break + if(found_disease) + dat += "Disease detected in target.
" + + var/extra_font = null + extra_font = (target.getBruteLoss() < 60 ? "" : "") + dat += "[extra_font]\t-Brute Damage %: [target.getBruteLoss()]
" + + extra_font = (target.getOxyLoss() < 60 ? "" : "") + dat += "[extra_font]\t-Respiratory Damage %: [target.getOxyLoss()]
" + + extra_font = (target.getToxLoss() < 60 ? "" : "") + dat += "[extra_font]\t-Toxin Content %: [target.getToxLoss()]
" + + extra_font = (target.getFireLoss() < 60 ? "" : "") + dat += "[extra_font]\t-Burn Severity %: [target.getFireLoss()]
" + + extra_font = (target.radiation < 10 ?"" : "") + dat += "[extra_font]\tRadiation Level %: [target.radiation]
" + + extra_font = (target.getCloneLoss() < 1 ?"" : "") + dat += "[extra_font]\tGenetic Tissue Damage %: [target.getCloneLoss()]
" + + extra_font = (target.getBrainLoss() < 1 ?"" : "") + dat += "[extra_font]\tApprox. Brain Damage %: [target.getBrainLoss()]
" + + dat += "Paralysis Summary %: [target.paralysis] ([round(target.paralysis / 4)] seconds left!)
" + dat += "Body Temperature: [target.bodytemperature-T0C]°C ([target.bodytemperature*1.8-459.67]°F)
" + + dat += "
" + + if(target.has_brain_worms()) + dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
" + + var/blood_percent = round((target.blood_volume / BLOOD_VOLUME_NORMAL)) + blood_percent *= 100 + + extra_font = (target.blood_volume > 448 ? "" : "") + dat += "[extra_font]\tBlood Level %: [blood_percent] ([target.blood_volume] units)
" + + if(target.reagents) + dat += "Epinephrine units: [target.reagents.get_reagent_amount("Epinephrine")] units
" + dat += "Ether: [target.reagents.get_reagent_amount("ether")] units
" + + extra_font = (target.reagents.get_reagent_amount("silver_sulfadiazine") < 30 ? "" : "") + dat += "[extra_font]\tSilver Sulfadiazine: [target.reagents.get_reagent_amount("silver_sulfadiazine")]
" + + extra_font = (target.reagents.get_reagent_amount("styptic_powder") < 30 ? "" : "") + dat += "[extra_font]\tStyptic Powder: [target.reagents.get_reagent_amount("styptic_powder")] units
" + + extra_font = (target.reagents.get_reagent_amount("salbutamol") < 30 ? "" : "") + dat += "[extra_font]\tSalbutamol: [target.reagents.get_reagent_amount("salbutamol")] units
" + + dat += "
" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + + for(var/obj/item/organ/external/e in target.bodyparts) + dat += "" + var/AN = "" + var/open = "" + var/infected = "" + var/robot = "" + var/imp = "" + var/bled = "" + var/splint = "" + var/internal_bleeding = "" + var/lung_ruptured = "" + if(e.internal_bleeding) + internal_bleeding = "
Internal bleeding" + if(istype(e, /obj/item/organ/external/chest) && target.is_lung_ruptured()) + lung_ruptured = "Lung ruptured:" + if(e.status & ORGAN_SPLINTED) + splint = "Splinted:" + if(e.status & ORGAN_BROKEN) + AN = "[e.broken_description]:" + if(e.is_robotic()) + robot = "Robotic:" + 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.embedded_objects) + unknown_body++ + + if(unknown_body || e.hidden) + imp += "Unknown body present:" + if(!AN && !open && !infected & !imp) + AN = "None:" + dat += "" + dat += "" + for(var/obj/item/organ/internal/i in target.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 += "" + dat += "" + dat += "
OrganBurn DamageBrute DamageOther Wounds
[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]
[i.name]N/A[i.damage][infection]:[mech]
" + if(target.disabilities & BLIND) + dat += "Cataracts detected.
" + if(target.disabilities & COLOURBLIND) + dat += "Photoreceptor abnormalities detected.
" + if(target.disabilities & NEARSIGHTED) + dat += "Retinal misalignment detected.
" + + return dat diff --git a/icons/obj/device.dmi b/icons/obj/device.dmi index 042c10b2aed..9b8a03d8e2c 100644 Binary files a/icons/obj/device.dmi and b/icons/obj/device.dmi differ