diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 4cfdc0a6c29..1b3f89af28a 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -729,7 +729,7 @@ /obj/machinery/vending/assist products = list( /obj/item/device/assembly/prox_sensor = 5,/obj/item/device/assembly/igniter = 3,/obj/item/device/assembly/signaler = 4, /obj/item/weapon/wirecutters = 1, /obj/item/weapon/cartridge/signal = 4) - contraband = list(/obj/item/device/flashlight = 5,/obj/item/device/assembly/timer = 2) + contraband = list(/obj/item/device/flashlight = 5,/obj/item/device/assembly/timer = 2, /obj/item/device/assembly/voice = 2, /obj/item/device/assembly/health = 2) product_ads = "Only the finest!;Have some tools.;The most robust equipment.;The finest gear in space!" /obj/machinery/vending/boozeomat/New() @@ -887,6 +887,7 @@ products = list(/obj/item/clothing/under/rank/scientist = 6,/obj/item/clothing/suit/bio_suit = 6,/obj/item/clothing/head/bio_hood = 6, /obj/item/device/transfer_valve = 6,/obj/item/device/assembly/timer = 6,/obj/item/device/assembly/signaler = 6, /obj/item/device/assembly/prox_sensor = 6,/obj/item/device/assembly/igniter = 6) + contraband = list(/obj/item/device/assembly/health = 3) /obj/machinery/vending/wallmed1 name = "NanoMed" diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm new file mode 100644 index 00000000000..f1a3f402336 --- /dev/null +++ b/code/modules/assembly/health.dm @@ -0,0 +1,104 @@ +/obj/item/device/assembly/health + name = "health sensor" + desc = "Used for scanning and monitoring health." + icon_state = "health" + materials = list(MAT_METAL=800, MAT_GLASS=200) + origin_tech = "magnets=1;biotech=1" + secured = 0 + + var/scanning = 0 + var/health_scan + var/alarm_health = 0 + + + +/obj/item/device/assembly/health/activate() + if(!..()) return 0//Cooldown check + toggle_scan() + return 0 + +/obj/item/device/assembly/health/toggle_secure() + secured = !secured + if(secured && scanning) + processing_objects.Add(src) + else + scanning = 0 + processing_objects.Remove(src) + update_icon() + return secured + +/obj/item/device/assembly/health/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/device/multitool)) + if(alarm_health == 0) + alarm_health = -90 + user.show_message("You toggle [src] to \"detect death\" mode.") + else + alarm_health = 0 + user.show_message("You toggle [src] to \"detect critical state\" mode.") + return + else + return ..() + +/obj/item/device/assembly/health/process() + if(!scanning || !secured) + return + + var/atom/A = src + if(connected && connected.holder) + A = connected.holder + + for(A, A && !ismob(A), A=A.loc); + // like get_turf(), but for mobs. + var/mob/living/M = A + + if(M) + health_scan = M.health + if(health_scan <= alarm_health) + pulse() + audible_message("\icon[src] *beep* *beep*", "*beep* *beep*") + toggle_scan() + return + return + +/obj/item/device/assembly/health/proc/toggle_scan() + if(!secured) return 0 + scanning = !scanning + if(scanning) + processing_objects.Add(src) + else + processing_objects.Remove(src) + return + +/obj/item/device/assembly/health/interact(mob/user as mob)//TODO: Change this to the wires thingy + if(!secured) + user.show_message("The [name] is unsecured!") + return 0 + var/dat = text("Health Sensor [scanning?"On":"Off"]") + if(scanning && health_scan) + dat += "
Health: [health_scan]" + user << browse(dat, "window=hscan") + onclose(user, "hscan") + return + + +/obj/item/device/assembly/health/Topic(href, href_list) + ..() + if(!ismob(usr)) + return + + var/mob/user = usr + + if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) + usr << browse(null, "window=hscan") + onclose(usr, "hscan") + return + + if(href_list["scanning"]) + toggle_scan() + + if(href_list["close"]) + usr << browse(null, "window=hscan") + return + + attack_self(user) + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a63f487aec7..b5e637fa546 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -244,6 +244,8 @@ stat(null, eta_status) if (client.statpanel == "Status") + if(locate(/obj/item/device/assembly/health) in src) + stat(null, "Health: [health]") if (internal) if (!internal.air_contents) qdel(internal) @@ -431,7 +433,7 @@ var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) -/mob/living/carbon/human/proc/is_loyalty_implanted() +/mob/living/carbon/human/proc/is_loyalty_implanted() for(var/L in contents) if(istype(L, /obj/item/weapon/implant/loyalty)) for(var/obj/item/organ/external/O in organs) @@ -694,7 +696,7 @@ // if looting pockets with gloves, do it quietly if(href_list["pockets"]) - if(isanimal(usr)) + if(isanimal(usr)) return //animals cannot strip people if(frozen) @@ -726,19 +728,19 @@ // Update strip window if(usr.machine == src && in_range(src, usr)) show_inv(usr) - + else if(!pickpocket) // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" // if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White if(href_list["item"]) - if(isanimal(usr)) + if(isanimal(usr)) return //animals cannot strip people - + if(frozen) usr << "\red Do not attempt to strip frozen people." - return + return var/itemTarget = href_list["item"] if(itemTarget == "id") if(pickpocket) @@ -1158,7 +1160,7 @@ if(!fail_msg) fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into." user << "[fail_msg]" - + /mob/living/carbon/human/proc/check_has_mouth() // Todo, check stomach organ when implemented. var/obj/item/organ/external/head/H = get_organ("head") @@ -1170,7 +1172,7 @@ if(stat==DEAD)return if(!check_has_mouth()) - return + return if(!lastpuke) lastpuke = 1 @@ -1517,16 +1519,16 @@ W.add_fingerprint(src) -// Allows IPC's to change their monitor display +// Allows IPC's to change their monitor display /mob/living/carbon/human/proc/change_monitor() - set category = "IC" + set category = "IC" set name = "Change Monitor Display" set desc = "Change the display on your monitor." - + if(stat || paralysis || stunned || weakened) src << "You cannot change your monitor display in your current state." - return - + return + var/list/hair = list() for(var/i in hair_styles_list) var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i] @@ -1540,7 +1542,7 @@ h_style = new_style update_hair() - + //Putting a couple of procs here that I don't know where else to dump. //Mostly going to be used for Vox and Vox Armalis, but other human mobs might like them (for adminbuse). /mob/living/carbon/human/proc/leap() diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index bfaf774c42f..90cebcf4648 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -162,6 +162,14 @@ build_path = /obj/item/device/assembly/infra category = list("initial", "Miscellaneous") +/datum/design/health_sensor + name = "Health sensor" + id = "health_sensor" + build_type = AUTOLATHE + materials = list(MAT_METAL = 800, MAT_GLASS = 200) + build_path = /obj/item/device/assembly/health + category = list("initial", "Medical") + /datum/design/kitchen_knife name = "Kitchen knife" id = "kitchen_knife" diff --git a/icons/obj/assemblies/new_assemblies.dmi b/icons/obj/assemblies/new_assemblies.dmi index 0f9dc460825..b50ef0e13e3 100644 Binary files a/icons/obj/assemblies/new_assemblies.dmi and b/icons/obj/assemblies/new_assemblies.dmi differ diff --git a/paradise.dme b/paradise.dme index b8184ad6713..238cea3415c 100644 --- a/paradise.dme +++ b/paradise.dme @@ -959,6 +959,7 @@ #include "code\modules\alarm\power_alarm.dm" #include "code\modules\assembly\assembly.dm" #include "code\modules\assembly\bomb.dm" +#include "code\modules\assembly\health.dm" #include "code\modules\assembly\helpers.dm" #include "code\modules\assembly\holder.dm" #include "code\modules\assembly\igniter.dm"