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 23:23:16 +08: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
+2 -2
View File
@@ -5,8 +5,8 @@
/obj/machinery/r_n_d
name = "R&D device"
icon = 'icons/obj/machinery/research.dmi'
density = 1
anchored = 1
density = TRUE
anchored = TRUE
var/busy = 0
var/obj/machinery/computer/rdconsole/linked_console
+1 -2
View File
@@ -1,8 +1,7 @@
/obj/machinery/r_n_d/server
name = "\improper R&D server"
desc = "A server which houses a back-up of all station research. It can be used to restore lost data, or to act as another point of retrieval."
icon = 'icons/obj/machinery/research.dmi'
icon_state = "server"
icon_state = "RD-server"
var/datum/research/files
var/health = 100
var/list/id_with_upload = list() //List of R&D consoles with upload to server access.
+4 -4
View File
@@ -1,7 +1,7 @@
/obj/machinery/r_n_d/tech_processor
name = "\improper R&D tech processor"
desc = "A highly advanced analytical computation engine, when connected to an R&D server with a multitool, it will start processing known technology and add research points to it."
icon_state = "tech_processor"
icon_state = "RD-server"
component_types = list(
/obj/item/circuitboard/rdtechprocessor,
@@ -76,10 +76,10 @@
/obj/machinery/r_n_d/tech_processor/update_icon()
ClearOverlays()
if(stat & (NOPOWER|BROKEN))
icon_state = "[initial(icon_state)]_off"
icon_state = "[initial(icon_state)]-off"
else if(!linked_server)
icon_state = "[initial(icon_state)]_unlinked"
icon_state = "[initial(icon_state)]-halt"
else
icon_state = initial(icon_state)
icon_state = "[initial(icon_state)]-on"
if(panel_open)
AddOverlays("[initial(icon_state)]_open")
+15 -19
View File
@@ -1,13 +1,9 @@
/obj/machinery/weapons_analyzer
/obj/machinery/r_n_d/weapons_analyzer
name = "weapons analyzer"
desc = "A research device which can be used to put together modular energy weapons, or to gain knowledge about the effectiveness of various objects as weaponry."
icon = 'icons/obj/machinery/research.dmi'
icon_state = "weapon_analyzer"
density = TRUE
anchored = TRUE
idle_power_usage = 60
active_power_usage = 2000
var/obj/item/item = null
var/process = FALSE
@@ -17,11 +13,11 @@
/obj/item/stock_parts/console_screen = 1
)
/obj/machinery/weapons_analyzer/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
/obj/machinery/r_n_d/weapons_analyzer/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
. += SPAN_NOTICE("It has [item ? "[item.name]" : "nothing"] attached.")
/obj/machinery/weapons_analyzer/attackby(obj/item/attacking_item, mob/user)
/obj/machinery/r_n_d/weapons_analyzer/attackby(obj/item/attacking_item, mob/user)
if(!attacking_item || !user || !ishuman(user))
return
@@ -66,15 +62,15 @@
attacking_item.forceMove(src)
update_icon()
/obj/machinery/weapons_analyzer/attack_hand(mob/user)
/obj/machinery/r_n_d/weapons_analyzer/attack_hand(mob/user)
user.set_machine(src)
ui_interact(user)
/obj/machinery/weapons_analyzer/proc/reset()
/obj/machinery/r_n_d/weapons_analyzer/proc/reset()
process = FALSE
update_icon()
/obj/machinery/weapons_analyzer/proc/check_swap(var/mob/user, var/obj/I)
/obj/machinery/r_n_d/weapons_analyzer/proc/check_swap(var/mob/user, var/obj/I)
if(item)
to_chat(user, SPAN_NOTICE("You swap \the [item] out for \the [I]."))
if(istype(item, /obj/item/device/laser_assembly))
@@ -86,7 +82,7 @@
item = null
update_icon()
/obj/machinery/weapons_analyzer/verb/eject()
/obj/machinery/r_n_d/weapons_analyzer/verb/eject()
set name = "Eject Inserted Item"
set category = "Object"
set src in view(1)
@@ -110,7 +106,7 @@
else
to_chat(usr, SPAN_WARNING("There is nothing in \the [src]."))
/obj/machinery/weapons_analyzer/update_icon()
/obj/machinery/r_n_d/weapons_analyzer/update_icon()
icon_state = initial(icon_state)
ClearOverlays()
@@ -129,11 +125,11 @@
// Making gun sprite smaller and centering it where we want, cause dang they are thicc
Icon_used.Scale(round(Icon_used.Width() * 0.75), round(Icon_used.Height() * 0.75))
var/image/gun_overlay = image(Icon_used)
gun_overlay.pixel_x += 7
gun_overlay.pixel_y += 8
gun_overlay.pixel_x += 4
gun_overlay.pixel_y += 12
AddOverlays(gun_overlay)
/obj/machinery/weapons_analyzer/ui_data(mob/user)
/obj/machinery/r_n_d/weapons_analyzer/ui_data(mob/user)
var/list/data = list()
if(istype(item, /obj/item/device/laser_assembly))
@@ -253,7 +249,7 @@
data["item"]["shield_power"] = E_item.shield_power
return data
/obj/machinery/weapons_analyzer/ui_interact(mob/user, var/datum/tgui/ui)
/obj/machinery/r_n_d/weapons_analyzer/ui_interact(mob/user, var/datum/tgui/ui)
var/height = item ? 600: 300
var/width = item ? 500 : 300
if(istype(item, /obj/item/gun/energy/laser/prototype) || istype(item, /obj/item/device/laser_assembly))
@@ -266,7 +262,7 @@
ui.open()
/obj/machinery/weapons_analyzer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
/obj/machinery/r_n_d/weapons_analyzer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
@@ -275,13 +271,13 @@
do_print()
. = TRUE
/obj/machinery/weapons_analyzer/proc/do_print()
/obj/machinery/r_n_d/weapons_analyzer/proc/do_print()
var/obj/item/paper/R = new /obj/item/paper(get_turf(src))
R.color = "#fef8ff"
R.set_content_unsafe("Weapon Analysis ([item.name])", get_print_info(item))
print(R, message = "\The [src] beeps, printing \the [R] after a moment.", user = usr)
/obj/machinery/weapons_analyzer/proc/get_print_info(var/obj/item/device)
/obj/machinery/r_n_d/weapons_analyzer/proc/get_print_info(var/obj/item/device)
var/dat = "<span class='notice'><b>Analysis performed at [worldtime2text()]</b></span><br>"
dat += "<span class='notice'><b>Analyzer Item: [device.name]</b></span><br><br>"
dat += device.get_print_info()