Artur
2021-07-28 02:13:57 +03:00
parent 187f0e4280
commit 3100f98b90
20 changed files with 196 additions and 148 deletions
+20 -8
View File
@@ -66,7 +66,11 @@
. = ..()
switch(blocks_emissive)
if(EMISSIVE_BLOCK_GENERIC)
update_emissive_block()
var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = EMISSIVE_PLANE, alpha = src.alpha)
gen_emissive_blocker.color = GLOB.em_block_color
gen_emissive_blocker.dir = dir
gen_emissive_blocker.appearance_flags |= appearance_flags
add_overlay(list(gen_emissive_blocker))
if(EMISSIVE_BLOCK_UNIQUE)
render_target = ref(src)
em_block = new(src, render_target)
@@ -111,13 +115,21 @@
/atom/movable/proc/update_emissive_block()
if(blocks_emissive != EMISSIVE_BLOCK_GENERIC)
return
if(length(managed_vis_overlays))
for(var/a in managed_vis_overlays)
var/obj/effect/overlay/vis/vs
if(vs.plane == EMISSIVE_BLOCKER_PLANE)
SSvis_overlays.remove_vis_overlay(src, list(vs))
break
SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir)
else if (blocks_emissive == EMISSIVE_BLOCK_GENERIC)
var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = EMISSIVE_PLANE, alpha = src.alpha)
gen_emissive_blocker.color = GLOB.em_block_color
gen_emissive_blocker.dir = dir
gen_emissive_blocker.appearance_flags |= appearance_flags
return gen_emissive_blocker
else if(blocks_emissive == EMISSIVE_BLOCK_UNIQUE)
if(!em_block)
render_target = ref(src)
em_block = new(src, render_target)
return em_block
/atom/movable/update_overlays()
. = ..()
. += update_emissive_block()
/atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction)
if(!direction)
+2 -2
View File
@@ -57,8 +57,8 @@
var/overlay_state = icon_screen
if(stat & BROKEN)
overlay_state = "[icon_state]_broken"
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, layer, plane, dir)
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha=128)
. += mutable_appearance(icon, overlay_state)
. += emissive_appearance(icon, overlay_state)
/obj/machinery/computer/power_change()
..()
@@ -123,7 +123,7 @@
var/list/this_pad = list()
this_pad["name"] = pad.display_name
this_pad["id"] = i
if(pad.machine_stat & NOPOWER)
if(pad.stat & NOPOWER)
this_pad["inactive"] = TRUE
pad_list += list(this_pad)
else
@@ -135,7 +135,7 @@
var/obj/machinery/mechpad/current_pad = mechpads[selected_id]
data["pad_name"] = current_pad.display_name
data["selected_pad"] = current_pad
if(QDELETED(current_pad) || (current_pad.machine_stat & NOPOWER))
if(QDELETED(current_pad) || (current_pad.stat & NOPOWER))
data["pad_active"] = FALSE
return data
data["pad_active"] = TRUE
+16 -6
View File
@@ -78,24 +78,34 @@
. += "fire_overlay"
if(is_station_level(z))
. += "fire_[GLOB.security_level]"
SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
. += "fire_[SSsecurity_level.current_level]"
. += mutable_appearance(icon, "fire_[SSsecurity_level.current_level]")
. += emissive_appearance(icon, "fire_[SSsecurity_level.current_level]")
else
. += "fire_[SEC_LEVEL_GREEN]"
SSvis_overlays.add_vis_overlay(src, icon, "fire_[SEC_LEVEL_GREEN]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
. += mutable_appearance(icon, "fire_[SEC_LEVEL_GREEN]")
. += emissive_appearance(icon, "fire_[SEC_LEVEL_GREEN]")
var/area/A = src.loc
A = A.loc
if(!detecting || !A.fire)
. += "fire_off"
SSvis_overlays.add_vis_overlay(src, icon, "fire_off", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
. += mutable_appearance(icon, "fire_off")
. += emissive_appearance(icon, "fire_off")
else if(obj_flags & EMAGGED)
. += "fire_emagged"
SSvis_overlays.add_vis_overlay(src, icon, "fire_emagged", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
. += mutable_appearance(icon, "fire_emagged")
. += emissive_appearance(icon, "fire_emagged")
else
. += "fire_on"
SSvis_overlays.add_vis_overlay(src, icon, "fire_on", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
. += mutable_appearance(icon, "fire_on")
. += emissive_appearance(icon, "fire_on")
if(!panel_open && detecting && triggered) //It just looks horrible with the panel open
. += "fire_detected"
. += mutable_appearance(icon, "fire_detected")
. += emissive_appearance(icon, "fire_detected") //Pain
/obj/machinery/firealarm/emp_act(severity)
. = ..()
+9 -6
View File
@@ -26,12 +26,15 @@
/obj/machinery/light_switch/update_icon_state()
if(stat & NOPOWER)
icon_state = "light-p"
else
if(on)
icon_state = "light1"
else
icon_state = "light0"
icon_state = "[base_icon_state]-p"
return ..()
icon_state = "[base_icon_state][area.lightswitch ? 1 : 0]"
return ..()
/obj/machinery/light_switch/update_overlays()
. = ..()
if(!(stat & NOPOWER))
. += emissive_appearance(icon, "[base_icon_state]-glow", alpha = src.alpha)
/obj/machinery/light_switch/examine(mob/user)
. = ..()
+24 -11
View File
@@ -187,16 +187,29 @@
if(B.cell)
B.cell.charge = 0
/obj/machinery/recharger/update_appearance(updates)
. = ..()
if((stat & (NOPOWER|BROKEN)) || panel_open || !anchored)
luminosity = 0
return
luminosity = 1
/obj/machinery/recharger/update_icon_state()
/obj/machinery/recharger/update_overlays()
. = ..()
if(stat & (NOPOWER|BROKEN) || !anchored)
icon_state = "rechargeroff"
else if(panel_open)
icon_state = "rechargeropen"
else if(charging)
if(using_power)
icon_state = "recharger1"
else
icon_state = "recharger2"
else
icon_state = "recharger0"
return
if(panel_open)
. += mutable_appearance(icon, "[base_icon_state]-open", alpha = src.alpha)
return
if(!charging)
. += mutable_appearance(icon, "[base_icon_state]-empty", alpha = src.alpha)
. += emissive_appearance(icon, "[base_icon_state]-empty", alpha = src.alpha)
return
if(using_power)
. += mutable_appearance(icon, "[base_icon_state]-charging", alpha = src.alpha)
. += emissive_appearance(icon, "[base_icon_state]-charging", alpha = src.alpha)
return
. += mutable_appearance(icon, "[base_icon_state]-full", alpha = src.alpha)
. += emissive_appearance(icon, "[base_icon_state]-full", alpha = src.alpha)
@@ -86,7 +86,7 @@
. += "off"
. += "sparking"
//Overlay is similar enough for both that we can use the same mask for both
SSvis_overlays.add_vis_overlay(src, icon, "locked", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
. += emissive_appearance(icon, "locked", alpha = src.alpha)
. += locked ? "locked" : "unlocked"