Research and Lathes resprite emissives + tcomms emmisives (#20398)

Title. 'nuff seid.

Also fixes the fucked up material insertion animations to use
flick_overlay_view so it isn't laggy as fuck.

And adds emissives to machines that have lights so they glow in the dark
epically.

<img width="138" alt="dreamseeker_N6egRW6Yz3"
src="https://github.com/user-attachments/assets/a17f12ba-b768-4ad6-a35f-baf33aaae658"
/>
This commit is contained in:
Wowzewow (Wezzy)
2025-01-30 15:23:16 +00:00
committed by GitHub
parent c76a3de037
commit edba6021b9
22 changed files with 179 additions and 87 deletions
+26 -8
View File
@@ -63,6 +63,7 @@
T += M.rating
mat_efficiency = 1 - (T - 2) / 8
production_speed = T / 2
update_icon()
/obj/machinery/r_n_d/protolathe/dismantle()
for(var/obj/I in component_parts)
@@ -76,13 +77,21 @@
S.amount = round(materials[f] / SHEET_MATERIAL_AMOUNT)
..()
/obj/machinery/r_n_d/protolathe/power_change()
. = ..()
update_icon()
/obj/machinery/r_n_d/protolathe/update_icon()
ClearOverlays()
if(panel_open)
icon_state = "protolathe_t"
else if(build_callback_timer)
icon_state = "protolathe_n"
else
icon_state = "protolathe"
AddOverlays("[icon_state]_panel")
if(!(stat & (NOPOWER|BROKEN)))
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
if(build_callback_timer)
AddOverlays("[icon_state]_working")
AddOverlays(emissive_appearance(icon, "[icon_state]_lights_working"))
AddOverlays("[icon_state]_lights_working")
/obj/machinery/r_n_d/protolathe/attackby(obj/item/attacking_item, mob/user)
if(build_callback_timer)
@@ -131,14 +140,22 @@
if(amount <= 0)//No negative numbers, no nulls
return
AddOverlays("protolathe_[stack.default_type]")
CUT_OVERLAY_IN("protolathe_[stack.default_type]", 10)
var/mutable_appearance/M = mutable_appearance(icon, "material_insertion")
M.color = stack.material.icon_colour
//first play the insertion animation
flick_overlay_view(M, 1 SECONDS)
//now play the progress bar animation
flick_overlay_view(mutable_appearance(icon, "protolathe_progress"), 1 SECONDS)
//Use some power and add the materials
use_power_oneoff(max(1000, (SHEET_MATERIAL_AMOUNT * amount / 10)))
if(do_after(user, 1.6 SECONDS))
if(stack.use(amount))
to_chat(user, SPAN_NOTICE("You add [amount] sheets to \the [src]."))
if(amount>1)
to_chat(user, SPAN_NOTICE("You add [amount] [stack.material.sheet_plural_name] of [stack.material.name] to \the [src]."))
else
to_chat(user, SPAN_NOTICE("You add [amount] [stack.material.sheet_singular_name] of [stack.material.name] to \the [src]."))
materials[stack.default_type] += amount * SHEET_MATERIAL_AMOUNT
//In case there's things queued up, we run the queue handler
@@ -184,6 +201,7 @@
//If there's no power, there's no building
if(stat & NOPOWER)
queue = list()
update_icon()
return
//Get the first design in the queue