diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm new file mode 100644 index 0000000000..f198da0edb --- /dev/null +++ b/code/modules/examine/examine_vr.dm @@ -0,0 +1,74 @@ +/mob/verb/mob_examine() + set name = "Mob Examine" + set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects." + set category = "IC" + set popup_menu = FALSE + + if((is_blind(src) || src.stat) && !isobserver(src)) + to_chat(src, "Something is there but you can't see it.") + return 1 + var/list/E = list() + if(isAI(src)) + var/mob/living/silicon/ai/my_ai = src + for(var/e in my_ai.all_eyes) + var/turf/my_turf = get_turf(e) + var/foundcam = FALSE + for(var/obj/cam in view(world.view, my_turf)) + if(istype(cam, /obj/machinery/camera)) + var/obj/machinery/camera/mycam = cam + if(!mycam.stat) + foundcam = TRUE + if(!foundcam) + continue + for(var/atom/M in view(world.view, my_turf)) + if(M == src || istype(M, /mob/observer)) + continue + if(ismob(M) && !M.invisibility) + if(src && src == M) + var/list/results = src.examine(src) + if(!results || !results.len) + results = list("You were unable to examine that. Tell a developer!") + to_chat(src, jointext(results, "
")) + update_examine_panel(src) + return + else + E |= M + if(E.len == 0) + return + else + var/my_turf = get_turf(src) + for(var/atom/M in view(world.view, my_turf)) + if(ismob(M) && M != src && !istype(M, /mob/observer) && !M.invisibility) + E |= M + for(var/turf/T in view(world.view, my_turf)) + if(!isopenspace(T)) + continue + var/turf/checked = T + var/keepgoing = TRUE + while(keepgoing) + var/checking = GetBelow(checked) + for(var/atom/m in checking) + if(ismob(m) && !istype(m, /mob/observer) && !m.invisibility) + E |= m + checked = checking + if(!isopenspace(checked)) + keepgoing = FALSE + + if(E.len == 0) + to_chat(src, SPAN_NOTICE("There are no mobs to examine.")) + return + var/atom/B = null + if(E.len == 1) + B = pick(E) + else + B = tgui_input_list(src, "What would you like to examine?", "Examine", E) + if(!B) + return + if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder) && !isAI(src)) + if(B.z == src.z) + face_atom(B) + var/list/results = B.examine(src) + if(!results || !results.len) + results = list("You were unable to examine that. Tell a developer!") + to_chat(src, jointext(results, "
")) + update_examine_panel(B) \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 6efd253f27..be1923eada 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2227,6 +2227,7 @@ #include "code\modules\events\supply_demand_vr.dm" #include "code\modules\events\wallrot.dm" #include "code\modules\examine\examine.dm" +#include "code\modules\examine\examine_vr.dm" #include "code\modules\examine\stat_icons.dm" #include "code\modules\examine\descriptions\armor.dm" #include "code\modules\examine\descriptions\atmospherics.dm"