From aae6ea020335588bacc80c401ff815ba7dc0a18e Mon Sep 17 00:00:00 2001
From: iksyp <33264221+iskyp@users.noreply.github.com>
Date: Sat, 19 May 2018 14:39:14 -0700
Subject: [PATCH 1/2] [READY] Gives Stacking Machines and their consoles
machine boards (#37607)
* patch-2
* does everything on the TODO list
FUCK YEAH
*breaks up the engineering node design ID's for readability
*linking the device via multitool is possible
*The machinery construction "recipes" are less shit and make a bit more sense
* coil
* did somebody say RUNTIMES?
*fixed runtimes when there is no link on the stacking machine console
*added feedback for unlinked consoles
*it's -> its
*proper typecheck
* achieved with [src]
---
.../circuitboards/machine_circuitboards.dm | 14 +++++++++
code/modules/mining/machine_stacking.dm | 31 ++++++++++++++++---
.../research/designs/machine_designs.dm | 16 ++++++++++
code/modules/research/techweb/all_nodes.dm | 3 +-
4 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm
index 1e7969fa8f..c4aa6f52cc 100644
--- a/code/game/objects/items/circuitboards/machine_circuitboards.dm
+++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm
@@ -873,3 +873,17 @@
return
transmit = !transmit
to_chat(user, "You [transmit ? "enable" : "disable"] the board's automatic disposal transmission.")
+
+/obj/item/circuitboard/machine/stacking_unit_console
+ name = "Stacking Machine Console (Machine Board)"
+ build_path = /obj/machinery/mineral/stacking_unit_console
+ req_components = list(
+ /obj/item/stack/sheet/glass = 2,
+ /obj/item/stack/cable_coil = 5)
+
+/obj/item/circuitboard/machine/stacking_machine
+ name = "Stacking Machine (Machine Board)"
+ build_path = /obj/machinery/mineral/stacking_machine
+ req_components = list(
+ /obj/item/stock_parts/manipulator = 2,
+ /obj/item/stock_parts/matter_bin = 2)
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index f566a8f4a9..0f84d11082 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -7,20 +7,23 @@
desc = "Controls a stacking machine... in theory."
density = FALSE
anchored = TRUE
- var/obj/machinery/mineral/stacking_machine/machine = null
+ circuit = /obj/item/circuitboard/machine/stacking_unit_console
+ var/obj/machinery/mineral/stacking_machine/machine
var/machinedir = SOUTHEAST
- speed_process = TRUE
/obj/machinery/mineral/stacking_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
- else
- qdel(src)
/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user)
. = ..()
+
+ if(!machine)
+ to_chat(user, "[src] is not linked to a machine!")
+ return
+
var/obj/item/stack/sheet/s
var/dat
@@ -35,6 +38,13 @@
user << browse(dat, "window=console_stacking_machine")
+/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
+ if(istype(I, /obj/item/multitool))
+ var/obj/item/multitool/M = I
+ M.buffer = src
+ to_chat(user, "You store linkage information in [I]'s buffer.")
+ return TRUE
+
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
if(..())
return
@@ -62,6 +72,7 @@
desc = "A machine that automatically stacks acquired materials. Controlled by a nearby console."
density = TRUE
anchored = TRUE
+ circuit = /obj/item/circuitboard/machine/stacking_machine
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
@@ -78,6 +89,18 @@
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
+/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/I)
+ if(istype(I, /obj/item/multitool))
+ var/obj/item/multitool/M = I
+ if(!istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
+ to_chat(user, "The [I] has no linkage data in its buffer.")
+ return FALSE
+ else
+ CONSOLE = M.buffer
+ CONSOLE.machine = src
+ to_chat(user, "You link [src] to the console in [I]'s buffer.")
+ return TRUE
+
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
if(!(inp.type in stack_list)) //It's the first of this sheet added
var/obj/item/stack/sheet/s = new inp.type(src, 0)
diff --git a/code/modules/research/designs/machine_designs.dm b/code/modules/research/designs/machine_designs.dm
index be3ec60637..5771ff9891 100644
--- a/code/modules/research/designs/machine_designs.dm
+++ b/code/modules/research/designs/machine_designs.dm
@@ -482,3 +482,19 @@
build_path = /obj/item/circuitboard/machine/dish_drive
category = list ("Misc. Machinery")
departmental_flags = DEPARTMENTAL_FLAG_SERVICE
+
+/datum/design/board/stacking_unit_console
+ name = "Machine Design (Stacking Machine Console)"
+ desc = "The circuit board for a Stacking Machine Console."
+ id = "stack_console"
+ build_path = /obj/item/circuitboard/machine/stacking_unit_console
+ category = list ("Misc. Machinery")
+ departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_ENGINEERING
+
+/datum/design/board/stacking_machine
+ name = "Machine Design (Stacking Machine)"
+ desc = "The circuit board for a Stacking Machine."
+ id = "stack_machine"
+ build_path = /obj/item/circuitboard/machine/stacking_machine
+ category = list ("Misc. Machinery")
+ departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_ENGINEERING
\ No newline at end of file
diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm
index c29c8b7732..c69d0ad728 100644
--- a/code/modules/research/techweb/all_nodes.dm
+++ b/code/modules/research/techweb/all_nodes.dm
@@ -93,7 +93,8 @@
description = "A refresher course on modern engineering technology."
prereq_ids = list("base")
design_ids = list("solarcontrol", "recharger", "powermonitor", "rped", "pacman", "adv_capacitor", "adv_scanning", "emitter", "high_cell", "adv_matter_bin",
- "atmosalerts", "atmos_control", "recycler", "autolathe", "high_micro_laser", "nano_mani", "mesons", "thermomachine", "rad_collector", "tesla_coil", "grounding_rod", "apc_control", "cell_charger", "power control", "airlock_board", "firelock_board", "airalarm_electronics", "firealarm_electronics")
+ "atmosalerts", "atmos_control", "recycler", "autolathe", "high_micro_laser", "nano_mani", "mesons", "thermomachine", "rad_collector", "tesla_coil", "grounding_rod",
+ "apc_control", "cell_charger", "power control", "airlock_board", "firelock_board", "airalarm_electronics", "firealarm_electronics", "cell_charger", "stack_console", "stack_machine")
research_cost = 7500
export_price = 5000