From 83ea4021855a258272c7eac4d42a7fb309853c78 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Mon, 18 Apr 2022 22:10:32 -0400 Subject: [PATCH 1/7] Mob Examine Introduces the 'Mob Examine' verb, which lives in the right click menu and the IC tab. This verb is functionally identical to regular examine, except: -Mob Examine only works on mobs -Mob Examine will allow you to examine people your character cannot technically 'see', such as in cases where you are in a belly, or in a micro holder, or you are in a locker. They do need to be visible to the turf whatever you are in occupies though, so it's not like you'll be able to xray people through walls, or inside of other people. However, this should enable people who are being held in hands or in tummies to examine the people around whoever is holding them for purposes of checking prefs and descriptions. As a note, I did try to add this on to the basic examine verb to make it more seamless, but how examine gathers its targets is not something I really understand, and the way it works totally fails out before it even gets to the code in the verb, so I can't just tell it to run this proc if they're in a belly or a holder, and I didn't want to break it by changing it. SO! Separate verb. --- code/modules/examine/examine_vr.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 code/modules/examine/examine_vr.dm diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm new file mode 100644 index 0000000000..3b0fed0d56 --- /dev/null +++ b/code/modules/examine/examine_vr.dm @@ -0,0 +1,19 @@ +/mob/verb/mob_examine(atom/A as mob in view(world.view, get_turf(src))) + set name = "Mob Examine" + set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects." + set category = "IC" + + if((is_blind(src) || usr.stat) && !isobserver(src)) + to_chat(src, "Something is there but you can't see it.") + return 1 + + if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder)) + examinate(A) + return + if(!A) + return + var/list/results = A.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(A) From c77d689417377e0f4b3e3156e0f796d2aa8f562b Mon Sep 17 00:00:00 2001 From: VerySoft Date: Tue, 19 Apr 2022 00:19:58 -0400 Subject: [PATCH 2/7] I guess also these things! --- code/modules/examine/examine_vr.dm | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm index 3b0fed0d56..d771ed362d 100644 --- a/code/modules/examine/examine_vr.dm +++ b/code/modules/examine/examine_vr.dm @@ -17,3 +17,67 @@ results = list("You were unable to examine that. Tell a developer!") to_chat(src, jointext(results, "
")) update_examine_panel(A) + +/mob/living/silicon/ai/mob_examine(atom/A as mob) + set name = "Mob Examine" + set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects." + set category = "IC" + + var/list/E = list() + for(var/e in all_eyes) + for(var/atom/M as mob in view(world.view, get_turf(e))) + if(M == src || istype(M, /mob/observer/eye/aiEye)) + continue + if(ismob(M)) + if(A && A == M) + var/list/results = A.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(A) + return + else + E |= M + if(E.len == 0) + return + var/atom/B = input(usr, "What would you like to examine?", "Examine") as mob in E + if(!B) + return + 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) + +/turf/simulated/open/verb/examine_below(mob/usr) + set name = "Examine Below" + set desc = "Allows one to examine things below them." + set src in oview(7) + + + var/list/E = list() + var/list/T = list() + + var/keepgoing = TRUE + while(keepgoing) + var/t = GetBelow(src) + T |= t + if(!isopenspace(t)) + keepgoing = FALSE + + for(var/trf in T) + for(var/O in trf) + if(isopenspace(O)) + continue + E |= O + + if(E.len == 0) + return + var/atom/B = input(usr, "What would you like to examine?", "Examine") as anything in E + if(!B) + return + var/list/results = B.examine(usr) + if(!results || !results.len) + results = list("You were unable to examine that. Tell a developer!") + to_chat(usr, jointext(results, "
")) + usr.update_examine_panel(B) \ No newline at end of file From 88e641d16586ca61f6e019372af5e5e448efef1b Mon Sep 17 00:00:00 2001 From: VerySoft Date: Tue, 19 Apr 2022 02:08:57 -0400 Subject: [PATCH 3/7] Yup! --- code/modules/examine/examine_vr.dm | 59 ++++++++++++++++-------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm index d771ed362d..0eedf9ca2e 100644 --- a/code/modules/examine/examine_vr.dm +++ b/code/modules/examine/examine_vr.dm @@ -1,4 +1,4 @@ -/mob/verb/mob_examine(atom/A as mob in view(world.view, get_turf(src))) +/mob/verb/mob_examine(atom/A as mob) set name = "Mob Examine" set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects." set category = "IC" @@ -7,39 +7,42 @@ to_chat(src, "Something is there but you can't see it.") return 1 - if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder)) + if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder) && !isAI(src)) examinate(A) return - if(!A) - return - var/list/results = A.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(A) - -/mob/living/silicon/ai/mob_examine(atom/A as mob) - set name = "Mob Examine" - set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects." - set category = "IC" - var/list/E = list() - for(var/e in all_eyes) - for(var/atom/M as mob in view(world.view, get_turf(e))) - if(M == src || istype(M, /mob/observer/eye/aiEye)) + if(isAI(src)) + var/mob/living/silicon/ai/my_ai = src + for(var/e in my_ai.all_eyes) + for(var/atom/M in view(world.view, get_turf(e))) + if(M == src || istype(M, /mob/observer)) + continue + if(ismob(M)) + if(A && A == M) + var/list/results = A.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(A) + return + else + E |= M + if(E.len == 0) + return + else + for(var/atom/M in view(world.view, get_turf(src))) + if(M == src || istype(M, /mob/observer)) continue - if(ismob(M)) - if(A && A == M) - var/list/results = A.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(A) - return - else - E |= M + E |= M if(E.len == 0) return + if(A && A in E) + var/list/results = A.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(A) + return var/atom/B = input(usr, "What would you like to examine?", "Examine") as mob in E if(!B) return From 30ec336fa02210577fdec0926574c94e858c87e0 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Tue, 19 Apr 2022 22:43:48 -0400 Subject: [PATCH 4/7] LETS COMBINE --- code/modules/examine/examine_vr.dm | 88 +++++++++++++----------------- 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm index 0eedf9ca2e..9fd1192c82 100644 --- a/code/modules/examine/examine_vr.dm +++ b/code/modules/examine/examine_vr.dm @@ -1,15 +1,12 @@ -/mob/verb/mob_examine(atom/A as mob) +/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) || usr.stat) && !isobserver(src)) + if((is_blind(src) || src.stat) && !isobserver(src)) to_chat(src, "Something is there but you can't see it.") return 1 - - if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder) && !isAI(src)) - examinate(A) - return var/list/E = list() if(isAI(src)) var/mob/living/silicon/ai/my_ai = src @@ -17,70 +14,59 @@ for(var/atom/M in view(world.view, get_turf(e))) if(M == src || istype(M, /mob/observer)) continue - if(ismob(M)) - if(A && A == M) - var/list/results = A.examine(src) + 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(A) + update_examine_panel(src) return else E |= M if(E.len == 0) return else - for(var/atom/M in view(world.view, get_turf(src))) - if(M == src || istype(M, /mob/observer)) + 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 - E |= M + 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 - if(A && A in E) - var/list/results = A.examine(src) + if(src && src in E) + 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(A) + update_examine_panel(src) return - var/atom/B = input(usr, "What would you like to examine?", "Examine") as mob in E + 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) - -/turf/simulated/open/verb/examine_below(mob/usr) - set name = "Examine Below" - set desc = "Allows one to examine things below them." - set src in oview(7) - - - var/list/E = list() - var/list/T = list() - - var/keepgoing = TRUE - while(keepgoing) - var/t = GetBelow(src) - T |= t - if(!isopenspace(t)) - keepgoing = FALSE - - for(var/trf in T) - for(var/O in trf) - if(isopenspace(O)) - continue - E |= O - - if(E.len == 0) - return - var/atom/B = input(usr, "What would you like to examine?", "Examine") as anything in E - if(!B) - return - var/list/results = B.examine(usr) - if(!results || !results.len) - results = list("You were unable to examine that. Tell a developer!") - to_chat(usr, jointext(results, "
")) - usr.update_examine_panel(B) \ No newline at end of file + update_examine_panel(B) \ No newline at end of file From 9c29ef2b5053b51d23c2fc2023a899851837baec Mon Sep 17 00:00:00 2001 From: VerySoft Date: Tue, 19 Apr 2022 23:20:46 -0400 Subject: [PATCH 5/7] Makes sure the AI actually has a working camera nearby --- code/modules/examine/examine_vr.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm index 9fd1192c82..0f707e294e 100644 --- a/code/modules/examine/examine_vr.dm +++ b/code/modules/examine/examine_vr.dm @@ -11,7 +11,16 @@ if(isAI(src)) var/mob/living/silicon/ai/my_ai = src for(var/e in my_ai.all_eyes) - for(var/atom/M in view(world.view, get_turf(e))) + 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) From aa911e6d33af09577489345671317393f67b8ece Mon Sep 17 00:00:00 2001 From: VerySoft Date: Tue, 19 Apr 2022 23:41:00 -0400 Subject: [PATCH 6/7] Also includes the DME :U --- vorestation.dme | 1 + 1 file changed, 1 insertion(+) 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" From 078e8765de9c5a01c44dcfcb667123ae27d8aa2a Mon Sep 17 00:00:00 2001 From: VerySoft Date: Wed, 20 Apr 2022 04:05:13 -0400 Subject: [PATCH 7/7] >:C --- code/modules/examine/examine_vr.dm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/code/modules/examine/examine_vr.dm b/code/modules/examine/examine_vr.dm index 0f707e294e..f198da0edb 100644 --- a/code/modules/examine/examine_vr.dm +++ b/code/modules/examine/examine_vr.dm @@ -57,13 +57,6 @@ if(E.len == 0) to_chat(src, SPAN_NOTICE("There are no mobs to examine.")) return - if(src && src in E) - 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 var/atom/B = null if(E.len == 1) B = pick(E)