mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 07:59:01 +01:00
This updates the research console to be a TGUI and fixes several bugs with it. It now uses a material silo for materials, while the acid for the circuit imprinter is still given directly to the machine. Mech fabricators now also need to be linked to a research console. It is also capable of connecting to multiple fabricators and distribute tasks between them. The sprite originates from TG station. Unit tests were also made to ensure there is no fabricators missing consoles and no console missing material silos. <img width="1200" height="800" alt="image" src="https://github.com/user-attachments/assets/b2076036-18e5-4518-9af1-3ac3698b3924" /> <img width="1200" height="800" alt="image" src="https://github.com/user-attachments/assets/e954e1e4-cf2d-4472-8386-10d8993ac375" /> <img width="1200" height="800" alt="image" src="https://github.com/user-attachments/assets/df690b93-c7ff-49a3-a1b3-002f6807981b" /> <img width="1200" height="800" alt="image" src="https://github.com/user-attachments/assets/ff10ef88-e1d9-4b6f-9643-309d919a601f" />
64 lines
2.6 KiB
Plaintext
64 lines
2.6 KiB
Plaintext
/obj/structure/machinery/r_n_d/fabricator/protolathe
|
|
name = "protolathe"
|
|
desc = "An upgraded variant of a common Autolathe, this can only be operated via a nearby RnD console, but can manufacture cutting edge technology, provided it has the design and the correct materials."
|
|
icon_state = "protolathe"
|
|
atom_flags = ATOM_FLAG_OPEN_CONTAINER
|
|
idle_power_usage = 30 WATTS
|
|
active_power_usage = 25 KILO WATTS
|
|
build_type = PROTOLATHE
|
|
uses_reagents = TRUE
|
|
fabrication_loop_type = /datum/looping_sound/synth_fab
|
|
component_types = list(
|
|
/obj/item/circuitboard/protolathe,
|
|
/obj/item/stock_parts/manipulator = 2,
|
|
/obj/item/reagent_containers/glass/beaker = 2
|
|
)
|
|
|
|
/obj/structure/machinery/r_n_d/fabricator/protolathe/upgrade_hints(mob/user, distance, is_adjacent)
|
|
. += ..()
|
|
. += "- Materials are drawn from the research material silo linked to the same R&D console."
|
|
. += "- Upgraded <b>manipulators</b> will improve material use efficiency and increase fabrication speed."
|
|
. += SPAN_NOTICE(" - The current speed increase is <b>[round((1 - (1 / production_speed)) * 100)]%</b>")
|
|
. += SPAN_NOTICE(" - The current cost reduction is <b>[round((1 - mat_efficiency) * 100)]%</b>")
|
|
|
|
/obj/structure/machinery/r_n_d/fabricator/protolathe/RefreshParts()
|
|
..()
|
|
var/total_volume = 0
|
|
for(var/obj/item/reagent_containers/glass/beaker in component_parts)
|
|
total_volume += beaker.reagents.maximum_volume
|
|
create_reagents(total_volume)
|
|
for(var/obj/item/reagent_containers/glass/beaker in component_parts)
|
|
beaker.reagents.trans_to_obj(src, beaker.reagents.total_volume)
|
|
|
|
var/manipulator_rating = 0
|
|
for(var/obj/item/stock_parts/manipulator/manipulator in component_parts)
|
|
manipulator_rating += manipulator.rating
|
|
mat_efficiency = 1 - (manipulator_rating - 2) / 8
|
|
production_speed = manipulator_rating / 2
|
|
update_icon()
|
|
|
|
/obj/structure/machinery/r_n_d/fabricator/protolathe/dismantle()
|
|
for(var/obj/item/reagent_containers/glass/beaker in component_parts)
|
|
reagents.trans_to_obj(beaker, reagents.total_volume)
|
|
..()
|
|
|
|
/obj/structure/machinery/r_n_d/fabricator/protolathe/power_change()
|
|
. = ..()
|
|
update_icon()
|
|
|
|
/obj/structure/machinery/r_n_d/fabricator/protolathe/update_icon()
|
|
ClearOverlays()
|
|
if(panel_open)
|
|
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/structure/machinery/r_n_d/fabricator/protolathe/is_open_container()
|
|
. = ..()
|
|
linked_console?.dispatch_fabrication_jobs()
|