diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 1980ded0172..813b9983e04 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -4,6 +4,7 @@ name = "Mecha" desc = "Exosuit" icon = 'icons/mecha/mecha.dmi' + density = TRUE //Dense. To raise the heat. opacity = TRUE ///opaque. Menacing. anchored = TRUE //no pulling around. @@ -37,8 +38,11 @@ var/dna //dna-locking the mech var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference var/datum/effect_system/spark_spread/spark_system = new - var/lights = 0 + var/lights = FALSE var/lights_power = 6 + var/lights_range = 6 + var/lights_power_ambient = LIGHTING_MINIMUM_POWER + var/lights_range_ambient = MINIMUM_USEFUL_LIGHT_RANGE var/frozen = FALSE var/repairing = FALSE var/emp_proof = FALSE //If it is immune to emps @@ -81,6 +85,9 @@ var/activated = FALSE var/power_warned = FALSE + /// DMI containing greyscale emissive overlays, responsible for what parts of the mech glow in the dark + var/emissive_appearance_icon = 'icons/mecha/mecha_emissive.dmi' + var/destruction_sleep_duration = 2 SECONDS //Time that mech pilot is put to sleep for if mech is destroyed var/melee_cooldown = 10 @@ -147,6 +154,14 @@ V.install(src) qdel(V) + set_light(lights_range_ambient, lights_power_ambient) + update_overlays() + +/obj/mecha/update_overlays() + . = ..() + underlays.Cut() + underlays += emissive_appearance(emissive_appearance_icon, "[icon_state]_lightmask") + //////////////////////// ////// Helpers ///////// //////////////////////// @@ -1018,6 +1033,7 @@ AI.forceMove(src) occupant = AI icon_state = reset_icon(icon_state) + update_overlays() playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!hasInternalDamage()) SEND_SOUND(occupant, sound(nominalsound, volume = 50)) @@ -1086,9 +1102,9 @@ /obj/mecha/proc/toggle_lights(show_message = TRUE) lights = !lights if(lights) - set_light(light_range + lights_power) + set_light(lights_range, lights_power) else - set_light(light_range - lights_power) + set_light(lights_range_ambient, lights_power_ambient) if(show_message) occupant_message("Toggled lights [lights ? "on" : "off"].") log_message("Toggled lights [lights ? "on" : "off"].") @@ -1175,6 +1191,7 @@ H.throw_alert("locked", /atom/movable/screen/alert/mech_maintenance) if(connected_port) H.throw_alert("mechaport_d", /atom/movable/screen/alert/mech_port_disconnect) + update_overlays() return TRUE else return FALSE @@ -1230,6 +1247,7 @@ Move(loc) icon_state = reset_icon() dir = dir_in + update_overlays() log_message("[mmi_as_oc] moved in as pilot.") if(!hasInternalDamage()) SEND_SOUND(occupant, sound(nominalsound, volume = 50)) @@ -1319,6 +1337,7 @@ if(ishuman(L)) var/mob/living/carbon/human/H = L H.regenerate_icons() // workaround for 14457 + update_overlays() /obj/mecha/force_eject_occupant(mob/target) go_out() diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index b52c7060fa1..316e4eb737e 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -66,10 +66,10 @@ return chassis.lights = !chassis.lights if(chassis.lights) - chassis.set_light(chassis.lights_power) + chassis.set_light(chassis.lights_range, chassis.lights_power) button_overlay_icon_state = "mech_lights_on" else - chassis.set_light(-chassis.lights_power) + chassis.set_light(chassis.lights_range_ambient, chassis.lights_power_ambient) button_overlay_icon_state = "mech_lights_off" chassis.occupant_message("Toggled lights [chassis.lights ? "on" : "off"].") chassis.log_message("Toggled lights [chassis.lights ? "on" : "off"].") diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 788df39c50d..0ef350472a1 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -123,6 +123,8 @@ //drake hides if(drake_hides) if(drake_hides == DRAKE_HIDES_COVERED_FULL) + underlays.Cut() + underlays += emissive_appearance(emissive_appearance_icon, occupant ? "ripley-d-full_lightmask" : "ripley-d-full-open_lightmask") . += occupant ? "ripley-d-full" : "ripley-d-full-open" else if(drake_hides == DRAKE_HIDES_COVERED_MODERATE) . += occupant ? "ripley-d-2" : "ripley-d-2-open" diff --git a/icons/mecha/mecha.dmi b/icons/mecha/mecha.dmi index 5cef247ee7f..28b04958109 100644 Binary files a/icons/mecha/mecha.dmi and b/icons/mecha/mecha.dmi differ diff --git a/icons/mecha/mecha_emissive.dmi b/icons/mecha/mecha_emissive.dmi new file mode 100644 index 00000000000..b48ecc11935 Binary files /dev/null and b/icons/mecha/mecha_emissive.dmi differ