From e0089ea813e0bfb8914003a308134f59c47121a5 Mon Sep 17 00:00:00 2001 From: The0bserver Date: Thu, 1 Oct 2020 06:44:11 -0400 Subject: [PATCH] Again? --- .../circuitboards/machine_circuitboards.dm | 4 ++ code/modules/plumbing/plumbers/autohydro.dm | 64 +++++++++++++++++++ .../machine_designs_service.dm | 8 +++ .../research/techweb/nodes/medical_nodes.dm | 2 +- tgstation.dme | 1 + 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 code/modules/plumbing/plumbers/autohydro.dm diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 3cd899fcf4..37d19783b5 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -519,6 +519,10 @@ /obj/item/stack/sheet/glass = 1) needs_anchored = FALSE +/obj/item/circuitboard/machine/hydroponics/automagic + name = "Automatic Hydroponics Tray (Machine Board)" + build_path = /obj/machinery/hydroponics/constructable/automagic + /obj/item/circuitboard/machine/seed_extractor name = "Seed Extractor (Machine Board)" build_path = /obj/machinery/seed_extractor diff --git a/code/modules/plumbing/plumbers/autohydro.dm b/code/modules/plumbing/plumbers/autohydro.dm new file mode 100644 index 0000000000..37590bb4f3 --- /dev/null +++ b/code/modules/plumbing/plumbers/autohydro.dm @@ -0,0 +1,64 @@ +/obj/machinery/hydroponics/constructable/automagic + name = "automated hydroponics system" + desc = "The bane of botanists everywhere. Accepts chemical reagents via plumbing, automatically harvests and removes dead plants." + obj_flags = CAN_BE_HIT | UNIQUE_RENAME + circuit = /obj/item/circuitboard/machine/hydroponics/automagic + self_sufficiency_req = 400 //automating hydroponics makes gaia sad so she needs more drugs to turn they tray godly. + + +/obj/machinery/hydroponics/constructable/automagic/attackby(obj/item/O, mob/user, params) + if(istype(O, /obj/item/reagent_containers)) + return FALSE //avoid fucky wuckies + ..() + +/obj/machinery/hydroponics/constructable/automagic/default_unfasten_wrench(mob/user, obj/item/I, time = 20) + . = ..() + if(. == SUCCESSFUL_UNFASTEN) + user.visible_message("[user.name] [anchored ? "fasten" : "unfasten"] [src]", \ + "You [anchored ? "fasten" : "unfasten"] [src]") + var/datum/component/plumbing/CP = GetComponent(/datum/component/plumbing) + if(anchored) + CP.enable() + else + CP.disable() + +/obj/machinery/hydroponics/constructable/automagic/Destroy() + . = ..() + STOP_PROCESSING(SSobj, src) + +/obj/machinery/hydroponics/constructable/automagic/Initialize(mapload) + . = ..() + START_PROCESSING(SSobj, src) + create_reagents(100 , AMOUNT_VISIBLE) + +/obj/machinery/hydroponics/constructable/automagic/ComponentInitialize() + . = ..() + AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated)) + AddComponent(/datum/component/plumbing/simple_demand) + +/obj/machinery/hydroponics/constructable/proc/can_be_rotated(mob/user, rotation_type) + return !anchored + +/obj/machinery/hydroponics/constructable/automagic/process() + if(reagents) + reagents.add_reagent(reagents) + reagents.clear_reagents() + if(dead) + dead = 0 + qdel(myseed) + myseed = null + update_icon() + name = initial(name) + desc = initial(desc) + if(harvest) + myseed.harvest_userless() + harvest = 0 + lastproduce = age + if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest)) + qdel(myseed) + myseed = null + dead = 0 + name = initial(name) + desc = initial(desc) + update_icon() + ..() diff --git a/code/modules/research/designs/machine_desings/machine_designs_service.dm b/code/modules/research/designs/machine_desings/machine_designs_service.dm index 5cbff1c66a..af4f650793 100644 --- a/code/modules/research/designs/machine_desings/machine_designs_service.dm +++ b/code/modules/research/designs/machine_desings/machine_designs_service.dm @@ -81,6 +81,14 @@ category = list ("Hydroponics Machinery") departmental_flags = DEPARTMENTAL_FLAG_SERVICE +/datum/design/board/hydroponics/auto + name = "Machine Design (Automatic Hydroponics Tray Board)" + desc = "The circuit board for an automatic hydroponics tray. GIVE ME THE PLANT, CAPTAIN." + id = "autohydrotray" + build_path = /obj/machinery/hydroponics/constructable/automagic + category = list ("Hydroponics Machinery") + departmental_flags = DEPARTMENTAL_FLAG_SERVICE | DEPARTMENTAL_FLAG_MEDICAL + /datum/design/board/monkey_recycler name = "Machine Design (Monkey Recycler Board)" desc = "The circuit board for a monkey recycler." diff --git a/code/modules/research/techweb/nodes/medical_nodes.dm b/code/modules/research/techweb/nodes/medical_nodes.dm index afab12990b..150e420c09 100644 --- a/code/modules/research/techweb/nodes/medical_nodes.dm +++ b/code/modules/research/techweb/nodes/medical_nodes.dm @@ -38,7 +38,7 @@ display_name = "Advanced Plumbing Technology" description = "Plumbing RCD." prereq_ids = list("plumbing", "adv_engi") - design_ids = list("plumb_rcd") + design_ids = list("plumb_rcd", "autohydrotray") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) //////////////////////Cybernetics///////////////////// diff --git a/tgstation.dme b/tgstation.dme index 84ba5e24f7..d71d8db2bf 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2873,6 +2873,7 @@ #include "code\modules\plumbing\ducts.dm" #include "code\modules\plumbing\plumbers\_plumb_machinery.dm" #include "code\modules\plumbing\plumbers\acclimator.dm" +#include "code\modules\plumbing\plumbers\autohydro.dm" #include "code\modules\plumbing\plumbers\bottler.dm" #include "code\modules\plumbing\plumbers\destroyer.dm" #include "code\modules\plumbing\plumbers\fermenter.dm"