mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
[SPRITES] Emissive mechs (#26589)
* Emissive mechs * I accidentally touched the Durand * old_durand lightmask * Phazon open sprite upgrade * Move emissives to seperate file * Add unique emissives for dragon armour ripleys * Edge cases for updating overlays * Changed number to a define * Added Autodoc --------- Co-authored-by: adrermail@gmail.com <adrermail@gmail.com>
This commit is contained in:
co-authored by
adrermail@gmail.com <adrermail@gmail.com>
parent
1f9945ee5f
commit
6e3635171c
@@ -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()
|
||||
|
||||
@@ -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"].")
|
||||
|
||||
@@ -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"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 189 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
Reference in New Issue
Block a user