Skip to content

Commit

Permalink
Health Scanner HUD
Browse files Browse the repository at this point in the history
Shows the health status of all humans in view. Has a slight delay and isn't very optimised, but 5 of them spawn in surgery, as well as one in CMO's office.
 Crayon
Crayon runes are anchored.
 Glowshrooms
Fixed their spread rate. Goddomot reset to 30 lifespan.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1536 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
uporotiy committed May 5, 2011
1 parent 2c6b184 commit 66be177
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 4 deletions.
32 changes: 31 additions & 1 deletion code/defines/obj/clothing/glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,34 @@

/obj/item/clothing/glasses/thermal/monocle
name = "Thermoncle"
icon_state = "thermoncle"
icon_state = "thermoncle"
flags = null //doesn't protect eyes because it's a monocle, duh

/obj/item/clothing/glasses/healthscanner
name = "Health Scanner HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
icon_state = "healthscanner"
flags = null //doesn't protect eyes because it's a monocle, duh
var/list/icon/current = list() //the current hud icons

/proc/RoundHealth(health)
switch(health)
if(100 to INFINITY)
return "health100"
if(70 to 100)
return "health80"
if(50 to 70)
return "health60"
if(30 to 50)
return "health40"
if(20 to 30)
return "health25"
if(5 to 15)
return "health10"
if(1 to 5)
return "health1"
if(-99 to 0)
return "health0"
else
return "health-100"
return "0"
2 changes: 1 addition & 1 deletion code/game/machinery/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ obj/machinery/hydroponics/proc/hardmutate() // Strongly mutates the current seed
src.myseed.lifespan += rand(-4,4)
if(src.myseed.lifespan < 10)
src.myseed.lifespan = 10
else if(src.myseed.lifespan > 30)
else if(src.myseed.lifespan > 30 && !istype(myseed,/obj/item/seeds/glowshroom)) //hack to prevent glowshrooms from always resetting to 30 sec delay
src.myseed.lifespan = 30

src.myseed.endurance += rand(-10,10)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ CRAYONS
desc = "A rune drawn in crayon."
icon = 'rune.dmi'
layer = 2.1
anchored = 1

/obj/decal/cleanable/crayon/New(location,main = "#FFFFFF",shade = "#000000")
..()
Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@

handle_regular_hud_updates()

if(client)
for(var/image/hud in client.images)
if(hud.icon_state in list("healthdead","healthill","healthy","health-100","health0","health1","health10","health25","health40","health60","health80","health100")) //ugly, but icon comparison is worse, I believe
del(hud)

if (src.stat == 2 || src.mutations & 4)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
Expand Down Expand Up @@ -790,6 +795,19 @@
src.sight |= SEE_OBJS
if (!src.druggy)
src.see_invisible = 0
else if (istype(glasses, /obj/item/clothing/glasses/healthscanner))
if(client)
var/icon/tempHud = 'hud.dmi'
for(var/mob/living/carbon/human/patient in view(src))
client.images += image(tempHud,patient,RoundHealth(patient.health))
if(patient.stat == 2)
client.images += image(tempHud,patient,"healthdead")
else if(patient.virus)
client.images += image(tempHud,patient,"healthill")
else
client.images += image(tempHud,patient,"healthy")
if (!src.druggy)
src.see_invisible = 0

else if (src.stat != 2)
src.sight &= ~SEE_TURFS
Expand Down
Binary file modified icons/mob/eyes.dmi
Binary file not shown.
Binary file added icons/mob/hud.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/glasses.dmi
Binary file not shown.
Binary file modified icons/obj/items.dmi
Binary file not shown.
4 changes: 2 additions & 2 deletions maps/tgstation.2.0.7.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3471,7 +3471,7 @@
"boM" = (/obj/machinery/atmospherics/unary/vent_pump{dir = 1; on = 1},/obj/item/device/radio/intercom{pixel_y = 25},/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
"boN" = (/obj/machinery/computer/operating,/obj/cable{icon_state = "0-2"; d2 = 2},/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
"boO" = (/obj/machinery/door_control{id = "Obshutter"; name = "Observation Door Control"; pixel_y = 25},/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
"boP" = (/obj/table{icon_state = "tabledir"; dir = 8},/obj/item/weapon/scalpel,/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
"boP" = (/obj/table{icon_state = "tabledir"; dir = 8},/obj/item/weapon/scalpel,/obj/item/clothing/glasses/healthscanner,/obj/item/clothing/glasses/healthscanner,/obj/item/clothing/glasses/healthscanner,/obj/item/clothing/glasses/healthscanner,/obj/item/clothing/glasses/healthscanner,/turf/simulated/floor{icon_state = "white"},/area/medical/surgery)
"boQ" = (/obj/grille,/obj/machinery/door/poddoor{density = 0; icon_state = "pdoor0"; id = "Obshutter"; name = "Observation Shutters"; opacity = 0},/obj/window/reinforced{dir = 8},/obj/window/reinforced{dir = 4},/turf/simulated/floor/plating,/area/medical/surgery)
"boR" = (/obj/stool/chair{dir = 8},/obj/item/device/radio/intercom{pixel_y = 25},/obj/machinery/camera{c_tag = "Surgery Observation"},/turf/simulated/floor{icon_state = "dark"},/area/medical/surgery)
"boS" = (/turf/simulated/floor{icon_state = "dark"},/area/medical/surgery)
Expand Down Expand Up @@ -4084,7 +4084,7 @@
"bAB" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 0; scrub_Toxins = 0},/obj/secure_closet/personal/patient,/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/medical/genetics)
"bAC" = (/obj/machinery/light{dir = 8},/obj/disposalpipe/segment{dir = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/medbay)
"bAD" = (/obj/grille,/obj/window/reinforced{dir = 4},/obj/window/reinforced{dir = 1},/obj/window/reinforced{dir = 8},/obj/window/reinforced,/turf/simulated/floor/plating,/area/medical/cmo)
"bAE" = (/obj/table{dir = 5; icon_state = "tabledir"},/obj/item/weapon/reagent_containers/hypospray,/turf/simulated/floor{icon_state = "white"},/area/medical/cmo)
"bAE" = (/obj/table{dir = 5; icon_state = "tabledir"},/obj/item/weapon/reagent_containers/hypospray,/obj/item/clothing/glasses/healthscanner,/turf/simulated/floor{icon_state = "white"},/area/medical/cmo)
"bAF" = (/obj/machinery/firealarm{dir = 1; pixel_y = -24},/obj/landmark{name = "xeno_spawn"; pixel_x = -1},/obj/machinery/atmospherics/unary/vent_pump{on = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/cmo)
"bAG" = (/obj/machinery/atmospherics/pipe/simple{color = "red"; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/machinery/requests_console{department = "Chief Medical Officer's Office"; departmentType = 5; name = "CMO RC"; pixel_y = -30},/obj/cable{d1 = 1; d2 = 4; icon_state = "1-4"; tag = "90Curve"},/turf/simulated/floor{icon_state = "white"},/area/medical/cmo)
"bAH" = (/obj/machinery/light,/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 0; scrub_Toxins = 0},/obj/cable{d1 = 4; d2 = 8; icon_state = "4-8"; tag = "Streight"},/turf/simulated/floor{icon_state = "white"},/area/medical/cmo)
Expand Down

0 comments on commit 66be177

Please sign in to comment.