More review fixes

* Move start/stop processing for rad view into verb
* Move rad view proc into mob.dm
* Remove extraneous check on view range
This commit is contained in:
chafla
2021-06-29 10:02:00 -07:00
parent c9e796da8d
commit 000b89a604
3 changed files with 32 additions and 27 deletions
@@ -66,30 +66,6 @@
if(MODE_RAD)
show_rads()
/mob/proc/show_rads(range)
var/list/rad_places = list()
for(var/datum/component/radioactive/thing in SSradiation.processing)
var/atom/owner = thing.parent
var/turf/place = get_turf(owner)
if(rad_places[place])
rad_places[place] += thing.strength
else
rad_places[place] = thing.strength
for(var/i in rad_places)
var/turf/place = i
if(range != -1 && get_dist(src, place) >= range)
continue
var/strength = round(rad_places[i] / 1000, 0.1)
var/image/pic = image(loc = place)
var/mutable_appearance/MA = new()
MA.maptext = MAPTEXT("[strength]k")
MA.color = "#04e604"
MA.layer = RAD_TEXT_LAYER
MA.plane = GAME_PLANE
pic.appearance = MA
flick_overlay(pic, list(client), 10)
/obj/item/clothing/glasses/meson/engine/proc/show_rads()
var/mob/living/carbon/human/user = loc
+4 -3
View File
@@ -88,8 +88,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
//starts ghosts off with all HUDs.
toggle_medHUD()
START_PROCESSING(SSobj, src)
..()
/mob/dead/observer/Destroy()
@@ -100,7 +98,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
if(orbit_menu)
SStgui.close_uis(orbit_menu)
QDEL_NULL(orbit_menu)
STOP_PROCESSING(SSobj, src)
if (seerads)
STOP_PROCESSING(SSobj, src)
return ..()
/mob/dead/observer/examine(mob/user)
@@ -406,9 +405,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(seerads) //remove old huds
to_chat(src, "<span class='notice'>Rad view disabled.</span>")
seerads = FALSE
STOP_PROCESSING(SSobj, src)
else
to_chat(src, "<span class='notice'>Rad view enabled.</span>")
seerads = TRUE
START_PROCESSING(SSobj, src)
/mob/dead/observer/verb/set_dnr()
set name = "Set DNR"
+28
View File
@@ -1459,3 +1459,31 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
*/
/mob/proc/update_runechat_msg_location()
return
/**
* Show an overlay of radiation levels on radioactive objects.
*/
/mob/proc/show_rads(range)
var/list/rad_places = list()
for(var/datum/component/radioactive/thing in SSradiation.processing)
var/atom/owner = thing.parent
var/turf/place = get_turf(owner)
if(rad_places[place])
rad_places[place] += thing.strength
else
rad_places[place] = thing.strength
for(var/i in rad_places)
var/turf/place = i
if(get_dist(src, place) >= range)
continue
var/strength = round(rad_places[i] / 1000, 0.1)
var/image/pic = image(loc = place)
var/mutable_appearance/MA = new()
MA.maptext = MAPTEXT("[strength]k")
MA.color = "#04e604"
MA.layer = RAD_TEXT_LAYER
MA.plane = GAME_PLANE
pic.appearance = MA
flick_overlay(pic, list(client), 10)