diff --git a/code/game/machinery/adv_med_vr.dm b/code/game/machinery/adv_med_vr.dm index ed91ac24e2c..434523d5c02 100644 --- a/code/game/machinery/adv_med_vr.dm +++ b/code/game/machinery/adv_med_vr.dm @@ -29,31 +29,67 @@ return incoming /obj/machinery/bodyscanner/update_icon() + cut_overlays() + + if(!occupant) + icon_state = "scanner_open" + set_light(0) + return + + // base image + icon_state = "new_scanner_off" + + // Determine gradient state + var/state + var/scan = TRUE + var/h_ratio = occupant.health / occupant.getMaxHealth() + if(console) + console.update_icon(h_ratio) + if(stat & (NOPOWER|BROKEN)) - icon_state = "scanner_off" + state = "gradient_gray" + scan = FALSE set_light(0) else - var/h_ratio - if(occupant) - h_ratio = occupant.health / occupant.getMaxHealth() - switch(h_ratio) - if(1.000) - icon_state = "scanner_green" - set_light(l_range = 1.5, l_power = 2, l_color = COLOR_LIME) - if(0.001 to 0.999) - icon_state = "scanner_yellow" - set_light(l_range = 1.5, l_power = 2, l_color = COLOR_YELLOW) - if(-0.999 to 0.000) - icon_state = "scanner_red" - set_light(l_range = 1.5, l_power = 2, l_color = COLOR_RED) - else - icon_state = "scanner_death" - set_light(l_range = 1.5, l_power = 2, l_color = COLOR_RED) - else - icon_state = "scanner_open" - set_light(0) - if(console) - console.update_icon(h_ratio) + switch(h_ratio) + if(1.000) + state = "gradient_green" + set_light(l_range = 1.5, l_power = 2, l_color = COLOR_LIME) + if(0.001 to 0.999) + state = "gradient_yellow" + set_light(l_range = 1.5, l_power = 2, l_color = COLOR_YELLOW) + else + state = "gradient_red" + set_light(l_range = 1.5, l_power = 2, l_color = COLOR_RED) + + // First, we render the occupant + var/image/occ = image(occupant) + occ.dir = SOUTH + var/matrix/M = matrix() + M.Turn(dir == EAST ? 90 : -90) + occ.transform = M + occ.plane = plane + occ.layer = layer + 0.1 + occ.filters = list( + filter("type" = "alpha", "icon" = icon(icon, "alpha_mask", dir = dir == EAST ? EAST : WEST)), + filter("type" = "color", "color" = "#000000") + ) + add_overlay(occ) + + if(scan) + // Second, we render the scan beam + var/image/scan_beam = image(icon(icon, "scan_beam")) + scan_beam.plane = plane + scan_beam.layer = layer + 0.2 + add_overlay(scan_beam) + + if(state) + // Third, we tint everything + var/image/gradient = image(icon(icon, state)) + gradient.plane = plane + gradient.layer = layer + 0.3 + add_overlay(gradient) + /obj/machinery/body_scanconsole/update_icon(var/h_ratio) if(stat & (NOPOWER|BROKEN)) diff --git a/icons/obj/Cryogenic2_vr.dmi b/icons/obj/Cryogenic2_vr.dmi index e4b88cb6359..7ed20714a7b 100644 Binary files a/icons/obj/Cryogenic2_vr.dmi and b/icons/obj/Cryogenic2_vr.dmi differ