From a0e336e6826301cf455af62fa56acf280bdbb826 Mon Sep 17 00:00:00 2001 From: YoYoBatty <32651551+yoyobatty@users.noreply.github.com> Date: Mon, 7 Jan 2019 01:45:48 -0500 Subject: [PATCH] Check plumbing verb upgrade + t-ray view verb (#42218) cl YoYoBatty add: Added a ghost verb that lets you t-ray view underfloor objects admin: Checking plumbing verb checks every atmospheric component instead of just pipes code: Check plumbing verb is less snowflakey /cl --- code/modules/admin/verbs/atmosdebug.dm | 14 ++++---- .../atmospherics/machinery/atmosmachinery.dm | 1 - .../atmospherics/machinery/datum_pipeline.dm | 6 ++-- code/modules/mob/dead/observer/observer.dm | 33 +++++++++++++++++-- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 75407eae9c3..6075f1eace6 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -7,18 +7,18 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Plumbing") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //all plumbing - yes, some things might get stated twice, doesn't matter. - for (var/obj/machinery/atmospherics/plumbing in GLOB.machines) - if (plumbing.nodealert) - to_chat(usr, "Unconnected [plumbing.name] located at [ADMIN_VERBOSEJMP(plumbing)]") + for(var/obj/machinery/atmospherics/components/pipe in GLOB.machines) + if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes))) + to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]") //Manifolds - for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines) - if (!pipe.nodes[1] || !pipe.nodes[2] || !pipe.nodes[3]) + for(var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines) + if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes))) to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]") //Pipes - for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) - if (!pipe.nodes[1] || !pipe.nodes[2]) + for(var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) + if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes))) to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]") /client/proc/powerdebug() diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 0dc59a0a5d1..e4aeafdef9c 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -20,7 +20,6 @@ resistance_flags = FIRE_PROOF max_integrity = 200 obj_flags = CAN_BE_HIT | ON_BLUEPRINTS - var/nodealert = 0 var/can_unwrench = 0 var/initialize_directions = 0 var/pipe_color diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index edea8baa55b..6ba30cc6125 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -43,12 +43,10 @@ if(!air) air = new var/list/possible_expansions = list(base) - while(possible_expansions.len>0) + while(possible_expansions.len) for(var/obj/machinery/atmospherics/borderline in possible_expansions) - var/list/result = borderline.pipeline_expansion(src) - - if(result.len>0) + if(result && result.len) for(var/obj/machinery/atmospherics/P in result) if(istype(P, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/item = P diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 81a59ff4929..1076aa39d4e 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -61,7 +61,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) verbs += list( /mob/dead/observer/proc/dead_tele, /mob/dead/observer/proc/open_spawners_menu, - /mob/dead/observer/proc/view_gas) + /mob/dead/observer/proc/view_gas, + /mob/dead/observer/proc/tray_view) if(icon_state in GLOB.ghost_forms_with_directions_list) ghostimage_default = image(src.icon,src,src.icon_state + "_nodir") @@ -351,7 +352,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp else to_chat(usr, "You're already stuck out of your body!") return FALSE - + can_reenter_corpse = FALSE do_not_resuscitate = TRUE to_chat(src, "You can now no longer be brought back into your body. You can undo this at any time by using the Do Not Resuscitate verb again.") @@ -863,3 +864,31 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp spawners_menu = new(src) spawners_menu.ui_interact(src) + +/mob/dead/observer/proc/tray_view() + set category = "Ghost" + set name = "T-ray view" + set desc = "Toggles a view of sub-floor objects" + + var/static/t_ray_view = FALSE + t_ray_view = !t_ray_view + + var/list/t_ray_images = list() + var/static/list/stored_t_ray_images = list() + for(var/obj/O in orange(client.view, src) ) + if(O.level != 1) + continue + + if(O.invisibility == INVISIBILITY_MAXIMUM) + var/image/I = new(loc = get_turf(O)) + var/mutable_appearance/MA = new(O) + MA.alpha = 128 + MA.dir = O.dir + I.appearance = MA + t_ray_images += I + stored_t_ray_images += t_ray_images + if(t_ray_images.len) + if(t_ray_view) + client.images += t_ray_images + else + client.images -= stored_t_ray_images