From 7c6be505051dc8a016e8eee73a3d50d78e775bf5 Mon Sep 17 00:00:00 2001 From: chafla Date: Fri, 25 Jun 2021 14:29:58 -0700 Subject: [PATCH] Create new mob proc to show radiation, add to verb --- .../clothing/glasses/engine_goggles.dm | 13 ++++++---- code/modules/mob/dead/observer/observer.dm | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm index acdce6a78ed..0ccebdd7432 100644 --- a/code/modules/clothing/glasses/engine_goggles.dm +++ b/code/modules/clothing/glasses/engine_goggles.dm @@ -66,8 +66,8 @@ if(MODE_RAD) show_rads() -/obj/item/clothing/glasses/meson/engine/proc/show_rads() - var/mob/living/carbon/human/user = loc +/mob/proc/show_rads(range) + var/mob/user = src var/list/rad_places = list() for(var/datum/component/radioactive/thing in SSradiation.processing) var/atom/owner = thing.parent @@ -79,8 +79,8 @@ for(var/i in rad_places) var/turf/place = i - if(get_dist(user, place) >= range * 5) //Rads are easier to see than wires under the floor - continue + // if(get_dist(user, place) >= range * 5) //Rads are easier to see than wires under the floor + // continue var/strength = round(rad_places[i] / 1000, 0.1) var/image/pic = image(loc = place) var/mutable_appearance/MA = new() @@ -91,6 +91,11 @@ pic.appearance = MA flick_overlay(pic, list(user.client), 10) + +/obj/item/clothing/glasses/meson/engine/proc/show_rads() + var/mob/living/carbon/human/user = loc + user.show_rads(range) + /obj/item/clothing/glasses/meson/engine/update_icon() icon_state = "trayson-[mode]" update_mob() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 82df0409d2e..516feca29ac 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -26,6 +26,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/image/ghostimage = null //this mobs ghost image, for deleting and stuff var/ghostvision = TRUE //is the ghost able to see things humans can't? var/seedarkness = TRUE + var/seerads = FALSE // can the ghost see radiation? var/data_hud_seen = FALSE //this should one of the defines in __DEFINES/hud.dm var/ghost_orbit = GHOST_ORBIT_CIRCLE var/health_scan = FALSE //does the ghost have health scanner mode on? by default it should be off @@ -87,6 +88,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) //starts ghosts off with all HUDs. toggle_medHUD() + + START_PROCESSING(SSobj, src) ..() /mob/dead/observer/Destroy() @@ -97,6 +100,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) if(orbit_menu) SStgui.close_uis(orbit_menu) QDEL_NULL(orbit_menu) + STOP_PROCESSING(SSobj, src) return ..() /mob/dead/observer/examine(mob/user) @@ -104,6 +108,11 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) if(!invisibility) . += "It seems extremely obvious." +/mob/dead/observer/process() + if(seerads) + show_rads(1) + return + // This seems stupid, but it's the easiest way to avoid absolutely ridiculous shit from happening // Copying an appearance directly from a mob includes it's verb list, it's invisibility, it's alpha, and it's density // You might recognize these things as "fucking ridiculous to put in an appearance" @@ -387,6 +396,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "AntagHud Toggled OFF") M.antagHUD = FALSE +/mob/dead/observer/verb/toggle_rad_view() + set category = "Ghost" + set name = "Toggle Radiation View" // "Haunt" + set desc = "Toggle viewing radiation ." + + if(!isobserver(src)) // Somehow + return + + if(seerads) //remove old huds + to_chat(src, "Rad view disabled.") + seerads = FALSE + else + to_chat(src, "Rad view enabled.") + seerads = TRUE + /mob/dead/observer/verb/set_dnr() set name = "Set DNR" set category = "Ghost"